From 56fedcf49522ce0d5a74a00e5aa130d8ce9f9d0f Mon Sep 17 00:00:00 2001 From: LemmyCook Date: Fri, 5 Sep 2025 15:07:31 -0400 Subject: [PATCH] HooksTab: removed ScrollView which already exists in parent (SettingsPanel.qml) --- Modules/SettingsPanel/Tabs/HooksTab.qml | 143 +++++++++++------------- 1 file changed, 67 insertions(+), 76 deletions(-) diff --git a/Modules/SettingsPanel/Tabs/HooksTab.qml b/Modules/SettingsPanel/Tabs/HooksTab.qml index 9f08a15..461a4b8 100644 --- a/Modules/SettingsPanel/Tabs/HooksTab.qml +++ b/Modules/SettingsPanel/Tabs/HooksTab.qml @@ -5,94 +5,85 @@ import qs.Commons import qs.Services import qs.Widgets -ScrollView { - id: root +ColumnLayout { + id: contentColumn + spacing: Style.marginL * scaling + width: root.width - property real scaling: 1.0 - - contentWidth: contentColumn.width - contentHeight: contentColumn.height + // Enable/Disable Toggle + NToggle { + label: "Enable Hooks" + description: "Enable or disable all hook commands." + checked: Settings.data.hooks.enabled + onToggled: checked => Settings.data.hooks.enabled = checked + } ColumnLayout { - id: contentColumn + visible: Settings.data.hooks.enabled spacing: Style.marginL * scaling - width: root.width + Layout.fillWidth: true - // Enable/Disable Toggle - NToggle { - label: "Enable Hooks" - description: "Enable or disable all hook commands." - checked: Settings.data.hooks.enabled - onToggled: checked => Settings.data.hooks.enabled = checked + NDivider { + Layout.fillWidth: true } + // 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 { - visible: Settings.data.hooks.enabled - spacing: Style.marginL * scaling + spacing: Style.marginM * scaling Layout.fillWidth: true - NDivider { - 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" } - // 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 { - 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)" - } + NLabel { + label: "Available Parameters" + description: "• Wallpaper Hook: $1 = wallpaper path, $2 = screen name\n• Theme Toggle Hook: $1 = true/false (dark mode state)" } } }