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 zcmeAS@N?(olHy`uVBq!ia0y~yU=RXf4mJh`hOl#e;S3B6jKx9jP7LeL$-HD>U|>mi z^mSxl*x1kgCy|wbfq}EYBeIx*f$uN~Gak=hk;1^hsO0J57-HeSbc(GPbD&5oyYIwv zhf;K%SXc`Movc{5D~L^NjBH2^6Aa8ziJq`TlxdQYZ--cB+NZrUC(o~Ze@=N8Ki~Vp z_m=I6pC-#V&3k@U=X6{^{NnwKCzXHc)-&mIUeUPoaAj{)+{vXmg$8j8^AE9d^_L#= z{%}9}mqY9p9qm;H^^@+h9hTkYXq@VEqhDm>L4y+27iM9{@>X{6wyo>AX!K0j)hS|^ z`0h&ebu2Se&&Y|cK6I}3$mL7hj%q#rcdT$thUm2PrMfBGd2|D!HwsL9ero25l)ot} zlN5FQ4bFB?Vcac0b*Fm1rr4oNwQudar?7txzw&HW(L61oro`{tFFVI;%~-&`jyLl4 zM=!Jevd`Riy<>ma82?FMqr&a?-}zT2sc4_EblceS%JU}!0|SGntDnm{r-UW|2Q8tG 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 zcmeAS@N?(olHy`uVBq!ia0y~yU=RXf4mJh`hOl#e;S3B6jKx9jP7LeL$-HD>U|>mi z^mSxl*x1kgCy|wbfq}EYBeIx*f$uN~Gak=hk;1^h80hKZ7-Hc+b;^FP!wDisl{u_B z`Mj2gy{zs~vatBcwy2pu@ZjBz3cG%Ybmc!#dM7Fqy>jvkB@L%X?^TYUm|oZUw(;=a z@^@#aKT$iWb7E7Dq3`9~H+C`QHO%XEe#&>0KQKOP`C#)|0=)DaOL>4Ymdu2bgrCK%bR>> z!M^}q|n-i30{@$!3-|(}ZxWZ2c_YJS76lIq^eXicb9KHAGw$t?s3ZATH zIn45iPv(%jitbg}_^6*F?^4kO1rPG3MZ4|wjxbs_b4nxtdq=HRu7dD4( z@k?5k$kA*bc=XEQ3$Gr!?pJQSwY=@2-fmSsmMXXAJ*$~M-I{Fnjp?=x$3@dC>lg6H z+dg2O_n__cH5RFJi9hWR#wQ(^b69htiv5x7%xS%U*ZyT-U|{fc^>bP0l+XkKY#_tK literal 0 HcmV?d00001 diff --git a/dist/qt_themes/qdarkstyle/style.qrc b/dist/qt_themes/qdarkstyle/style.qrc index c2c14c28a..bcb121d4b 100644 --- a/dist/qt_themes/qdarkstyle/style.qrc +++ b/dist/qt_themes/qdarkstyle/style.qrc @@ -1,6 +1,8 @@ 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&);