mirror of https://github.com/vitalif/openscad
Merge pull request #1003 from openscad/configure-window-reorder
Add option to disable window reordering by removing the dock window title barmaster
commit
92389b8589
|
@ -67,6 +67,9 @@ public:
|
||||||
QAction *actionRecentFile[UIUtils::maxRecentFiles];
|
QAction *actionRecentFile[UIUtils::maxRecentFiles];
|
||||||
QMap<QString, QString> knownFileExtensions;
|
QMap<QString, QString> knownFileExtensions;
|
||||||
|
|
||||||
|
QWidget *editorDockTitleWidget;
|
||||||
|
QWidget *consoleDockTitleWidget;
|
||||||
|
|
||||||
QString editortype;
|
QString editortype;
|
||||||
bool useScintilla;
|
bool useScintilla;
|
||||||
|
|
||||||
|
@ -81,6 +84,7 @@ private slots:
|
||||||
void updateTVal();
|
void updateTVal();
|
||||||
void updateMdiMode(bool mdi);
|
void updateMdiMode(bool mdi);
|
||||||
void updateUndockMode(bool undockMode);
|
void updateUndockMode(bool undockMode);
|
||||||
|
void updateReorderMode(bool reorderMode);
|
||||||
void setFileName(const QString &filename);
|
void setFileName(const QString &filename);
|
||||||
void setFont(const QString &family, uint size);
|
void setFont(const QString &family, uint size);
|
||||||
void setColorScheme(const QString &cs);
|
void setColorScheme(const QString &cs);
|
||||||
|
@ -235,6 +239,7 @@ private:
|
||||||
static void report_func(const class AbstractNode*, void *vp, int mark);
|
static void report_func(const class AbstractNode*, void *vp, int mark);
|
||||||
static bool mdiMode;
|
static bool mdiMode;
|
||||||
static bool undockMode;
|
static bool undockMode;
|
||||||
|
static bool reorderMode;
|
||||||
static QSet<MainWindow*> *windows;
|
static QSet<MainWindow*> *windows;
|
||||||
|
|
||||||
char const * afterCompileSlot;
|
char const * afterCompileSlot;
|
||||||
|
|
|
@ -103,6 +103,7 @@ Preferences::Preferences(QWidget *parent) : QMainWindow(parent)
|
||||||
this->defaultmap["advanced/forceGoldfeather"] = false;
|
this->defaultmap["advanced/forceGoldfeather"] = false;
|
||||||
this->defaultmap["advanced/mdi"] = true;
|
this->defaultmap["advanced/mdi"] = true;
|
||||||
this->defaultmap["advanced/undockableWindows"] = false;
|
this->defaultmap["advanced/undockableWindows"] = false;
|
||||||
|
this->defaultmap["advanced/reorderWindows"] = true;
|
||||||
this->defaultmap["launcher/showOnStartup"] = true;
|
this->defaultmap["launcher/showOnStartup"] = true;
|
||||||
|
|
||||||
// Toolbar
|
// Toolbar
|
||||||
|
@ -321,6 +322,18 @@ Preferences::on_mdiCheckBox_toggled(bool state)
|
||||||
emit updateMdiMode(state);
|
emit updateMdiMode(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Preferences::on_reorderCheckBox_toggled(bool state)
|
||||||
|
{
|
||||||
|
if (!state) {
|
||||||
|
undockCheckBox->setChecked(false);
|
||||||
|
}
|
||||||
|
undockCheckBox->setEnabled(state);
|
||||||
|
QSettings settings;
|
||||||
|
settings.setValue("advanced/reorderWindows", state);
|
||||||
|
emit updateReorderMode(state);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Preferences::on_undockCheckBox_toggled(bool state)
|
Preferences::on_undockCheckBox_toggled(bool state)
|
||||||
{
|
{
|
||||||
|
@ -467,7 +480,9 @@ void Preferences::updateGUI()
|
||||||
this->opencsgLimitEdit->setText(getValue("advanced/openCSGLimit").toString());
|
this->opencsgLimitEdit->setText(getValue("advanced/openCSGLimit").toString());
|
||||||
this->forceGoldfeatherBox->setChecked(getValue("advanced/forceGoldfeather").toBool());
|
this->forceGoldfeatherBox->setChecked(getValue("advanced/forceGoldfeather").toBool());
|
||||||
this->mdiCheckBox->setChecked(getValue("advanced/mdi").toBool());
|
this->mdiCheckBox->setChecked(getValue("advanced/mdi").toBool());
|
||||||
|
this->reorderCheckBox->setChecked(getValue("advanced/reorderWindows").toBool());
|
||||||
this->undockCheckBox->setChecked(getValue("advanced/undockableWindows").toBool());
|
this->undockCheckBox->setChecked(getValue("advanced/undockableWindows").toBool());
|
||||||
|
this->undockCheckBox->setEnabled(this->reorderCheckBox->isChecked());
|
||||||
this->launcherBox->setChecked(getValue("launcher/showOnStartup").toBool());
|
this->launcherBox->setChecked(getValue("launcher/showOnStartup").toBool());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@ public slots:
|
||||||
void on_updateCheckBox_toggled(bool);
|
void on_updateCheckBox_toggled(bool);
|
||||||
void on_snapshotCheckBox_toggled(bool);
|
void on_snapshotCheckBox_toggled(bool);
|
||||||
void on_mdiCheckBox_toggled(bool);
|
void on_mdiCheckBox_toggled(bool);
|
||||||
|
void on_reorderCheckBox_toggled(bool);
|
||||||
void on_undockCheckBox_toggled(bool);
|
void on_undockCheckBox_toggled(bool);
|
||||||
void on_checkNowButton_clicked();
|
void on_checkNowButton_clicked();
|
||||||
void on_launcherBox_toggled(bool);
|
void on_launcherBox_toggled(bool);
|
||||||
|
@ -41,7 +42,8 @@ public slots:
|
||||||
signals:
|
signals:
|
||||||
void requestRedraw() const;
|
void requestRedraw() const;
|
||||||
void updateMdiMode(bool mdi) const;
|
void updateMdiMode(bool mdi) const;
|
||||||
void updateUndockMode(bool mdi) const;
|
void updateUndockMode(bool undockMode) const;
|
||||||
|
void updateReorderMode(bool undockMode) const;
|
||||||
void fontChanged(const QString &family, uint size) const;
|
void fontChanged(const QString &family, uint size) const;
|
||||||
void colorSchemeChanged(const QString &scheme) const;
|
void colorSchemeChanged(const QString &scheme) const;
|
||||||
void openCSGSettingsChanged() const;
|
void openCSGSettingsChanged() const;
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>852</width>
|
<width>852</width>
|
||||||
<height>550</height>
|
<height>554</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QStackedWidget" name="stackedWidget">
|
<widget class="QStackedWidget" name="stackedWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>3</number>
|
<number>4</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="page3DView">
|
<widget class="QWidget" name="page3DView">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||||
|
@ -547,8 +547,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>832</width>
|
<width>100</width>
|
||||||
<height>420</height>
|
<height>30</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_10">
|
<layout class="QVBoxLayout" name="verticalLayout_10">
|
||||||
|
@ -685,10 +685,17 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="reorderCheckBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Enable docking of Editor and Console in different places</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="undockCheckBox">
|
<widget class="QCheckBox" name="undockCheckBox">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Enable undocking of Editor and Console</string>
|
<string>Enable undocking of Editor and Console to separate windows</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
@ -172,12 +172,16 @@ settings_valueList(const QString &key, const QList<int> &defaultList = QList<int
|
||||||
|
|
||||||
bool MainWindow::mdiMode = false;
|
bool MainWindow::mdiMode = false;
|
||||||
bool MainWindow::undockMode = false;
|
bool MainWindow::undockMode = false;
|
||||||
|
bool MainWindow::reorderMode = false;
|
||||||
|
|
||||||
MainWindow::MainWindow(const QString &filename)
|
MainWindow::MainWindow(const QString &filename)
|
||||||
: root_inst("group"), library_info_dialog(NULL), font_list_dialog(NULL), tempFile(NULL), progresswidget(NULL)
|
: root_inst("group"), library_info_dialog(NULL), font_list_dialog(NULL), tempFile(NULL), progresswidget(NULL)
|
||||||
{
|
{
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
|
|
||||||
|
editorDockTitleWidget = new QWidget();
|
||||||
|
consoleDockTitleWidget = new QWidget();
|
||||||
|
|
||||||
this->editorDock->setConfigKey("view/hideEditor");
|
this->editorDock->setConfigKey("view/hideEditor");
|
||||||
this->editorDock->setAction(this->viewActionHideEditor);
|
this->editorDock->setAction(this->viewActionHideEditor);
|
||||||
this->consoleDock->setConfigKey("view/hideConsole");
|
this->consoleDock->setConfigKey("view/hideConsole");
|
||||||
|
@ -422,6 +426,7 @@ MainWindow::MainWindow(const QString &filename)
|
||||||
|
|
||||||
connect(Preferences::inst(), SIGNAL(requestRedraw()), this->qglview, SLOT(updateGL()));
|
connect(Preferences::inst(), SIGNAL(requestRedraw()), this->qglview, SLOT(updateGL()));
|
||||||
connect(Preferences::inst(), SIGNAL(updateMdiMode(bool)), this, SLOT(updateMdiMode(bool)));
|
connect(Preferences::inst(), SIGNAL(updateMdiMode(bool)), this, SLOT(updateMdiMode(bool)));
|
||||||
|
connect(Preferences::inst(), SIGNAL(updateReorderMode(bool)), this, SLOT(updateReorderMode(bool)));
|
||||||
connect(Preferences::inst(), SIGNAL(updateUndockMode(bool)), this, SLOT(updateUndockMode(bool)));
|
connect(Preferences::inst(), SIGNAL(updateUndockMode(bool)), this, SLOT(updateUndockMode(bool)));
|
||||||
connect(Preferences::inst(), SIGNAL(fontChanged(const QString&,uint)),
|
connect(Preferences::inst(), SIGNAL(fontChanged(const QString&,uint)),
|
||||||
editor, SLOT(initFont(const QString&,uint)));
|
editor, SLOT(initFont(const QString&,uint)));
|
||||||
|
@ -619,6 +624,7 @@ void MainWindow::loadViewSettings(){
|
||||||
hideToolbars();
|
hideToolbars();
|
||||||
updateMdiMode(settings.value("advanced/mdi").toBool());
|
updateMdiMode(settings.value("advanced/mdi").toBool());
|
||||||
updateUndockMode(settings.value("advanced/undockableWindows").toBool());
|
updateUndockMode(settings.value("advanced/undockableWindows").toBool());
|
||||||
|
updateReorderMode(settings.value("advanced/reorderWindows").toBool());
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::loadDesignSettings()
|
void MainWindow::loadDesignSettings()
|
||||||
|
@ -647,11 +653,24 @@ void MainWindow::updateUndockMode(bool undockMode)
|
||||||
editorDock->setFeatures(editorDock->features() | QDockWidget::DockWidgetFloatable);
|
editorDock->setFeatures(editorDock->features() | QDockWidget::DockWidgetFloatable);
|
||||||
consoleDock->setFeatures(consoleDock->features() | QDockWidget::DockWidgetFloatable);
|
consoleDock->setFeatures(consoleDock->features() | QDockWidget::DockWidgetFloatable);
|
||||||
} else {
|
} else {
|
||||||
|
if (editorDock->isFloating()) {
|
||||||
|
editorDock->setFloating(false);
|
||||||
|
}
|
||||||
editorDock->setFeatures(editorDock->features() & ~QDockWidget::DockWidgetFloatable);
|
editorDock->setFeatures(editorDock->features() & ~QDockWidget::DockWidgetFloatable);
|
||||||
|
if (consoleDock->isFloating()) {
|
||||||
|
consoleDock->setFloating(false);
|
||||||
|
}
|
||||||
consoleDock->setFeatures(consoleDock->features() & ~QDockWidget::DockWidgetFloatable);
|
consoleDock->setFeatures(consoleDock->features() & ~QDockWidget::DockWidgetFloatable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::updateReorderMode(bool reorderMode)
|
||||||
|
{
|
||||||
|
MainWindow::reorderMode = reorderMode;
|
||||||
|
editorDock->setTitleBarWidget(reorderMode ? 0 : editorDockTitleWidget);
|
||||||
|
consoleDock->setTitleBarWidget(reorderMode ? 0 : consoleDockTitleWidget);
|
||||||
|
}
|
||||||
|
|
||||||
MainWindow::~MainWindow()
|
MainWindow::~MainWindow()
|
||||||
{
|
{
|
||||||
if (root_module) delete root_module;
|
if (root_module) delete root_module;
|
||||||
|
|
Loading…
Reference in New Issue