This repository was archived by the owner on Mar 21, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSettings.qml
More file actions
147 lines (129 loc) · 7.22 KB
/
Settings.qml
File metadata and controls
147 lines (129 loc) · 7.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import qs.Commons
import qs.Widgets
import "I18n.js" as I18n
ColumnLayout {
id: root
spacing: Style.marginM
width: 560
required property var pluginApi
readonly property var defaults: pluginApi && pluginApi.manifest && pluginApi.manifest.metadata
? (pluginApi.manifest.metadata.defaultSettings || {})
: ({})
property int valuePollIntervalMs: pluginApi.pluginSettings.pollIntervalMs !== undefined
? pluginApi.pluginSettings.pollIntervalMs
: (defaults.pollIntervalMs !== undefined ? defaults.pollIntervalMs : 2500)
property string valueLeftClickAction: pluginApi.pluginSettings.leftClickAction !== undefined
? pluginApi.pluginSettings.leftClickAction
: (defaults.leftClickAction !== undefined ? defaults.leftClickAction : "panel")
property string valueVideosPath: pluginApi.pluginSettings.videosPath !== undefined
? pluginApi.pluginSettings.videosPath
: (defaults.videosPath !== undefined ? defaults.videosPath : "")
property bool valueShowBarWhenRecording: pluginApi.pluginSettings.showBarWhenRecording !== undefined
? pluginApi.pluginSettings.showBarWhenRecording
: (defaults.showBarWhenRecording !== undefined ? defaults.showBarWhenRecording : true)
property bool valueShowBarWhenReplay: pluginApi.pluginSettings.showBarWhenReplay !== undefined
? pluginApi.pluginSettings.showBarWhenReplay
: (defaults.showBarWhenReplay !== undefined ? defaults.showBarWhenReplay : false)
property bool valueShowControlCenterWhenRecording: pluginApi.pluginSettings.showControlCenterWhenRecording !== undefined
? pluginApi.pluginSettings.showControlCenterWhenRecording
: (defaults.showControlCenterWhenRecording !== undefined ? defaults.showControlCenterWhenRecording : true)
property bool valueShowControlCenterWhenReplay: pluginApi.pluginSettings.showControlCenterWhenReplay !== undefined
? pluginApi.pluginSettings.showControlCenterWhenReplay
: (defaults.showControlCenterWhenReplay !== undefined ? defaults.showControlCenterWhenReplay : true)
property bool valueShowControlCenterWhenReady: pluginApi.pluginSettings.showControlCenterWhenReady !== undefined
? pluginApi.pluginSettings.showControlCenterWhenReady
: (defaults.showControlCenterWhenReady !== undefined ? defaults.showControlCenterWhenReady : false)
function tr(key, fallback, interpolations) {
return I18n.tr(pluginApi, key, fallback, interpolations)
}
function saveSettings() {
if (!pluginApi) {
return;
}
pluginApi.pluginSettings.pollIntervalMs = valuePollIntervalMs;
pluginApi.pluginSettings.leftClickAction = valueLeftClickAction;
pluginApi.pluginSettings.videosPath = valueVideosPath.trim();
pluginApi.pluginSettings.showBarWhenRecording = valueShowBarWhenRecording;
pluginApi.pluginSettings.showBarWhenReplay = valueShowBarWhenReplay;
pluginApi.pluginSettings.showControlCenterWhenRecording = valueShowControlCenterWhenRecording;
pluginApi.pluginSettings.showControlCenterWhenReplay = valueShowControlCenterWhenReplay;
pluginApi.pluginSettings.showControlCenterWhenReady = valueShowControlCenterWhenReady;
pluginApi.saveSettings();
}
NHeader {
label: tr("settings.header.label", "OBS Control")
description: tr("settings.header.description", "Control how often the plugin polls OBS and when it becomes visible in the shell.")
}
NSpinBox {
label: tr("settings.poll_interval.label", "Poll Interval")
description: tr("settings.poll_interval.description", "How often the plugin refreshes OBS state, in milliseconds.")
from: 750
to: 10000
stepSize: 250
value: valuePollIntervalMs
onValueChanged: valuePollIntervalMs = value
}
NComboBox {
label: tr("settings.left_click_action.label", "Left Click Action")
description: tr("settings.left_click_action.description", "Choose whether left click opens the panel or toggles recording directly.")
model: [
{ "key": "panel", "name": tr("settings.left_click_action.options.open_controls", "Open Controls") },
{ "key": "toggle-record", "name": tr("settings.left_click_action.options.toggle_recording", "Toggle Recording") }
]
currentKey: valueLeftClickAction
minimumWidth: 220
onSelected: key => valueLeftClickAction = key
}
NTextInput {
Layout.fillWidth: true
label: tr("settings.videos_path.label", "Videos Path")
description: tr("settings.videos_path.description", "Optional custom folder used by the panel and the toast action. Leave empty to use your default Videos directory.")
placeholderText: "~/Videos"
text: valueVideosPath
onTextChanged: valueVideosPath = text
}
NDivider {
Layout.fillWidth: true
}
NToggle {
Layout.fillWidth: true
label: tr("settings.show_bar_recording.label", "Show Bar While Recording")
description: tr("settings.show_bar_recording.description", "Display the bar indicator while OBS is actively recording.")
checked: valueShowBarWhenRecording
onToggled: checked => valueShowBarWhenRecording = checked
}
NToggle {
Layout.fillWidth: true
label: tr("settings.show_bar_replay.label", "Show Bar While Replay Is Active")
description: tr("settings.show_bar_replay.description", "Keep the bar indicator visible when only the replay buffer is running.")
checked: valueShowBarWhenReplay
onToggled: checked => valueShowBarWhenReplay = checked
}
NDivider {
Layout.fillWidth: true
}
NToggle {
Layout.fillWidth: true
label: tr("settings.show_control_center_recording.label", "Show Control Center While Recording")
description: tr("settings.show_control_center_recording.description", "Show the Control Center shortcut while OBS is recording.")
checked: valueShowControlCenterWhenRecording
onToggled: checked => valueShowControlCenterWhenRecording = checked
}
NToggle {
Layout.fillWidth: true
label: tr("settings.show_control_center_replay.label", "Show Control Center While Replay Is Active")
description: tr("settings.show_control_center_replay.description", "Show the Control Center shortcut while the replay buffer is active.")
checked: valueShowControlCenterWhenReplay
onToggled: checked => valueShowControlCenterWhenReplay = checked
}
NToggle {
Layout.fillWidth: true
label: tr("settings.show_control_center_ready.label", "Show Control Center When OBS Is Ready")
description: tr("settings.show_control_center_ready.description", "Keep the shortcut visible when OBS is connected but idle.")
checked: valueShowControlCenterWhenReady
onToggled: checked => valueShowControlCenterWhenReady = checked
}
}