diff --git a/dots/.config/quickshell/ii/modules/sidebarRight/nightLight/NightLightDialog.qml b/dots/.config/quickshell/ii/modules/sidebarRight/nightLight/NightLightDialog.qml index 9343c4588..f0286fc38 100644 --- a/dots/.config/quickshell/ii/modules/sidebarRight/nightLight/NightLightDialog.qml +++ b/dots/.config/quickshell/ii/modules/sidebarRight/nightLight/NightLightDialog.qml @@ -102,7 +102,7 @@ WindowDialog { right: parent.right } iconSize: Appearance.font.pixelSize.larger - buttonIcon: "destruction" + buttonIcon: "flash_off" text: Translation.tr("Enable") checked: Config.options.light.antiFlashbang.enable onCheckedChanged: { diff --git a/dots/.config/quickshell/ii/modules/sidebarRight/quickToggles/AndroidQuickPanel.qml b/dots/.config/quickshell/ii/modules/sidebarRight/quickToggles/AndroidQuickPanel.qml index b5e49d3b0..f8c93bfff 100644 --- a/dots/.config/quickshell/ii/modules/sidebarRight/quickToggles/AndroidQuickPanel.qml +++ b/dots/.config/quickshell/ii/modules/sidebarRight/quickToggles/AndroidQuickPanel.qml @@ -29,7 +29,7 @@ AbstractQuickPanel { readonly property real baseCellHeight: 56 // Toggles - readonly property list availableToggleTypes: ["network", "bluetooth", "idleInhibitor", "easyEffects", "nightLight", "darkMode", "cloudflareWarp", "gameMode", "screenSnip", "colorPicker", "onScreenKeyboard", "mic", "audio", "notifications", "powerProfile","musicRecognition"] + readonly property list availableToggleTypes: ["network", "bluetooth", "idleInhibitor", "easyEffects", "nightLight", "darkMode", "cloudflareWarp", "gameMode", "screenSnip", "colorPicker", "onScreenKeyboard", "mic", "audio", "notifications", "powerProfile","musicRecognition", "antiFlashbang"] readonly property int columns: Config.options.sidebar.quickToggles.android.columns readonly property list toggles: Config.ready ? Config.options.sidebar.quickToggles.android.toggles : [] readonly property list toggleRows: toggleRowsForList(toggles) diff --git a/dots/.config/quickshell/ii/modules/sidebarRight/quickToggles/androidStyle/AndroidAntiFlashbangToggle.qml b/dots/.config/quickshell/ii/modules/sidebarRight/quickToggles/androidStyle/AndroidAntiFlashbangToggle.qml new file mode 100644 index 000000000..4fc8ee4f5 --- /dev/null +++ b/dots/.config/quickshell/ii/modules/sidebarRight/quickToggles/androidStyle/AndroidAntiFlashbangToggle.qml @@ -0,0 +1,29 @@ +import qs.modules.common +import qs.modules.common.widgets +import qs.services +import QtQuick +import Quickshell + +AndroidQuickToggleButton { + id: root + + property bool auto: Config.options.light.night.automatic + + name: Translation.tr("Anti-flashbang") + + toggled: Config.options.light.antiFlashbang.enable + buttonIcon: "flash_off" + + mainAction: () => { + Config.options.light.antiFlashbang.enable = !Config.options.light.antiFlashbang.enable; + } + + altAction: () => { + root.openMenu() + } + + StyledToolTip { + text: Translation.tr("Anti-flashbang") + } +} + diff --git a/dots/.config/quickshell/ii/modules/sidebarRight/quickToggles/androidStyle/AndroidToggleDelegateChooser.qml b/dots/.config/quickshell/ii/modules/sidebarRight/quickToggles/androidStyle/AndroidToggleDelegateChooser.qml index aa5356e2e..43cc712b5 100644 --- a/dots/.config/quickshell/ii/modules/sidebarRight/quickToggles/androidStyle/AndroidToggleDelegateChooser.qml +++ b/dots/.config/quickshell/ii/modules/sidebarRight/quickToggles/androidStyle/AndroidToggleDelegateChooser.qml @@ -245,4 +245,20 @@ DelegateChooser { cellSize: modelData.size } } + DelegateChoice { roleValue: "antiFlashbang"; AndroidAntiFlashbangToggle { + required property int index + required property var modelData + buttonIndex: root.startingIndex + index + buttonData: modelData + editMode: root.editMode + expandedSize: modelData.size > 1 + baseCellWidth: root.baseCellWidth + baseCellHeight: root.baseCellHeight + cellSpacing: root.spacing + cellSize: modelData.size + onOpenMenu: { + root.openNightLightDialog() + } + } } + } diff --git a/dots/.config/quickshell/ii/services/Brightness.qml b/dots/.config/quickshell/ii/services/Brightness.qml index 5232f76f9..f3cec016c 100644 --- a/dots/.config/quickshell/ii/services/Brightness.qml +++ b/dots/.config/quickshell/ii/services/Brightness.qml @@ -86,7 +86,7 @@ Singleton { property int rawMaxBrightness: 100 property real brightness property real brightnessMultiplier: 1.0 - property real multipliedBrightness: Math.max(0, Math.min(1, brightness * brightnessMultiplier)) + property real multipliedBrightness: Math.max(0, Math.min(1, brightness * (Config.options.light.antiFlashbang.enable ? brightnessMultiplier : 1))) property bool ready: false property bool animateChanges: !monitor.isDdc