diff options
Diffstat (limited to 'src/yuzu')
| -rw-r--r-- | src/yuzu/bootmanager.cpp | 16 | ||||
| -rw-r--r-- | src/yuzu/configuration/config.cpp | 3 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_system.cpp | 2 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_system.h | 1 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_system.ui | 257 | ||||
| -rw-r--r-- | src/yuzu/loading_screen.cpp | 3 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 21 | ||||
| -rw-r--r-- | src/yuzu/main.h | 1 | ||||
| -rw-r--r-- | src/yuzu/main.ui | 12 | 
9 files changed, 293 insertions, 23 deletions
| diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp index 3d759f77b..1adf8932b 100644 --- a/src/yuzu/bootmanager.cpp +++ b/src/yuzu/bootmanager.cpp @@ -150,18 +150,19 @@ public:      }      void MakeCurrent() override { -        if (is_current) { -            return; +        // We can't track the current state of the underlying context in this wrapper class because +        // Qt may make the underlying context not current for one reason or another. In particular, +        // the WebBrowser uses GL, so it seems to conflict if we aren't careful. +        // Instead of always just making the context current (which does not have any caching to +        // check if the underlying context is already current) we can check for the current context +        // in the thread local data by calling `currentContext()` and checking if its ours. +        if (QOpenGLContext::currentContext() != context.get()) { +            context->makeCurrent(surface);          } -        is_current = context->makeCurrent(surface);      }      void DoneCurrent() override { -        if (!is_current) { -            return; -        }          context->doneCurrent(); -        is_current = false;      }      QOpenGLContext* GetShareContext() { @@ -178,7 +179,6 @@ private:      std::unique_ptr<QOpenGLContext> context;      std::unique_ptr<QOffscreenSurface> offscreen_surface{};      QSurface* surface; -    bool is_current = false;  };  class DummyContext : public Core::Frontend::GraphicsContext {}; diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 75c6cf20b..27775701d 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp @@ -687,6 +687,8 @@ void Config::ReadSystemValues() {      Settings::values.region_index = ReadSetting(QStringLiteral("region_index"), 1).toInt(); +    Settings::values.time_zone_index = ReadSetting(QStringLiteral("time_zone_index"), 0).toInt(); +      const auto rng_seed_enabled = ReadSetting(QStringLiteral("rng_seed_enabled"), false).toBool();      if (rng_seed_enabled) {          Settings::values.rng_seed = ReadSetting(QStringLiteral("rng_seed"), 0).toULongLong(); @@ -1126,6 +1128,7 @@ void Config::SaveSystemValues() {      WriteSetting(QStringLiteral("current_user"), Settings::values.current_user, 0);      WriteSetting(QStringLiteral("language_index"), Settings::values.language_index, 1);      WriteSetting(QStringLiteral("region_index"), Settings::values.region_index, 1); +    WriteSetting(QStringLiteral("time_zone_index"), Settings::values.time_zone_index, 0);      WriteSetting(QStringLiteral("rng_seed_enabled"), Settings::values.rng_seed.has_value(), false);      WriteSetting(QStringLiteral("rng_seed"), Settings::values.rng_seed.value_or(0), 0); diff --git a/src/yuzu/configuration/configure_system.cpp b/src/yuzu/configuration/configure_system.cpp index f49cd4c8f..10315e7a6 100644 --- a/src/yuzu/configuration/configure_system.cpp +++ b/src/yuzu/configuration/configure_system.cpp @@ -57,6 +57,7 @@ void ConfigureSystem::SetConfiguration() {      ui->combo_language->setCurrentIndex(Settings::values.language_index);      ui->combo_region->setCurrentIndex(Settings::values.region_index); +    ui->combo_time_zone->setCurrentIndex(Settings::values.time_zone_index);      ui->combo_sound->setCurrentIndex(Settings::values.sound_index);      ui->rng_seed_checkbox->setChecked(Settings::values.rng_seed.has_value()); @@ -84,6 +85,7 @@ void ConfigureSystem::ApplyConfiguration() {      Settings::values.language_index = ui->combo_language->currentIndex();      Settings::values.region_index = ui->combo_region->currentIndex(); +    Settings::values.time_zone_index = ui->combo_time_zone->currentIndex();      Settings::values.sound_index = ui->combo_sound->currentIndex();      if (ui->rng_seed_checkbox->isChecked()) { diff --git a/src/yuzu/configuration/configure_system.h b/src/yuzu/configuration/configure_system.h index d8fa2d2cc..26d42d5c5 100644 --- a/src/yuzu/configuration/configure_system.h +++ b/src/yuzu/configuration/configure_system.h @@ -37,5 +37,6 @@ private:      int language_index = 0;      int region_index = 0; +    int time_zone_index = 0;      int sound_index = 0;  }; diff --git a/src/yuzu/configuration/configure_system.ui b/src/yuzu/configuration/configure_system.ui index 4e2c7e76e..9c8cca6dc 100644 --- a/src/yuzu/configuration/configure_system.ui +++ b/src/yuzu/configuration/configure_system.ui @@ -22,14 +22,14 @@          <string>System Settings</string>         </property>         <layout class="QGridLayout" name="gridLayout"> -        <item row="2" column="0"> +        <item row="3" column="0">           <widget class="QLabel" name="label_sound">            <property name="text">             <string>Sound output mode</string>            </property>           </widget>          </item> -        <item row="3" column="0"> +        <item row="4" column="0">           <widget class="QLabel" name="label_console_id">            <property name="text">             <string>Console ID:</string> @@ -174,14 +174,255 @@            </item>           </widget>          </item> -        <item row="5" column="0"> +        <item row="2" column="0"> +         <widget class="QLabel" name="label_timezone"> +          <property name="text"> +           <string>Time Zone:</string> +          </property> +         </widget> +        </item> +        <item row="2" column="1"> +         <widget class="QComboBox" name="combo_time_zone"> +          <item> +           <property name="text"> +            <string>Auto</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>Default</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>CET</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>CST6CDT</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>Cuba</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>EET</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>Egypt</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>Eire</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>EST</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>EST5EDT</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>GB</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>GB-Eire</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>GMT</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>GMT+0</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>GMT-0</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>GMT0</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>Greenwich</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>Hongkong</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>HST</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>Iceland</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>Iran</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>Israel</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>Jamaica</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>Japan</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>Kwajalein</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>Libya</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>MET</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>MST</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>MST7MDT</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>Navajo</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>NZ</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>NZ-CHAT</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>Poland</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>Portugal</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>PRC</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>PST8PDT</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>ROC</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>ROK</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>Singapore</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>Turkey</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>UCT</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>Universal</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>UTC</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>W-SU</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>WET</string> +           </property> +          </item> +          <item> +           <property name="text"> +            <string>Zulu</string> +           </property> +          </item> +         </widget> +        </item> +        <item row="6" column="0">           <widget class="QCheckBox" name="rng_seed_checkbox">            <property name="text">             <string>RNG Seed</string>            </property>           </widget>          </item> -        <item row="2" column="1"> +        <item row="3" column="1">           <widget class="QComboBox" name="combo_sound">            <item>             <property name="text"> @@ -207,7 +448,7 @@            </property>           </widget>          </item> -        <item row="3" column="1"> +        <item row="4" column="1">           <widget class="QPushButton" name="button_regenerate_console_id">            <property name="sizePolicy">             <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> @@ -223,14 +464,14 @@            </property>           </widget>          </item> -        <item row="4" column="0"> +        <item row="5" column="0">           <widget class="QCheckBox" name="custom_rtc_checkbox">            <property name="text">             <string>Custom RTC</string>            </property>           </widget>          </item> -        <item row="4" column="1"> +        <item row="5" column="1">           <widget class="QDateTimeEdit" name="custom_rtc_edit">            <property name="minimumDate">             <date> @@ -244,7 +485,7 @@            </property>           </widget>          </item> -        <item row="5" column="1"> +        <item row="6" column="1">           <widget class="QLineEdit" name="rng_seed_edit">            <property name="sizePolicy">             <sizepolicy hsizetype="Minimum" vsizetype="Fixed"> diff --git a/src/yuzu/loading_screen.cpp b/src/yuzu/loading_screen.cpp index 2a6483370..ae842306c 100644 --- a/src/yuzu/loading_screen.cpp +++ b/src/yuzu/loading_screen.cpp @@ -19,6 +19,7 @@  #include <QTime>  #include <QtConcurrent/QtConcurrentRun>  #include "common/logging/log.h" +#include "core/frontend/framebuffer_layout.h"  #include "core/loader/loader.h"  #include "ui_loading_screen.h"  #include "video_core/rasterizer_interface.h" @@ -61,7 +62,7 @@ LoadingScreen::LoadingScreen(QWidget* parent)      : QWidget(parent), ui(std::make_unique<Ui::LoadingScreen>()),        previous_stage(VideoCore::LoadCallbackStage::Complete) {      ui->setupUi(this); -    setMinimumSize(1280, 720); +    setMinimumSize(Layout::MinimumSize::Width, Layout::MinimumSize::Height);      // Create a fade out effect to hide this loading screen widget.      // When fading opacity, it will fade to the parent widgets background color, which is why we diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 437464797..0b291c7d0 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -724,13 +724,13 @@ void GMainWindow::InitializeHotkeys() {  }  void GMainWindow::SetDefaultUIGeometry() { -    // geometry: 55% of the window contents are in the upper screen half, 45% in the lower half +    // geometry: 53% of the window contents are in the upper screen half, 47% in the lower half      const QRect screenRect = QApplication::desktop()->screenGeometry(this);      const int w = screenRect.width() * 2 / 3; -    const int h = screenRect.height() / 2; +    const int h = screenRect.height() * 2 / 3;      const int x = (screenRect.x() + screenRect.width()) / 2 - w / 2; -    const int y = (screenRect.y() + screenRect.height()) / 2 - h * 55 / 100; +    const int y = (screenRect.y() + screenRect.height()) / 2 - h * 53 / 100;      setGeometry(x, y, w, h);  } @@ -831,6 +831,7 @@ void GMainWindow::ConnectMenuEvents() {              &GMainWindow::OnDisplayTitleBars);      connect(ui.action_Show_Filter_Bar, &QAction::triggered, this, &GMainWindow::OnToggleFilterBar);      connect(ui.action_Show_Status_Bar, &QAction::triggered, statusBar(), &QStatusBar::setVisible); +    connect(ui.action_Reset_Window_Size, &QAction::triggered, this, &GMainWindow::ResetWindowSize);      // Fullscreen      ui.action_Fullscreen->setShortcut( @@ -1851,6 +1852,20 @@ void GMainWindow::ToggleWindowMode() {      }  } +void GMainWindow::ResetWindowSize() { +    const auto aspect_ratio = Layout::EmulationAspectRatio( +        static_cast<Layout::AspectRatio>(Settings::values.aspect_ratio), +        static_cast<float>(Layout::ScreenUndocked::Height) / Layout::ScreenUndocked::Width); +    if (!ui.action_Single_Window_Mode->isChecked()) { +        render_window->resize(Layout::ScreenUndocked::Height / aspect_ratio, +                              Layout::ScreenUndocked::Height); +    } else { +        resize(Layout::ScreenUndocked::Height / aspect_ratio, +               Layout::ScreenUndocked::Height + menuBar()->height() + +                   (ui.action_Show_Status_Bar->isChecked() ? statusBar()->height() : 0)); +    } +} +  void GMainWindow::OnConfigure() {      const auto old_theme = UISettings::values.theme;      const bool old_discord_presence = UISettings::values.enable_discord_presence; diff --git a/src/yuzu/main.h b/src/yuzu/main.h index 1495a1b26..4f4c8ddbe 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h @@ -208,6 +208,7 @@ private slots:      void ShowFullscreen();      void HideFullscreen();      void ToggleWindowMode(); +    void ResetWindowSize();      void OnCaptureScreenshot();      void OnCoreError(Core::System::ResultStatus, std::string);      void OnReinitializeKeys(ReinitializeKeyBehavior behavior); diff --git a/src/yuzu/main.ui b/src/yuzu/main.ui index ae414241e..97c90f50b 100644 --- a/src/yuzu/main.ui +++ b/src/yuzu/main.ui @@ -6,8 +6,8 @@     <rect>      <x>0</x>      <y>0</y> -    <width>1081</width> -    <height>730</height> +    <width>1280</width> +    <height>720</height>     </rect>    </property>    <property name="windowTitle"> @@ -44,7 +44,7 @@      <rect>       <x>0</x>       <y>0</y> -     <width>1081</width> +     <width>1280</width>       <height>21</height>      </rect>     </property> @@ -96,6 +96,7 @@      <addaction name="action_Display_Dock_Widget_Headers"/>      <addaction name="action_Show_Filter_Bar"/>      <addaction name="action_Show_Status_Bar"/> +    <addaction name="action_Reset_Window_Size"/>      <addaction name="separator"/>      <addaction name="menu_View_Debugging"/>     </widget> @@ -215,6 +216,11 @@      <string>Show Status Bar</string>     </property>    </action> +  <action name="action_Reset_Window_Size"> +   <property name="text"> +    <string>Reset Window Size</string> +   </property> +  </action>    <action name="action_Fullscreen">     <property name="checkable">      <bool>true</bool> | 
