mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-29 16:02:51 -05:00
dock: add dot indicator style
This commit is contained in:
@@ -202,6 +202,7 @@ Singleton {
|
|||||||
property real dockSpacing: 4
|
property real dockSpacing: 4
|
||||||
property real dockBottomGap: 0
|
property real dockBottomGap: 0
|
||||||
property real dockIconSize: 40
|
property real dockIconSize: 40
|
||||||
|
property string dockIndicatorStyle: "circle"
|
||||||
|
|
||||||
property bool notificationOverlayEnabled: false
|
property bool notificationOverlayEnabled: false
|
||||||
property bool dankBarAutoHide: false
|
property bool dankBarAutoHide: false
|
||||||
@@ -450,6 +451,7 @@ Singleton {
|
|||||||
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
|
dockIconSize = settings.dockIconSize !== undefined ? settings.dockIconSize : 40
|
||||||
|
dockIndicatorStyle = settings.dockIndicatorStyle !== undefined ? settings.dockIndicatorStyle : "circle"
|
||||||
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)
|
||||||
@@ -631,6 +633,7 @@ Singleton {
|
|||||||
"dockSpacing": dockSpacing,
|
"dockSpacing": dockSpacing,
|
||||||
"dockBottomGap": dockBottomGap,
|
"dockBottomGap": dockBottomGap,
|
||||||
"dockIconSize": dockIconSize,
|
"dockIconSize": dockIconSize,
|
||||||
|
"dockIndicatorStyle": dockIndicatorStyle,
|
||||||
"cornerRadius": cornerRadius,
|
"cornerRadius": cornerRadius,
|
||||||
"notificationOverlayEnabled": notificationOverlayEnabled,
|
"notificationOverlayEnabled": notificationOverlayEnabled,
|
||||||
"dankBarAutoHide": dankBarAutoHide,
|
"dankBarAutoHide": dankBarAutoHide,
|
||||||
@@ -724,7 +727,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", "dockIconSize",
|
"dockOpenOnOverview", "dockPosition", "dockSpacing", "dockBottomGap", "dockIconSize", "dockIndicatorStyle",
|
||||||
"cornerRadius", "notificationOverlayEnabled", "dankBarAutoHide",
|
"cornerRadius", "notificationOverlayEnabled", "dankBarAutoHide",
|
||||||
"dankBarOpenOnOverview", "dankBarVisible", "dankBarSpacing", "dankBarBottomGap",
|
"dankBarOpenOnOverview", "dankBarVisible", "dankBarSpacing", "dankBarBottomGap",
|
||||||
"dankBarInnerPadding", "dankBarSquareCorners", "dankBarNoBackground",
|
"dankBarInnerPadding", "dankBarSquareCorners", "dankBarNoBackground",
|
||||||
@@ -1607,6 +1610,11 @@ Singleton {
|
|||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setDockIndicatorStyle(style) {
|
||||||
|
dockIndicatorStyle = style
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
|
||||||
function setNotificationOverlayEnabled(enabled) {
|
function setNotificationOverlayEnabled(enabled) {
|
||||||
notificationOverlayEnabled = enabled
|
notificationOverlayEnabled = enabled
|
||||||
saveSettings()
|
saveSettings()
|
||||||
|
|||||||
@@ -452,10 +452,10 @@ Item {
|
|||||||
anchors.top: SettingsData.dockPosition === SettingsData.Position.Top ? parent.top : undefined
|
anchors.top: SettingsData.dockPosition === SettingsData.Position.Top ? parent.top : undefined
|
||||||
anchors.left: SettingsData.dockPosition === SettingsData.Position.Left ? parent.left : undefined
|
anchors.left: SettingsData.dockPosition === SettingsData.Position.Left ? parent.left : undefined
|
||||||
anchors.right: SettingsData.dockPosition === SettingsData.Position.Right ? parent.right : undefined
|
anchors.right: SettingsData.dockPosition === SettingsData.Position.Right ? parent.right : undefined
|
||||||
anchors.bottomMargin: SettingsData.dockPosition === SettingsData.Position.Bottom ? -2 : 0
|
anchors.bottomMargin: SettingsData.dockPosition === SettingsData.Position.Bottom ? (SettingsData.dockIndicatorStyle === "circle" ? -4 : -2) : 0
|
||||||
anchors.topMargin: SettingsData.dockPosition === SettingsData.Position.Top ? -2 : 0
|
anchors.topMargin: SettingsData.dockPosition === SettingsData.Position.Top ? (SettingsData.dockIndicatorStyle === "circle" ? -4 : -2) : 0
|
||||||
anchors.leftMargin: SettingsData.dockPosition === SettingsData.Position.Left ? -2 : 0
|
anchors.leftMargin: SettingsData.dockPosition === SettingsData.Position.Left ? (SettingsData.dockIndicatorStyle === "circle" ? -4 : -2) : 0
|
||||||
anchors.rightMargin: SettingsData.dockPosition === SettingsData.Position.Right ? -2 : 0
|
anchors.rightMargin: SettingsData.dockPosition === SettingsData.Position.Right ? (SettingsData.dockIndicatorStyle === "circle" ? -4 : -2) : 0
|
||||||
|
|
||||||
sourceComponent: SettingsData.dockPosition === SettingsData.Position.Left || SettingsData.dockPosition === SettingsData.Position.Right ? columnIndicator : rowIndicator
|
sourceComponent: SettingsData.dockPosition === SettingsData.Position.Left || SettingsData.dockPosition === SettingsData.Position.Right ? columnIndicator : rowIndicator
|
||||||
|
|
||||||
@@ -486,9 +486,19 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
width: appData && appData.type === "grouped" && appData.windowCount > 1 ? Math.max(3, actualIconSize * 0.1) : Math.max(6, actualIconSize * 0.2)
|
width: {
|
||||||
height: Math.max(2, actualIconSize * 0.05)
|
if (SettingsData.dockIndicatorStyle === "circle") {
|
||||||
radius: Theme.cornerRadius
|
return Math.max(4, actualIconSize * 0.1)
|
||||||
|
}
|
||||||
|
return appData && appData.type === "grouped" && appData.windowCount > 1 ? Math.max(3, actualIconSize * 0.1) : Math.max(6, actualIconSize * 0.2)
|
||||||
|
}
|
||||||
|
height: {
|
||||||
|
if (SettingsData.dockIndicatorStyle === "circle") {
|
||||||
|
return Math.max(4, actualIconSize * 0.1)
|
||||||
|
}
|
||||||
|
return Math.max(2, actualIconSize * 0.05)
|
||||||
|
}
|
||||||
|
radius: SettingsData.dockIndicatorStyle === "circle" ? width / 2 : Theme.cornerRadius
|
||||||
color: {
|
color: {
|
||||||
if (!appData) {
|
if (!appData) {
|
||||||
return "transparent"
|
return "transparent"
|
||||||
@@ -533,9 +543,19 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
width: Math.max(2, actualIconSize * 0.05)
|
width: {
|
||||||
height: appData && appData.type === "grouped" && appData.windowCount > 1 ? Math.max(3, actualIconSize * 0.1) : Math.max(6, actualIconSize * 0.2)
|
if (SettingsData.dockIndicatorStyle === "circle") {
|
||||||
radius: Theme.cornerRadius
|
return Math.max(4, actualIconSize * 0.1)
|
||||||
|
}
|
||||||
|
return Math.max(2, actualIconSize * 0.05)
|
||||||
|
}
|
||||||
|
height: {
|
||||||
|
if (SettingsData.dockIndicatorStyle === "circle") {
|
||||||
|
return Math.max(4, actualIconSize * 0.1)
|
||||||
|
}
|
||||||
|
return appData && appData.type === "grouped" && appData.windowCount > 1 ? Math.max(3, actualIconSize * 0.1) : Math.max(6, actualIconSize * 0.2)
|
||||||
|
}
|
||||||
|
radius: SettingsData.dockIndicatorStyle === "circle" ? width / 2 : Theme.cornerRadius
|
||||||
color: {
|
color: {
|
||||||
if (!appData) {
|
if (!appData) {
|
||||||
return "transparent"
|
return "transparent"
|
||||||
|
|||||||
@@ -329,6 +329,72 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Indicator Style Section
|
||||||
|
StyledRect {
|
||||||
|
width: parent.width
|
||||||
|
height: indicatorStyleSection.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: indicatorStyleSection
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.margins: Theme.spacingL
|
||||||
|
spacing: Theme.spacingM
|
||||||
|
|
||||||
|
Row {
|
||||||
|
width: parent.width
|
||||||
|
spacing: Theme.spacingM
|
||||||
|
|
||||||
|
DankIcon {
|
||||||
|
name: "fiber_manual_record"
|
||||||
|
size: Theme.iconSize
|
||||||
|
color: Theme.primary
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
id: indicatorStyleText
|
||||||
|
text: I18n.tr("Indicator Style")
|
||||||
|
font.pixelSize: Theme.fontSizeLarge
|
||||||
|
font.weight: Font.Medium
|
||||||
|
color: Theme.surfaceText
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
width: parent.width - Theme.iconSize - Theme.spacingM - indicatorStyleText.width - indicatorStyleButtonGroup.width - Theme.spacingM * 2
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
DankButtonGroup {
|
||||||
|
id: indicatorStyleButtonGroup
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
model: ["Circle", "Line"]
|
||||||
|
currentIndex: SettingsData.dockIndicatorStyle === "circle" ? 0 : 1
|
||||||
|
onSelectionChanged: (index, selected) => {
|
||||||
|
if (selected) {
|
||||||
|
SettingsData.setDockIndicatorStyle(index === 0 ? "circle" : "line")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
NumberAnimation {
|
||||||
|
duration: Theme.mediumDuration
|
||||||
|
easing.type: Theme.emphasizedEasing
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Icon Size Section
|
// Icon Size Section
|
||||||
StyledRect {
|
StyledRect {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|||||||
Reference in New Issue
Block a user