diff --git a/dist/qt_themes/colorful/style.qrc b/dist/qt_themes/colorful/style.qrc index b8d47460f..2866c69bd 100644 --- a/dist/qt_themes/colorful/style.qrc +++ b/dist/qt_themes/colorful/style.qrc @@ -13,6 +13,6 @@ icons/256x256/plus_folder.png - style.qss + ../default/style.qss diff --git a/dist/qt_themes/colorful/style.qss b/dist/qt_themes/colorful/style.qss deleted file mode 100644 index 413fc81da..000000000 --- a/dist/qt_themes/colorful/style.qss +++ /dev/null @@ -1,4 +0,0 @@ -/* - This file is intentionally left blank. - We do not want to apply any stylesheet for colorful, only icons. -*/ diff --git a/dist/qt_themes/default/default.qrc b/dist/qt_themes/default/default.qrc index cf011680f..6da475316 100644 --- a/dist/qt_themes/default/default.qrc +++ b/dist/qt_themes/default/default.qrc @@ -1,33 +1,22 @@ icons/index.theme - icons/16x16/checked.png - icons/16x16/failed.png - icons/16x16/connected.png - icons/16x16/disconnected.png - icons/16x16/connected_notification.png - icons/16x16/lock.png - icons/48x48/bad_folder.png - icons/48x48/chip.png - icons/48x48/folder.png - icons/48x48/no_avatar.png - icons/48x48/plus.png - icons/48x48/sd_card.png - icons/256x256/citra.png - icons/256x256/plus_folder.png + + style.qss + diff --git a/dist/qt_themes/default/style.qss b/dist/qt_themes/default/style.qss new file mode 100644 index 000000000..9ed47a3a6 --- /dev/null +++ b/dist/qt_themes/default/style.qss @@ -0,0 +1,13 @@ +QPushButton#GraphicsAPIStatusBarButton { + color: #656565; + border: 1px solid transparent; + background-color: transparent; + padding: 0px 3px 0px 3px; + text-align: center; + min-width: 60px; + min-height: 20px; +} + +QPushButton#GraphicsAPIStatusBarButton:hover { + border: 1px solid #76797C; +} \ No newline at end of file diff --git a/dist/qt_themes/qdarkstyle/style.qss b/dist/qt_themes/qdarkstyle/style.qss index 094c7629a..ea6ea95d6 100644 --- a/dist/qt_themes/qdarkstyle/style.qss +++ b/dist/qt_themes/qdarkstyle/style.qss @@ -1,31 +1,3 @@ -QPushButton#TogglableStatusBarButton { - color: #959595; - border: 1px solid transparent; - background-color: transparent; - padding: 0px 3px 0px 3px; - text-align: center; -} - -QPushButton#TogglableStatusBarButton:checked { - color: palette(text); -} - -QPushButton#TogglableStatusBarButton:hover { - border: 1px solid #76797C; -} - -QPushButton#GraphicsAPIStatusBarButton { - color: #656565; - border: 1px solid transparent; - background-color: transparent; - padding: 0px 3px 0px 3px; - text-align: center; -} - -QPushButton#GraphicsAPIStatusBarButton:hover { - border: 1px solid #76797C; -} - QToolTip { border: 1px solid #76797C; background-color: #5A7566; @@ -550,13 +522,12 @@ QToolButton#qt_toolbar_ext_button { QPushButton { color: #eff0f1; - border-width: 1px; - border-color: #54575B; - border-style: solid; - padding: 6px 4px; + border: 1px solid #54575B; border-radius: 2px; + padding: 5px 0px 5px 0px; outline: none; min-width: 100px; + min-height: 13px; background-color: #232629; } @@ -1265,3 +1236,17 @@ QPlainTextEdit:disabled { TouchScreenPreview { qproperty-dotHighlightColor: #3daee9; } + +QPushButton#GraphicsAPIStatusBarButton { + color: #656565; + border: 1px solid transparent; + background-color: transparent; + padding: 0px 3px 0px 3px; + text-align: center; + min-width: 60px; + min-height: 20px; +} + +QPushButton#GraphicsAPIStatusBarButton:hover { + border: 1px solid #76797C; +} \ No newline at end of file diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index 4d301b25d..5ede4fc97 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -293,29 +293,11 @@ void GMainWindow::InitializeWidgets() { // Create status bar message_label = new QLabel(); // Configured separately for left alignment - message_label->setVisible(false); message_label->setFrameStyle(QFrame::NoFrame); message_label->setContentsMargins(4, 0, 4, 0); message_label->setAlignment(Qt::AlignLeft); statusBar()->addPermanentWidget(message_label, 1); - // Setup Graphics API button - graphics_api_button = new QPushButton(); - graphics_api_button->setCheckable(true); - graphics_api_button->setObjectName(QStringLiteral("GraphicsAPIStatusBarButton")); - graphics_api_button->setFocusPolicy(Qt::NoFocus); - UpdateAPIIndicator(false); - - connect(graphics_api_button, &QPushButton::clicked, this, [this] { - if (emulation_running) { - return; - } - - UpdateAPIIndicator(true); - }); - - statusBar()->addPermanentWidget(graphics_api_button); - progress_bar = new QProgressBar(); progress_bar->hide(); statusBar()->addPermanentWidget(progress_bar); @@ -338,8 +320,25 @@ void GMainWindow::InitializeWidgets() { statusBar()->addPermanentWidget(label); } - statusBar()->addPermanentWidget(multiplayer_state->GetStatusText(), 0); - statusBar()->addPermanentWidget(multiplayer_state->GetStatusIcon(), 0); + // Setup Graphics API button + graphics_api_button = new QPushButton(); + graphics_api_button->setObjectName(QStringLiteral("GraphicsAPIStatusBarButton")); + graphics_api_button->setFocusPolicy(Qt::NoFocus); + UpdateAPIIndicator(false); + + connect(graphics_api_button, &QPushButton::clicked, this, [this] { + if (emulation_running) { + return; + } + + UpdateAPIIndicator(true); + }); + + statusBar()->insertPermanentWidget(0, graphics_api_button); + + statusBar()->addPermanentWidget(multiplayer_state->GetStatusText()); + statusBar()->addPermanentWidget(multiplayer_state->GetStatusIcon()); + statusBar()->setVisible(true); // Removes an ugly inner border from the status bar widgets under Linux @@ -1268,7 +1267,6 @@ void GMainWindow::ShutdownGame() { // Disable status bar updates status_bar_update_timer.stop(); - message_label->setVisible(false); message_label_used_for_movie = false; emu_speed_label->setVisible(false); game_fps_label->setVisible(false); @@ -2456,8 +2454,16 @@ void GMainWindow::UpdateUITheme() { QStringList theme_paths(default_theme_paths); if (is_default_theme || current_theme.isEmpty()) { - qApp->setStyleSheet({}); - setStyleSheet({}); + const QString theme_uri(QStringLiteral(":default/style.qss")); + QFile f(theme_uri); + if (f.open(QFile::ReadOnly | QFile::Text)) { + QTextStream ts(&f); + qApp->setStyleSheet(ts.readAll()); + setStyleSheet(ts.readAll()); + } else { + qApp->setStyleSheet({}); + setStyleSheet({}); + } theme_paths.append(default_icons); QIcon::setThemeName(default_icons); } else {