Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interface: Static Game Window Title option #13137

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Source/Core/Core/Config/MainSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ const Info<ShowCursor> MAIN_SHOW_CURSOR{{System::Main, "Interface", "CursorVisib
ShowCursor::OnMovement};
const Info<bool> MAIN_LOCK_CURSOR{{System::Main, "Interface", "LockCursor"}, false};
const Info<std::string> MAIN_INTERFACE_LANGUAGE{{System::Main, "Interface", "LanguageCode"}, ""};
const Info<bool> MAIN_STATIC_TITLE{{System::Main, "Interface", "StaticTitle"}, false};
const Info<bool> MAIN_SHOW_ACTIVE_TITLE{{System::Main, "Interface", "ShowActiveTitle"}, true};
const Info<bool> MAIN_USE_BUILT_IN_TITLE_DATABASE{
{System::Main, "Interface", "UseBuiltinTitleDatabase"}, true};
Expand Down
1 change: 1 addition & 0 deletions Source/Core/Core/Config/MainSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ extern const Info<ShowCursor> MAIN_SHOW_CURSOR;

extern const Info<bool> MAIN_LOCK_CURSOR;
extern const Info<std::string> MAIN_INTERFACE_LANGUAGE;
extern const Info<bool> MAIN_STATIC_TITLE;
extern const Info<bool> MAIN_SHOW_ACTIVE_TITLE;
extern const Info<bool> MAIN_USE_BUILT_IN_TITLE_DATABASE;
extern const Info<std::string> MAIN_THEME_NAME;
Expand Down
7 changes: 6 additions & 1 deletion Source/Core/Core/Core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,12 @@ void UpdateTitle(Core::System& system)
g_video_backend->GetDisplayName(), Config::Get(Config::MAIN_DSP_HLE) ? "HLE" : "LLE");

std::string message = fmt::format("{} | {}", Common::GetScmRevStr(), SSettings);
if (Config::Get(Config::MAIN_SHOW_ACTIVE_TITLE))

if (Config::Get(Config::MAIN_STATIC_TITLE))
{
message = Common::GetStringT("Dolphin Render Window");
}
else if (Config::Get(Config::MAIN_SHOW_ACTIVE_TITLE))
{
const std::string& title = SConfig::GetInstance().GetTitleDescription();
if (!title.empty())
Expand Down
20 changes: 20 additions & 0 deletions Source/Core/DolphinQt/Settings/InterfacePane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ void InterfacePane::CreateInGame()
new ConfigBool(tr("Use Panic Handlers"), Config::MAIN_USE_PANIC_HANDLERS);
m_checkbox_enable_osd =
new ConfigBool(tr("Show On-Screen Display Messages"), Config::MAIN_OSD_MESSAGES);
m_checkbox_static_title = new ConfigBool(tr("Static Window Title"), Config::MAIN_STATIC_TITLE);
m_checkbox_show_active_title =
new ConfigBool(tr("Show Active Title in Window Title"), Config::MAIN_SHOW_ACTIVE_TITLE);
m_checkbox_pause_on_focus_lost =
Expand Down Expand Up @@ -219,6 +220,7 @@ void InterfacePane::CreateInGame()
groupbox_layout->addWidget(m_checkbox_confirm_on_stop);
groupbox_layout->addWidget(m_checkbox_use_panic_handlers);
groupbox_layout->addWidget(m_checkbox_enable_osd);
groupbox_layout->addWidget(m_checkbox_static_title);
groupbox_layout->addWidget(m_checkbox_show_active_title);
groupbox_layout->addWidget(m_checkbox_pause_on_focus_lost);
groupbox_layout->addWidget(mouse_groupbox);
Expand All @@ -227,6 +229,7 @@ void InterfacePane::CreateInGame()
#else
m_checkbox_lock_mouse->hide();
#endif
UpdateShowActiveTitleEnabled();
}

void InterfacePane::ConnectLayout()
Expand All @@ -253,6 +256,8 @@ void InterfacePane::ConnectLayout()
&Settings::CursorVisibilityChanged);
connect(m_checkbox_lock_mouse, &QCheckBox::toggled, &Settings::Instance(),
&Settings::LockCursorChanged);
connect(m_checkbox_static_title, &QCheckBox::stateChanged,
[this](int) { UpdateShowActiveTitleEnabled(); });
}

void InterfacePane::UpdateShowDebuggingCheckbox()
Expand Down Expand Up @@ -353,6 +358,9 @@ void InterfacePane::AddDescriptions()
QT_TR_NOOP("Shows on-screen display messages over the render window. These messages "
"disappear after several seconds."
"<br><br><dolphin_emphasis>If unsure, leave this checked.</dolphin_emphasis>");
static constexpr char TR_STATIC_WINDOW_TITLE[] =
QT_TR_NOOP("The render window's title will always be \"Dolphin Render Window\"."
"<br><br><dolphin_emphasis>If unsure, leave this unchecked.</dolphin_emphasis>");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Settings that disable other settings should mention that in the tooltip, please change this to:

The render window's title will always be \"Dolphin Render Window\".<br><br>If this setting is enabled, Show Active Title in Window Title will be disabled.<br><br><dolphin_emphasis>If unsure, leave this unchecked.</dolphin_emphasis>

static constexpr char TR_SHOW_ACTIVE_TITLE_DESCRIPTION[] =
QT_TR_NOOP("Shows the active game title in the render window's title bar."
"<br><br><dolphin_emphasis>If unsure, leave this checked.</dolphin_emphasis>");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Settings that get disabled when other settings are enabled should also mention that, please change this to:

Shows the active game title in the render window's title bar.<br><br>This setting is disabled when Static Window Title is enabled.<br><br><dolphin_emphasis>If unsure, leave this checked.</dolphin_emphasis>

Expand Down Expand Up @@ -400,6 +408,8 @@ void InterfacePane::AddDescriptions()

m_checkbox_enable_osd->SetDescription(tr(TR_ENABLE_OSD_DESCRIPTION));

m_checkbox_static_title->SetDescription(tr(TR_STATIC_WINDOW_TITLE));

m_checkbox_show_active_title->SetDescription(tr(TR_SHOW_ACTIVE_TITLE_DESCRIPTION));

m_checkbox_pause_on_focus_lost->SetDescription(tr(TR_PAUSE_ON_FOCUS_LOST_DESCRIPTION));
Expand All @@ -415,3 +425,13 @@ void InterfacePane::AddDescriptions()
m_combobox_userstyle->SetTitle(tr("Style"));
m_combobox_userstyle->SetDescription(tr(TR_USER_STYLE_DESCRIPTION));
}

void InterfacePane::UpdateShowActiveTitleEnabled()
{

const bool enabled = m_checkbox_static_title->isChecked();

if (enabled)
m_checkbox_show_active_title->setChecked(false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't uncheck "Show Active Title in Window Title" when "Static Window Title" is enabled, just setting the checkbox state to disabled is enough.

m_checkbox_show_active_title->setEnabled(!enabled);
}
2 changes: 2 additions & 0 deletions Source/Core/DolphinQt/Settings/InterfacePane.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class InterfacePane final : public QWidget
void LoadUserStyle();
void OnUserStyleChanged();
void OnLanguageChanged();
void UpdateShowActiveTitleEnabled();

QVBoxLayout* m_main_layout;
ConfigStringChoice* m_combobox_language;
Expand All @@ -46,6 +47,7 @@ class InterfacePane final : public QWidget
ConfigBool* m_checkbox_confirm_on_stop;
ConfigBool* m_checkbox_use_panic_handlers;
ConfigBool* m_checkbox_enable_osd;
ConfigBool* m_checkbox_static_title;
ConfigBool* m_checkbox_show_active_title;
ConfigBool* m_checkbox_pause_on_focus_lost;
ConfigRadioInt* m_radio_cursor_visible_movement;
Expand Down