mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-01-27 23:59:43 -05:00
UI: Add system tray capability
This adds a system tray when enabled. There is also a option to minimize to the system tray when the app is started. Closes jp9000/obs-studio#595
This commit is contained in:
@@ -274,6 +274,8 @@ OBSBasicSettings::OBSBasicSettings(QWidget *parent)
|
||||
HookWidget(ui->hideProjectorCursor, CHECK_CHANGED, GENERAL_CHANGED);
|
||||
HookWidget(ui->recordWhenStreaming, CHECK_CHANGED, GENERAL_CHANGED);
|
||||
HookWidget(ui->keepRecordStreamStops,CHECK_CHANGED, GENERAL_CHANGED);
|
||||
HookWidget(ui->systemTrayEnabled, CHECK_CHANGED, GENERAL_CHANGED);
|
||||
HookWidget(ui->systemTrayWhenStarted,CHECK_CHANGED, GENERAL_CHANGED);
|
||||
HookWidget(ui->snappingEnabled, CHECK_CHANGED, GENERAL_CHANGED);
|
||||
HookWidget(ui->screenSnapping, CHECK_CHANGED, GENERAL_CHANGED);
|
||||
HookWidget(ui->centerSnapping, CHECK_CHANGED, GENERAL_CHANGED);
|
||||
@@ -845,6 +847,14 @@ void OBSBasicSettings::LoadGeneralSettings()
|
||||
"BasicWindow", "KeepRecordingWhenStreamStops");
|
||||
ui->keepRecordStreamStops->setChecked(keepRecordStreamStops);
|
||||
|
||||
bool systemTrayEnabled = config_get_bool(GetGlobalConfig(),
|
||||
"BasicWindow", "SysTrayEnabled");
|
||||
ui->systemTrayEnabled->setChecked(systemTrayEnabled);
|
||||
|
||||
bool systemTrayWhenStarted = config_get_bool(GetGlobalConfig(),
|
||||
"BasicWindow", "SysTrayWhenStarted");
|
||||
ui->systemTrayWhenStarted->setChecked(systemTrayWhenStarted);
|
||||
|
||||
bool snappingEnabled = config_get_bool(GetGlobalConfig(),
|
||||
"BasicWindow", "SnappingEnabled");
|
||||
ui->snappingEnabled->setChecked(snappingEnabled);
|
||||
@@ -2235,6 +2245,16 @@ void OBSBasicSettings::SaveGeneralSettings()
|
||||
config_set_bool(GetGlobalConfig(), "BasicWindow",
|
||||
"KeepRecordingWhenStreamStops",
|
||||
ui->keepRecordStreamStops->isChecked());
|
||||
|
||||
if (WidgetChanged(ui->systemTrayEnabled))
|
||||
config_set_bool(GetGlobalConfig(), "BasicWindow",
|
||||
"SysTrayEnabled",
|
||||
ui->systemTrayEnabled->isChecked());
|
||||
|
||||
if (WidgetChanged(ui->systemTrayWhenStarted))
|
||||
config_set_bool(GetGlobalConfig(), "BasicWindow",
|
||||
"SysTrayWhenStarted",
|
||||
ui->systemTrayWhenStarted->isChecked());
|
||||
}
|
||||
|
||||
void OBSBasicSettings::SaveStream1Settings()
|
||||
|
||||
Reference in New Issue
Block a user