From b1bbe0441eecfcad58550daaa91363d5e1cd8ee2 Mon Sep 17 00:00:00 2001 From: zhupengfei Date: Fri, 27 Jul 2018 10:51:33 +0800 Subject: [PATCH] qt_themes: add themed connected/disconnected icons for dark and fix status bar theme updating In dark theme, it is very hard to see the connected/disconnected icons because they are dark too. So I added two white-coloured icons for the dark theme. This also fixed an issue where theme update does not change the icon on the status bar. --- .../qdarkstyle/icons/16x16/connected.png | Bin 0 -> 397 bytes .../qdarkstyle/icons/16x16/disconnected.png | Bin 0 -> 444 bytes dist/qt_themes/qdarkstyle/style.qrc | 2 ++ src/citra_qt/main.cpp | 2 ++ src/citra_qt/multiplayer/state.cpp | 8 ++++++++ src/citra_qt/multiplayer/state.h | 1 + 6 files changed, 13 insertions(+) create mode 100644 dist/qt_themes/qdarkstyle/icons/16x16/connected.png create mode 100644 dist/qt_themes/qdarkstyle/icons/16x16/disconnected.png diff --git a/dist/qt_themes/qdarkstyle/icons/16x16/connected.png b/dist/qt_themes/qdarkstyle/icons/16x16/connected.png new file mode 100644 index 0000000000000000000000000000000000000000..90feb372af3e4c1dd9782e075993946c26b1e5b0 GIT binary patch literal 397 zcmV;80doF{P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0U}96K~y+TrIbBN z15p%(2ThUA!elK%1O;&sLOKPvAQqN^S%76$5m9U;Tacs`0+KRKh!$yP^1YdppLy@j zBbpBm?{V)rhhg%Q973Mw%`D4aP+z0Jqmp;@i!L;dL#Tnd!+DKbUdg3waWGz?Z^8u% zk9EdN@ZV$lKwY#fE2=PmlHCTw9lAj?WlY$Q6tTfDbS3CER>p3rhz*9WjL|aY6GcK; zx)-~7C$0pUWy~HGtHREG#M9EY#VX_e#&N7@6_#hEEo8S0El^vr5SHi4nW$v_WT|2y zEKe}ain4kx)4O#2)N;bb8 r=102j2jPKV@-HZOM*IDr)RH7C%sED}gz8E800000NkvXXu0mjf2Q8tG literal 0 HcmV?d00001 diff --git a/dist/qt_themes/qdarkstyle/icons/16x16/disconnected.png b/dist/qt_themes/qdarkstyle/icons/16x16/disconnected.png new file mode 100644 index 0000000000000000000000000000000000000000..fc5f23894e4aedae7a49981f68ba017a177b065b GIT binary patch literal 444 zcmV;t0YmPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D0Z~arK~y+Tm6X3q z!(bG}BM3T)4oat1>3fJGI5_zRqJs}n!QHVSy7&}|Z{Q;C6&zcsljtHSLgMcv$HI{dexom*ghNEXcBKF-_BL>^@v~d;_m6`5%aP;4{rR@W0^`{D7O5#ex19(LFqb zU&V+JY)3s}}a0Qf@czHi&OA^DY-4`2a_->y&b9cID?Mf&*K<#kR|Tpm5}?1j7X4 z4jjTqBrVk)Us_UtgqE$`6a4DQ_TU|*mQ&iX713e2_G4@Sa=K!0vPRIeRkTiGreO$! zH&MmZ!_eyCMZY6~+NXx$F1sZT1bRk;ysHB8+LJc+0^2+Y(KXbspbuX?;02!GhRfCj m8qQ()KfzyOz?{P=kt9FFYiX8^{jL1~0000 icons/index.theme + icons/16x16/connected.png + icons/16x16/disconnected.png icons/16x16/lock.png icons/48x48/bad_folder.png icons/48x48/chip.png diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index 2d27192bd..061d14db4 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -440,6 +440,8 @@ void GMainWindow::ConnectWidgetEvents() { connect(this, &GMainWindow::UpdateProgress, this, &GMainWindow::OnUpdateProgress); connect(this, &GMainWindow::CIAInstallReport, this, &GMainWindow::OnCIAInstallReport); connect(this, &GMainWindow::CIAInstallFinished, this, &GMainWindow::OnCIAInstallFinished); + connect(this, &GMainWindow::UpdateThemedIcons, multiplayer_state, + &MultiplayerState::UpdateThemedIcons); } void GMainWindow::ConnectMenuEvents() { diff --git a/src/citra_qt/multiplayer/state.cpp b/src/citra_qt/multiplayer/state.cpp index cb264b2a0..c3ff03af1 100644 --- a/src/citra_qt/multiplayer/state.cpp +++ b/src/citra_qt/multiplayer/state.cpp @@ -134,6 +134,14 @@ void MultiplayerState::OnAnnounceFailed(const Common::WebResult& result) { QMessageBox::Ok); } +void MultiplayerState::UpdateThemedIcons() { + if (current_state == Network::RoomMember::State::Joined) { + status_icon->setPixmap(QIcon::fromTheme("connected").pixmap(16)); + } else { + status_icon->setPixmap(QIcon::fromTheme("disconnected").pixmap(16)); + } +} + static void BringWidgetToFront(QWidget* widget) { widget->show(); widget->activateWindow(); diff --git a/src/citra_qt/multiplayer/state.h b/src/citra_qt/multiplayer/state.h index 5463cd461..b375a81a6 100644 --- a/src/citra_qt/multiplayer/state.h +++ b/src/citra_qt/multiplayer/state.h @@ -46,6 +46,7 @@ public slots: void OnOpenNetworkRoom(); void OnDirectConnectToRoom(); void OnAnnounceFailed(const Common::WebResult&); + void UpdateThemedIcons(); signals: void NetworkStateChanged(const Network::RoomMember::State&);