mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-07 22:15:38 -05:00
@@ -240,6 +240,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 dockMargin: 0
|
||||||
property real dockIconSize: 40
|
property real dockIconSize: 40
|
||||||
property string dockIndicatorStyle: "circle"
|
property string dockIndicatorStyle: "circle"
|
||||||
|
|
||||||
|
|||||||
@@ -157,6 +157,7 @@ var SPEC = {
|
|||||||
dockPosition: { def: 1 },
|
dockPosition: { def: 1 },
|
||||||
dockSpacing: { def: 4 },
|
dockSpacing: { def: 4 },
|
||||||
dockBottomGap: { def: 0 },
|
dockBottomGap: { def: 0 },
|
||||||
|
dockMargin: { def: 0 },
|
||||||
dockIconSize: { def: 40 },
|
dockIconSize: { def: 40 },
|
||||||
dockIndicatorStyle: { def: "circle" },
|
dockIndicatorStyle: { def: "circle" },
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ Variants {
|
|||||||
}
|
}
|
||||||
|
|
||||||
readonly property real dockMargin: SettingsData.dockSpacing
|
readonly property real dockMargin: SettingsData.dockSpacing
|
||||||
readonly property real positionSpacing: barSpacing + SettingsData.dockBottomGap
|
readonly property real positionSpacing: barSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin
|
||||||
readonly property real _dpr: (dock.screen && dock.screen.devicePixelRatio) ? dock.screen.devicePixelRatio : 1
|
readonly property real _dpr: (dock.screen && dock.screen.devicePixelRatio) ? dock.screen.devicePixelRatio : 1
|
||||||
function px(v) { return Math.round(v * _dpr) / _dpr }
|
function px(v) { return Math.round(v * _dpr) / _dpr }
|
||||||
|
|
||||||
@@ -103,13 +103,13 @@ 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(effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap)
|
return px(effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin)
|
||||||
}
|
}
|
||||||
|
|
||||||
property real animationHeadroom: Math.ceil(SettingsData.dockIconSize * 0.35)
|
property real animationHeadroom: Math.ceil(SettingsData.dockIconSize * 0.35)
|
||||||
|
|
||||||
implicitWidth: isVertical ? (px(effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockIconSize * 0.3) + animationHeadroom) : 0
|
implicitWidth: isVertical ? (px(effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin + SettingsData.dockIconSize * 0.3) + animationHeadroom) : 0
|
||||||
implicitHeight: !isVertical ? (px(effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockIconSize * 0.3) + animationHeadroom) : 0
|
implicitHeight: !isVertical ? (px(effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin + SettingsData.dockIconSize * 0.3) + animationHeadroom) : 0
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: maskItem
|
id: maskItem
|
||||||
@@ -188,7 +188,7 @@ Variants {
|
|||||||
const isBottom = SettingsData.dockPosition === SettingsData.Position.Bottom
|
const isBottom = SettingsData.dockPosition === SettingsData.Position.Bottom
|
||||||
const globalX = buttonGlobalPos.x + dock.hoveredButton.width / 2
|
const globalX = buttonGlobalPos.x + dock.hoveredButton.width / 2
|
||||||
const screenRelativeY = isBottom
|
const screenRelativeY = isBottom
|
||||||
? (screenHeight - dock.effectiveBarHeight - SettingsData.dockSpacing - SettingsData.dockBottomGap - 35)
|
? (screenHeight - dock.effectiveBarHeight - SettingsData.dockSpacing - SettingsData.dockBottomGap - SettingsData.dockMargin - 35)
|
||||||
: (buttonGlobalPos.y - screenY + dock.hoveredButton.height + Theme.spacingS)
|
: (buttonGlobalPos.y - screenY + dock.hoveredButton.height + Theme.spacingS)
|
||||||
dockTooltip.show(tooltipText,
|
dockTooltip.show(tooltipText,
|
||||||
globalX,
|
globalX,
|
||||||
@@ -197,7 +197,7 @@ Variants {
|
|||||||
false, false)
|
false, false)
|
||||||
} else {
|
} else {
|
||||||
const isLeft = SettingsData.dockPosition === SettingsData.Position.Left
|
const isLeft = SettingsData.dockPosition === SettingsData.Position.Left
|
||||||
const tooltipOffset = dock.effectiveBarHeight + SettingsData.dockSpacing + Theme.spacingXS
|
const tooltipOffset = dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockMargin + Theme.spacingXS
|
||||||
const tooltipX = isLeft ? tooltipOffset : (dock.screen.width - tooltipOffset)
|
const tooltipX = isLeft ? tooltipOffset : (dock.screen.width - tooltipOffset)
|
||||||
const screenRelativeY = buttonGlobalPos.y - screenY + dock.hoveredButton.height / 2
|
const screenRelativeY = buttonGlobalPos.y - screenY + dock.hoveredButton.height / 2
|
||||||
dockTooltip.show(tooltipText,
|
dockTooltip.show(tooltipText,
|
||||||
@@ -259,12 +259,12 @@ Variants {
|
|||||||
if (dock.isVertical) {
|
if (dock.isVertical) {
|
||||||
return dock.reveal ? Math.min(dockBackground.implicitHeight + 4, 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(dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap) : 1
|
return dock.reveal ? px(dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin) : 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
width: {
|
width: {
|
||||||
if (dock.isVertical) {
|
if (dock.isVertical) {
|
||||||
return dock.reveal ? px(dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap) : 1
|
return dock.reveal ? px(dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin) : 1
|
||||||
} else {
|
} else {
|
||||||
return dock.reveal ? Math.min(dockBackground.implicitWidth + 4, 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)
|
||||||
}
|
}
|
||||||
@@ -304,7 +304,7 @@ Variants {
|
|||||||
x: {
|
x: {
|
||||||
if (!dock.isVertical) return 0
|
if (!dock.isVertical) return 0
|
||||||
if (dock.reveal) return 0
|
if (dock.reveal) return 0
|
||||||
const hideDistance = dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + 10
|
const hideDistance = dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin + 10
|
||||||
if (SettingsData.dockPosition === SettingsData.Position.Right) {
|
if (SettingsData.dockPosition === SettingsData.Position.Right) {
|
||||||
return hideDistance
|
return hideDistance
|
||||||
} else {
|
} else {
|
||||||
@@ -314,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 = dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + 10
|
const hideDistance = dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin + 10
|
||||||
if (SettingsData.dockPosition === SettingsData.Position.Bottom) {
|
if (SettingsData.dockPosition === SettingsData.Position.Bottom) {
|
||||||
return hideDistance
|
return hideDistance
|
||||||
} else {
|
} else {
|
||||||
@@ -350,10 +350,10 @@ Variants {
|
|||||||
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.Top ? barSpacing + 1 : 0
|
anchors.topMargin: !dock.isVertical && SettingsData.dockPosition === SettingsData.Position.Top ? barSpacing + SettingsData.dockMargin + 1 : 0
|
||||||
anchors.bottomMargin: !dock.isVertical && SettingsData.dockPosition === SettingsData.Position.Bottom ? barSpacing + 1 : 0
|
anchors.bottomMargin: !dock.isVertical && SettingsData.dockPosition === SettingsData.Position.Bottom ? barSpacing + SettingsData.dockMargin + 1 : 0
|
||||||
anchors.leftMargin: dock.isVertical && SettingsData.dockPosition === SettingsData.Position.Left ? barSpacing + 1 : 0
|
anchors.leftMargin: dock.isVertical && SettingsData.dockPosition === SettingsData.Position.Left ? barSpacing + SettingsData.dockMargin + 1 : 0
|
||||||
anchors.rightMargin: dock.isVertical && SettingsData.dockPosition === SettingsData.Position.Right ? barSpacing + 1 : 0
|
anchors.rightMargin: dock.isVertical && SettingsData.dockPosition === SettingsData.Position.Right ? barSpacing + SettingsData.dockMargin + 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)
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ PanelWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const isVertical = SettingsData.dockPosition === SettingsData.Position.Left || SettingsData.dockPosition === SettingsData.Position.Right
|
const isVertical = SettingsData.dockPosition === SettingsData.Position.Left || SettingsData.dockPosition === SettingsData.Position.Right
|
||||||
const dockMargin = 16
|
const dockMargin = SettingsData.dockMargin + 16
|
||||||
let buttonScreenX, buttonScreenY
|
let buttonScreenX, buttonScreenY
|
||||||
|
|
||||||
if (isVertical) {
|
if (isVertical) {
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ Item {
|
|||||||
return "niri GitHub"
|
return "niri GitHub"
|
||||||
}
|
}
|
||||||
|
|
||||||
property string dmsDiscordUrl: "https://discord.gg/vT8Sfjy7sx"
|
property string dmsDiscordUrl: "https://discord.gg/ppWTpKmPgT"
|
||||||
property string dmsDiscordTooltip: "niri/dms Discord"
|
property string dmsDiscordTooltip: "niri/dms Discord"
|
||||||
|
|
||||||
property string compositorDiscordUrl: {
|
property string compositorDiscordUrl: {
|
||||||
|
|||||||
@@ -547,11 +547,38 @@ Item {
|
|||||||
wheelEnabled: false
|
wheelEnabled: false
|
||||||
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||||
onSliderValueChanged: newValue => {
|
onSliderValueChanged: newValue => {
|
||||||
SettingsData.set("dockBottomGap",
|
SettingsData.set("dockBottomGap",
|
||||||
newValue)
|
newValue)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Column {
|
||||||
|
width: parent.width
|
||||||
|
spacing: Theme.spacingS
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: I18n.tr("Margin")
|
||||||
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
|
color: Theme.surfaceText
|
||||||
|
font.weight: Font.Medium
|
||||||
|
}
|
||||||
|
|
||||||
|
DankSlider {
|
||||||
|
width: parent.width
|
||||||
|
height: 24
|
||||||
|
value: SettingsData.dockMargin
|
||||||
|
minimum: 0
|
||||||
|
maximum: 100
|
||||||
|
unit: ""
|
||||||
|
showValue: true
|
||||||
|
wheelEnabled: false
|
||||||
|
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||||
|
onSliderValueChanged: newValue => {
|
||||||
|
SettingsData.set("dockMargin", newValue)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
|
|||||||
@@ -1244,7 +1244,7 @@
|
|||||||
{
|
{
|
||||||
"term": "Dock Transparency",
|
"term": "Dock Transparency",
|
||||||
"context": "Dock Transparency",
|
"context": "Dock Transparency",
|
||||||
"reference": "Modules/Settings/DockTab.qml:596",
|
"reference": "Modules/Settings/DockTab.qml:623",
|
||||||
"comment": ""
|
"comment": ""
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -2081,6 +2081,12 @@
|
|||||||
"reference": "Modules/Settings/DankBarTab.qml:875",
|
"reference": "Modules/Settings/DankBarTab.qml:875",
|
||||||
"comment": ""
|
"comment": ""
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"term": "Margin",
|
||||||
|
"context": "Margin",
|
||||||
|
"reference": "Modules/Settings/DockTab.qml:561",
|
||||||
|
"comment": ""
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"term": "Marker Supply Empty",
|
"term": "Marker Supply Empty",
|
||||||
"context": "Marker Supply Empty",
|
"context": "Marker Supply Empty",
|
||||||
|
|||||||
@@ -1064,6 +1064,9 @@
|
|||||||
"Manual Show/Hide": {
|
"Manual Show/Hide": {
|
||||||
"Manual Show/Hide": "Mostra/Nascondi Manuale"
|
"Manual Show/Hide": "Mostra/Nascondi Manuale"
|
||||||
},
|
},
|
||||||
|
"Margin": {
|
||||||
|
"Margin": ""
|
||||||
|
},
|
||||||
"Marker Supply Empty": {
|
"Marker Supply Empty": {
|
||||||
"Marker Supply Empty": ""
|
"Marker Supply Empty": ""
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1064,6 +1064,9 @@
|
|||||||
"Manual Show/Hide": {
|
"Manual Show/Hide": {
|
||||||
"Manual Show/Hide": "手動で表示/非表示"
|
"Manual Show/Hide": "手動で表示/非表示"
|
||||||
},
|
},
|
||||||
|
"Margin": {
|
||||||
|
"Margin": ""
|
||||||
|
},
|
||||||
"Marker Supply Empty": {
|
"Marker Supply Empty": {
|
||||||
"Marker Supply Empty": "マーカー供給量がない"
|
"Marker Supply Empty": "マーカー供給量がない"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1064,6 +1064,9 @@
|
|||||||
"Manual Show/Hide": {
|
"Manual Show/Hide": {
|
||||||
"Manual Show/Hide": "Mostrar/Esconder Manualmente"
|
"Manual Show/Hide": "Mostrar/Esconder Manualmente"
|
||||||
},
|
},
|
||||||
|
"Margin": {
|
||||||
|
"Margin": ""
|
||||||
|
},
|
||||||
"Marker Supply Empty": {
|
"Marker Supply Empty": {
|
||||||
"Marker Supply Empty": ""
|
"Marker Supply Empty": ""
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1064,6 +1064,9 @@
|
|||||||
"Manual Show/Hide": {
|
"Manual Show/Hide": {
|
||||||
"Manual Show/Hide": "Manuel Göster/Gizle"
|
"Manual Show/Hide": "Manuel Göster/Gizle"
|
||||||
},
|
},
|
||||||
|
"Margin": {
|
||||||
|
"Margin": ""
|
||||||
|
},
|
||||||
"Marker Supply Empty": {
|
"Marker Supply Empty": {
|
||||||
"Marker Supply Empty": "Sarf Malzemesi Boş"
|
"Marker Supply Empty": "Sarf Malzemesi Boş"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1064,6 +1064,9 @@
|
|||||||
"Manual Show/Hide": {
|
"Manual Show/Hide": {
|
||||||
"Manual Show/Hide": "手动显示/隐藏"
|
"Manual Show/Hide": "手动显示/隐藏"
|
||||||
},
|
},
|
||||||
|
"Margin": {
|
||||||
|
"Margin": ""
|
||||||
|
},
|
||||||
"Marker Supply Empty": {
|
"Marker Supply Empty": {
|
||||||
"Marker Supply Empty": "打印耗材已用尽"
|
"Marker Supply Empty": "打印耗材已用尽"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1064,6 +1064,9 @@
|
|||||||
"Manual Show/Hide": {
|
"Manual Show/Hide": {
|
||||||
"Manual Show/Hide": "手動顯示/隱藏"
|
"Manual Show/Hide": "手動顯示/隱藏"
|
||||||
},
|
},
|
||||||
|
"Margin": {
|
||||||
|
"Margin": ""
|
||||||
|
},
|
||||||
"Marker Supply Empty": {
|
"Marker Supply Empty": {
|
||||||
"Marker Supply Empty": ""
|
"Marker Supply Empty": ""
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2428,6 +2428,13 @@
|
|||||||
"reference": "",
|
"reference": "",
|
||||||
"comment": ""
|
"comment": ""
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"term": "Margin",
|
||||||
|
"translation": "",
|
||||||
|
"context": "",
|
||||||
|
"reference": "",
|
||||||
|
"comment": ""
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"term": "Marker Supply Empty",
|
"term": "Marker Supply Empty",
|
||||||
"translation": "",
|
"translation": "",
|
||||||
|
|||||||
Reference in New Issue
Block a user