1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

workspace: tweak animations slightly

This commit is contained in:
bbedward
2025-11-05 09:32:50 -05:00
parent d48cd1acdd
commit 1e6c80bd03

View File

@@ -480,34 +480,27 @@ Item {
property bool loadedHasIcon: false property bool loadedHasIcon: false
property var loadedIcons: [] property var loadedIcons: []
readonly property real visualWidth: { readonly property real baseWidth: root.isVertical ? (SettingsData.showWorkspaceApps ? widgetHeight * 0.7 : widgetHeight * 0.5) : (isActive ? root.widgetHeight * 1.05 : root.widgetHeight * 0.7)
if (root.isVertical) { readonly property real baseHeight: root.isVertical ? (isActive ? root.widgetHeight * 1.05 : root.widgetHeight * 0.7) : (SettingsData.showWorkspaceApps ? widgetHeight * 0.7 : widgetHeight * 0.5)
return SettingsData.showWorkspaceApps ? widgetHeight * 0.7 : widgetHeight * 0.5
} else { readonly property real iconsExtraWidth: {
if (SettingsData.showWorkspaceApps && loadedIcons.length > 0) { if (!root.isVertical && SettingsData.showWorkspaceApps && loadedIcons.length > 0) {
const numIcons = Math.min(loadedIcons.length, SettingsData.maxWorkspaceIcons) const numIcons = Math.min(loadedIcons.length, SettingsData.maxWorkspaceIcons)
const iconsWidth = numIcons * 18 + (numIcons > 0 ? (numIcons - 1) * Theme.spacingXS : 0) return numIcons * 18 + (numIcons > 0 ? (numIcons - 1) * Theme.spacingXS : 0) + (isActive ? Theme.spacingXS : 0)
const baseWidth = isActive ? root.widgetHeight * 0.9 + Theme.spacingXS : root.widgetHeight * 0.7
return baseWidth + iconsWidth
}
return isActive ? root.widgetHeight * 1.05 : root.widgetHeight * 0.7
} }
return 0
} }
readonly property real visualHeight: { readonly property real iconsExtraHeight: {
if (root.isVertical) { if (root.isVertical && SettingsData.showWorkspaceApps && loadedIcons.length > 0) {
if (SettingsData.showWorkspaceApps && loadedIcons.length > 0) { const numIcons = Math.min(loadedIcons.length, SettingsData.maxWorkspaceIcons)
const numIcons = Math.min(loadedIcons.length, SettingsData.maxWorkspaceIcons) return numIcons * 18 + (numIcons > 0 ? (numIcons - 1) * Theme.spacingXS : 0) + (isActive ? Theme.spacingXS : 0)
const iconsHeight = numIcons * 18 + (numIcons > 0 ? (numIcons - 1) * Theme.spacingXS : 0)
const baseHeight = isActive ? root.widgetHeight * 0.9 + Theme.spacingXS : root.widgetHeight * 0.7
return baseHeight + iconsHeight
}
return isActive ? root.widgetHeight * 1.05 : root.widgetHeight * 0.7
} else {
return SettingsData.showWorkspaceApps ? widgetHeight * 0.7 : widgetHeight * 0.5
} }
return 0
} }
//DO NOT move this MouseArea. It should be on this level in order for the appMouseArea to work readonly property real visualWidth: baseWidth + iconsExtraWidth
readonly property real visualHeight: baseHeight + iconsExtraHeight
MouseArea { MouseArea {
id: mouseArea id: mouseArea
anchors.fill: parent anchors.fill: parent
@@ -609,17 +602,10 @@ Item {
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: isActive ? Theme.primary : isUrgent ? Theme.error : isPlaceholder ? Theme.surfaceTextLight : isHovered ? Theme.outlineButton : Theme.surfaceTextAlpha color: isActive ? Theme.primary : isUrgent ? Theme.error : isPlaceholder ? Theme.surfaceTextLight : isHovered ? Theme.outlineButton : Theme.surfaceTextAlpha
border.width: { border.width: isUrgent && !isActive ? 2 : 0
if (isUrgent && !isActive) return 2 border.color: isUrgent && !isActive ? Theme.error : Theme.withAlpha(Theme.error, 0)
return 0
}
border.color: {
if (isUrgent && !isActive) return Theme.error
return Theme.withAlpha(Theme.error, 0)
}
Behavior on width { Behavior on width {
enabled: (!SettingsData.showWorkspaceApps || SettingsData.maxWorkspaceIcons <= 3)
NumberAnimation { NumberAnimation {
duration: Theme.mediumDuration duration: Theme.mediumDuration
easing.type: Theme.emphasizedEasing easing.type: Theme.emphasizedEasing
@@ -627,7 +613,6 @@ Item {
} }
Behavior on height { Behavior on height {
enabled: root.isVertical && (!SettingsData.showWorkspaceApps || SettingsData.maxWorkspaceIcons <= 3)
NumberAnimation { NumberAnimation {
duration: Theme.mediumDuration duration: Theme.mediumDuration
easing.type: Theme.emphasizedEasing easing.type: Theme.emphasizedEasing
@@ -643,14 +628,14 @@ Item {
Behavior on border.width { Behavior on border.width {
NumberAnimation { NumberAnimation {
duration: Theme.shortDuration duration: Theme.mediumDuration
easing.type: Theme.emphasizedEasing easing.type: Theme.emphasizedEasing
} }
} }
Behavior on border.color { Behavior on border.color {
ColorAnimation { ColorAnimation {
duration: Theme.shortDuration duration: Theme.mediumDuration
easing.type: Theme.emphasizedEasing easing.type: Theme.emphasizedEasing
} }
} }