提交 081fc548 编写于 作者: M Matt Gajownik 提交者: jp9000

UI: Add setting for taskbar color

上级 a4d8dd5f
......@@ -651,9 +651,10 @@ Basic.Settings.General.RecordWhenStreaming="Automatically record when streaming"
Basic.Settings.General.KeepRecordingWhenStreamStops="Keep recording when stream stops"
Basic.Settings.General.ReplayBufferWhileStreaming="Automatically start replay buffer when streaming"
Basic.Settings.General.KeepReplayBufferStreamStops="Keep replay buffer active when stream stops"
Basic.Settings.General.SysTray="System Tray"
Basic.Settings.General.SysTray="System Tray/Taskbar"
Basic.Settings.General.SysTrayWhenStarted="Minimize to system tray when started"
Basic.Settings.General.SystemTrayHideMinimize="Always minimize to system tray instead of task bar"
Basic.Settings.General.TaskbarStatusColor="Change taskbar color when output is active"
Basic.Settings.General.SaveProjectors="Save projectors on exit"
Basic.Settings.General.Preview="Preview"
Basic.Settings.General.OverflowHidden="Hide overflow"
......
......@@ -534,6 +534,16 @@
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="taskbarColor">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Basic.Settings.General.TaskbarStatusColor</string>
</property>
</widget>
</item>
<item row="1" column="0">
<spacer name="horizontalSpacer_2">
<property name="orientation">
......
......@@ -420,6 +420,10 @@ bool OBSApp::InitGlobalConfigDefaults()
"KeepRecordingWhenStreamStops", false);
config_set_default_bool(globalConfig, "BasicWindow", "SysTrayEnabled",
true);
#ifdef _WIN32
config_set_default_bool(globalConfig, "BasicWindow",
"TaskbarStatusColor", true);
#endif
config_set_default_bool(globalConfig, "BasicWindow",
"SysTrayWhenStarted", false);
config_set_default_bool(globalConfig, "BasicWindow", "SaveProjectors",
......
......@@ -5392,7 +5392,8 @@ inline void OBSBasic::OnActivate()
UpdateProcessPriority();
#ifdef _WIN32
taskProg->show();
if (taskbarStatusColor())
taskProg->show();
taskProg->resume();
taskProg->setValue(1);
taskBtn->setOverlayIcon(QIcon::fromTheme(
......@@ -5426,7 +5427,8 @@ inline void OBSBasic::OnDeactivate()
} else {
if (os_atomic_load_bool(&recording_paused)) {
#ifdef _WIN32
taskProg->show();
if (taskbarStatusColor())
taskProg->show();
taskProg->pause();
taskBtn->setOverlayIcon(QIcon::fromTheme(
"obs-paused",
......@@ -5437,7 +5439,8 @@ inline void OBSBasic::OnDeactivate()
QIcon(":/res/images/obs_paused.png"));
} else {
#ifdef _WIN32
taskProg->show();
if (taskbarStatusColor())
taskProg->show();
taskProg->resume();
taskBtn->setOverlayIcon(QIcon::fromTheme(
"obs-active",
......@@ -7451,7 +7454,13 @@ bool OBSBasic::sysTrayMinimizeToTray()
return config_get_bool(GetGlobalConfig(), "BasicWindow",
"SysTrayMinimizeToTray");
}
#ifdef _WIN32
bool OBSBasic::taskbarStatusColor()
{
return config_get_bool(GetGlobalConfig(), "BasicWindow",
"TaskbarStatusColor");
}
#endif
void OBSBasic::on_actionCopySource_triggered()
{
copyStrings.clear();
......
......@@ -465,6 +465,9 @@ private:
void ReplayBufferClicked();
bool sysTrayMinimizeToTray();
#ifdef _WIN32
bool taskbarStatusColor();
#endif
void EnumDialogs();
......
......@@ -398,6 +398,9 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
HookWidget(ui->systemTrayEnabled, CHECK_CHANGED, GENERAL_CHANGED);
HookWidget(ui->systemTrayWhenStarted,CHECK_CHANGED, GENERAL_CHANGED);
HookWidget(ui->systemTrayAlways, CHECK_CHANGED, GENERAL_CHANGED);
#ifdef _WIN32
HookWidget(ui->taskbarColor, CHECK_CHANGED, GENERAL_CHANGED);
#endif
HookWidget(ui->saveProjectors, CHECK_CHANGED, GENERAL_CHANGED);
HookWidget(ui->snappingEnabled, CHECK_CHANGED, GENERAL_CHANGED);
HookWidget(ui->screenSnapping, CHECK_CHANGED, GENERAL_CHANGED);
......@@ -629,6 +632,7 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
delete ui->enableNewSocketLoop;
delete ui->enableLowLatencyMode;
delete ui->browserHWAccel;
delete ui->taskbarColor;
delete ui->sourcesGroup;
#if defined(__APPLE__) || HAVE_PULSEAUDIO
delete ui->disableAudioDucking;
......@@ -643,6 +647,7 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
ui->enableNewSocketLoop = nullptr;
ui->enableLowLatencyMode = nullptr;
ui->browserHWAccel = nullptr;
ui->taskbarColor = nullptr;
ui->sourcesGroup = nullptr;
#if defined(__APPLE__) || HAVE_PULSEAUDIO
ui->disableAudioDucking = nullptr;
......@@ -1198,7 +1203,11 @@ void OBSBasicSettings::LoadGeneralSettings()
bool systemTrayAlways = config_get_bool(
GetGlobalConfig(), "BasicWindow", "SysTrayMinimizeToTray");
ui->systemTrayAlways->setChecked(systemTrayAlways);
#ifdef _WIN32
bool taskbarColor = config_get_bool(GetGlobalConfig(), "BasicWindow",
"TaskbarStatusColor");
ui->taskbarColor->setChecked(taskbarColor);
#endif
bool saveProjectors = config_get_bool(GetGlobalConfig(), "BasicWindow",
"SaveProjectors");
ui->saveProjectors->setChecked(saveProjectors);
......@@ -2994,7 +3003,15 @@ void OBSBasicSettings::SaveGeneralSettings()
config_set_bool(GetGlobalConfig(), "BasicWindow",
"SysTrayMinimizeToTray",
ui->systemTrayAlways->isChecked());
#ifdef _WIN32
if (WidgetChanged(ui->taskbarColor)) {
bool enable_color = ui->taskbarColor->isChecked();
config_set_bool(GetGlobalConfig(), "BasicWindow",
"TaskbarStatusColor", enable_color);
if (!enable_color)
main->taskProg->setVisible(enable_color);
}
#endif
if (WidgetChanged(ui->saveProjectors))
config_set_bool(GetGlobalConfig(), "BasicWindow",
"SaveProjectors",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册