added username in the titlebar

This commit is contained in:
fourtf
2018-02-05 23:32:38 +01:00
parent 9b1300212a
commit 6b483640cd
3 changed files with 22 additions and 2 deletions
+6 -1
View File
@@ -39,9 +39,14 @@ Window::Window(const QString &windowName, singletons::ThemeManager &_themeManage
this->addTitleBarButton(TitleBarButton::Settings, [] {
singletons::WindowManager::getInstance().showSettingsDialog();
});
this->addTitleBarButton(TitleBarButton::User, [this] {
auto user = this->addTitleBarLabel([this] {
singletons::WindowManager::getInstance().showAccountSelectPopup(QCursor::pos());
});
singletons::AccountManager::getInstance().Twitch.userChanged.connect([this, user] {
user->getLabel().setText(
singletons::AccountManager::getInstance().Twitch.getCurrent()->getUserName());
});
}
QVBoxLayout *layout = new QVBoxLayout(this);