mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-27 23:12:49 -05:00
dock: some cleanup to overflow
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import QtQuick
|
||||
import qs.Common
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
|
||||
Item {
|
||||
@@ -11,7 +10,7 @@ Item {
|
||||
property bool overflowExpanded: false
|
||||
property bool isVertical: false
|
||||
|
||||
signal clicked()
|
||||
signal clicked
|
||||
|
||||
Rectangle {
|
||||
id: buttonBackground
|
||||
@@ -22,7 +21,9 @@ Item {
|
||||
color: Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, mouseArea.containsMouse ? 0.2 : 0.1)
|
||||
|
||||
Behavior on color {
|
||||
ColorAnimation { duration: Theme.shortDuration }
|
||||
ColorAnimation {
|
||||
duration: Theme.shortDuration
|
||||
}
|
||||
}
|
||||
|
||||
DankIcon {
|
||||
@@ -31,16 +32,7 @@ Item {
|
||||
size: actualIconSize * 0.6
|
||||
name: "expand_more"
|
||||
color: Theme.surfaceText
|
||||
|
||||
// For horizontal docks, rotate -90° to point right (collapsed), then 90° to point left (expanded)
|
||||
// For vertical docks, keep default (down arrow = 0°), flip 180° to point up (expanded)
|
||||
rotation: {
|
||||
if (isVertical) {
|
||||
return overflowExpanded ? 180 : 0;
|
||||
} else {
|
||||
return overflowExpanded ? 90 : -90;
|
||||
}
|
||||
}
|
||||
rotation: isVertical ? (overflowExpanded ? 180 : 0) : (overflowExpanded ? 90 : -90)
|
||||
|
||||
Behavior on rotation {
|
||||
NumberAnimation {
|
||||
@@ -51,7 +43,6 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
// Badge showing overflow count (outside main rectangle to avoid clipping)
|
||||
Rectangle {
|
||||
visible: overflowCount > 0 && !overflowExpanded && SettingsData.dockShowOverflowBadge
|
||||
anchors.right: buttonBackground.right
|
||||
@@ -79,10 +70,6 @@ Item {
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onWheel: (wheel) => {
|
||||
// Always allow wheel events to propagate to Flickable for scrolling
|
||||
wheel.accepted = false
|
||||
}
|
||||
onClicked: root.clicked()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user