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.
This commit is contained in:
zhupengfei 2018-07-27 10:51:33 +08:00
parent 4a3c4f5f67
commit b1bbe0441e
No known key found for this signature in database
GPG key ID: 85B82A3E62174206
6 changed files with 13 additions and 0 deletions

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