Added menu to GUI palette color editor.
This commit is contained in:
parent
037f1e04f9
commit
a9059517a5
|
@ -430,7 +430,7 @@ void fceuStyle::polish(QPalette &palette)
|
||||||
//basePtr->polish(palette);
|
//basePtr->polish(palette);
|
||||||
//QStyle::polish(palette);
|
//QStyle::polish(palette);
|
||||||
|
|
||||||
printf("Polish Palette Style!!!\n");
|
//printf("Polish Palette Style!!!\n");
|
||||||
return;
|
return;
|
||||||
// modify palette to dark
|
// modify palette to dark
|
||||||
palette.setColor(QPalette::Window, QColor(53, 53, 53));
|
palette.setColor(QPalette::Window, QColor(53, 53, 53));
|
||||||
|
@ -465,7 +465,7 @@ void fceuStyle::polish(QApplication *app)
|
||||||
|
|
||||||
if (!app) return;
|
if (!app) return;
|
||||||
|
|
||||||
printf("Load Style Sheet!!!\n");
|
//printf("Load Style Sheet!!!\n");
|
||||||
// increase font size for better reading,
|
// increase font size for better reading,
|
||||||
// setPointSize was reduced from +2 because when applied this way in Qt5, the
|
// setPointSize was reduced from +2 because when applied this way in Qt5, the
|
||||||
// font is larger than intended for some reason
|
// font is larger than intended for some reason
|
||||||
|
@ -599,14 +599,42 @@ GuiPaletteEditDialog_t::GuiPaletteEditDialog_t(QWidget *parent)
|
||||||
QVBoxLayout *mainLayout;
|
QVBoxLayout *mainLayout;
|
||||||
QVBoxLayout *vbox;
|
QVBoxLayout *vbox;
|
||||||
QHBoxLayout *hbox1;
|
QHBoxLayout *hbox1;
|
||||||
|
QMenuBar *menuBar;
|
||||||
|
QMenu *fileMenu;
|
||||||
|
QAction *act;
|
||||||
GuiPaletteColorSelect *pcs;
|
GuiPaletteColorSelect *pcs;
|
||||||
QPalette::ColorGroup g;
|
QPalette::ColorGroup g;
|
||||||
QWidget *viewport;
|
QWidget *viewport;
|
||||||
QFrame *line;
|
QFrame *line;
|
||||||
QLabel *lbl;
|
QLabel *lbl;
|
||||||
|
int useNativeMenuBarVal;
|
||||||
|
|
||||||
setWindowTitle(tr("GUI Color Palette Edit"));
|
setWindowTitle(tr("GUI Color Palette Edit"));
|
||||||
|
|
||||||
|
g_config->getOption("SDL.UseNativeMenuBar", &useNativeMenuBarVal);
|
||||||
|
|
||||||
|
menuBar = new QMenuBar(this);
|
||||||
|
|
||||||
|
menuBar->setNativeMenuBar( useNativeMenuBarVal ? true : false );
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// Menu Start
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// File
|
||||||
|
fileMenu = menuBar->addMenu(tr("&File"));
|
||||||
|
|
||||||
|
// File -> Close
|
||||||
|
act = new QAction(tr("&Close"), this);
|
||||||
|
act->setShortcut(QKeySequence::Close);
|
||||||
|
act->setStatusTip(tr("Close Window"));
|
||||||
|
connect(act, SIGNAL(triggered()), this, SLOT(closeWindow(void)) );
|
||||||
|
|
||||||
|
fileMenu->addAction(act);
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// Menu End
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
|
||||||
scrollArea = new QScrollArea(this);
|
scrollArea = new QScrollArea(this);
|
||||||
viewport = new QWidget(this);
|
viewport = new QWidget(this);
|
||||||
scrollArea->setWidget( viewport );
|
scrollArea->setWidget( viewport );
|
||||||
|
@ -617,6 +645,8 @@ GuiPaletteEditDialog_t::GuiPaletteEditDialog_t(QWidget *parent)
|
||||||
|
|
||||||
mainLayout = new QVBoxLayout(this);
|
mainLayout = new QVBoxLayout(this);
|
||||||
|
|
||||||
|
mainLayout->setMenuBar( menuBar );
|
||||||
|
|
||||||
hbox1 = new QHBoxLayout(viewport);
|
hbox1 = new QHBoxLayout(viewport);
|
||||||
|
|
||||||
//viewport->setLayout( hbox1 );
|
//viewport->setLayout( hbox1 );
|
||||||
|
@ -785,8 +815,14 @@ void GuiPaletteColorSelect::updateColor(void)
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
void GuiPaletteColorSelect::colorEditClicked(void)
|
void GuiPaletteColorSelect::colorEditClicked(void)
|
||||||
{
|
{
|
||||||
|
QString title;
|
||||||
|
|
||||||
guiColorPickerDialog_t *editor = new guiColorPickerDialog_t( &color, this );
|
guiColorPickerDialog_t *editor = new guiColorPickerDialog_t( &color, this );
|
||||||
|
|
||||||
|
title = QStringLiteral("Pick Palette Color for ") + lbl->text();
|
||||||
|
|
||||||
|
editor->setWindowTitle( title );
|
||||||
|
|
||||||
editor->show();
|
editor->show();
|
||||||
}
|
}
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
|
@ -799,7 +835,6 @@ void GuiPaletteColorSelect::updatePalette(void)
|
||||||
pal.setColor( group, role, color );
|
pal.setColor( group, role, color );
|
||||||
|
|
||||||
QApplication::setPalette( pal );
|
QApplication::setPalette( pal );
|
||||||
|
|
||||||
}
|
}
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
//----------------------------------------------------
|
//----------------------------------------------------
|
||||||
|
@ -815,13 +850,10 @@ guiColorPickerDialog_t::guiColorPickerDialog_t( QColor *c, QWidget *parent )
|
||||||
QPushButton *cancelButton;
|
QPushButton *cancelButton;
|
||||||
QPushButton *resetButton;
|
QPushButton *resetButton;
|
||||||
QStyle *style;
|
QStyle *style;
|
||||||
char stmp[128];
|
|
||||||
|
|
||||||
style = this->style();
|
style = this->style();
|
||||||
|
|
||||||
sprintf( stmp, "Pick Palette Color");
|
setWindowTitle( "Pick Palette Color" );
|
||||||
|
|
||||||
setWindowTitle( stmp );
|
|
||||||
|
|
||||||
colorPtr = c;
|
colorPtr = c;
|
||||||
origColor = *c;
|
origColor = *c;
|
||||||
|
|
Loading…
Reference in New Issue