+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+import QtCore
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Effects
+import QtQuick.Shapes
+import org.kde.kirigami as Kirigami
+
+Item {
+ id: iconRoot
+
+ property bool active: true
+ property bool hovered: false
+ property bool pressed: false
+ property bool toggled: false
+ property alias source: icon.source
+
+ anchors.fill: parent
+
+ Shape {
+ id: iconBackground
+
+ layer.enabled: true
+ anchors.fill: parent
+ opacity: hovered ? 0.25 : pressed || toggled ? 0.15 : 0
+
+ ShapePath {
+ startX: 0
+ startY: height / 2
+ fillGradient: radialGradient
+ strokeColor: "transparent"
+
+ PathArc {
+ x: width
+ y: height / 2
+ radiusX: iconBackground.width / 2
+ radiusY: height / 2
+ useLargeArc: true
+ }
+
+ PathArc {
+ x: 0
+ y: height / 2
+ radiusX: iconBackground.width / 2
+ radiusY: height / 2
+ useLargeArc: true
+ }
+
+ }
+
+ RadialGradient {
+ id: radialGradient
+
+ centerX: iconBackground.width / 2
+ centerY: iconBackground.height / 2
+ centerRadius: iconBackground.width / 2
+ focalX: centerX
+ focalY: centerY
+
+ GradientStop {
+ position: 0
+ color: Kirigami.Theme.textColor
+ }
+
+ GradientStop {
+ position: 1
+ color: "transparent"
+ }
+
+ }
+
+ Behavior on opacity {
+ NumberAnimation {
+ duration: button.animationDuration
+ }
+
+ }
+
+ }
+
+ Kirigami.Icon {
+ id: icon
+
+ anchors.fill: parent
+ }
+
+ MultiEffect {
+ anchors.fill: source
+ source: icon
+ blurEnabled: true
+ blurMax: 8
+ brightness: hovered ? 0.6 : pressed || toggled ? 0.3 : 0
+ blur: hovered ? 4 : pressed || toggled ? 2 : 0
+ saturation: active ? 0 : -0.5
+
+ Behavior on blur {
+ NumberAnimation {
+ duration: button.animationDuration
+ }
+
+ }
+
+ Behavior on brightness {
+ NumberAnimation {
+ duration: button.animationDuration
+ }
+
+ }
+
+ }
+
+}
diff --git a/package/contents/ui/WindowControlButton.qml b/package/contents/ui/WindowControlButton.qml
index 3e49889..aeb2ae3 100644
--- a/package/contents/ui/WindowControlButton.qml
+++ b/package/contents/ui/WindowControlButton.qml
@@ -331,86 +331,13 @@ Item {
Component {
id: fallbackButtonIcon
- Item {
- anchors.fill: parent
-
- Kirigami.Icon {
- id: icon
-
- anchors.fill: parent
- source: fallbackIcon
- }
-
- MultiEffect {
- id: iconEffects
-
- anchors.fill: source
- source: icon
- blurEnabled: true
- blurMax: 8
- states: [
- State {
- name: "hover"
- when: isHoveredButtonState(button.iconState)
-
- PropertyChanges {
- target: iconEffects
- brightness: 0.8
- blur: 4
- }
-
- },
- State {
- name: "pressed"
- when: isPressedButtonState(button.iconState)
-
- PropertyChanges {
- target: iconEffects
- brightness: 0.6
- blur: 4
- }
-
- },
- State {
- name: "toggled"
- when: isToggledButtonState(button.iconState)
-
- PropertyChanges {
- target: iconEffects
- brightness: 0.6
- blur: 4
- }
-
- },
- State {
- name: "deactivated"
- when: isDeactivatedButtonState(button.iconState)
-
- PropertyChanges {
- target: iconEffects
- brightness: -0.5
- saturation: -1
- }
-
- }
- ]
-
- Behavior on blur {
- NumberAnimation {
- duration: button.animationDuration
- }
-
- }
-
- Behavior on brightness {
- NumberAnimation {
- duration: button.animationDuration
- }
-
- }
-
- }
-
+ PlasmaWindowControlButtonIcon {
+ source: fallbackIcon
+ hovered: isHoveredButtonState(button.iconState)
+ toggled: isToggledButtonState(button.iconState)
+ pressed: isPressedButtonState(button.iconState)
+ active: isActiveButtonState(button.iconState)
+ enabled: !isDeactivatedButtonState(button.iconState)
}
}
diff --git a/package/contents/ui/config/ConfigBehavior.qml b/package/contents/ui/config/ConfigBehavior.qml
index 351ac9d..241f114 100644
--- a/package/contents/ui/config/ConfigBehavior.qml
+++ b/package/contents/ui/config/ConfigBehavior.qml
@@ -72,11 +72,11 @@ KCM.SimpleKCM {
ComboBox {
id: widgetActiveTaskSource
- model: [i18n("Active task"), i18n("Last active task")]
+ model: [i18n("Active task"), i18n("Last active task"), i18n("Last active maximized task")]
}
KCM.ContextualHelpButton {
- toolTipText: i18n("How to obtain the active task from tasks manager:
Active task: current active task after filtering. The widget will be disabled if the current active task is on another screen, regardless whether there are another tasks on this screen or not.
Last active task: show widget for the last active task after filters applied.
")
+ toolTipText: i18n("How to obtain the active task from tasks manager:
Active task: current active task after filtering. The widget will be disabled if the current active task is on another screen, regardless whether there are another tasks on this screen or not.
Last active task: show widget for the last active task after filters applied.
Last active maximized task: show widget for the last active maximized task after filters applied.
")
}
}
@@ -117,6 +117,7 @@ KCM.SimpleKCM {
CheckBox {
id: widgetActiveTaskFilterNotMaximized
+ enabled: widgetActiveTaskSource.currentIndex !== ActiveTasksModel.ActiveTaskSource.LastActiveMaximized
Kirigami.FormData.label: i18n("Disable for not maximized:")
text: i18n("enabled")
}
diff --git a/package/contents/ui/main.qml b/package/contents/ui/main.qml
index 8215b23..24e92ae 100644
--- a/package/contents/ui/main.qml
+++ b/package/contents/ui/main.qml
@@ -169,6 +169,7 @@ PlasmoidItem {
}
enabled: tasksModel.hasActiveWindow && tasksModel.activeWindow.actionSupported(getAction())
toggled: tasksModel.hasActiveWindow && tasksModel.activeWindow.buttonToggled(modelData.windowControlButtonType)
+ active: tasksModel.hasActiveWindow && tasksModel.activeWindow.active
}
}
diff --git a/package/metadata.json b/package/metadata.json
index 736e3a4..00eaf1b 100644
--- a/package/metadata.json
+++ b/package/metadata.json
@@ -12,7 +12,7 @@
"Id": "com.github.antroids.application-title-bar",
"Name": "Application Title Bar",
"License": "GPL-3.0+",
- "Version": "0.4.3",
+ "Version": "0.4.4",
"Website": "https://github.com/antroids/application-title-bar",
"FormFactors": [
"desktop"