HooksTab: removed ScrollView which already exists in parent (SettingsPanel.qml)
This commit is contained in:
parent
783e9fb140
commit
56fedcf495
1 changed files with 67 additions and 76 deletions
|
|
@ -5,94 +5,85 @@ import qs.Commons
|
||||||
import qs.Services
|
import qs.Services
|
||||||
import qs.Widgets
|
import qs.Widgets
|
||||||
|
|
||||||
ScrollView {
|
ColumnLayout {
|
||||||
id: root
|
id: contentColumn
|
||||||
|
spacing: Style.marginL * scaling
|
||||||
|
width: root.width
|
||||||
|
|
||||||
property real scaling: 1.0
|
// Enable/Disable Toggle
|
||||||
|
NToggle {
|
||||||
contentWidth: contentColumn.width
|
label: "Enable Hooks"
|
||||||
contentHeight: contentColumn.height
|
description: "Enable or disable all hook commands."
|
||||||
|
checked: Settings.data.hooks.enabled
|
||||||
|
onToggled: checked => Settings.data.hooks.enabled = checked
|
||||||
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: contentColumn
|
visible: Settings.data.hooks.enabled
|
||||||
spacing: Style.marginL * scaling
|
spacing: Style.marginL * scaling
|
||||||
width: root.width
|
Layout.fillWidth: true
|
||||||
|
|
||||||
// Enable/Disable Toggle
|
NDivider {
|
||||||
NToggle {
|
Layout.fillWidth: true
|
||||||
label: "Enable Hooks"
|
|
||||||
description: "Enable or disable all hook commands."
|
|
||||||
checked: Settings.data.hooks.enabled
|
|
||||||
onToggled: checked => Settings.data.hooks.enabled = checked
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Wallpaper Hook Section
|
||||||
|
NInputAction {
|
||||||
|
id: wallpaperHookInput
|
||||||
|
label: "Wallpaper Change Hook"
|
||||||
|
description: "Command to be executed when wallpaper changes."
|
||||||
|
placeholderText: "e.g., notify-send \"Wallpaper\" \"Changed\""
|
||||||
|
text: Settings.data.hooks.wallpaperChange
|
||||||
|
onEditingFinished: {
|
||||||
|
Settings.data.hooks.wallpaperChange = wallpaperHookInput.text
|
||||||
|
}
|
||||||
|
onActionClicked: {
|
||||||
|
if (wallpaperHookInput.text) {
|
||||||
|
HooksService.executeWallpaperHook("test", "test-screen")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
|
||||||
|
NDivider {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
|
||||||
|
// Dark Mode Hook Section
|
||||||
|
NInputAction {
|
||||||
|
id: darkModeHookInput
|
||||||
|
label: "Theme Toggle Hook"
|
||||||
|
description: "Command to be executed when theme toggles between dark and light mode."
|
||||||
|
placeholderText: "e.g., notify-send \"Theme\" \"Toggled\""
|
||||||
|
text: Settings.data.hooks.darkModeChange
|
||||||
|
onEditingFinished: {
|
||||||
|
Settings.data.hooks.darkModeChange = darkModeHookInput.text
|
||||||
|
}
|
||||||
|
onActionClicked: {
|
||||||
|
if (darkModeHookInput.text) {
|
||||||
|
HooksService.executeDarkModeHook(Settings.data.colorSchemes.darkMode)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
|
||||||
|
NDivider {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
|
||||||
|
// Info section
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
visible: Settings.data.hooks.enabled
|
spacing: Style.marginM * scaling
|
||||||
spacing: Style.marginL * scaling
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
NDivider {
|
NLabel {
|
||||||
Layout.fillWidth: true
|
label: "Hook Command Information"
|
||||||
|
description: "• Commands are executed via shell (sh -c)\n• Commands run in background (detached)\n• Test buttons execute with current values"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wallpaper Hook Section
|
NLabel {
|
||||||
NInputAction {
|
label: "Available Parameters"
|
||||||
id: wallpaperHookInput
|
description: "• Wallpaper Hook: $1 = wallpaper path, $2 = screen name\n• Theme Toggle Hook: $1 = true/false (dark mode state)"
|
||||||
label: "Wallpaper Change Hook"
|
|
||||||
description: "Command to be executed when wallpaper changes."
|
|
||||||
placeholderText: "e.g., notify-send \"Wallpaper\" \"Changed\""
|
|
||||||
text: Settings.data.hooks.wallpaperChange
|
|
||||||
onEditingFinished: {
|
|
||||||
Settings.data.hooks.wallpaperChange = wallpaperHookInput.text
|
|
||||||
}
|
|
||||||
onActionClicked: {
|
|
||||||
if (wallpaperHookInput.text) {
|
|
||||||
HooksService.executeWallpaperHook("test", "test-screen")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Layout.fillWidth: true
|
|
||||||
}
|
|
||||||
|
|
||||||
NDivider {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
}
|
|
||||||
|
|
||||||
// Dark Mode Hook Section
|
|
||||||
NInputAction {
|
|
||||||
id: darkModeHookInput
|
|
||||||
label: "Theme Toggle Hook"
|
|
||||||
description: "Command to be executed when theme toggles between dark and light mode."
|
|
||||||
placeholderText: "e.g., notify-send \"Theme\" \"Toggled\""
|
|
||||||
text: Settings.data.hooks.darkModeChange
|
|
||||||
onEditingFinished: {
|
|
||||||
Settings.data.hooks.darkModeChange = darkModeHookInput.text
|
|
||||||
}
|
|
||||||
onActionClicked: {
|
|
||||||
if (darkModeHookInput.text) {
|
|
||||||
HooksService.executeDarkModeHook(Settings.data.colorSchemes.darkMode)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Layout.fillWidth: true
|
|
||||||
}
|
|
||||||
|
|
||||||
NDivider {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
}
|
|
||||||
|
|
||||||
// Info section
|
|
||||||
ColumnLayout {
|
|
||||||
spacing: Style.marginM * scaling
|
|
||||||
Layout.fillWidth: true
|
|
||||||
|
|
||||||
NLabel {
|
|
||||||
label: "Hook Command Information"
|
|
||||||
description: "• Commands are executed via shell (sh -c)\n• Commands run in background (detached)\n• Test buttons execute with current values"
|
|
||||||
}
|
|
||||||
|
|
||||||
NLabel {
|
|
||||||
label: "Available Parameters"
|
|
||||||
description: "• Wallpaper Hook: $1 = wallpaper path, $2 = screen name\n• Theme Toggle Hook: $1 = true/false (dark mode state)"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue