mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 21:42:51 -05:00
dock: restructure + icon size option + orientation improvements
This commit is contained in:
@@ -197,6 +197,7 @@ Singleton {
|
|||||||
property int dockPosition: SettingsData.Position.Bottom
|
property int dockPosition: SettingsData.Position.Bottom
|
||||||
property real dockSpacing: 4
|
property real dockSpacing: 4
|
||||||
property real dockBottomGap: 0
|
property real dockBottomGap: 0
|
||||||
|
property real dockIconSize: 40
|
||||||
|
|
||||||
property bool notificationOverlayEnabled: false
|
property bool notificationOverlayEnabled: false
|
||||||
property bool dankBarAutoHide: false
|
property bool dankBarAutoHide: false
|
||||||
@@ -438,6 +439,7 @@ Singleton {
|
|||||||
dockPosition = settings.dockPosition !== undefined ? settings.dockPosition : SettingsData.Position.Bottom
|
dockPosition = settings.dockPosition !== undefined ? settings.dockPosition : SettingsData.Position.Bottom
|
||||||
dockSpacing = settings.dockSpacing !== undefined ? settings.dockSpacing : 4
|
dockSpacing = settings.dockSpacing !== undefined ? settings.dockSpacing : 4
|
||||||
dockBottomGap = settings.dockBottomGap !== undefined ? settings.dockBottomGap : 0
|
dockBottomGap = settings.dockBottomGap !== undefined ? settings.dockBottomGap : 0
|
||||||
|
dockIconSize = settings.dockIconSize !== undefined ? settings.dockIconSize : 40
|
||||||
cornerRadius = settings.cornerRadius !== undefined ? settings.cornerRadius : 12
|
cornerRadius = settings.cornerRadius !== undefined ? settings.cornerRadius : 12
|
||||||
notificationOverlayEnabled = settings.notificationOverlayEnabled !== undefined ? settings.notificationOverlayEnabled : false
|
notificationOverlayEnabled = settings.notificationOverlayEnabled !== undefined ? settings.notificationOverlayEnabled : false
|
||||||
dankBarAutoHide = settings.dankBarAutoHide !== undefined ? settings.dankBarAutoHide : (settings.topBarAutoHide !== undefined ? settings.topBarAutoHide : false)
|
dankBarAutoHide = settings.dankBarAutoHide !== undefined ? settings.dankBarAutoHide : (settings.topBarAutoHide !== undefined ? settings.topBarAutoHide : false)
|
||||||
@@ -613,6 +615,7 @@ Singleton {
|
|||||||
"dockPosition": dockPosition,
|
"dockPosition": dockPosition,
|
||||||
"dockSpacing": dockSpacing,
|
"dockSpacing": dockSpacing,
|
||||||
"dockBottomGap": dockBottomGap,
|
"dockBottomGap": dockBottomGap,
|
||||||
|
"dockIconSize": dockIconSize,
|
||||||
"cornerRadius": cornerRadius,
|
"cornerRadius": cornerRadius,
|
||||||
"notificationOverlayEnabled": notificationOverlayEnabled,
|
"notificationOverlayEnabled": notificationOverlayEnabled,
|
||||||
"dankBarAutoHide": dankBarAutoHide,
|
"dankBarAutoHide": dankBarAutoHide,
|
||||||
@@ -703,7 +706,7 @@ Singleton {
|
|||||||
"notepadTransparencyOverride", "notepadLastCustomTransparency", "soundsEnabled",
|
"notepadTransparencyOverride", "notepadLastCustomTransparency", "soundsEnabled",
|
||||||
"useSystemSoundTheme", "soundNewNotification", "soundVolumeChanged", "soundPluggedIn", "gtkThemingEnabled",
|
"useSystemSoundTheme", "soundNewNotification", "soundVolumeChanged", "soundPluggedIn", "gtkThemingEnabled",
|
||||||
"qtThemingEnabled", "syncModeWithPortal", "showDock", "dockAutoHide", "dockGroupByApp",
|
"qtThemingEnabled", "syncModeWithPortal", "showDock", "dockAutoHide", "dockGroupByApp",
|
||||||
"dockOpenOnOverview", "dockPosition", "dockSpacing", "dockBottomGap",
|
"dockOpenOnOverview", "dockPosition", "dockSpacing", "dockBottomGap", "dockIconSize",
|
||||||
"cornerRadius", "notificationOverlayEnabled", "dankBarAutoHide",
|
"cornerRadius", "notificationOverlayEnabled", "dankBarAutoHide",
|
||||||
"dankBarOpenOnOverview", "dankBarVisible", "dankBarSpacing", "dankBarBottomGap",
|
"dankBarOpenOnOverview", "dankBarVisible", "dankBarSpacing", "dankBarBottomGap",
|
||||||
"dankBarInnerPadding", "dankBarSquareCorners", "dankBarNoBackground",
|
"dankBarInnerPadding", "dankBarSquareCorners", "dankBarNoBackground",
|
||||||
@@ -1556,6 +1559,11 @@ Singleton {
|
|||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setDockIconSize(size) {
|
||||||
|
dockIconSize = size
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
|
||||||
function setDockOpenOnOverview(enabled) {
|
function setDockOpenOnOverview(enabled) {
|
||||||
dockOpenOnOverview = enabled
|
dockOpenOnOverview = enabled
|
||||||
saveSettings()
|
saveSettings()
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ Variants {
|
|||||||
property real backgroundTransparency: SettingsData.dockTransparency
|
property real backgroundTransparency: SettingsData.dockTransparency
|
||||||
property bool groupByApp: SettingsData.dockGroupByApp
|
property bool groupByApp: SettingsData.dockGroupByApp
|
||||||
|
|
||||||
readonly property real widgetHeight: Math.max(20, 26 + SettingsData.dankBarInnerPadding * 0.6)
|
readonly property real widgetHeight: SettingsData.dockIconSize
|
||||||
readonly property real effectiveBarHeight: Math.max(widgetHeight + SettingsData.dankBarInnerPadding + 4, Theme.barHeight - 4 - (8 - SettingsData.dankBarInnerPadding))
|
readonly property real effectiveBarHeight: widgetHeight + SettingsData.dockSpacing * 2 + 10
|
||||||
readonly property real barSpacing: {
|
readonly property real barSpacing: {
|
||||||
const barIsHorizontal = (SettingsData.dankBarPosition === SettingsData.Position.Top || SettingsData.dankBarPosition === SettingsData.Position.Bottom)
|
const barIsHorizontal = (SettingsData.dankBarPosition === SettingsData.Position.Top || SettingsData.dankBarPosition === SettingsData.Position.Bottom)
|
||||||
const barIsVertical = (SettingsData.dankBarPosition === SettingsData.Position.Left || SettingsData.dankBarPosition === SettingsData.Position.Right)
|
const barIsVertical = (SettingsData.dankBarPosition === SettingsData.Position.Left || SettingsData.dankBarPosition === SettingsData.Position.Right)
|
||||||
@@ -103,11 +103,38 @@ Variants {
|
|||||||
exclusiveZone: {
|
exclusiveZone: {
|
||||||
if (!SettingsData.showDock || autoHide) return -1
|
if (!SettingsData.showDock || autoHide) return -1
|
||||||
if (barSpacing > 0) return -1
|
if (barSpacing > 0) return -1
|
||||||
return px(58 + SettingsData.dockSpacing + SettingsData.dockBottomGap)
|
return px(effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap)
|
||||||
|
}
|
||||||
|
|
||||||
|
property real animationHeadroom: Math.ceil(SettingsData.dockIconSize * 0.35)
|
||||||
|
|
||||||
|
implicitWidth: isVertical ? (px(effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockIconSize * 0.3) + animationHeadroom) : 0
|
||||||
|
implicitHeight: !isVertical ? (px(effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockIconSize * 0.3) + animationHeadroom) : 0
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: maskItem
|
||||||
|
parent: dock.contentItem
|
||||||
|
visible: false
|
||||||
|
x: {
|
||||||
|
const baseX = dockCore.x + dockMouseArea.x
|
||||||
|
if (isVertical && SettingsData.dockPosition === SettingsData.Position.Right) {
|
||||||
|
return baseX - animationHeadroom
|
||||||
|
}
|
||||||
|
return baseX
|
||||||
|
}
|
||||||
|
y: {
|
||||||
|
const baseY = dockCore.y + dockMouseArea.y
|
||||||
|
if (!isVertical && SettingsData.dockPosition === SettingsData.Position.Bottom) {
|
||||||
|
return baseY - animationHeadroom
|
||||||
|
}
|
||||||
|
return baseY
|
||||||
|
}
|
||||||
|
width: dockMouseArea.width + (isVertical ? animationHeadroom : 0)
|
||||||
|
height: dockMouseArea.height + (!isVertical ? animationHeadroom : 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
mask: Region {
|
mask: Region {
|
||||||
item: dockMouseArea
|
item: maskItem
|
||||||
}
|
}
|
||||||
|
|
||||||
property var hoveredButton: {
|
property var hoveredButton: {
|
||||||
@@ -136,9 +163,75 @@ Variants {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DankTooltip {
|
||||||
|
id: dockTooltip
|
||||||
|
targetScreen: dock.screen
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: tooltipRevealDelay
|
||||||
|
interval: 250
|
||||||
|
repeat: false
|
||||||
|
onTriggered: dock.showTooltipForHoveredButton()
|
||||||
|
}
|
||||||
|
|
||||||
|
function showTooltipForHoveredButton() {
|
||||||
|
dockTooltip.hide()
|
||||||
|
if (dock.hoveredButton && dock.reveal && !slideXAnimation.running && !slideYAnimation.running) {
|
||||||
|
const buttonGlobalPos = dock.hoveredButton.mapToGlobal(0, 0)
|
||||||
|
const tooltipText = dock.hoveredButton.tooltipText || ""
|
||||||
|
if (tooltipText) {
|
||||||
|
const screenX = dock.screen ? (dock.screen.x || 0) : 0
|
||||||
|
const screenY = dock.screen ? (dock.screen.y || 0) : 0
|
||||||
|
const screenHeight = dock.screen ? dock.screen.height : 0
|
||||||
|
if (!dock.isVertical) {
|
||||||
|
const isBottom = SettingsData.dockPosition === SettingsData.Position.Bottom
|
||||||
|
const globalX = buttonGlobalPos.x + dock.hoveredButton.width / 2
|
||||||
|
const screenRelativeY = isBottom
|
||||||
|
? (screenHeight - dock.effectiveBarHeight - SettingsData.dockSpacing - SettingsData.dockBottomGap - 35)
|
||||||
|
: (buttonGlobalPos.y - screenY + dock.hoveredButton.height + Theme.spacingS)
|
||||||
|
dockTooltip.show(tooltipText,
|
||||||
|
globalX,
|
||||||
|
screenRelativeY,
|
||||||
|
dock.screen,
|
||||||
|
false, false)
|
||||||
|
} else {
|
||||||
|
const isLeft = SettingsData.dockPosition === SettingsData.Position.Left
|
||||||
|
const tooltipOffset = dock.effectiveBarHeight + SettingsData.dockSpacing + Theme.spacingXS
|
||||||
|
const tooltipX = isLeft ? tooltipOffset : (dock.screen.width - tooltipOffset)
|
||||||
|
const screenRelativeY = buttonGlobalPos.y - screenY + dock.hoveredButton.height / 2
|
||||||
|
dockTooltip.show(tooltipText,
|
||||||
|
screenX + tooltipX,
|
||||||
|
screenRelativeY,
|
||||||
|
dock.screen,
|
||||||
|
isLeft,
|
||||||
|
!isLeft)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: dock
|
||||||
|
function onRevealChanged() {
|
||||||
|
if (!dock.reveal) {
|
||||||
|
tooltipRevealDelay.stop()
|
||||||
|
dockTooltip.hide()
|
||||||
|
} else {
|
||||||
|
tooltipRevealDelay.restart()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function onHoveredButtonChanged() {
|
||||||
|
dock.showTooltipForHoveredButton()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: dockCore
|
id: dockCore
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
x: isVertical && SettingsData.dockPosition === SettingsData.Position.Right ? animationHeadroom : 0
|
||||||
|
y: !isVertical && SettingsData.dockPosition === SettingsData.Position.Bottom ? animationHeadroom : 0
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: dockMouseArea
|
target: dockMouseArea
|
||||||
@@ -164,16 +257,16 @@ Variants {
|
|||||||
|
|
||||||
height: {
|
height: {
|
||||||
if (dock.isVertical) {
|
if (dock.isVertical) {
|
||||||
return dock.reveal ? Math.min(dockBackground.implicitHeight + 32, maxDockHeight) : Math.min(Math.max(dockBackground.implicitHeight + 64, 200), screenHeight * 0.5)
|
return dock.reveal ? Math.min(dockBackground.implicitHeight + 4, maxDockHeight) : Math.min(Math.max(dockBackground.implicitHeight + 64, 200), screenHeight * 0.5)
|
||||||
} else {
|
} else {
|
||||||
return dock.reveal ? px(58 + SettingsData.dockSpacing + SettingsData.dockBottomGap) : 1
|
return dock.reveal ? px(dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap) : 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
width: {
|
width: {
|
||||||
if (dock.isVertical) {
|
if (dock.isVertical) {
|
||||||
return dock.reveal ? px(58 + SettingsData.dockSpacing + SettingsData.dockBottomGap) : 1
|
return dock.reveal ? px(dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap) : 1
|
||||||
} else {
|
} else {
|
||||||
return dock.reveal ? Math.min(dockBackground.implicitWidth + 32, maxDockWidth) : Math.min(Math.max(dockBackground.implicitWidth + 64, 200), screenWidth * 0.5)
|
return dock.reveal ? Math.min(dockBackground.implicitWidth + 4, maxDockWidth) : Math.min(Math.max(dockBackground.implicitWidth + 64, 200), screenWidth * 0.5)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
anchors {
|
anchors {
|
||||||
@@ -204,69 +297,14 @@ Variants {
|
|||||||
Item {
|
Item {
|
||||||
id: dockContainer
|
id: dockContainer
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
clip: false
|
||||||
Item {
|
|
||||||
id: appTooltip
|
|
||||||
z: 1000
|
|
||||||
anchors.fill: parent
|
|
||||||
|
|
||||||
property string tooltipText: dock.hoveredButton ? dock.hoveredButton.tooltipText : ""
|
|
||||||
property bool shouldShow: dock.hoveredButton !== null && tooltipText !== "" && dock.reveal && !slideXAnimation.running && !slideYAnimation.running
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: tooltipBackground
|
|
||||||
width: tooltipLabel.contentWidth + 24
|
|
||||||
height: tooltipLabel.contentHeight + 12
|
|
||||||
|
|
||||||
visible: appTooltip.shouldShow && tooltipLabel.contentWidth > 0
|
|
||||||
color: Theme.surfaceContainer
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
border.width: 1
|
|
||||||
border.color: Theme.outlineMedium
|
|
||||||
|
|
||||||
x: {
|
|
||||||
if (!dock.hoveredButton || !visible) return 0
|
|
||||||
const buttonPos = dock.hoveredButton.mapToItem(dockContainer, 0, 0)
|
|
||||||
if (!dock.isVertical) {
|
|
||||||
return buttonPos.x + dock.hoveredButton.width / 2 - width / 2
|
|
||||||
} else {
|
|
||||||
if (SettingsData.dockPosition === SettingsData.Position.Right) {
|
|
||||||
return buttonPos.x - width - Theme.spacingS
|
|
||||||
} else {
|
|
||||||
return buttonPos.x + dock.hoveredButton.width + Theme.spacingS
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
y: {
|
|
||||||
if (!dock.hoveredButton || !visible) return 0
|
|
||||||
const buttonPos = dock.hoveredButton.mapToItem(dockContainer, 0, 0)
|
|
||||||
if (!dock.isVertical) {
|
|
||||||
if (SettingsData.dockPosition === SettingsData.Position.Bottom) {
|
|
||||||
return buttonPos.y - height - Theme.spacingS
|
|
||||||
} else {
|
|
||||||
return buttonPos.y + dock.hoveredButton.height + Theme.spacingS
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return buttonPos.y + dock.hoveredButton.height / 2 - height / 2
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
id: tooltipLabel
|
|
||||||
anchors.centerIn: parent
|
|
||||||
text: appTooltip.tooltipText
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceText
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
transform: Translate {
|
transform: Translate {
|
||||||
id: dockSlide
|
id: dockSlide
|
||||||
x: {
|
x: {
|
||||||
if (!dock.isVertical) return 0
|
if (!dock.isVertical) return 0
|
||||||
if (dock.reveal) return 0
|
if (dock.reveal) return 0
|
||||||
const hideDistance = 58 + SettingsData.dockSpacing + SettingsData.dockBottomGap + 10
|
const hideDistance = dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + 10
|
||||||
if (SettingsData.dockPosition === SettingsData.Position.Right) {
|
if (SettingsData.dockPosition === SettingsData.Position.Right) {
|
||||||
return hideDistance
|
return hideDistance
|
||||||
} else {
|
} else {
|
||||||
@@ -276,7 +314,7 @@ Variants {
|
|||||||
y: {
|
y: {
|
||||||
if (dock.isVertical) return 0
|
if (dock.isVertical) return 0
|
||||||
if (dock.reveal) return 0
|
if (dock.reveal) return 0
|
||||||
const hideDistance = 58 + SettingsData.dockSpacing + SettingsData.dockBottomGap + 10
|
const hideDistance = dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + 10
|
||||||
if (SettingsData.dockPosition === SettingsData.Position.Bottom) {
|
if (SettingsData.dockPosition === SettingsData.Position.Bottom) {
|
||||||
return hideDistance
|
return hideDistance
|
||||||
} else {
|
} else {
|
||||||
@@ -305,17 +343,17 @@ Variants {
|
|||||||
id: dockBackground
|
id: dockBackground
|
||||||
objectName: "dockBackground"
|
objectName: "dockBackground"
|
||||||
anchors {
|
anchors {
|
||||||
top: !dock.isVertical ? (SettingsData.dockPosition === SettingsData.Position.Bottom ? undefined : parent.top) : undefined
|
top: !dock.isVertical ? (SettingsData.dockPosition === SettingsData.Position.Top ? parent.top : undefined) : undefined
|
||||||
bottom: !dock.isVertical ? (SettingsData.dockPosition === SettingsData.Position.Bottom ? parent.bottom : undefined) : undefined
|
bottom: !dock.isVertical ? (SettingsData.dockPosition === SettingsData.Position.Bottom ? parent.bottom : undefined) : undefined
|
||||||
horizontalCenter: !dock.isVertical ? parent.horizontalCenter : undefined
|
horizontalCenter: !dock.isVertical ? parent.horizontalCenter : undefined
|
||||||
left: dock.isVertical ? (SettingsData.dockPosition === SettingsData.Position.Right ? undefined : parent.left) : undefined
|
left: dock.isVertical ? (SettingsData.dockPosition === SettingsData.Position.Left ? parent.left : undefined) : undefined
|
||||||
right: dock.isVertical ? (SettingsData.dockPosition === SettingsData.Position.Right ? parent.right : undefined) : undefined
|
right: dock.isVertical ? (SettingsData.dockPosition === SettingsData.Position.Right ? parent.right : undefined) : undefined
|
||||||
verticalCenter: dock.isVertical ? parent.verticalCenter : undefined
|
verticalCenter: dock.isVertical ? parent.verticalCenter : undefined
|
||||||
}
|
}
|
||||||
anchors.topMargin: !dock.isVertical ? (SettingsData.dockPosition === SettingsData.Position.Bottom ? 0 : barSpacing + 4) : 0
|
anchors.topMargin: !dock.isVertical && SettingsData.dockPosition === SettingsData.Position.Top ? barSpacing + 1 : 0
|
||||||
anchors.bottomMargin: !dock.isVertical ? (SettingsData.dockPosition === SettingsData.Position.Bottom ? barSpacing + 1 : 0) : 0
|
anchors.bottomMargin: !dock.isVertical && SettingsData.dockPosition === SettingsData.Position.Bottom ? barSpacing + 1 : 0
|
||||||
anchors.leftMargin: dock.isVertical ? (SettingsData.dockPosition === SettingsData.Position.Right ? 0 : barSpacing + 4) : 0
|
anchors.leftMargin: dock.isVertical && SettingsData.dockPosition === SettingsData.Position.Left ? barSpacing + 1 : 0
|
||||||
anchors.rightMargin: dock.isVertical ? (SettingsData.dockPosition === SettingsData.Position.Right ? barSpacing + 1 : 0) : 0
|
anchors.rightMargin: dock.isVertical && SettingsData.dockPosition === SettingsData.Position.Right ? barSpacing + 1 : 0
|
||||||
|
|
||||||
implicitWidth: dock.isVertical ? (dockApps.implicitHeight + SettingsData.dockSpacing * 2) : (dockApps.implicitWidth + SettingsData.dockSpacing * 2)
|
implicitWidth: dock.isVertical ? (dockApps.implicitHeight + SettingsData.dockSpacing * 2) : (dockApps.implicitWidth + SettingsData.dockSpacing * 2)
|
||||||
implicitHeight: dock.isVertical ? (dockApps.implicitWidth + SettingsData.dockSpacing * 2) : (dockApps.implicitHeight + SettingsData.dockSpacing * 2)
|
implicitHeight: dock.isVertical ? (dockApps.implicitWidth + SettingsData.dockSpacing * 2) : (dockApps.implicitHeight + SettingsData.dockSpacing * 2)
|
||||||
@@ -326,33 +364,34 @@ Variants {
|
|||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
border.width: 1
|
border.width: 1
|
||||||
border.color: Theme.outlineMedium
|
border.color: Theme.outlineMedium
|
||||||
layer.enabled: true
|
clip: false
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: Qt.rgba(Theme.surfaceTint.r, Theme.surfaceTint.g, Theme.surfaceTint.b, 0.04)
|
color: Qt.rgba(Theme.surfaceTint.r, Theme.surfaceTint.g, Theme.surfaceTint.b, 0.04)
|
||||||
radius: parent.radius
|
radius: parent.radius
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DockApps {
|
DockApps {
|
||||||
id: dockApps
|
id: dockApps
|
||||||
|
|
||||||
anchors.top: !dock.isVertical ? parent.top : undefined
|
anchors.top: !dock.isVertical ? (SettingsData.dockPosition === SettingsData.Position.Top ? dockBackground.top : undefined) : undefined
|
||||||
anchors.bottom: !dock.isVertical ? parent.bottom : undefined
|
anchors.bottom: !dock.isVertical ? (SettingsData.dockPosition === SettingsData.Position.Bottom ? dockBackground.bottom : undefined) : undefined
|
||||||
anchors.horizontalCenter: !dock.isVertical ? parent.horizontalCenter : undefined
|
anchors.horizontalCenter: !dock.isVertical ? dockBackground.horizontalCenter : undefined
|
||||||
anchors.left: dock.isVertical ? parent.left : undefined
|
anchors.left: dock.isVertical ? (SettingsData.dockPosition === SettingsData.Position.Left ? dockBackground.left : undefined) : undefined
|
||||||
anchors.right: dock.isVertical ? parent.right : undefined
|
anchors.right: dock.isVertical ? (SettingsData.dockPosition === SettingsData.Position.Right ? dockBackground.right : undefined) : undefined
|
||||||
anchors.verticalCenter: dock.isVertical ? parent.verticalCenter : undefined
|
anchors.verticalCenter: dock.isVertical ? dockBackground.verticalCenter : undefined
|
||||||
anchors.topMargin: !dock.isVertical ? SettingsData.dockSpacing : 0
|
anchors.topMargin: !dock.isVertical ? SettingsData.dockSpacing : 0
|
||||||
anchors.bottomMargin: !dock.isVertical ? SettingsData.dockSpacing : 0
|
anchors.bottomMargin: !dock.isVertical ? SettingsData.dockSpacing : 0
|
||||||
anchors.leftMargin: dock.isVertical ? SettingsData.dockSpacing : 0
|
anchors.leftMargin: dock.isVertical ? SettingsData.dockSpacing : 0
|
||||||
anchors.rightMargin: dock.isVertical ? SettingsData.dockSpacing : 0
|
anchors.rightMargin: dock.isVertical ? SettingsData.dockSpacing : 0
|
||||||
|
|
||||||
contextMenu: dockVariants.contextMenu
|
contextMenu: dockVariants.contextMenu
|
||||||
groupByApp: dock.groupByApp
|
groupByApp: dock.groupByApp
|
||||||
isVertical: dock.isVertical
|
isVertical: dock.isVertical
|
||||||
dockScreen: dock.screen
|
dockScreen: dock.screen
|
||||||
}
|
iconSize: dock.widgetHeight
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ Item {
|
|||||||
property bool isHovered: mouseArea.containsMouse && !dragging
|
property bool isHovered: mouseArea.containsMouse && !dragging
|
||||||
property bool showTooltip: mouseArea.containsMouse && !dragging
|
property bool showTooltip: mouseArea.containsMouse && !dragging
|
||||||
property var cachedDesktopEntry: null
|
property var cachedDesktopEntry: null
|
||||||
|
property real actualIconSize: 40
|
||||||
|
|
||||||
function updateDesktopEntry() {
|
function updateDesktopEntry() {
|
||||||
if (!appData || appData.appId === "__SEPARATOR__") {
|
if (!appData || appData.appId === "__SEPARATOR__") {
|
||||||
@@ -89,9 +90,6 @@ Item {
|
|||||||
return cachedDesktopEntry && cachedDesktopEntry.name ? cachedDesktopEntry.name : appData.appId
|
return cachedDesktopEntry && cachedDesktopEntry.name ? cachedDesktopEntry.name : appData.appId
|
||||||
}
|
}
|
||||||
|
|
||||||
width: 40
|
|
||||||
height: 40
|
|
||||||
|
|
||||||
function getToplevelObject() {
|
function getToplevelObject() {
|
||||||
if (!appData) {
|
if (!appData) {
|
||||||
return null
|
return null
|
||||||
@@ -145,34 +143,47 @@ Item {
|
|||||||
return toplevels
|
return toplevels
|
||||||
}
|
}
|
||||||
onIsHoveredChanged: {
|
onIsHoveredChanged: {
|
||||||
|
if (mouseArea.pressed) return
|
||||||
|
|
||||||
if (isHovered) {
|
if (isHovered) {
|
||||||
exitAnimation.stop()
|
exitAnimation.stop()
|
||||||
if (!bounceAnimation.running)
|
if (!bounceAnimation.running) {
|
||||||
bounceAnimation.restart()
|
bounceAnimation.restart()
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
bounceAnimation.stop()
|
bounceAnimation.stop()
|
||||||
exitAnimation.restart()
|
exitAnimation.restart()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
readonly property bool animateX: SettingsData.dockPosition === SettingsData.Position.Left || SettingsData.dockPosition === SettingsData.Position.Right
|
||||||
|
readonly property real animationDistance: actualIconSize
|
||||||
|
readonly property real animationDirection: {
|
||||||
|
if (SettingsData.dockPosition === SettingsData.Position.Bottom) return -1
|
||||||
|
if (SettingsData.dockPosition === SettingsData.Position.Top) return 1
|
||||||
|
if (SettingsData.dockPosition === SettingsData.Position.Right) return -1
|
||||||
|
if (SettingsData.dockPosition === SettingsData.Position.Left) return 1
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
|
||||||
SequentialAnimation {
|
SequentialAnimation {
|
||||||
id: bounceAnimation
|
id: bounceAnimation
|
||||||
|
|
||||||
running: false
|
running: false
|
||||||
|
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
target: translateY
|
target: iconTransform
|
||||||
property: "y"
|
property: animateX ? "x" : "y"
|
||||||
to: -10
|
to: animationDirection * animationDistance * 0.25
|
||||||
duration: Anims.durShort
|
duration: Anims.durShort
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: Anims.emphasizedAccel
|
easing.bezierCurve: Anims.emphasizedAccel
|
||||||
}
|
}
|
||||||
|
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
target: translateY
|
target: iconTransform
|
||||||
property: "y"
|
property: animateX ? "x" : "y"
|
||||||
to: -8
|
to: animationDirection * animationDistance * 0.2
|
||||||
duration: Anims.durShort
|
duration: Anims.durShort
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: Anims.emphasizedDecel
|
easing.bezierCurve: Anims.emphasizedDecel
|
||||||
@@ -183,24 +194,14 @@ Item {
|
|||||||
id: exitAnimation
|
id: exitAnimation
|
||||||
|
|
||||||
running: false
|
running: false
|
||||||
target: translateY
|
target: iconTransform
|
||||||
property: "y"
|
property: animateX ? "x" : "y"
|
||||||
to: 0
|
to: 0
|
||||||
duration: Anims.durShort
|
duration: Anims.durShort
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: Anims.emphasizedDecel
|
easing.bezierCurve: Anims.emphasizedDecel
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
anchors.fill: parent
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.3)
|
|
||||||
border.width: 2
|
|
||||||
border.color: Theme.primary
|
|
||||||
visible: dragging
|
|
||||||
z: -1
|
|
||||||
}
|
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
id: longPressTimer
|
id: longPressTimer
|
||||||
|
|
||||||
@@ -217,7 +218,6 @@ Item {
|
|||||||
id: mouseArea
|
id: mouseArea
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.bottomMargin: -20
|
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
cursorShape: longPressing ? Qt.DragMoveCursor : Qt.PointingHandCursor
|
cursorShape: longPressing ? Qt.DragMoveCursor : Qt.PointingHandCursor
|
||||||
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
|
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
|
||||||
@@ -253,7 +253,7 @@ Item {
|
|||||||
if (dragging) {
|
if (dragging) {
|
||||||
dragOffset = Qt.point(mouse.x - dragStartPos.x, mouse.y - dragStartPos.y)
|
dragOffset = Qt.point(mouse.x - dragStartPos.x, mouse.y - dragStartPos.y)
|
||||||
if (dockApps) {
|
if (dockApps) {
|
||||||
const threshold = 40
|
const threshold = actualIconSize
|
||||||
let newTargetIndex = targetIndex
|
let newTargetIndex = targetIndex
|
||||||
if (dragOffset.x > threshold && targetIndex < dockApps.pinnedAppCount - 1) {
|
if (dragOffset.x > threshold && targetIndex < dockApps.pinnedAppCount - 1) {
|
||||||
newTargetIndex = targetIndex + 1
|
newTargetIndex = targetIndex + 1
|
||||||
@@ -318,7 +318,7 @@ Item {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (contextMenu) {
|
if (contextMenu) {
|
||||||
contextMenu.showForButton(root, appData, 65, true, cachedDesktopEntry, parentDockScreen)
|
contextMenu.showForButton(root, appData, root.height + 25, true, cachedDesktopEntry, parentDockScreen)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -335,7 +335,7 @@ Item {
|
|||||||
}
|
}
|
||||||
} else if (appData && appData.type === "grouped") {
|
} else if (appData && appData.type === "grouped") {
|
||||||
if (contextMenu) {
|
if (contextMenu) {
|
||||||
contextMenu.showForButton(root, appData, 40, false, cachedDesktopEntry, parentDockScreen)
|
contextMenu.showForButton(root, appData, root.height, false, cachedDesktopEntry, parentDockScreen)
|
||||||
}
|
}
|
||||||
} else if (appData && appData.appId) {
|
} else if (appData && appData.appId) {
|
||||||
const desktopEntry = cachedDesktopEntry
|
const desktopEntry = cachedDesktopEntry
|
||||||
@@ -352,7 +352,7 @@ Item {
|
|||||||
}
|
}
|
||||||
} else if (mouse.button === Qt.RightButton) {
|
} else if (mouse.button === Qt.RightButton) {
|
||||||
if (contextMenu && appData) {
|
if (contextMenu && appData) {
|
||||||
contextMenu.showForButton(root, appData, 40, false, cachedDesktopEntry, parentDockScreen)
|
contextMenu.showForButton(root, appData, root.height, false, cachedDesktopEntry, parentDockScreen)
|
||||||
} else {
|
} else {
|
||||||
console.warn("No context menu or appData available")
|
console.warn("No context menu or appData available")
|
||||||
}
|
}
|
||||||
@@ -360,123 +360,205 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IconImage {
|
Item {
|
||||||
id: iconImg
|
id: visualContent
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
anchors.centerIn: parent
|
transform: Translate {
|
||||||
implicitSize: 40
|
id: iconTransform
|
||||||
source: {
|
x: 0
|
||||||
if (appData.appId === "__SEPARATOR__") {
|
y: 0
|
||||||
return ""
|
|
||||||
}
|
|
||||||
const moddedId = Paths.moddedAppId(appData.appId)
|
|
||||||
if (moddedId.toLowerCase().includes("steam_app")) {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
return cachedDesktopEntry && cachedDesktopEntry.icon ? Quickshell.iconPath(cachedDesktopEntry.icon, true) : ""
|
|
||||||
}
|
}
|
||||||
mipmap: true
|
|
||||||
smooth: true
|
|
||||||
asynchronous: true
|
|
||||||
visible: status === Image.Ready
|
|
||||||
}
|
|
||||||
|
|
||||||
DankIcon {
|
Rectangle {
|
||||||
anchors.centerIn: parent
|
anchors.fill: parent
|
||||||
size: 40
|
radius: Theme.cornerRadius
|
||||||
name: "sports_esports"
|
color: Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.3)
|
||||||
color: Theme.surfaceText
|
border.width: 2
|
||||||
visible: {
|
border.color: Theme.primary
|
||||||
if (!appData || !appData.appId || appData.appId === "__SEPARATOR__") {
|
visible: dragging
|
||||||
return false
|
z: -1
|
||||||
}
|
|
||||||
const moddedId = Paths.moddedAppId(appData.appId)
|
|
||||||
return moddedId.toLowerCase().includes("steam_app")
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
IconImage {
|
||||||
width: 40
|
id: iconImg
|
||||||
height: 40
|
|
||||||
anchors.centerIn: parent
|
|
||||||
visible: iconImg.status !== Image.Ready
|
|
||||||
color: Theme.surfaceLight
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
border.width: 1
|
|
||||||
border.color: Theme.primarySelected
|
|
||||||
|
|
||||||
Text {
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
text: {
|
implicitSize: actualIconSize
|
||||||
if (!appData || !appData.appId) {
|
source: {
|
||||||
return "?"
|
if (appData.appId === "__SEPARATOR__") {
|
||||||
|
return ""
|
||||||
}
|
}
|
||||||
|
const moddedId = Paths.moddedAppId(appData.appId)
|
||||||
const desktopEntry = cachedDesktopEntry
|
if (moddedId.toLowerCase().includes("steam_app")) {
|
||||||
if (desktopEntry && desktopEntry.name) {
|
return ""
|
||||||
return desktopEntry.name.charAt(0).toUpperCase()
|
|
||||||
}
|
}
|
||||||
|
return cachedDesktopEntry && cachedDesktopEntry.icon ? Quickshell.iconPath(cachedDesktopEntry.icon, true) : ""
|
||||||
return appData.appId.charAt(0).toUpperCase()
|
|
||||||
}
|
}
|
||||||
font.pixelSize: 14
|
mipmap: true
|
||||||
color: Theme.primary
|
smooth: true
|
||||||
font.weight: Font.Bold
|
asynchronous: true
|
||||||
|
visible: status === Image.Ready
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Indicator for running/focused state
|
DankIcon {
|
||||||
Row {
|
anchors.centerIn: parent
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
size: actualIconSize
|
||||||
anchors.bottom: parent.bottom
|
name: "sports_esports"
|
||||||
anchors.bottomMargin: -2
|
color: Theme.surfaceText
|
||||||
spacing: 2
|
visible: {
|
||||||
visible: appData && (appData.isRunning || appData.type === "window" || (appData.type === "grouped" && appData.windowCount > 0))
|
if (!appData || !appData.appId || appData.appId === "__SEPARATOR__") {
|
||||||
|
return false
|
||||||
Repeater {
|
|
||||||
model: {
|
|
||||||
if (!appData) return 0
|
|
||||||
if (appData.type === "grouped") {
|
|
||||||
return Math.min(appData.windowCount, 4)
|
|
||||||
} else if (appData.type === "window" || appData.isRunning) {
|
|
||||||
return 1
|
|
||||||
}
|
}
|
||||||
return 0
|
const moddedId = Paths.moddedAppId(appData.appId)
|
||||||
|
return moddedId.toLowerCase().includes("steam_app")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
width: appData && appData.type === "grouped" && appData.windowCount > 1 ? 4 : 8
|
width: actualIconSize
|
||||||
height: 2
|
height: actualIconSize
|
||||||
radius: 1
|
anchors.centerIn: parent
|
||||||
color: {
|
visible: iconImg.status !== Image.Ready
|
||||||
if (!appData) {
|
color: Theme.surfaceLight
|
||||||
return "transparent"
|
radius: Theme.cornerRadius
|
||||||
|
border.width: 1
|
||||||
|
border.color: Theme.primarySelected
|
||||||
|
|
||||||
|
Text {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
text: {
|
||||||
|
if (!appData || !appData.appId) {
|
||||||
|
return "?"
|
||||||
}
|
}
|
||||||
|
|
||||||
if (appData.type !== "grouped" || appData.windowCount === 1) {
|
const desktopEntry = cachedDesktopEntry
|
||||||
if (isWindowFocused) {
|
if (desktopEntry && desktopEntry.name) {
|
||||||
return Theme.primary
|
return desktopEntry.name.charAt(0).toUpperCase()
|
||||||
|
}
|
||||||
|
|
||||||
|
return appData.appId.charAt(0).toUpperCase()
|
||||||
|
}
|
||||||
|
font.pixelSize: Math.max(8, parent.width * 0.35)
|
||||||
|
color: Theme.primary
|
||||||
|
font.weight: Font.Bold
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Loader {
|
||||||
|
anchors.horizontalCenter: SettingsData.dockPosition === SettingsData.Position.Left || SettingsData.dockPosition === SettingsData.Position.Right ? undefined : parent.horizontalCenter
|
||||||
|
anchors.verticalCenter: SettingsData.dockPosition === SettingsData.Position.Left || SettingsData.dockPosition === SettingsData.Position.Right ? parent.verticalCenter : undefined
|
||||||
|
anchors.bottom: SettingsData.dockPosition === SettingsData.Position.Bottom ? parent.bottom : undefined
|
||||||
|
anchors.top: SettingsData.dockPosition === SettingsData.Position.Top ? parent.top : undefined
|
||||||
|
anchors.left: SettingsData.dockPosition === SettingsData.Position.Left ? parent.left : undefined
|
||||||
|
anchors.right: SettingsData.dockPosition === SettingsData.Position.Right ? parent.right : undefined
|
||||||
|
anchors.bottomMargin: SettingsData.dockPosition === SettingsData.Position.Bottom ? -2 : 0
|
||||||
|
anchors.topMargin: SettingsData.dockPosition === SettingsData.Position.Top ? -2 : 0
|
||||||
|
anchors.leftMargin: SettingsData.dockPosition === SettingsData.Position.Left ? -2 : 0
|
||||||
|
anchors.rightMargin: SettingsData.dockPosition === SettingsData.Position.Right ? -2 : 0
|
||||||
|
|
||||||
|
sourceComponent: SettingsData.dockPosition === SettingsData.Position.Left || SettingsData.dockPosition === SettingsData.Position.Right ? columnIndicator : rowIndicator
|
||||||
|
|
||||||
|
visible: {
|
||||||
|
if (!appData) return false
|
||||||
|
if (appData.type === "window") return true
|
||||||
|
if (appData.type === "grouped") return appData.windowCount > 0
|
||||||
|
return appData.isRunning
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: rowIndicator
|
||||||
|
|
||||||
|
Row {
|
||||||
|
spacing: 2
|
||||||
|
|
||||||
|
Repeater {
|
||||||
|
model: {
|
||||||
|
if (!appData) return 0
|
||||||
|
if (appData.type === "grouped") {
|
||||||
|
return Math.min(appData.windowCount, 4)
|
||||||
|
} else if (appData.type === "window" || appData.isRunning) {
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
width: appData && appData.type === "grouped" && appData.windowCount > 1 ? Math.max(3, actualIconSize * 0.1) : Math.max(6, actualIconSize * 0.2)
|
||||||
|
height: Math.max(2, actualIconSize * 0.05)
|
||||||
|
radius: Theme.cornerRadius
|
||||||
|
color: {
|
||||||
|
if (!appData) {
|
||||||
|
return "transparent"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (appData.type !== "grouped" || appData.windowCount === 1) {
|
||||||
|
if (isWindowFocused) {
|
||||||
|
return Theme.primary
|
||||||
|
}
|
||||||
|
return Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.6)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (appData.type === "grouped" && appData.windowCount > 1) {
|
||||||
|
const groupToplevels = getGroupedToplevels()
|
||||||
|
if (index < groupToplevels.length && groupToplevels[index].activated) {
|
||||||
|
return Theme.primary
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.6)
|
return Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.6)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (appData.type === "grouped" && appData.windowCount > 1) {
|
|
||||||
const groupToplevels = getGroupedToplevels()
|
|
||||||
if (index < groupToplevels.length && groupToplevels[index].activated) {
|
|
||||||
return Theme.primary
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.6)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: columnIndicator
|
||||||
|
|
||||||
transform: Translate {
|
Column {
|
||||||
id: translateY
|
spacing: 2
|
||||||
|
|
||||||
y: 0
|
Repeater {
|
||||||
|
model: {
|
||||||
|
if (!appData) return 0
|
||||||
|
if (appData.type === "grouped") {
|
||||||
|
return Math.min(appData.windowCount, 4)
|
||||||
|
} else if (appData.type === "window" || appData.isRunning) {
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
width: Math.max(2, actualIconSize * 0.05)
|
||||||
|
height: appData && appData.type === "grouped" && appData.windowCount > 1 ? Math.max(3, actualIconSize * 0.1) : Math.max(6, actualIconSize * 0.2)
|
||||||
|
radius: Theme.cornerRadius
|
||||||
|
color: {
|
||||||
|
if (!appData) {
|
||||||
|
return "transparent"
|
||||||
|
}
|
||||||
|
|
||||||
|
if (appData.type !== "grouped" || appData.windowCount === 1) {
|
||||||
|
if (isWindowFocused) {
|
||||||
|
return Theme.primary
|
||||||
|
}
|
||||||
|
return Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.6)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (appData.type === "grouped" && appData.windowCount > 1) {
|
||||||
|
const groupToplevels = getGroupedToplevels()
|
||||||
|
if (index < groupToplevels.length && groupToplevels[index].activated) {
|
||||||
|
return Theme.primary
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.6)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,9 @@ Item {
|
|||||||
property bool groupByApp: false
|
property bool groupByApp: false
|
||||||
property bool isVertical: false
|
property bool isVertical: false
|
||||||
property var dockScreen: null
|
property var dockScreen: null
|
||||||
|
property real iconSize: 40
|
||||||
|
|
||||||
|
clip: false
|
||||||
implicitWidth: isVertical ? appLayout.height : appLayout.width
|
implicitWidth: isVertical ? appLayout.height : appLayout.width
|
||||||
implicitHeight: isVertical ? appLayout.width : appLayout.height
|
implicitHeight: isVertical ? appLayout.width : appLayout.height
|
||||||
|
|
||||||
@@ -37,14 +39,18 @@ Item {
|
|||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: appLayout
|
id: appLayout
|
||||||
anchors.centerIn: parent
|
|
||||||
width: layoutFlow.width
|
width: layoutFlow.width
|
||||||
height: layoutFlow.height
|
height: layoutFlow.height
|
||||||
|
anchors.horizontalCenter: root.isVertical ? undefined : parent.horizontalCenter
|
||||||
|
anchors.verticalCenter: root.isVertical ? parent.verticalCenter : undefined
|
||||||
|
anchors.left: root.isVertical && SettingsData.dockPosition === SettingsData.Position.Left ? parent.left : undefined
|
||||||
|
anchors.right: root.isVertical && SettingsData.dockPosition === SettingsData.Position.Right ? parent.right : undefined
|
||||||
|
anchors.top: root.isVertical ? undefined : parent.top
|
||||||
|
|
||||||
Flow {
|
Flow {
|
||||||
id: layoutFlow
|
id: layoutFlow
|
||||||
flow: root.isVertical ? Flow.TopToBottom : Flow.LeftToRight
|
flow: root.isVertical ? Flow.TopToBottom : Flow.LeftToRight
|
||||||
spacing: 8
|
spacing: Math.min(8, Math.max(4, root.iconSize * 0.08))
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
id: repeater
|
id: repeater
|
||||||
@@ -193,26 +199,35 @@ Item {
|
|||||||
delegate: Item {
|
delegate: Item {
|
||||||
id: delegateItem
|
id: delegateItem
|
||||||
property alias dockButton: button
|
property alias dockButton: button
|
||||||
|
clip: false
|
||||||
|
|
||||||
width: model.type === "separator" ? 16 : 40
|
width: model.type === "separator" ? (root.isVertical ? root.iconSize : 8) : (root.isVertical ? root.iconSize : root.iconSize * 1.2)
|
||||||
height: 40
|
height: model.type === "separator" ? (root.isVertical ? 8 : root.iconSize) : (root.isVertical ? root.iconSize * 1.2 : root.iconSize)
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
visible: model.type === "separator"
|
visible: model.type === "separator"
|
||||||
width: 2
|
width: root.isVertical ? root.iconSize * 0.5 : 2
|
||||||
height: 20
|
height: root.isVertical ? 2 : root.iconSize * 0.5
|
||||||
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.3)
|
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.3)
|
||||||
radius: 1
|
radius: 1
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
visible: model.type === "separator"
|
||||||
|
anchors.fill: parent
|
||||||
|
hoverEnabled: true
|
||||||
|
acceptedButtons: Qt.NoButton
|
||||||
|
}
|
||||||
|
|
||||||
DockAppButton {
|
DockAppButton {
|
||||||
id: button
|
id: button
|
||||||
visible: model.type !== "separator"
|
visible: model.type !== "separator"
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|
||||||
width: 40
|
width: delegateItem.width
|
||||||
height: 40
|
height: delegateItem.height
|
||||||
|
actualIconSize: root.iconSize
|
||||||
|
|
||||||
appData: model
|
appData: model
|
||||||
contextMenu: root.contextMenu
|
contextMenu: root.contextMenu
|
||||||
@@ -220,7 +235,6 @@ Item {
|
|||||||
index: model.index
|
index: model.index
|
||||||
parentDockScreen: root.dockScreen
|
parentDockScreen: root.dockScreen
|
||||||
|
|
||||||
// Override tooltip for windows to show window title
|
|
||||||
showWindowTitle: model.type === "window" || model.type === "grouped"
|
showWindowTitle: model.type === "window" || model.type === "grouped"
|
||||||
windowTitle: model.windowTitle || ""
|
windowTitle: model.windowTitle || ""
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import qs.Widgets
|
|||||||
PanelWindow {
|
PanelWindow {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property bool showContextMenu: false
|
|
||||||
property var appData: null
|
property var appData: null
|
||||||
property var anchorItem: null
|
property var anchorItem: null
|
||||||
property real dockVisibleHeight: 40
|
property real dockVisibleHeight: 40
|
||||||
@@ -18,25 +17,24 @@ PanelWindow {
|
|||||||
property var desktopEntry: null
|
property var desktopEntry: null
|
||||||
|
|
||||||
function showForButton(button, data, dockHeight, hidePinOption, entry, dockScreen) {
|
function showForButton(button, data, dockHeight, hidePinOption, entry, dockScreen) {
|
||||||
|
if (dockScreen) {
|
||||||
|
root.screen = dockScreen
|
||||||
|
}
|
||||||
|
|
||||||
anchorItem = button
|
anchorItem = button
|
||||||
appData = data
|
appData = data
|
||||||
dockVisibleHeight = dockHeight || 40
|
dockVisibleHeight = dockHeight || 40
|
||||||
hidePin = hidePinOption || false
|
hidePin = hidePinOption || false
|
||||||
desktopEntry = entry || null
|
desktopEntry = entry || null
|
||||||
|
|
||||||
if (dockScreen) {
|
visible = true
|
||||||
root.screen = dockScreen
|
|
||||||
}
|
|
||||||
|
|
||||||
showContextMenu = true
|
|
||||||
}
|
}
|
||||||
function close() {
|
function close() {
|
||||||
showContextMenu = false
|
visible = false
|
||||||
}
|
}
|
||||||
|
|
||||||
screen: Quickshell.screens[0]
|
screen: null
|
||||||
|
visible: false
|
||||||
visible: showContextMenu
|
|
||||||
WlrLayershell.layer: WlrLayershell.Overlay
|
WlrLayershell.layer: WlrLayershell.Overlay
|
||||||
WlrLayershell.exclusiveZone: -1
|
WlrLayershell.exclusiveZone: -1
|
||||||
WlrLayershell.keyboardFocus: WlrKeyboardFocus.None
|
WlrLayershell.keyboardFocus: WlrKeyboardFocus.None
|
||||||
@@ -168,7 +166,7 @@ PanelWindow {
|
|||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
||||||
border.width: 1
|
border.width: 1
|
||||||
|
|
||||||
opacity: root.showContextMenu ? 1 : 0
|
opacity: root.visible ? 1 : 0
|
||||||
visible: opacity > 0
|
visible: opacity > 0
|
||||||
|
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
|
|||||||
@@ -329,6 +329,69 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Icon Size Section
|
||||||
|
StyledRect {
|
||||||
|
width: parent.width
|
||||||
|
height: iconSizeSection.implicitHeight + Theme.spacingL * 2
|
||||||
|
radius: Theme.cornerRadius
|
||||||
|
color: Theme.surfaceContainerHigh
|
||||||
|
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
|
||||||
|
Theme.outline.b, 0.2)
|
||||||
|
border.width: 0
|
||||||
|
visible: SettingsData.showDock
|
||||||
|
opacity: visible ? 1 : 0
|
||||||
|
|
||||||
|
Column {
|
||||||
|
id: iconSizeSection
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.margins: Theme.spacingL
|
||||||
|
spacing: Theme.spacingM
|
||||||
|
|
||||||
|
Row {
|
||||||
|
width: parent.width
|
||||||
|
spacing: Theme.spacingM
|
||||||
|
|
||||||
|
DankIcon {
|
||||||
|
name: "photo_size_select_large"
|
||||||
|
size: Theme.iconSize
|
||||||
|
color: Theme.primary
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: I18n.tr("Icon Size")
|
||||||
|
font.pixelSize: Theme.fontSizeLarge
|
||||||
|
font.weight: Font.Medium
|
||||||
|
color: Theme.surfaceText
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DankSlider {
|
||||||
|
width: parent.width
|
||||||
|
height: 24
|
||||||
|
value: SettingsData.dockIconSize
|
||||||
|
minimum: 24
|
||||||
|
maximum: 96
|
||||||
|
unit: ""
|
||||||
|
showValue: true
|
||||||
|
wheelEnabled: false
|
||||||
|
thumbOutlineColor: Theme.surfaceContainerHigh
|
||||||
|
onSliderValueChanged: newValue => {
|
||||||
|
SettingsData.setDockIconSize(newValue)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
NumberAnimation {
|
||||||
|
duration: Theme.mediumDuration
|
||||||
|
easing.type: Theme.emphasizedEasing
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Dock Spacing Section
|
// Dock Spacing Section
|
||||||
StyledRect {
|
StyledRect {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|||||||
Reference in New Issue
Block a user