Add an indicator in the title bar if Streamer Mode is active (#4410)
This commit is contained in:
@@ -195,6 +195,11 @@ void SettingsDialog::filterElements(const QString &text)
|
||||
}
|
||||
}
|
||||
|
||||
void SettingsDialog::setElementFilter(const QString &query)
|
||||
{
|
||||
this->ui_.search->setText(query);
|
||||
}
|
||||
|
||||
void SettingsDialog::addTabs()
|
||||
{
|
||||
this->ui_.tabContainer->setSpacing(0);
|
||||
@@ -203,7 +208,7 @@ void SettingsDialog::addTabs()
|
||||
// Constructors are wrapped in std::function to remove some strain from first time loading.
|
||||
|
||||
// clang-format off
|
||||
this->addTab([]{return new GeneralPage;}, "General", ":/settings/about.svg");
|
||||
this->addTab([]{return new GeneralPage;}, "General", ":/settings/about.svg", SettingsTabId::General);
|
||||
this->ui_.tabContainer->addSpacing(16);
|
||||
this->addTab([]{return new AccountsPage;}, "Accounts", ":/settings/accounts.svg", SettingsTabId::Accounts);
|
||||
this->addTab([]{return new NicknamesPage;}, "Nicknames", ":/settings/accounts.svg");
|
||||
@@ -316,10 +321,20 @@ void SettingsDialog::showDialog(QWidget *parent,
|
||||
}
|
||||
break;
|
||||
|
||||
case SettingsDialogPreference::StreamerMode: {
|
||||
instance->selectTab(SettingsTabId::General);
|
||||
}
|
||||
break;
|
||||
|
||||
default:;
|
||||
}
|
||||
|
||||
instance->show();
|
||||
if (preferredTab == SettingsDialogPreference::StreamerMode)
|
||||
{
|
||||
// this is needed because each time the settings are opened, the query is reset
|
||||
instance->setElementFilter("Streamer Mode");
|
||||
}
|
||||
instance->activateWindow();
|
||||
instance->raise();
|
||||
instance->setFocus();
|
||||
|
||||
Reference in New Issue
Block a user