diff options
author | Mai M <mathew1800@gmail.com> | 2022-06-11 05:11:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-11 05:11:29 +0200 |
commit | 20576ebb4320382709012fbf36eac49cf53299a5 (patch) | |
tree | 95fc12f4b9a6c8060d43339bdf3500babc4e3d54 /src | |
parent | Merge pull request #8333 from Docteh/translate_hotkeys (diff) | |
parent | ui: Status bars dock button becomes dock/undock button (diff) | |
download | yuzu-20576ebb4320382709012fbf36eac49cf53299a5.tar yuzu-20576ebb4320382709012fbf36eac49cf53299a5.tar.gz yuzu-20576ebb4320382709012fbf36eac49cf53299a5.tar.bz2 yuzu-20576ebb4320382709012fbf36eac49cf53299a5.tar.lz yuzu-20576ebb4320382709012fbf36eac49cf53299a5.tar.xz yuzu-20576ebb4320382709012fbf36eac49cf53299a5.tar.zst yuzu-20576ebb4320382709012fbf36eac49cf53299a5.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/yuzu/main.cpp | 15 | ||||
-rw-r--r-- | src/yuzu/main.h | 1 |
2 files changed, 11 insertions, 5 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 379c925e5..cbfcba9ef 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -852,12 +852,11 @@ void GMainWindow::InitializeWidgets() { // Setup Dock button dock_status_button = new QPushButton(); - dock_status_button->setObjectName(QStringLiteral("TogglableStatusBarButton")); + dock_status_button->setObjectName(QStringLiteral("DockingStatusBarButton")); dock_status_button->setFocusPolicy(Qt::NoFocus); connect(dock_status_button, &QPushButton::clicked, this, &GMainWindow::OnToggleDockedMode); - dock_status_button->setText(tr("DOCK")); dock_status_button->setCheckable(true); - dock_status_button->setChecked(Settings::values.use_docked_mode.GetValue()); + UpdateDockedButton(); statusBar()->insertPermanentWidget(0, dock_status_button); gpu_accuracy_button = new QPushButton(); @@ -2887,7 +2886,7 @@ void GMainWindow::OnToggleDockedMode() { } Settings::values.use_docked_mode.SetValue(!is_docked); - dock_status_button->setChecked(!is_docked); + UpdateDockedButton(); OnDockedModeChanged(is_docked, !is_docked, *system); } @@ -3253,6 +3252,12 @@ void GMainWindow::UpdateGPUAccuracyButton() { } } +void GMainWindow::UpdateDockedButton() { + const bool is_docked = Settings::values.use_docked_mode.GetValue(); + dock_status_button->setChecked(is_docked); + dock_status_button->setText(is_docked ? tr("DOCKED") : tr("HANDHELD")); +} + void GMainWindow::UpdateFilterText() { const auto filter = Settings::values.scaling_filter.GetValue(); switch (filter) { @@ -3296,10 +3301,10 @@ void GMainWindow::UpdateAAText() { } void GMainWindow::UpdateStatusButtons() { - dock_status_button->setChecked(Settings::values.use_docked_mode.GetValue()); renderer_status_button->setChecked(Settings::values.renderer_backend.GetValue() == Settings::RendererBackend::Vulkan); UpdateGPUAccuracyButton(); + UpdateDockedButton(); UpdateFilterText(); UpdateAAText(); } diff --git a/src/yuzu/main.h b/src/yuzu/main.h index b399e9b01..600647015 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h @@ -320,6 +320,7 @@ private: void MigrateConfigFiles(); void UpdateWindowTitle(std::string_view title_name = {}, std::string_view title_version = {}, std::string_view gpu_vendor = {}); + void UpdateDockedButton(); void UpdateFilterText(); void UpdateAAText(); void UpdateStatusBar(); |