From 266bbeefc885d63dc5502a0790e95e1e742a1f1a Mon Sep 17 00:00:00 2001 From: Dentomologist Date: Sun, 5 Nov 2023 11:45:56 -0800 Subject: [PATCH] InterfacePane: Add BalloonTip to top window checkbox --- Source/Core/DolphinQt/Settings.cpp | 1 - Source/Core/DolphinQt/Settings/InterfacePane.cpp | 13 ++++++++----- Source/Core/DolphinQt/Settings/InterfacePane.h | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Source/Core/DolphinQt/Settings.cpp b/Source/Core/DolphinQt/Settings.cpp index 2afb243855..19af18d9d9 100644 --- a/Source/Core/DolphinQt/Settings.cpp +++ b/Source/Core/DolphinQt/Settings.cpp @@ -445,7 +445,6 @@ void Settings::SetKeepWindowOnTop(bool top) if (IsKeepWindowOnTopEnabled() == top) return; - Config::SetBaseOrCurrent(Config::MAIN_KEEP_WINDOW_ON_TOP, top); emit KeepWindowOnTopChanged(top); } diff --git a/Source/Core/DolphinQt/Settings/InterfacePane.cpp b/Source/Core/DolphinQt/Settings/InterfacePane.cpp index 14b61ad56a..9f13dde8b6 100644 --- a/Source/Core/DolphinQt/Settings/InterfacePane.cpp +++ b/Source/Core/DolphinQt/Settings/InterfacePane.cpp @@ -177,7 +177,7 @@ void InterfacePane::CreateInGame() groupbox->setLayout(groupbox_layout); m_main_layout->addWidget(groupbox); - m_checkbox_top_window = new QCheckBox(tr("Keep Window on Top")); + m_checkbox_top_window = new ConfigBool(tr("Keep Window on Top"), Config::MAIN_KEEP_WINDOW_ON_TOP); m_checkbox_confirm_on_stop = new QCheckBox(tr("Confirm on Stop")); m_checkbox_use_panic_handlers = new QCheckBox(tr("Use Panic Handlers")); m_checkbox_enable_osd = new QCheckBox(tr("Show On-Screen Display Messages")); @@ -234,7 +234,8 @@ void InterfacePane::ConnectLayout() connect(m_combobox_userstyle, &QComboBox::currentIndexChanged, this, &InterfacePane::OnSaveConfig); connect(m_combobox_language, &QComboBox::currentIndexChanged, this, &InterfacePane::OnSaveConfig); - connect(m_checkbox_top_window, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig); + connect(m_checkbox_top_window, &QCheckBox::toggled, &Settings::Instance(), + &Settings::KeepWindowOnTopChanged); connect(m_checkbox_confirm_on_stop, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig); connect(m_checkbox_use_panic_handlers, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig); connect(m_checkbox_show_active_title, &QCheckBox::toggled, this, &InterfacePane::OnSaveConfig); @@ -283,8 +284,6 @@ void InterfacePane::LoadConfig() SignalBlocking(m_combobox_userstyle)->setCurrentIndex(index); // Render Window Options - SignalBlocking(m_checkbox_top_window) - ->setChecked(Settings::Instance().IsKeepWindowOnTopEnabled()); SignalBlocking(m_checkbox_confirm_on_stop)->setChecked(Config::Get(Config::MAIN_CONFIRM_ON_STOP)); SignalBlocking(m_checkbox_use_panic_handlers) ->setChecked(Config::Get(Config::MAIN_USE_PANIC_HANDLERS)); @@ -321,7 +320,6 @@ void InterfacePane::OnSaveConfig() Settings::Instance().ApplyStyle(); // Render Window Options - Settings::Instance().SetKeepWindowOnTop(m_checkbox_top_window->isChecked()); Config::SetBase(Config::MAIN_CONFIRM_ON_STOP, m_checkbox_confirm_on_stop->isChecked()); Config::SetBase(Config::MAIN_USE_PANIC_HANDLERS, m_checkbox_use_panic_handlers->isChecked()); Config::SetBase(Config::MAIN_OSD_MESSAGES, m_checkbox_enable_osd->isChecked()); @@ -374,9 +372,14 @@ void InterfacePane::AddDescriptions() static constexpr char TR_THEME_DESCRIPTION[] = QT_TR_NOOP("Changes the appearance and color of Dolphin's buttons." "

If unsure, select Clean."); + static constexpr char TR_TOP_WINDOW_DESCRIPTION[] = + QT_TR_NOOP("Forces the render window to stay on top of other windows and applications." + "

If unsure, leave this unchecked."); m_checkbox_use_builtin_title_database->SetDescription(tr(TR_TITLE_DATABASE_DESCRIPTION)); m_combobox_theme->SetTitle(tr("Theme")); m_combobox_theme->SetDescription(tr(TR_THEME_DESCRIPTION)); + + m_checkbox_top_window->SetDescription(tr(TR_TOP_WINDOW_DESCRIPTION)); } diff --git a/Source/Core/DolphinQt/Settings/InterfacePane.h b/Source/Core/DolphinQt/Settings/InterfacePane.h index 8363c56800..34da744bbd 100644 --- a/Source/Core/DolphinQt/Settings/InterfacePane.h +++ b/Source/Core/DolphinQt/Settings/InterfacePane.h @@ -38,7 +38,7 @@ private: ConfigStringChoice* m_combobox_theme; QComboBox* m_combobox_userstyle; QLabel* m_label_userstyle; - QCheckBox* m_checkbox_top_window; + ConfigBool* m_checkbox_top_window; ConfigBool* m_checkbox_use_builtin_title_database; ToolTipCheckBox* m_checkbox_show_debugging_ui; QCheckBox* m_checkbox_focused_hotkeys;