Merge pull request #4010 from zhaowenlan1779/statusbar-retheme

qt_themes: add themed connected/disconnected icons for dark and fix status bar theme updating
This commit is contained in:
James Rowe 2018-07-30 10:35:42 -06:00 committed by GitHub
commit 7b46b7e29a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 13 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 397 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 444 B

View File

@ -1,6 +1,8 @@
<RCC>
<qresource prefix="icons/qdarkstyle">
<file alias="index.theme">icons/index.theme</file>
<file alias="16x16/connected.png">icons/16x16/connected.png</file>
<file alias="16x16/disconnected.png">icons/16x16/disconnected.png</file>
<file alias="16x16/lock.png">icons/16x16/lock.png</file>
<file alias="48x48/bad_folder.png">icons/48x48/bad_folder.png</file>
<file alias="48x48/chip.png">icons/48x48/chip.png</file>

View File

@ -448,6 +448,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() {

View File

@ -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();

View File

@ -46,6 +46,7 @@ public slots:
void OnOpenNetworkRoom();
void OnDirectConnectToRoom();
void OnAnnounceFailed(const Common::WebResult&);
void UpdateThemedIcons();
signals:
void NetworkStateChanged(const Network::RoomMember::State&);