mirror of
https://github.com/86Box/86Box.git
synced 2026-02-22 09:35:32 -07:00
Manager: Make the toolbar hideable
This commit is contained in:
@@ -106,6 +106,11 @@ VMManagerMainWindow::
|
||||
|
||||
{
|
||||
auto config = new VMManagerConfig(VMManagerConfig::ConfigType::General);
|
||||
ui->actionHide_tool_bar->setChecked(!!config->getStringValue("hide_tool_bar").toInt());
|
||||
if (ui->actionHide_tool_bar->isChecked())
|
||||
ui->toolBar->setVisible(false);
|
||||
else
|
||||
config->setStringValue("hide_tool_bar", "0");
|
||||
if (!!config->getStringValue("window_remember").toInt()) {
|
||||
QString coords = config->getStringValue("window_coordinates");
|
||||
if (!coords.isEmpty()) {
|
||||
@@ -217,6 +222,7 @@ VMManagerMainWindow::saveSettings() const
|
||||
const auto currentSelection = vmm->getCurrentSelection();
|
||||
const auto config = new VMManagerConfig(VMManagerConfig::ConfigType::General);
|
||||
config->setStringValue("last_selection", currentSelection);
|
||||
config->setStringValue("hide_tool_bar", (ui->toolBar->isVisible() ? "0" : "1"));
|
||||
if (!!config->getStringValue("window_remember").toInt()) {
|
||||
config->setStringValue("window_coordinates", QString::asprintf("%i, %i, %i, %i", this->geometry().x(), this->geometry().y(), this->geometry().width(), this->geometry().height()));
|
||||
config->setStringValue("window_maximized", this->isMaximized() ? "1" : "");
|
||||
@@ -287,6 +293,15 @@ VMManagerMainWindow::setStatusRight(const QString &text) const
|
||||
statusRight->setText(text);
|
||||
}
|
||||
|
||||
void
|
||||
VMManagerMainWindow::on_actionHide_tool_bar_triggered()
|
||||
{
|
||||
const auto config = new VMManagerConfig(VMManagerConfig::ConfigType::General);
|
||||
int isHidden = config->getStringValue("hide_tool_bar").toInt();
|
||||
ui->toolBar->setVisible(!!isHidden);
|
||||
config->setStringValue("hide_tool_bar", (isHidden ? "0" : "1"));
|
||||
}
|
||||
|
||||
#if EMU_BUILD_NUM != 0
|
||||
void
|
||||
VMManagerMainWindow::checkForUpdatesTriggered()
|
||||
|
||||
@@ -58,6 +58,7 @@ public slots:
|
||||
|
||||
private slots:
|
||||
void vmmStateChanged(const VMManagerSystem *sysconfig) const;
|
||||
void on_actionHide_tool_bar_triggered();
|
||||
void preferencesTriggered();
|
||||
#if EMU_BUILD_NUM != 0
|
||||
void checkForUpdatesTriggered();
|
||||
|
||||
@@ -41,6 +41,12 @@
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionExit"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuView">
|
||||
<property name="title">
|
||||
<string>&View</string>
|
||||
</property>
|
||||
<addaction name="actionHide_tool_bar"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuHelp">
|
||||
<property name="title">
|
||||
<string>&Help</string>
|
||||
@@ -50,6 +56,7 @@
|
||||
<addaction name="actionAbout_Qt"/>
|
||||
</widget>
|
||||
<addaction name="menuFile"/>
|
||||
<addaction name="menuView"/>
|
||||
<addaction name="menuTools"/>
|
||||
<addaction name="menuHelp"/>
|
||||
</widget>
|
||||
@@ -198,6 +205,17 @@
|
||||
<string>New machine...</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionHide_tool_bar">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Hide &toolbar</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Hide tool bar</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionPreferences">
|
||||
<property name="text">
|
||||
<string>&Preferences...</string>
|
||||
|
||||
Reference in New Issue
Block a user