mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-10-25 10:02:41 -05:00
Add an option to disable inactive status blinking
Some checks are pending
debian-build / build (push) Waiting to run
Check locale / ubuntu64 (push) Waiting to run
Push to master / Check Formatting 🔍 (push) Waiting to run
Push to master / Build Project 🧱 (push) Waiting to run
Push to master / Create Release 🛫 (push) Blocked by required conditions
Some checks are pending
debian-build / build (push) Waiting to run
Check locale / ubuntu64 (push) Waiting to run
Push to master / Check Formatting 🔍 (push) Waiting to run
Push to master / Build Project 🧱 (push) Waiting to run
Push to master / Create Release 🛫 (push) Blocked by required conditions
This commit is contained in:
@@ -38,6 +38,8 @@ AdvSceneSwitcher.generalTab.generalBehavior.logLevel.verbose="Verbose logging"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.saveWindowGeo="Save window position and size"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.showTrayNotifications="Show system tray notifications"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.disableUIHints="Disable UI hints"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.disableInactiveStatusBlink="Disable blinking of the inactive status"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.disableInactiveStatusBlink.tooltip="Only affects the inactive status label in the settings window and status dock."
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.comboBoxFilterDisable="Disable filtering by typing in drop down menus"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.warnPluginLoadFailure="Display warning if plugins cannot be loaded"
|
||||
AdvSceneSwitcher.generalTab.generalBehavior.suppressCrashRecoveryDialog="Do not ask to keep the plugin stopped after an unclean shutdown"
|
||||
|
||||
@@ -319,6 +319,16 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="inactiveStatusBlinkDisable">
|
||||
<property name="toolTip">
|
||||
<string>AdvSceneSwitcher.generalTab.generalBehavior.disableInactiveStatusBlink.tooltip</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>AdvSceneSwitcher.generalTab.generalBehavior.disableInactiveStatusBlink</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="hideLegacyTabs">
|
||||
<property name="text">
|
||||
|
||||
@@ -61,6 +61,7 @@ public slots:
|
||||
void on_saveWindowGeo_stateChanged(int state);
|
||||
void on_showTrayNotifications_stateChanged(int state);
|
||||
void on_uiHintsDisable_stateChanged(int state);
|
||||
void on_inactiveStatusBlinkDisable_stateChanged(int state);
|
||||
void on_disableComboBoxFilter_stateChanged(int state);
|
||||
void on_warnPluginLoadFailure_stateChanged(int state);
|
||||
void on_suppressCrashRecoveryDialog_stateChanged(int state);
|
||||
|
||||
@@ -181,6 +181,15 @@ void AdvSceneSwitcher::on_uiHintsDisable_stateChanged(int state)
|
||||
switcher->disableHints = state;
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::on_inactiveStatusBlinkDisable_stateChanged(int state)
|
||||
{
|
||||
if (loading) {
|
||||
return;
|
||||
}
|
||||
|
||||
switcher->disableInactiveStatusBlink = state;
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::on_disableComboBoxFilter_stateChanged(int state)
|
||||
{
|
||||
if (loading) {
|
||||
@@ -626,6 +635,8 @@ void SwitcherData::SaveGeneralSettings(obs_data_t *obj)
|
||||
obs_data_set_bool(obj, "showSystemTrayNotifications",
|
||||
showSystemTrayNotifications);
|
||||
obs_data_set_bool(obj, "disableHints", disableHints);
|
||||
obs_data_set_bool(obj, "disableInactiveStatusBlink",
|
||||
disableInactiveStatusBlink);
|
||||
obs_data_set_bool(obj, "disableFilterComboboxFilter",
|
||||
disableFilterComboboxFilter);
|
||||
obs_data_set_bool(obj, "warnPluginLoadFailure", warnPluginLoadFailure);
|
||||
@@ -698,6 +709,8 @@ void SwitcherData::LoadGeneralSettings(obs_data_t *obj)
|
||||
showSystemTrayNotifications =
|
||||
obs_data_get_bool(obj, "showSystemTrayNotifications");
|
||||
disableHints = obs_data_get_bool(obj, "disableHints");
|
||||
disableInactiveStatusBlink =
|
||||
obs_data_get_bool(obj, "disableInactiveStatusBlink");
|
||||
disableFilterComboboxFilter =
|
||||
obs_data_get_bool(obj, "disableFilterComboboxFilter");
|
||||
obs_data_set_default_bool(obj, "warnPluginLoadFailure", true);
|
||||
@@ -1021,6 +1034,8 @@ void AdvSceneSwitcher::SetupGeneralTab()
|
||||
ui->showTrayNotifications->setChecked(
|
||||
switcher->showSystemTrayNotifications);
|
||||
ui->uiHintsDisable->setChecked(switcher->disableHints);
|
||||
ui->inactiveStatusBlinkDisable->setChecked(
|
||||
switcher->disableInactiveStatusBlink);
|
||||
ui->disableComboBoxFilter->setChecked(
|
||||
switcher->disableFilterComboboxFilter);
|
||||
FilterComboBox::SetFilterBehaviourEnabled(
|
||||
|
||||
@@ -161,6 +161,7 @@ public:
|
||||
QStringList loadFailureLibs;
|
||||
bool warnPluginLoadFailure = true;
|
||||
bool disableHints = false;
|
||||
bool disableInactiveStatusBlink = false;
|
||||
bool disableFilterComboboxFilter = false;
|
||||
bool hideLegacyTabs = true;
|
||||
bool settingsLockEnabled = false;
|
||||
|
||||
@@ -338,6 +338,12 @@ bool HighlightUIElementsEnabled()
|
||||
return GetSwitcher() && !GetSwitcher()->disableHints;
|
||||
}
|
||||
|
||||
bool InactiveStatusBlinkEnabled()
|
||||
{
|
||||
return HighlightUIElementsEnabled() &&
|
||||
!GetSwitcher()->disableInactiveStatusBlink;
|
||||
}
|
||||
|
||||
bool OBSIsShuttingDown()
|
||||
{
|
||||
return !GetSwitcher() || GetSwitcher()->obsIsShuttingDown;
|
||||
|
||||
@@ -49,6 +49,7 @@ EXPORT std::string PreviousForegroundWindowTitle();
|
||||
|
||||
EXPORT bool SettingsWindowIsOpened();
|
||||
EXPORT bool HighlightUIElementsEnabled();
|
||||
EXPORT bool InactiveStatusBlinkEnabled();
|
||||
|
||||
EXPORT bool OBSIsShuttingDown();
|
||||
EXPORT bool InitialLoadIsComplete();
|
||||
|
||||
@@ -134,17 +134,13 @@ void StatusControl::ButtonClicked()
|
||||
|
||||
void StatusControl::UpdateStatus()
|
||||
{
|
||||
if (PluginIsRunning()) {
|
||||
if (!_setToStopped) {
|
||||
return;
|
||||
}
|
||||
const bool running = PluginIsRunning();
|
||||
if (running && _setToStopped) {
|
||||
SetStarted();
|
||||
} else {
|
||||
if (_setToStopped) {
|
||||
return;
|
||||
}
|
||||
} else if (!running && !_setToStopped) {
|
||||
SetStopped();
|
||||
}
|
||||
UpdateStatusHighlight();
|
||||
}
|
||||
|
||||
void StatusControl::SetStarted()
|
||||
@@ -152,12 +148,9 @@ void StatusControl::SetStarted()
|
||||
_button->setText(
|
||||
obs_module_text("AdvSceneSwitcher.generalTab.status.stop"));
|
||||
_status->setText(obs_module_text("AdvSceneSwitcher.status.active"));
|
||||
if (_pulse) {
|
||||
_pulse->deleteLater();
|
||||
_pulse = nullptr;
|
||||
}
|
||||
SetStatusStyleSheet(false);
|
||||
_setToStopped = false;
|
||||
UpdateStatusHighlight();
|
||||
}
|
||||
|
||||
void StatusControl::SetStopped()
|
||||
@@ -166,11 +159,21 @@ void StatusControl::SetStopped()
|
||||
obs_module_text("AdvSceneSwitcher.generalTab.status.start"));
|
||||
_status->setText(obs_module_text("AdvSceneSwitcher.status.inactive"));
|
||||
SetStatusStyleSheet(true);
|
||||
if (HighlightUIElementsEnabled()) {
|
||||
_pulse = HighlightWidget(_status, QColor(Qt::red),
|
||||
QColor(0, 0, 0, 0));
|
||||
}
|
||||
_setToStopped = true;
|
||||
UpdateStatusHighlight();
|
||||
}
|
||||
|
||||
void StatusControl::UpdateStatusHighlight()
|
||||
{
|
||||
if (_setToStopped && InactiveStatusBlinkEnabled()) {
|
||||
if (!_pulse) {
|
||||
_pulse = HighlightWidget(_status, QColor(Qt::red),
|
||||
QColor(0, 0, 0, 0));
|
||||
}
|
||||
} else if (_pulse) {
|
||||
delete _pulse;
|
||||
_pulse = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void StatusControl::SetStatusStyleSheet(bool stopped) const
|
||||
|
||||
@@ -25,6 +25,7 @@ private:
|
||||
void SetStopped();
|
||||
void SetStarted();
|
||||
void SetStatusStyleSheet(bool stopped) const;
|
||||
void UpdateStatusHighlight();
|
||||
|
||||
QPushButton *_button;
|
||||
QHBoxLayout *_buttonLayout;
|
||||
|
||||
Reference in New Issue
Block a user