Moved Lua groupbox on Qt TAS editor to menu to save window space.

This commit is contained in:
mjbudd77 2021-11-13 06:48:18 -05:00
parent 326a190bd3
commit 40f301c665
2 changed files with 42 additions and 15 deletions

View File

@ -402,7 +402,8 @@ void TasEditorWindow::closeWindow(void)
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
QMenuBar *TasEditorWindow::buildMenuBar(void) QMenuBar *TasEditorWindow::buildMenuBar(void)
{ {
QMenu *fileMenu, *editMenu, *viewMenu, *confMenu, *helpMenu; QMenu *fileMenu, *editMenu, *viewMenu,
*confMenu, *luaMenu, *helpMenu;
//QActionGroup *actGroup; //QActionGroup *actGroup;
QAction *act; QAction *act;
int useNativeMenuBar=0; int useNativeMenuBar=0;
@ -910,6 +911,30 @@ QMenuBar *TasEditorWindow::buildMenuBar(void)
confMenu->addAction(act); confMenu->addAction(act);
// Lua
luaMenu = menuBar->addMenu(tr("&Lua"));
// Lua -> Run Function
act = new QAction(tr("Run Function"), this);
//act->setShortcut(QKeySequence(tr("Ctrl+N")));
act->setStatusTip(tr("Run Function"));
//act->setIcon( style()->standardIcon( QStyle::SP_FileDialogStart ) );
//connect(act, SIGNAL(triggered()), this, SLOT(createNewProject(void)) );
luaMenu->addAction(act);
luaMenu->addSeparator();
// Lua -> Auto Function
autoLuaAct = act = new QAction(tr("Auto Function"), this);
act->setCheckable(true);
//act->setShortcut(QKeySequence(tr("Ctrl+N")));
act->setStatusTip(tr("Auto Function"));
//act->setIcon( style()->standardIcon( QStyle::SP_FileDialogStart ) );
//connect(act, SIGNAL(triggered()), this, SLOT(createNewProject(void)) );
luaMenu->addAction(act);
// Help // Help
helpMenu = menuBar->addMenu(tr("&Help")); helpMenu = menuBar->addMenu(tr("&Help"));
@ -1053,7 +1078,7 @@ void TasEditorWindow::buildSideControlPanel(void)
playbackGBox = new QGroupBox( tr("Playback") ); playbackGBox = new QGroupBox( tr("Playback") );
recorderGBox = new QGroupBox( tr("Recorder") ); recorderGBox = new QGroupBox( tr("Recorder") );
splicerGBox = new QGroupBox( tr("Splicer") ); splicerGBox = new QGroupBox( tr("Splicer") );
luaGBox = new QGroupBox( tr("Lua") ); //luaGBox = new QGroupBox( tr("Lua") );
historyGBox = new QGroupBox( tr("History") ); historyGBox = new QGroupBox( tr("History") );
bbFrame = new QFrame(); bbFrame = new QFrame();
@ -1087,10 +1112,10 @@ void TasEditorWindow::buildSideControlPanel(void)
selectionLbl = new QLabel( tr("Empty") ); selectionLbl = new QLabel( tr("Empty") );
clipboardLbl = new QLabel( tr("Empty") ); clipboardLbl = new QLabel( tr("Empty") );
runLuaBtn = new QPushButton( tr("Run Function") ); //runLuaBtn = new QPushButton( tr("Run Function") );
autoLuaCBox = new QCheckBox( tr("Auto Function") ); //autoLuaCBox = new QCheckBox( tr("Auto Function") );
runLuaBtn->setEnabled(false); //runLuaBtn->setEnabled(false);
autoLuaCBox->setChecked(true); //autoLuaCBox->setChecked(true);
histTree = new QTreeWidget(); histTree = new QTreeWidget();
@ -1147,10 +1172,10 @@ void TasEditorWindow::buildSideControlPanel(void)
grid->addWidget( clipboardLbl, 1, 1, 1, 3 ); grid->addWidget( clipboardLbl, 1, 1, 1, 3 );
splicerGBox->setLayout( grid ); splicerGBox->setLayout( grid );
hbox = new QHBoxLayout(); //hbox = new QHBoxLayout();
hbox->addWidget( runLuaBtn ); //hbox->addWidget( runLuaBtn );
hbox->addWidget( autoLuaCBox ); //hbox->addWidget( autoLuaCBox );
luaGBox->setLayout( hbox ); //luaGBox->setLayout( hbox );
bkmkBrnchStack = new QTabWidget(); bkmkBrnchStack = new QTabWidget();
bkmkBrnchStack->addTab( &bookmarks, tr("Bookmarks") ); bkmkBrnchStack->addTab( &bookmarks, tr("Bookmarks") );
@ -1167,7 +1192,7 @@ void TasEditorWindow::buildSideControlPanel(void)
ctlPanelMainVbox->addWidget( playbackGBox ); ctlPanelMainVbox->addWidget( playbackGBox );
ctlPanelMainVbox->addWidget( recorderGBox ); ctlPanelMainVbox->addWidget( recorderGBox );
ctlPanelMainVbox->addWidget( splicerGBox ); ctlPanelMainVbox->addWidget( splicerGBox );
ctlPanelMainVbox->addWidget( luaGBox ); //ctlPanelMainVbox->addWidget( luaGBox );
ctlPanelMainVbox->addWidget( bbFrame ); ctlPanelMainVbox->addWidget( bbFrame );
ctlPanelMainVbox->addWidget( historyGBox ); ctlPanelMainVbox->addWidget( historyGBox );
@ -1253,7 +1278,8 @@ void TasEditorWindow::updateCheckedItems(void)
enaHotChgAct->setChecked( taseditorConfig.enableHotChanges ); enaHotChgAct->setChecked( taseditorConfig.enableHotChanges );
followMkrAct->setChecked( taseditorConfig.followMarkerNoteContext ); followMkrAct->setChecked( taseditorConfig.followMarkerNoteContext );
followUndoAct->setChecked( taseditorConfig.followUndoContext ); followUndoAct->setChecked( taseditorConfig.followUndoContext );
autoLuaCBox->setChecked( taseditorConfig.enableLuaAutoFunction ); //autoLuaCBox->setChecked( taseditorConfig.enableLuaAutoFunction );
autoLuaAct->setChecked( taseditorConfig.enableLuaAutoFunction );
enaGrnznAct->setChecked( taseditorConfig.enableGreenzoning ); enaGrnznAct->setChecked( taseditorConfig.enableGreenzoning );
afPtrnSkipLagAct->setChecked( taseditorConfig.autofirePatternSkipsLag ); afPtrnSkipLagAct->setChecked( taseditorConfig.autofirePatternSkipsLag );
adjInputLagAct->setChecked( taseditorConfig.autoAdjustInputAccordingToLag ); adjInputLagAct->setChecked( taseditorConfig.autoAdjustInputAccordingToLag );

View File

@ -212,6 +212,7 @@ class TasEditorWindow : public QDialog
QAction *hudInScrnBranchAct; QAction *hudInScrnBranchAct;
QAction *pauseAtEndAct; QAction *pauseAtEndAct;
QAction *showToolTipsAct; QAction *showToolTipsAct;
QAction *autoLuaAct;
QSplitter *mainHBox; QSplitter *mainHBox;
QFrame *pianoRollFrame; QFrame *pianoRollFrame;
@ -229,7 +230,7 @@ class TasEditorWindow : public QDialog
QGroupBox *playbackGBox; QGroupBox *playbackGBox;
QGroupBox *recorderGBox; QGroupBox *recorderGBox;
QGroupBox *splicerGBox; QGroupBox *splicerGBox;
QGroupBox *luaGBox; //QGroupBox *luaGBox;
QGroupBox *historyGBox; QGroupBox *historyGBox;
QFrame *bbFrame; QFrame *bbFrame;
@ -254,8 +255,8 @@ class TasEditorWindow : public QDialog
QLabel *selectionLbl; QLabel *selectionLbl;
QLabel *clipboardLbl; QLabel *clipboardLbl;
QPushButton *runLuaBtn; //QPushButton *runLuaBtn;
QCheckBox *autoLuaCBox; //QCheckBox *autoLuaCBox;
QTreeWidget *histTree; QTreeWidget *histTree;