forked from Shinonome/dots-hyprland
make DockButton not rely on auto-cascaded dockRow.padding
This commit is contained in:
@@ -16,19 +16,18 @@ Scope { // Scope
|
|||||||
id: root
|
id: root
|
||||||
property bool pinned: Config.options?.dock.pinnedOnStartup ?? false
|
property bool pinned: Config.options?.dock.pinnedOnStartup ?? false
|
||||||
|
|
||||||
Variants { // For each monitor
|
Variants {
|
||||||
|
// For each monitor
|
||||||
model: Quickshell.screens
|
model: Quickshell.screens
|
||||||
|
|
||||||
PanelWindow { // Window
|
PanelWindow {
|
||||||
required property var modelData
|
|
||||||
id: dockRoot
|
id: dockRoot
|
||||||
|
// Window
|
||||||
|
required property var modelData
|
||||||
screen: modelData
|
screen: modelData
|
||||||
visible: !GlobalStates.screenLocked
|
visible: !GlobalStates.screenLocked
|
||||||
|
|
||||||
property bool reveal: root.pinned
|
property bool reveal: root.pinned || (Config.options?.dock.hoverToReveal && dockMouseArea.containsMouse) || dockApps.requestDockShow || (!ToplevelManager.activeToplevel?.activated)
|
||||||
|| (Config.options?.dock.hoverToReveal && dockMouseArea.containsMouse)
|
|
||||||
|| dockApps.requestDockShow
|
|
||||||
|| (!ToplevelManager.activeToplevel?.activated)
|
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
bottom: true
|
bottom: true
|
||||||
@@ -36,9 +35,7 @@ Scope { // Scope
|
|||||||
right: true
|
right: true
|
||||||
}
|
}
|
||||||
|
|
||||||
exclusiveZone: root.pinned ? implicitHeight
|
exclusiveZone: root.pinned ? implicitHeight - (Appearance.sizes.hyprlandGapsOut) - (Appearance.sizes.elevationMargin - Appearance.sizes.hyprlandGapsOut) : 0
|
||||||
- (Appearance.sizes.hyprlandGapsOut)
|
|
||||||
- (Appearance.sizes.elevationMargin - Appearance.sizes.hyprlandGapsOut) : 0
|
|
||||||
|
|
||||||
implicitWidth: dockBackground.implicitWidth
|
implicitWidth: dockBackground.implicitWidth
|
||||||
WlrLayershell.namespace: "quickshell:dock"
|
WlrLayershell.namespace: "quickshell:dock"
|
||||||
@@ -55,9 +52,7 @@ Scope { // Scope
|
|||||||
height: parent.height
|
height: parent.height
|
||||||
anchors {
|
anchors {
|
||||||
top: parent.top
|
top: parent.top
|
||||||
topMargin: dockRoot.reveal ? 0 :
|
topMargin: dockRoot.reveal ? 0 : Config.options?.dock.hoverToReveal ? (dockRoot.implicitHeight - Config.options.dock.hoverRegionHeight) : (dockRoot.implicitHeight + 1)
|
||||||
Config.options?.dock.hoverToReveal ? (dockRoot.implicitHeight - Config.options.dock.hoverRegionHeight) :
|
|
||||||
(dockRoot.implicitHeight + 1)
|
|
||||||
horizontalCenter: parent.horizontalCenter
|
horizontalCenter: parent.horizontalCenter
|
||||||
}
|
}
|
||||||
implicitWidth: dockHoverRegion.implicitWidth + Appearance.sizes.elevationMargin * 2
|
implicitWidth: dockHoverRegion.implicitWidth + Appearance.sizes.elevationMargin * 2
|
||||||
@@ -108,7 +103,8 @@ Scope { // Scope
|
|||||||
|
|
||||||
VerticalButtonGroup {
|
VerticalButtonGroup {
|
||||||
Layout.topMargin: Appearance.sizes.hyprlandGapsOut // why does this work
|
Layout.topMargin: Appearance.sizes.hyprlandGapsOut // why does this work
|
||||||
GroupButton { // Pin button
|
GroupButton {
|
||||||
|
// Pin button
|
||||||
baseWidth: 35
|
baseWidth: 35
|
||||||
baseHeight: 35
|
baseHeight: 35
|
||||||
clickedWidth: baseWidth
|
clickedWidth: baseWidth
|
||||||
@@ -125,11 +121,16 @@ Scope { // Scope
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
DockSeparator {}
|
DockSeparator {}
|
||||||
DockApps { id: dockApps; }
|
DockApps {
|
||||||
|
id: dockApps
|
||||||
|
buttonPadding: dockRow.padding
|
||||||
|
}
|
||||||
DockSeparator {}
|
DockSeparator {}
|
||||||
DockButton {
|
DockButton {
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
onClicked: GlobalStates.overviewOpen = !GlobalStates.overviewOpen
|
onClicked: GlobalStates.overviewOpen = !GlobalStates.overviewOpen
|
||||||
|
topInset: Appearance.sizes.hyprlandGapsOut + dockRow.padding
|
||||||
|
bottomInset: Appearance.sizes.hyprlandGapsOut + dockRow.padding
|
||||||
contentItem: MaterialSymbol {
|
contentItem: MaterialSymbol {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
@@ -141,7 +142,6 @@ Scope { // Scope
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ Item {
|
|||||||
property real maxWindowPreviewHeight: 200
|
property real maxWindowPreviewHeight: 200
|
||||||
property real maxWindowPreviewWidth: 300
|
property real maxWindowPreviewWidth: 300
|
||||||
property real windowControlsHeight: 30
|
property real windowControlsHeight: 30
|
||||||
|
property real buttonPadding: 5
|
||||||
|
|
||||||
property Item lastHoveredButton
|
property Item lastHoveredButton
|
||||||
property bool buttonHovered: false
|
property bool buttonHovered: false
|
||||||
@@ -84,6 +85,9 @@ Item {
|
|||||||
required property var modelData
|
required property var modelData
|
||||||
appToplevel: modelData
|
appToplevel: modelData
|
||||||
appListRoot: root
|
appListRoot: root
|
||||||
|
|
||||||
|
topInset: Appearance.sizes.hyprlandGapsOut + root.buttonPadding
|
||||||
|
bottomInset: Appearance.sizes.hyprlandGapsOut + root.buttonPadding
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,5 @@ RippleButton {
|
|||||||
implicitWidth: implicitHeight - topInset - bottomInset
|
implicitWidth: implicitHeight - topInset - bottomInset
|
||||||
buttonRadius: Appearance.rounding.normal
|
buttonRadius: Appearance.rounding.normal
|
||||||
|
|
||||||
topInset: Appearance.sizes.hyprlandGapsOut + dockRow.padding
|
|
||||||
bottomInset: Appearance.sizes.hyprlandGapsOut + dockRow.padding
|
|
||||||
|
|
||||||
background.implicitHeight: 50
|
background.implicitHeight: 50
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user