mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 21:42:51 -05:00
feat: Long Live the DankBar > Top/Bottom positioning
This commit is contained in:
@@ -16,8 +16,8 @@ Singleton {
|
|||||||
property string currentThemeName: "blue"
|
property string currentThemeName: "blue"
|
||||||
property string customThemeFile: ""
|
property string customThemeFile: ""
|
||||||
property string matugenScheme: "scheme-tonal-spot"
|
property string matugenScheme: "scheme-tonal-spot"
|
||||||
property real topBarTransparency: 1.0
|
property real dankBarTransparency: 1.0
|
||||||
property real topBarWidgetTransparency: 1.0
|
property real dankBarWidgetTransparency: 1.0
|
||||||
property real popupTransparency: 1.0
|
property real popupTransparency: 1.0
|
||||||
property real dockTransparency: 1
|
property real dockTransparency: 1
|
||||||
property bool use24HourClock: true
|
property bool use24HourClock: true
|
||||||
@@ -70,12 +70,13 @@ Singleton {
|
|||||||
property string clockDateFormat: ""
|
property string clockDateFormat: ""
|
||||||
property string lockDateFormat: ""
|
property string lockDateFormat: ""
|
||||||
property int mediaSize: 1
|
property int mediaSize: 1
|
||||||
property var topBarLeftWidgets: ["launcherButton", "workspaceSwitcher", "focusedWindow"]
|
property var dankBarLeftWidgets: ["launcherButton", "workspaceSwitcher", "focusedWindow"]
|
||||||
property var topBarCenterWidgets: ["music", "clock", "weather"]
|
property var dankBarCenterWidgets: ["music", "clock", "weather"]
|
||||||
property var topBarRightWidgets: ["systemTray", "clipboard", "cpuUsage", "memUsage", "notificationButton", "battery", "controlCenterButton"]
|
property var dankBarRightWidgets: ["systemTray", "clipboard", "cpuUsage", "memUsage", "notificationButton", "battery", "controlCenterButton"]
|
||||||
property alias topBarLeftWidgetsModel: leftWidgetsModel
|
property var dankBarWidgetOrder: []
|
||||||
property alias topBarCenterWidgetsModel: centerWidgetsModel
|
property alias dankBarLeftWidgetsModel: leftWidgetsModel
|
||||||
property alias topBarRightWidgetsModel: rightWidgetsModel
|
property alias dankBarCenterWidgetsModel: centerWidgetsModel
|
||||||
|
property alias dankBarRightWidgetsModel: rightWidgetsModel
|
||||||
property string appLauncherViewMode: "list"
|
property string appLauncherViewMode: "list"
|
||||||
property string spotlightModalViewMode: "list"
|
property string spotlightModalViewMode: "list"
|
||||||
property string networkPreference: "auto"
|
property string networkPreference: "auto"
|
||||||
@@ -119,15 +120,16 @@ Singleton {
|
|||||||
property bool dockGroupByApp: false
|
property bool dockGroupByApp: false
|
||||||
property real cornerRadius: 12
|
property real cornerRadius: 12
|
||||||
property bool notificationOverlayEnabled: false
|
property bool notificationOverlayEnabled: false
|
||||||
property bool topBarAutoHide: false
|
property bool dankBarAutoHide: false
|
||||||
property bool topBarOpenOnOverview: false
|
property bool dankBarOpenOnOverview: false
|
||||||
property bool topBarVisible: true
|
property bool dankBarVisible: true
|
||||||
property real topBarSpacing: 4
|
property real dankBarSpacing: 4
|
||||||
property real topBarBottomGap: 0
|
property real dankBarBottomGap: 0
|
||||||
property real topBarInnerPadding: 8
|
property real dankBarInnerPadding: 4
|
||||||
property bool topBarSquareCorners: false
|
property bool dankBarSquareCorners: false
|
||||||
property bool topBarNoBackground: false
|
property bool dankBarNoBackground: false
|
||||||
property bool topBarGothCornersEnabled: false
|
property bool dankBarGothCornersEnabled: false
|
||||||
|
property bool dankBarAtBottom: false
|
||||||
property bool lockScreenShowPowerActions: true
|
property bool lockScreenShowPowerActions: true
|
||||||
property bool hideBrightnessSlider: false
|
property bool hideBrightnessSlider: false
|
||||||
property string widgetBackgroundColor: "sch"
|
property string widgetBackgroundColor: "sch"
|
||||||
@@ -142,7 +144,7 @@ Singleton {
|
|||||||
readonly property string _configUrl: StandardPaths.writableLocation(StandardPaths.ConfigLocation)
|
readonly property string _configUrl: StandardPaths.writableLocation(StandardPaths.ConfigLocation)
|
||||||
readonly property string _configDir: Paths.strip(_configUrl)
|
readonly property string _configDir: Paths.strip(_configUrl)
|
||||||
|
|
||||||
signal forceTopBarLayoutRefresh
|
signal forceDankBarLayoutRefresh
|
||||||
signal widgetDataChanged
|
signal widgetDataChanged
|
||||||
signal workspaceIconsUpdated
|
signal workspaceIconsUpdated
|
||||||
|
|
||||||
@@ -179,9 +181,9 @@ Singleton {
|
|||||||
centerWidgetsModel.append(dummyItem)
|
centerWidgetsModel.append(dummyItem)
|
||||||
rightWidgetsModel.append(dummyItem)
|
rightWidgetsModel.append(dummyItem)
|
||||||
|
|
||||||
updateListModel(leftWidgetsModel, topBarLeftWidgets)
|
updateListModel(leftWidgetsModel, dankBarLeftWidgets)
|
||||||
updateListModel(centerWidgetsModel, topBarCenterWidgets)
|
updateListModel(centerWidgetsModel, dankBarCenterWidgets)
|
||||||
updateListModel(rightWidgetsModel, topBarRightWidgets)
|
updateListModel(rightWidgetsModel, dankBarRightWidgets)
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadSettings() {
|
function loadSettings() {
|
||||||
@@ -209,8 +211,8 @@ Singleton {
|
|||||||
}
|
}
|
||||||
customThemeFile = settings.customThemeFile !== undefined ? settings.customThemeFile : ""
|
customThemeFile = settings.customThemeFile !== undefined ? settings.customThemeFile : ""
|
||||||
matugenScheme = settings.matugenScheme !== undefined ? settings.matugenScheme : "scheme-tonal-spot"
|
matugenScheme = settings.matugenScheme !== undefined ? settings.matugenScheme : "scheme-tonal-spot"
|
||||||
topBarTransparency = settings.topBarTransparency !== undefined ? (settings.topBarTransparency > 1 ? settings.topBarTransparency / 100 : settings.topBarTransparency) : 1.0
|
dankBarTransparency = settings.dankBarTransparency !== undefined ? (settings.dankBarTransparency > 1 ? settings.dankBarTransparency / 100 : settings.dankBarTransparency) : (settings.topBarTransparency !== undefined ? (settings.topBarTransparency > 1 ? settings.topBarTransparency / 100 : settings.topBarTransparency) : 1.0)
|
||||||
topBarWidgetTransparency = settings.topBarWidgetTransparency !== undefined ? (settings.topBarWidgetTransparency > 1 ? settings.topBarWidgetTransparency / 100 : settings.topBarWidgetTransparency) : 1.0
|
dankBarWidgetTransparency = settings.dankBarWidgetTransparency !== undefined ? (settings.dankBarWidgetTransparency > 1 ? settings.dankBarWidgetTransparency / 100 : settings.dankBarWidgetTransparency) : (settings.topBarWidgetTransparency !== undefined ? (settings.topBarWidgetTransparency > 1 ? settings.topBarWidgetTransparency / 100 : settings.topBarWidgetTransparency) : 1.0)
|
||||||
popupTransparency = settings.popupTransparency !== undefined ? (settings.popupTransparency > 1 ? settings.popupTransparency / 100 : settings.popupTransparency) : 1.0
|
popupTransparency = settings.popupTransparency !== undefined ? (settings.popupTransparency > 1 ? settings.popupTransparency / 100 : settings.popupTransparency) : 1.0
|
||||||
dockTransparency = settings.dockTransparency !== undefined ? (settings.dockTransparency > 1 ? settings.dockTransparency / 100 : settings.dockTransparency) : 1
|
dockTransparency = settings.dockTransparency !== undefined ? (settings.dockTransparency > 1 ? settings.dockTransparency / 100 : settings.dockTransparency) : 1
|
||||||
use24HourClock = settings.use24HourClock !== undefined ? settings.use24HourClock : true
|
use24HourClock = settings.use24HourClock !== undefined ? settings.use24HourClock : true
|
||||||
@@ -264,23 +266,24 @@ Singleton {
|
|||||||
clockDateFormat = settings.clockDateFormat !== undefined ? settings.clockDateFormat : ""
|
clockDateFormat = settings.clockDateFormat !== undefined ? settings.clockDateFormat : ""
|
||||||
lockDateFormat = settings.lockDateFormat !== undefined ? settings.lockDateFormat : ""
|
lockDateFormat = settings.lockDateFormat !== undefined ? settings.lockDateFormat : ""
|
||||||
mediaSize = settings.mediaSize !== undefined ? settings.mediaSize : (settings.mediaCompactMode !== undefined ? (settings.mediaCompactMode ? 0 : 1) : 1)
|
mediaSize = settings.mediaSize !== undefined ? settings.mediaSize : (settings.mediaCompactMode !== undefined ? (settings.mediaCompactMode ? 0 : 1) : 1)
|
||||||
if (settings.topBarWidgetOrder) {
|
if (settings.dankBarWidgetOrder || settings.topBarWidgetOrder) {
|
||||||
topBarLeftWidgets = settings.topBarWidgetOrder.filter(w => {
|
var widgetOrder = settings.dankBarWidgetOrder || settings.topBarWidgetOrder
|
||||||
|
dankBarLeftWidgets = widgetOrder.filter(w => {
|
||||||
return ["launcherButton", "workspaceSwitcher", "focusedWindow"].includes(w)
|
return ["launcherButton", "workspaceSwitcher", "focusedWindow"].includes(w)
|
||||||
})
|
})
|
||||||
topBarCenterWidgets = settings.topBarWidgetOrder.filter(w => {
|
dankBarCenterWidgets = widgetOrder.filter(w => {
|
||||||
return ["clock", "music", "weather"].includes(w)
|
return ["clock", "music", "weather"].includes(w)
|
||||||
})
|
})
|
||||||
topBarRightWidgets = settings.topBarWidgetOrder.filter(w => {
|
dankBarRightWidgets = widgetOrder.filter(w => {
|
||||||
return ["systemTray", "clipboard", "systemResources", "notificationButton", "battery", "controlCenterButton"].includes(w)
|
return ["systemTray", "clipboard", "systemResources", "notificationButton", "battery", "controlCenterButton"].includes(w)
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
var leftWidgets = settings.topBarLeftWidgets !== undefined ? settings.topBarLeftWidgets : ["launcherButton", "workspaceSwitcher", "focusedWindow"]
|
var leftWidgets = settings.dankBarLeftWidgets !== undefined ? settings.dankBarLeftWidgets : (settings.topBarLeftWidgets !== undefined ? settings.topBarLeftWidgets : ["launcherButton", "workspaceSwitcher", "focusedWindow"])
|
||||||
var centerWidgets = settings.topBarCenterWidgets !== undefined ? settings.topBarCenterWidgets : ["music", "clock", "weather"]
|
var centerWidgets = settings.dankBarCenterWidgets !== undefined ? settings.dankBarCenterWidgets : (settings.topBarCenterWidgets !== undefined ? settings.topBarCenterWidgets : ["music", "clock", "weather"])
|
||||||
var rightWidgets = settings.topBarRightWidgets !== undefined ? settings.topBarRightWidgets : ["systemTray", "clipboard", "cpuUsage", "memUsage", "notificationButton", "battery", "controlCenterButton"]
|
var rightWidgets = settings.dankBarRightWidgets !== undefined ? settings.dankBarRightWidgets : (settings.topBarRightWidgets !== undefined ? settings.topBarRightWidgets : ["systemTray", "clipboard", "cpuUsage", "memUsage", "notificationButton", "battery", "controlCenterButton"])
|
||||||
topBarLeftWidgets = leftWidgets
|
dankBarLeftWidgets = leftWidgets
|
||||||
topBarCenterWidgets = centerWidgets
|
dankBarCenterWidgets = centerWidgets
|
||||||
topBarRightWidgets = rightWidgets
|
dankBarRightWidgets = rightWidgets
|
||||||
updateListModel(leftWidgetsModel, leftWidgets)
|
updateListModel(leftWidgetsModel, leftWidgets)
|
||||||
updateListModel(centerWidgetsModel, centerWidgets)
|
updateListModel(centerWidgetsModel, centerWidgets)
|
||||||
updateListModel(rightWidgetsModel, rightWidgets)
|
updateListModel(rightWidgetsModel, rightWidgets)
|
||||||
@@ -310,18 +313,19 @@ Singleton {
|
|||||||
dockGroupByApp = settings.dockGroupByApp !== undefined ? settings.dockGroupByApp : false
|
dockGroupByApp = settings.dockGroupByApp !== undefined ? settings.dockGroupByApp : false
|
||||||
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
|
||||||
topBarAutoHide = settings.topBarAutoHide !== undefined ? settings.topBarAutoHide : false
|
dankBarAutoHide = settings.dankBarAutoHide !== undefined ? settings.dankBarAutoHide : (settings.topBarAutoHide !== undefined ? settings.topBarAutoHide : false)
|
||||||
topBarOpenOnOverview = settings.topBarOpenOnOverview !== undefined ? settings.topBarOpenOnOverview : false
|
dankBarOpenOnOverview = settings.dankBarOpenOnOverview !== undefined ? settings.dankBarOpenOnOverview : (settings.topBarOpenOnOverview !== undefined ? settings.topBarOpenOnOverview : false)
|
||||||
topBarVisible = settings.topBarVisible !== undefined ? settings.topBarVisible : true
|
dankBarVisible = settings.dankBarVisible !== undefined ? settings.dankBarVisible : (settings.topBarVisible !== undefined ? settings.topBarVisible : true)
|
||||||
notificationTimeoutLow = settings.notificationTimeoutLow !== undefined ? settings.notificationTimeoutLow : 5000
|
notificationTimeoutLow = settings.notificationTimeoutLow !== undefined ? settings.notificationTimeoutLow : 5000
|
||||||
notificationTimeoutNormal = settings.notificationTimeoutNormal !== undefined ? settings.notificationTimeoutNormal : 5000
|
notificationTimeoutNormal = settings.notificationTimeoutNormal !== undefined ? settings.notificationTimeoutNormal : 5000
|
||||||
notificationTimeoutCritical = settings.notificationTimeoutCritical !== undefined ? settings.notificationTimeoutCritical : 0
|
notificationTimeoutCritical = settings.notificationTimeoutCritical !== undefined ? settings.notificationTimeoutCritical : 0
|
||||||
topBarSpacing = settings.topBarSpacing !== undefined ? settings.topBarSpacing : 4
|
dankBarSpacing = settings.dankBarSpacing !== undefined ? settings.dankBarSpacing : (settings.topBarSpacing !== undefined ? settings.topBarSpacing : 4)
|
||||||
topBarBottomGap = settings.topBarBottomGap !== undefined ? settings.topBarBottomGap : 0
|
dankBarBottomGap = settings.dankBarBottomGap !== undefined ? settings.dankBarBottomGap : (settings.topBarBottomGap !== undefined ? settings.topBarBottomGap : 0)
|
||||||
topBarInnerPadding = settings.topBarInnerPadding !== undefined ? settings.topBarInnerPadding : 8
|
dankBarInnerPadding = settings.dankBarInnerPadding !== undefined ? settings.dankBarInnerPadding : (settings.topBarInnerPadding !== undefined ? settings.topBarInnerPadding : 4)
|
||||||
topBarSquareCorners = settings.topBarSquareCorners !== undefined ? settings.topBarSquareCorners : false
|
dankBarSquareCorners = settings.dankBarSquareCorners !== undefined ? settings.dankBarSquareCorners : (settings.topBarSquareCorners !== undefined ? settings.topBarSquareCorners : false)
|
||||||
topBarNoBackground = settings.topBarNoBackground !== undefined ? settings.topBarNoBackground : false
|
dankBarNoBackground = settings.dankBarNoBackground !== undefined ? settings.dankBarNoBackground : (settings.topBarNoBackground !== undefined ? settings.topBarNoBackground : false)
|
||||||
topBarGothCornersEnabled = settings.topBarGothCornersEnabled !== undefined ? settings.topBarGothCornersEnabled : false
|
dankBarGothCornersEnabled = settings.dankBarGothCornersEnabled !== undefined ? settings.dankBarGothCornersEnabled : (settings.topBarGothCornersEnabled !== undefined ? settings.topBarGothCornersEnabled : false)
|
||||||
|
dankBarAtBottom = settings.dankBarAtBottom !== undefined ? settings.dankBarAtBottom : (settings.topBarAtBottom !== undefined ? settings.topBarAtBottom : false)
|
||||||
lockScreenShowPowerActions = settings.lockScreenShowPowerActions !== undefined ? settings.lockScreenShowPowerActions : true
|
lockScreenShowPowerActions = settings.lockScreenShowPowerActions !== undefined ? settings.lockScreenShowPowerActions : true
|
||||||
hideBrightnessSlider = settings.hideBrightnessSlider !== undefined ? settings.hideBrightnessSlider : false
|
hideBrightnessSlider = settings.hideBrightnessSlider !== undefined ? settings.hideBrightnessSlider : false
|
||||||
widgetBackgroundColor = settings.widgetBackgroundColor !== undefined ? settings.widgetBackgroundColor : "sch"
|
widgetBackgroundColor = settings.widgetBackgroundColor !== undefined ? settings.widgetBackgroundColor : "sch"
|
||||||
@@ -349,8 +353,8 @@ Singleton {
|
|||||||
"currentThemeName": currentThemeName,
|
"currentThemeName": currentThemeName,
|
||||||
"customThemeFile": customThemeFile,
|
"customThemeFile": customThemeFile,
|
||||||
"matugenScheme": matugenScheme,
|
"matugenScheme": matugenScheme,
|
||||||
"topBarTransparency": topBarTransparency,
|
"dankBarTransparency": dankBarTransparency,
|
||||||
"topBarWidgetTransparency": topBarWidgetTransparency,
|
"dankBarWidgetTransparency": dankBarWidgetTransparency,
|
||||||
"popupTransparency": popupTransparency,
|
"popupTransparency": popupTransparency,
|
||||||
"dockTransparency": dockTransparency,
|
"dockTransparency": dockTransparency,
|
||||||
"use24HourClock": use24HourClock,
|
"use24HourClock": use24HourClock,
|
||||||
@@ -395,9 +399,9 @@ Singleton {
|
|||||||
"clockDateFormat": clockDateFormat,
|
"clockDateFormat": clockDateFormat,
|
||||||
"lockDateFormat": lockDateFormat,
|
"lockDateFormat": lockDateFormat,
|
||||||
"mediaSize": mediaSize,
|
"mediaSize": mediaSize,
|
||||||
"topBarLeftWidgets": topBarLeftWidgets,
|
"dankBarLeftWidgets": dankBarLeftWidgets,
|
||||||
"topBarCenterWidgets": topBarCenterWidgets,
|
"dankBarCenterWidgets": dankBarCenterWidgets,
|
||||||
"topBarRightWidgets": topBarRightWidgets,
|
"dankBarRightWidgets": dankBarRightWidgets,
|
||||||
"appLauncherViewMode": appLauncherViewMode,
|
"appLauncherViewMode": appLauncherViewMode,
|
||||||
"spotlightModalViewMode": spotlightModalViewMode,
|
"spotlightModalViewMode": spotlightModalViewMode,
|
||||||
"networkPreference": networkPreference,
|
"networkPreference": networkPreference,
|
||||||
@@ -423,15 +427,16 @@ Singleton {
|
|||||||
"dockGroupByApp": dockGroupByApp,
|
"dockGroupByApp": dockGroupByApp,
|
||||||
"cornerRadius": cornerRadius,
|
"cornerRadius": cornerRadius,
|
||||||
"notificationOverlayEnabled": notificationOverlayEnabled,
|
"notificationOverlayEnabled": notificationOverlayEnabled,
|
||||||
"topBarAutoHide": topBarAutoHide,
|
"dankBarAutoHide": dankBarAutoHide,
|
||||||
"topBarOpenOnOverview": topBarOpenOnOverview,
|
"dankBarOpenOnOverview": dankBarOpenOnOverview,
|
||||||
"topBarVisible": topBarVisible,
|
"dankBarVisible": dankBarVisible,
|
||||||
"topBarSpacing": topBarSpacing,
|
"dankBarSpacing": dankBarSpacing,
|
||||||
"topBarBottomGap": topBarBottomGap,
|
"dankBarBottomGap": dankBarBottomGap,
|
||||||
"topBarInnerPadding": topBarInnerPadding,
|
"dankBarInnerPadding": dankBarInnerPadding,
|
||||||
"topBarSquareCorners": topBarSquareCorners,
|
"dankBarSquareCorners": dankBarSquareCorners,
|
||||||
"topBarNoBackground": topBarNoBackground,
|
"dankBarNoBackground": dankBarNoBackground,
|
||||||
"topBarGothCornersEnabled": topBarGothCornersEnabled,
|
"dankBarGothCornersEnabled": dankBarGothCornersEnabled,
|
||||||
|
"dankBarAtBottom": dankBarAtBottom,
|
||||||
"lockScreenShowPowerActions": lockScreenShowPowerActions,
|
"lockScreenShowPowerActions": lockScreenShowPowerActions,
|
||||||
"hideBrightnessSlider": hideBrightnessSlider,
|
"hideBrightnessSlider": hideBrightnessSlider,
|
||||||
"widgetBackgroundColor": widgetBackgroundColor,
|
"widgetBackgroundColor": widgetBackgroundColor,
|
||||||
@@ -586,13 +591,13 @@ Singleton {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setTopBarTransparency(transparency) {
|
function setDankBarTransparency(transparency) {
|
||||||
topBarTransparency = transparency
|
dankBarTransparency = transparency
|
||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
function setTopBarWidgetTransparency(transparency) {
|
function setDankBarWidgetTransparency(transparency) {
|
||||||
topBarWidgetTransparency = transparency
|
dankBarWidgetTransparency = transparency
|
||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -727,25 +732,25 @@ Singleton {
|
|||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
function setTopBarWidgetOrder(order) {
|
function setDankBarWidgetOrder(order) {
|
||||||
topBarWidgetOrder = order
|
dankBarWidgetOrder = order
|
||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
function setTopBarLeftWidgets(order) {
|
function setDankBarLeftWidgets(order) {
|
||||||
topBarLeftWidgets = order
|
dankBarLeftWidgets = order
|
||||||
updateListModel(leftWidgetsModel, order)
|
updateListModel(leftWidgetsModel, order)
|
||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
function setTopBarCenterWidgets(order) {
|
function setDankBarCenterWidgets(order) {
|
||||||
topBarCenterWidgets = order
|
dankBarCenterWidgets = order
|
||||||
updateListModel(centerWidgetsModel, order)
|
updateListModel(centerWidgetsModel, order)
|
||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
function setTopBarRightWidgets(order) {
|
function setDankBarRightWidgets(order) {
|
||||||
topBarRightWidgets = order
|
dankBarRightWidgets = order
|
||||||
updateListModel(rightWidgetsModel, order)
|
updateListModel(rightWidgetsModel, order)
|
||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
@@ -778,13 +783,13 @@ Singleton {
|
|||||||
widgetDataChanged()
|
widgetDataChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
function resetTopBarWidgetsToDefault() {
|
function resetDankBarWidgetsToDefault() {
|
||||||
var defaultLeft = ["launcherButton", "workspaceSwitcher", "focusedWindow"]
|
var defaultLeft = ["launcherButton", "workspaceSwitcher", "focusedWindow"]
|
||||||
var defaultCenter = ["music", "clock", "weather"]
|
var defaultCenter = ["music", "clock", "weather"]
|
||||||
var defaultRight = ["systemTray", "clipboard", "notificationButton", "battery", "controlCenterButton"]
|
var defaultRight = ["systemTray", "clipboard", "notificationButton", "battery", "controlCenterButton"]
|
||||||
topBarLeftWidgets = defaultLeft
|
dankBarLeftWidgets = defaultLeft
|
||||||
topBarCenterWidgets = defaultCenter
|
dankBarCenterWidgets = defaultCenter
|
||||||
topBarRightWidgets = defaultRight
|
dankBarRightWidgets = defaultRight
|
||||||
updateListModel(leftWidgetsModel, defaultLeft)
|
updateListModel(leftWidgetsModel, defaultLeft)
|
||||||
updateListModel(centerWidgetsModel, defaultCenter)
|
updateListModel(centerWidgetsModel, defaultCenter)
|
||||||
updateListModel(rightWidgetsModel, defaultRight)
|
updateListModel(rightWidgetsModel, defaultRight)
|
||||||
@@ -951,6 +956,9 @@ Singleton {
|
|||||||
|
|
||||||
function setShowDock(enabled) {
|
function setShowDock(enabled) {
|
||||||
showDock = enabled
|
showDock = enabled
|
||||||
|
if (enabled && dankBarAtBottom) {
|
||||||
|
setDankBarAtBottom(false)
|
||||||
|
}
|
||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -974,23 +982,23 @@ Singleton {
|
|||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
function setTopBarAutoHide(enabled) {
|
function setDankBarAutoHide(enabled) {
|
||||||
topBarAutoHide = enabled
|
dankBarAutoHide = enabled
|
||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
function setTopBarOpenOnOverview(enabled) {
|
function setDankBarOpenOnOverview(enabled) {
|
||||||
topBarOpenOnOverview = enabled
|
dankBarOpenOnOverview = enabled
|
||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
function setTopBarVisible(visible) {
|
function setDankBarVisible(visible) {
|
||||||
topBarVisible = visible
|
dankBarVisible = visible
|
||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleTopBarVisible() {
|
function toggleDankBarVisible() {
|
||||||
topBarVisible = !topBarVisible
|
dankBarVisible = !dankBarVisible
|
||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1009,36 +1017,48 @@ Singleton {
|
|||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
function setTopBarSpacing(spacing) {
|
function setDankBarSpacing(spacing) {
|
||||||
topBarSpacing = spacing
|
dankBarSpacing = spacing
|
||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
function setTopBarBottomGap(gap) {
|
function setDankBarBottomGap(gap) {
|
||||||
topBarBottomGap = gap
|
dankBarBottomGap = gap
|
||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
function setTopBarInnerPadding(padding) {
|
function setDankBarInnerPadding(padding) {
|
||||||
topBarInnerPadding = padding
|
dankBarInnerPadding = padding
|
||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
function setTopBarSquareCorners(enabled) {
|
function setDankBarSquareCorners(enabled) {
|
||||||
topBarSquareCorners = enabled
|
dankBarSquareCorners = enabled
|
||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
function setTopBarNoBackground(enabled) {
|
function setDankBarNoBackground(enabled) {
|
||||||
topBarNoBackground = enabled
|
dankBarNoBackground = enabled
|
||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
function setTopBarGothCornersEnabled(enabled) {
|
function setDankBarGothCornersEnabled(enabled) {
|
||||||
topBarGothCornersEnabled = enabled
|
dankBarGothCornersEnabled = enabled
|
||||||
saveSettings()
|
saveSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setDankBarAtBottom(enabled) {
|
||||||
|
dankBarAtBottom = enabled
|
||||||
|
if (enabled && showDock) {
|
||||||
|
setShowDock(false)
|
||||||
|
}
|
||||||
|
saveSettings()
|
||||||
|
}
|
||||||
|
|
||||||
|
function getPopupYPosition(barHeight) {
|
||||||
|
return barHeight + dankBarSpacing + dankBarBottomGap - 2 + Theme.popupDistance
|
||||||
|
}
|
||||||
|
|
||||||
function setLockScreenShowPowerActions(enabled) {
|
function setLockScreenShowPowerActions(enabled) {
|
||||||
lockScreenShowPowerActions = enabled
|
lockScreenShowPowerActions = enabled
|
||||||
saveSettings()
|
saveSettings()
|
||||||
@@ -1221,22 +1241,22 @@ Singleton {
|
|||||||
|
|
||||||
IpcHandler {
|
IpcHandler {
|
||||||
function reveal(): string {
|
function reveal(): string {
|
||||||
root.setTopBarVisible(true)
|
root.setDankBarVisible(true)
|
||||||
return "BAR_SHOW_SUCCESS"
|
return "BAR_SHOW_SUCCESS"
|
||||||
}
|
}
|
||||||
|
|
||||||
function hide(): string {
|
function hide(): string {
|
||||||
root.setTopBarVisible(false)
|
root.setDankBarVisible(false)
|
||||||
return "BAR_HIDE_SUCCESS"
|
return "BAR_HIDE_SUCCESS"
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggle(): string {
|
function toggle(): string {
|
||||||
root.toggleTopBarVisible()
|
root.toggleDankBarVisible()
|
||||||
return topBarVisible ? "BAR_SHOW_SUCCESS" : "BAR_HIDE_SUCCESS"
|
return root.dankBarVisible ? "BAR_SHOW_SUCCESS" : "BAR_HIDE_SUCCESS"
|
||||||
}
|
}
|
||||||
|
|
||||||
function status(): string {
|
function status(): string {
|
||||||
return topBarVisible ? "visible" : "hidden"
|
return root.dankBarVisible ? "visible" : "hidden"
|
||||||
}
|
}
|
||||||
|
|
||||||
target: "bar"
|
target: "bar"
|
||||||
|
|||||||
@@ -258,7 +258,7 @@ Singleton {
|
|||||||
property real iconSizeLarge: 32
|
property real iconSizeLarge: 32
|
||||||
|
|
||||||
property real panelTransparency: 0.85
|
property real panelTransparency: 0.85
|
||||||
property real widgetTransparency: typeof SettingsData !== "undefined" && SettingsData.topBarWidgetTransparency !== undefined ? SettingsData.topBarWidgetTransparency : 1.0
|
property real widgetTransparency: typeof SettingsData !== "undefined" && SettingsData.dankBarWidgetTransparency !== undefined ? SettingsData.dankBarWidgetTransparency : 1.0
|
||||||
property real popupTransparency: typeof SettingsData !== "undefined" && SettingsData.popupTransparency !== undefined ? SettingsData.popupTransparency : 1.0
|
property real popupTransparency: typeof SettingsData !== "undefined" && SettingsData.popupTransparency !== undefined ? SettingsData.popupTransparency : 1.0
|
||||||
|
|
||||||
function screenTransition() {
|
function screenTransition() {
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ Item {
|
|||||||
visible: active
|
visible: active
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
|
|
||||||
sourceComponent: TopBarTab {
|
sourceComponent: DankBarTab {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ Rectangle {
|
|||||||
"text": "Weather",
|
"text": "Weather",
|
||||||
"icon": "cloud"
|
"icon": "cloud"
|
||||||
}, {
|
}, {
|
||||||
"text": "Top Bar",
|
"text": "Dank Bar",
|
||||||
"icon": "toolbar"
|
"icon": "toolbar"
|
||||||
}, {
|
}, {
|
||||||
"text": "Widgets",
|
"text": "Widgets",
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ DankPopout {
|
|||||||
popupWidth: 520
|
popupWidth: 520
|
||||||
popupHeight: 600
|
popupHeight: 600
|
||||||
triggerX: Theme.spacingL
|
triggerX: Theme.spacingL
|
||||||
triggerY: Math.max(26 + SettingsData.topBarInnerPadding + 4, Theme.barHeight - 4 - (8 - SettingsData.topBarInnerPadding)) + SettingsData.topBarSpacing + SettingsData.topBarBottomGap - 2 + Theme.popupDistance
|
triggerY: Math.max(26 + SettingsData.dankBarInnerPadding + 4, Theme.barHeight - 4 - (8 - SettingsData.dankBarInnerPadding)) + SettingsData.dankBarSpacing + SettingsData.dankBarBottomGap - 2 + Theme.popupDistance
|
||||||
triggerWidth: 40
|
triggerWidth: 40
|
||||||
positioning: "center"
|
positioning: "center"
|
||||||
screen: triggerScreen
|
screen: triggerScreen
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import qs.Common
|
|||||||
import qs.Modules.ControlCenter
|
import qs.Modules.ControlCenter
|
||||||
import qs.Modules.ControlCenter.Widgets
|
import qs.Modules.ControlCenter.Widgets
|
||||||
import qs.Modules.ControlCenter.Details
|
import qs.Modules.ControlCenter.Details
|
||||||
import qs.Modules.TopBar
|
import qs.Modules.DankBar
|
||||||
import qs.Services
|
import qs.Services
|
||||||
import qs.Widgets
|
import qs.Widgets
|
||||||
import qs.Modules.ControlCenter.Components
|
import qs.Modules.ControlCenter.Components
|
||||||
@@ -66,7 +66,7 @@ DankPopout {
|
|||||||
popupWidth: 550
|
popupWidth: 550
|
||||||
popupHeight: Math.min((triggerScreen?.height ?? 1080) - 100, contentLoader.item && contentLoader.item.implicitHeight > 0 ? contentLoader.item.implicitHeight + 20 : 400)
|
popupHeight: Math.min((triggerScreen?.height ?? 1080) - 100, contentLoader.item && contentLoader.item.implicitHeight > 0 ? contentLoader.item.implicitHeight + 20 : 400)
|
||||||
triggerX: (triggerScreen?.width ?? 1920) - 600 - Theme.spacingL
|
triggerX: (triggerScreen?.width ?? 1920) - 600 - Theme.spacingL
|
||||||
triggerY: Theme.barHeight - 4 + SettingsData.topBarSpacing + Theme.popupDistance
|
triggerY: Theme.barHeight - 4 + SettingsData.dankBarSpacing + Theme.popupDistance
|
||||||
triggerWidth: 80
|
triggerWidth: 80
|
||||||
positioning: "center"
|
positioning: "center"
|
||||||
screen: triggerScreen
|
screen: triggerScreen
|
||||||
|
|||||||
@@ -13,15 +13,15 @@ Rectangle {
|
|||||||
property var parentScreen: null
|
property var parentScreen: null
|
||||||
property real widgetHeight: 30
|
property real widgetHeight: 30
|
||||||
property real barHeight: 48
|
property real barHeight: 48
|
||||||
readonly property real horizontalPadding: SettingsData.topBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
|
readonly property real horizontalPadding: SettingsData.dankBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
|
||||||
|
|
||||||
signal toggleBatteryPopup()
|
signal toggleBatteryPopup()
|
||||||
|
|
||||||
width: batteryContent.implicitWidth + horizontalPadding * 2
|
width: batteryContent.implicitWidth + horizontalPadding * 2
|
||||||
height: widgetHeight
|
height: widgetHeight
|
||||||
radius: SettingsData.topBarNoBackground ? 0 : Theme.cornerRadius
|
radius: SettingsData.dankBarNoBackground ? 0 : Theme.cornerRadius
|
||||||
color: {
|
color: {
|
||||||
if (SettingsData.topBarNoBackground) {
|
if (SettingsData.dankBarNoBackground) {
|
||||||
return "transparent";
|
return "transparent";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ Rectangle {
|
|||||||
id: batteryContent
|
id: batteryContent
|
||||||
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
spacing: SettingsData.topBarNoBackground ? 1 : 2
|
spacing: SettingsData.dankBarNoBackground ? 1 : 2
|
||||||
|
|
||||||
DankIcon {
|
DankIcon {
|
||||||
name: BatteryService.getBatteryIcon()
|
name: BatteryService.getBatteryIcon()
|
||||||
@@ -80,7 +80,7 @@ Rectangle {
|
|||||||
const currentScreen = parentScreen || Screen;
|
const currentScreen = parentScreen || Screen;
|
||||||
const screenX = currentScreen.x || 0;
|
const screenX = currentScreen.x || 0;
|
||||||
const relativeX = globalPos.x - screenX;
|
const relativeX = globalPos.x - screenX;
|
||||||
popupTarget.setTriggerPosition(relativeX, barHeight + SettingsData.topBarSpacing + SettingsData.topBarBottomGap - 2 + Theme.popupDistance, width, section, currentScreen);
|
popupTarget.setTriggerPosition(relativeX, SettingsData.getPopupYPosition(barHeight), width, section, currentScreen);
|
||||||
}
|
}
|
||||||
toggleBatteryPopup();
|
toggleBatteryPopup();
|
||||||
}
|
}
|
||||||
@@ -45,7 +45,7 @@ DankPopout {
|
|||||||
popupWidth: 400
|
popupWidth: 400
|
||||||
popupHeight: contentLoader.item ? contentLoader.item.implicitHeight : 400
|
popupHeight: contentLoader.item ? contentLoader.item.implicitHeight : 400
|
||||||
triggerX: Screen.width - 380 - Theme.spacingL
|
triggerX: Screen.width - 380 - Theme.spacingL
|
||||||
triggerY: Theme.barHeight - 4 + SettingsData.topBarSpacing + Theme.popupDistance
|
triggerY: Theme.barHeight - 4 + SettingsData.dankBarSpacing + Theme.popupDistance
|
||||||
triggerWidth: 70
|
triggerWidth: 70
|
||||||
positioning: "center"
|
positioning: "center"
|
||||||
screen: triggerScreen
|
screen: triggerScreen
|
||||||
@@ -12,15 +12,15 @@ Rectangle {
|
|||||||
property var parentScreen: null
|
property var parentScreen: null
|
||||||
property real barHeight: 48
|
property real barHeight: 48
|
||||||
property real widgetHeight: 30
|
property real widgetHeight: 30
|
||||||
readonly property real horizontalPadding: SettingsData.topBarNoBackground ? 2 : Theme.spacingS
|
readonly property real horizontalPadding: SettingsData.dankBarNoBackground ? 2 : Theme.spacingS
|
||||||
|
|
||||||
signal clockClicked
|
signal clockClicked
|
||||||
|
|
||||||
width: clockRow.implicitWidth + horizontalPadding * 2
|
width: clockRow.implicitWidth + horizontalPadding * 2
|
||||||
height: widgetHeight
|
height: widgetHeight
|
||||||
radius: SettingsData.topBarNoBackground ? 0 : Theme.cornerRadius
|
radius: SettingsData.dankBarNoBackground ? 0 : Theme.cornerRadius
|
||||||
color: {
|
color: {
|
||||||
if (SettingsData.topBarNoBackground) {
|
if (SettingsData.dankBarNoBackground) {
|
||||||
return "transparent";
|
return "transparent";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ Rectangle {
|
|||||||
const currentScreen = parentScreen || Screen
|
const currentScreen = parentScreen || Screen
|
||||||
const screenX = currentScreen.x || 0
|
const screenX = currentScreen.x || 0
|
||||||
const relativeX = globalPos.x - screenX
|
const relativeX = globalPos.x - screenX
|
||||||
popupTarget.setTriggerPosition(relativeX, barHeight + SettingsData.topBarSpacing + SettingsData.topBarBottomGap - 2 + Theme.popupDistance, width, section, currentScreen)
|
popupTarget.setTriggerPosition(relativeX, SettingsData.getPopupYPosition(barHeight), width, section, currentScreen)
|
||||||
}
|
}
|
||||||
root.clockClicked()
|
root.clockClicked()
|
||||||
}
|
}
|
||||||
@@ -11,15 +11,15 @@ Rectangle {
|
|||||||
property var parentScreen: null
|
property var parentScreen: null
|
||||||
property real widgetHeight: 30
|
property real widgetHeight: 30
|
||||||
property real barHeight: 48
|
property real barHeight: 48
|
||||||
readonly property real horizontalPadding: SettingsData.topBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
|
readonly property real horizontalPadding: SettingsData.dankBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
|
||||||
|
|
||||||
signal clicked()
|
signal clicked()
|
||||||
|
|
||||||
width: colorPickerIcon.width + horizontalPadding * 2
|
width: colorPickerIcon.width + horizontalPadding * 2
|
||||||
height: widgetHeight
|
height: widgetHeight
|
||||||
radius: SettingsData.topBarNoBackground ? 0 : Theme.cornerRadius
|
radius: SettingsData.dankBarNoBackground ? 0 : Theme.cornerRadius
|
||||||
color: {
|
color: {
|
||||||
if (SettingsData.topBarNoBackground) {
|
if (SettingsData.dankBarNoBackground) {
|
||||||
return "transparent";
|
return "transparent";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -16,15 +16,15 @@ Rectangle {
|
|||||||
property bool showAudioIcon: SettingsData.controlCenterShowAudioIcon
|
property bool showAudioIcon: SettingsData.controlCenterShowAudioIcon
|
||||||
property real widgetHeight: 30
|
property real widgetHeight: 30
|
||||||
property real barHeight: 48
|
property real barHeight: 48
|
||||||
readonly property real horizontalPadding: SettingsData.topBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
|
readonly property real horizontalPadding: SettingsData.dankBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
|
||||||
|
|
||||||
signal clicked()
|
signal clicked()
|
||||||
|
|
||||||
width: controlIndicators.implicitWidth + horizontalPadding * 2
|
width: controlIndicators.implicitWidth + horizontalPadding * 2
|
||||||
height: widgetHeight
|
height: widgetHeight
|
||||||
radius: SettingsData.topBarNoBackground ? 0 : Theme.cornerRadius
|
radius: SettingsData.dankBarNoBackground ? 0 : Theme.cornerRadius
|
||||||
color: {
|
color: {
|
||||||
if (SettingsData.topBarNoBackground) {
|
if (SettingsData.dankBarNoBackground) {
|
||||||
return "transparent";
|
return "transparent";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -160,7 +160,7 @@ Rectangle {
|
|||||||
const currentScreen = parentScreen || Screen;
|
const currentScreen = parentScreen || Screen;
|
||||||
const screenX = currentScreen.x || 0;
|
const screenX = currentScreen.x || 0;
|
||||||
const relativeX = globalPos.x - screenX;
|
const relativeX = globalPos.x - screenX;
|
||||||
popupTarget.setTriggerPosition(relativeX, barHeight + SettingsData.topBarSpacing + SettingsData.topBarBottomGap - 2 + Theme.popupDistance, width, section, currentScreen);
|
popupTarget.setTriggerPosition(relativeX, SettingsData.getPopupYPosition(barHeight), width, section, currentScreen);
|
||||||
}
|
}
|
||||||
root.clicked();
|
root.clicked();
|
||||||
}
|
}
|
||||||
@@ -15,13 +15,13 @@ Rectangle {
|
|||||||
property var parentScreen: null
|
property var parentScreen: null
|
||||||
property real barHeight: 48
|
property real barHeight: 48
|
||||||
property real widgetHeight: 30
|
property real widgetHeight: 30
|
||||||
readonly property real horizontalPadding: SettingsData.topBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
|
readonly property real horizontalPadding: SettingsData.dankBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
|
||||||
|
|
||||||
width: cpuContent.implicitWidth + horizontalPadding * 2
|
width: cpuContent.implicitWidth + horizontalPadding * 2
|
||||||
height: widgetHeight
|
height: widgetHeight
|
||||||
radius: SettingsData.topBarNoBackground ? 0 : Theme.cornerRadius
|
radius: SettingsData.dankBarNoBackground ? 0 : Theme.cornerRadius
|
||||||
color: {
|
color: {
|
||||||
if (SettingsData.topBarNoBackground) {
|
if (SettingsData.dankBarNoBackground) {
|
||||||
return "transparent";
|
return "transparent";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ Rectangle {
|
|||||||
const currentScreen = parentScreen || Screen;
|
const currentScreen = parentScreen || Screen;
|
||||||
const screenX = currentScreen.x || 0;
|
const screenX = currentScreen.x || 0;
|
||||||
const relativeX = globalPos.x - screenX;
|
const relativeX = globalPos.x - screenX;
|
||||||
popupTarget.setTriggerPosition(relativeX, barHeight + SettingsData.topBarSpacing + SettingsData.topBarBottomGap - 2 + Theme.popupDistance, width, section, currentScreen);
|
popupTarget.setTriggerPosition(relativeX, SettingsData.getPopupYPosition(barHeight), width, section, currentScreen);
|
||||||
}
|
}
|
||||||
DgopService.setSortBy("cpu");
|
DgopService.setSortBy("cpu");
|
||||||
if (root.toggleProcessList) {
|
if (root.toggleProcessList) {
|
||||||
@@ -15,13 +15,13 @@ Rectangle {
|
|||||||
property var parentScreen: null
|
property var parentScreen: null
|
||||||
property real barHeight: 48
|
property real barHeight: 48
|
||||||
property real widgetHeight: 30
|
property real widgetHeight: 30
|
||||||
readonly property real horizontalPadding: SettingsData.topBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
|
readonly property real horizontalPadding: SettingsData.dankBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
|
||||||
|
|
||||||
width: cpuTempContent.implicitWidth + horizontalPadding * 2
|
width: cpuTempContent.implicitWidth + horizontalPadding * 2
|
||||||
height: widgetHeight
|
height: widgetHeight
|
||||||
radius: SettingsData.topBarNoBackground ? 0 : Theme.cornerRadius
|
radius: SettingsData.dankBarNoBackground ? 0 : Theme.cornerRadius
|
||||||
color: {
|
color: {
|
||||||
if (SettingsData.topBarNoBackground) {
|
if (SettingsData.dankBarNoBackground) {
|
||||||
return "transparent";
|
return "transparent";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ Rectangle {
|
|||||||
const currentScreen = parentScreen || Screen;
|
const currentScreen = parentScreen || Screen;
|
||||||
const screenX = currentScreen.x || 0;
|
const screenX = currentScreen.x || 0;
|
||||||
const relativeX = globalPos.x - screenX;
|
const relativeX = globalPos.x - screenX;
|
||||||
popupTarget.setTriggerPosition(relativeX, barHeight + SettingsData.topBarSpacing + SettingsData.topBarBottomGap - 2 + Theme.popupDistance, width, section, currentScreen);
|
popupTarget.setTriggerPosition(relativeX, SettingsData.getPopupYPosition(barHeight), width, section, currentScreen);
|
||||||
}
|
}
|
||||||
DgopService.setSortBy("cpu");
|
DgopService.setSortBy("cpu");
|
||||||
if (root.toggleProcessList) {
|
if (root.toggleProcessList) {
|
||||||
@@ -11,7 +11,7 @@ import Quickshell.Wayland
|
|||||||
import Quickshell.Widgets
|
import Quickshell.Widgets
|
||||||
import qs.Common
|
import qs.Common
|
||||||
import qs.Modules
|
import qs.Modules
|
||||||
import qs.Modules.TopBar
|
import qs.Modules.DankBar
|
||||||
import qs.Services
|
import qs.Services
|
||||||
import qs.Widgets
|
import qs.Widgets
|
||||||
|
|
||||||
@@ -23,10 +23,12 @@ PanelWindow {
|
|||||||
property var modelData
|
property var modelData
|
||||||
property var notepadVariants: null
|
property var notepadVariants: null
|
||||||
|
|
||||||
property bool gothCornersEnabled: SettingsData.topBarGothCornersEnabled
|
property bool gothCornersEnabled: SettingsData.dankBarGothCornersEnabled
|
||||||
property real wingtipsRadius: Theme.cornerRadius
|
property real wingtipsRadius: Theme.cornerRadius
|
||||||
readonly property real _wingR: Math.max(0, wingtipsRadius)
|
readonly property real _wingR: Math.max(0, wingtipsRadius)
|
||||||
readonly property color _bgColor: Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g, Theme.surfaceContainer.b, topBarCore.backgroundTransparency)
|
readonly property color _bgColor: Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g, Theme.surfaceContainer.b, topBarCore?.backgroundTransparency ?? SettingsData.dankBarTransparency)
|
||||||
|
readonly property real _dpr: (root.screen && root.screen.devicePixelRatio) ? root.screen.devicePixelRatio : 1
|
||||||
|
function px(v) { return Math.round(v * _dpr) / _dpr }
|
||||||
|
|
||||||
signal colorPickerRequested()
|
signal colorPickerRequested()
|
||||||
|
|
||||||
@@ -43,11 +45,11 @@ PanelWindow {
|
|||||||
}
|
}
|
||||||
property string screenName: modelData.name
|
property string screenName: modelData.name
|
||||||
readonly property int notificationCount: NotificationService.notifications.length
|
readonly property int notificationCount: NotificationService.notifications.length
|
||||||
readonly property real effectiveBarHeight: Math.max(root.widgetHeight + SettingsData.topBarInnerPadding + 4, Theme.barHeight - 4 - (8 - SettingsData.topBarInnerPadding))
|
readonly property real effectiveBarHeight: Math.max(root.widgetHeight + SettingsData.dankBarInnerPadding + 4, Theme.barHeight - 4 - (8 - SettingsData.dankBarInnerPadding))
|
||||||
readonly property real widgetHeight: Math.max(20, 26 + SettingsData.topBarInnerPadding * 0.6)
|
readonly property real widgetHeight: Math.max(20, 26 + SettingsData.dankBarInnerPadding * 0.6)
|
||||||
|
|
||||||
screen: modelData
|
screen: modelData
|
||||||
implicitHeight: effectiveBarHeight + SettingsData.topBarSpacing + (SettingsData.topBarGothCornersEnabled ? _wingR : 0)
|
implicitHeight: px(effectiveBarHeight + SettingsData.dankBarSpacing + (SettingsData.dankBarGothCornersEnabled ? _wingR : 0))
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
const fonts = Qt.fontFamilies()
|
const fonts = Qt.fontFamilies()
|
||||||
@@ -55,18 +57,20 @@ PanelWindow {
|
|||||||
ToastService.showError("Please install Material Symbols Rounded and Restart your Shell. See README.md for instructions")
|
ToastService.showError("Please install Material Symbols Rounded and Restart your Shell. See README.md for instructions")
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsData.forceTopBarLayoutRefresh.connect(() => {
|
if (SettingsData.forceStatusBarLayoutRefresh) {
|
||||||
Qt.callLater(() => {
|
SettingsData.forceStatusBarLayoutRefresh.connect(() => {
|
||||||
leftSection.visible = false
|
Qt.callLater(() => {
|
||||||
centerSection.visible = false
|
leftSection.visible = false
|
||||||
rightSection.visible = false
|
centerSection.visible = false
|
||||||
Qt.callLater(() => {
|
rightSection.visible = false
|
||||||
leftSection.visible = true
|
Qt.callLater(() => {
|
||||||
centerSection.visible = true
|
leftSection.visible = true
|
||||||
rightSection.visible = true
|
centerSection.visible = true
|
||||||
})
|
rightSection.visible = true
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
updateGpuTempConfig()
|
updateGpuTempConfig()
|
||||||
Qt.callLater(() => Qt.callLater(forceWidgetRefresh))
|
Qt.callLater(() => Qt.callLater(forceWidgetRefresh))
|
||||||
@@ -79,7 +83,7 @@ PanelWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function updateGpuTempConfig() {
|
function updateGpuTempConfig() {
|
||||||
const allWidgets = [...(SettingsData.topBarLeftWidgets || []), ...(SettingsData.topBarCenterWidgets || []), ...(SettingsData.topBarRightWidgets || [])]
|
const allWidgets = [...(SettingsData.dankBarLeftWidgets || []), ...(SettingsData.dankBarCenterWidgets || []), ...(SettingsData.dankBarRightWidgets || [])]
|
||||||
|
|
||||||
const hasGpuTempWidget = allWidgets.some(widget => {
|
const hasGpuTempWidget = allWidgets.some(widget => {
|
||||||
const widgetId = typeof widget === "string" ? widget : widget.id
|
const widgetId = typeof widget === "string" ? widget : widget.id
|
||||||
@@ -93,15 +97,15 @@ PanelWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
function onTopBarLeftWidgetsChanged() {
|
function onDankBarLeftWidgetsChanged() {
|
||||||
root.updateGpuTempConfig()
|
root.updateGpuTempConfig()
|
||||||
}
|
}
|
||||||
|
|
||||||
function onTopBarCenterWidgetsChanged() {
|
function onDankBarCenterWidgetsChanged() {
|
||||||
root.updateGpuTempConfig()
|
root.updateGpuTempConfig()
|
||||||
}
|
}
|
||||||
|
|
||||||
function onTopBarRightWidgetsChanged() {
|
function onDankBarRightWidgetsChanged() {
|
||||||
root.updateGpuTempConfig()
|
root.updateGpuTempConfig()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,28 +134,27 @@ PanelWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
top: true
|
top: !SettingsData.dankBarAtBottom
|
||||||
|
bottom: SettingsData.dankBarAtBottom
|
||||||
left: true
|
left: true
|
||||||
right: true
|
right: true
|
||||||
}
|
}
|
||||||
|
|
||||||
exclusiveZone: (!SettingsData.topBarVisible || topBarCore.autoHide) ? -1 : root.effectiveBarHeight + SettingsData.topBarSpacing + SettingsData.topBarBottomGap - 2
|
exclusiveZone: (!SettingsData.dankBarVisible || topBarCore.autoHide) ? -1 : (root.effectiveBarHeight + SettingsData.dankBarSpacing + SettingsData.dankBarBottomGap)
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: inputMask
|
id: inputMask
|
||||||
anchors {
|
anchors {
|
||||||
top: parent.top
|
top: SettingsData.dankBarAtBottom ? undefined : parent.top
|
||||||
|
bottom: SettingsData.dankBarAtBottom ? parent.bottom : undefined
|
||||||
left: parent.left
|
left: parent.left
|
||||||
right: parent.right
|
right: parent.right
|
||||||
}
|
}
|
||||||
height: {
|
height: {
|
||||||
if (topBarCore.autoHide && !topBarCore.reveal) {
|
const base = px(root.effectiveBarHeight + SettingsData.dankBarSpacing)
|
||||||
return 8
|
if (topBarCore.autoHide && !topBarCore.reveal) return 8
|
||||||
}
|
if (CompositorService.isNiri && NiriService.inOverview && SettingsData.dankBarOpenOnOverview) return base
|
||||||
if (CompositorService.isNiri && NiriService.inOverview && SettingsData.topBarOpenOnOverview) {
|
return SettingsData.dankBarVisible ? base : 0
|
||||||
return root.effectiveBarHeight + SettingsData.topBarSpacing
|
|
||||||
}
|
|
||||||
return SettingsData.topBarVisible ? (root.effectiveBarHeight + SettingsData.topBarSpacing) : 0
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -164,8 +167,8 @@ PanelWindow {
|
|||||||
id: topBarCore
|
id: topBarCore
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
property real backgroundTransparency: SettingsData.topBarTransparency
|
property real backgroundTransparency: SettingsData.dankBarTransparency
|
||||||
property bool autoHide: SettingsData.topBarAutoHide
|
property bool autoHide: SettingsData.dankBarAutoHide
|
||||||
property bool revealSticky: false
|
property bool revealSticky: false
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
@@ -177,9 +180,9 @@ PanelWindow {
|
|||||||
|
|
||||||
property bool reveal: {
|
property bool reveal: {
|
||||||
if (CompositorService.isNiri && NiriService.inOverview) {
|
if (CompositorService.isNiri && NiriService.inOverview) {
|
||||||
return SettingsData.topBarOpenOnOverview
|
return SettingsData.dankBarOpenOnOverview
|
||||||
}
|
}
|
||||||
return SettingsData.topBarVisible && (!autoHide || topBarMouseArea.containsMouse || hasActivePopout || revealSticky)
|
return SettingsData.dankBarVisible && (!autoHide || topBarMouseArea.containsMouse || hasActivePopout || revealSticky)
|
||||||
}
|
}
|
||||||
|
|
||||||
property var notepadInstance: null
|
property var notepadInstance: null
|
||||||
@@ -227,8 +230,8 @@ PanelWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
function onTopBarTransparencyChanged() {
|
function onDankBarTransparencyChanged() {
|
||||||
topBarCore.backgroundTransparency = SettingsData.topBarTransparency
|
topBarCore.backgroundTransparency = SettingsData.dankBarTransparency
|
||||||
}
|
}
|
||||||
|
|
||||||
target: SettingsData
|
target: SettingsData
|
||||||
@@ -257,10 +260,9 @@ PanelWindow {
|
|||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: topBarMouseArea
|
id: topBarMouseArea
|
||||||
y: 0
|
y: SettingsData.dankBarAtBottom ? parent.height - height : 0
|
||||||
height: root.effectiveBarHeight + SettingsData.topBarSpacing
|
height: px(root.effectiveBarHeight + SettingsData.dankBarSpacing)
|
||||||
anchors {
|
anchors {
|
||||||
top: parent.top
|
|
||||||
left: parent.left
|
left: parent.left
|
||||||
right: parent.right
|
right: parent.right
|
||||||
}
|
}
|
||||||
@@ -274,7 +276,7 @@ PanelWindow {
|
|||||||
|
|
||||||
transform: Translate {
|
transform: Translate {
|
||||||
id: topBarSlide
|
id: topBarSlide
|
||||||
y: Math.round(topBarCore.reveal ? 0 : -root.implicitHeight)
|
y: px(topBarCore.reveal ? 0 : (SettingsData.dankBarAtBottom ? root.implicitHeight : -root.implicitHeight))
|
||||||
|
|
||||||
Behavior on y {
|
Behavior on y {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
@@ -287,43 +289,55 @@ PanelWindow {
|
|||||||
Item {
|
Item {
|
||||||
id: barUnitInset
|
id: barUnitInset
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.leftMargin: SettingsData.topBarSpacing
|
anchors.leftMargin: px(SettingsData.dankBarSpacing)
|
||||||
anchors.rightMargin: SettingsData.topBarSpacing
|
anchors.rightMargin: px(SettingsData.dankBarSpacing)
|
||||||
anchors.topMargin: SettingsData.topBarSpacing
|
anchors.topMargin: SettingsData.dankBarAtBottom ? 0 : px(SettingsData.dankBarSpacing)
|
||||||
|
anchors.bottomMargin: SettingsData.dankBarAtBottom ? px(SettingsData.dankBarSpacing) : 0
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: barBackground
|
id: barBackground
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.bottomMargin: -(SettingsData.topBarGothCornersEnabled ? root._wingR : 0)
|
anchors.bottomMargin: -(SettingsData.dankBarGothCornersEnabled && !SettingsData.dankBarAtBottom ? root._wingR : 0)
|
||||||
|
anchors.topMargin: -(SettingsData.dankBarGothCornersEnabled && SettingsData.dankBarAtBottom ? root._wingR : 0)
|
||||||
|
|
||||||
Canvas {
|
Canvas {
|
||||||
id: barShape
|
id: barShape
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
antialiasing: true
|
antialiasing: true
|
||||||
renderTarget: Canvas.FramebufferObject
|
renderTarget: Canvas.Image
|
||||||
|
canvasSize: Qt.size(px(width), px(height))
|
||||||
|
|
||||||
property real h : height - (SettingsData.topBarGothCornersEnabled ? root._wingR : 0)
|
property real wing: SettingsData.dankBarGothCornersEnabled ? root._wingR : 0
|
||||||
property real rb : SettingsData.topBarGothCornersEnabled ? root._wingR : 0
|
property real rt: SettingsData.dankBarSquareCorners ? 0 : Theme.cornerRadius
|
||||||
property real rt : SettingsData.topBarSquareCorners ? 0 : Theme.cornerRadius
|
property real h: height
|
||||||
|
property real contentH: height - wing
|
||||||
|
property real y0: SettingsData.dankBarAtBottom ? wing : 0
|
||||||
|
|
||||||
onRbChanged: requestPaint()
|
onWingChanged: requestPaint()
|
||||||
onRtChanged: requestPaint()
|
onRtChanged: requestPaint()
|
||||||
|
onWidthChanged: requestPaint()
|
||||||
|
onHeightChanged: requestPaint()
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: root
|
target: root
|
||||||
function on_BgColorChanged() { barShape.requestPaint() }
|
function on_BgColorChanged() { barShape.requestPaint() }
|
||||||
|
function on_DprChanged() { barShape.requestPaint() }
|
||||||
}
|
}
|
||||||
|
|
||||||
onPaint: {
|
onPaint: {
|
||||||
const ctx = getContext("2d")
|
const ctx = getContext("2d")
|
||||||
const W = width, H = barShape.h, R = barShape.rb, RT = barShape.rt
|
const scale = root._dpr
|
||||||
|
const W = px(width)
|
||||||
|
const H_raw = px(height)
|
||||||
|
const R = px(wing)
|
||||||
|
const RT = px(rt)
|
||||||
|
const H = H_raw - (R > 0 ? R : 0)
|
||||||
|
const isBottom = SettingsData.dankBarAtBottom
|
||||||
|
|
||||||
ctx.reset()
|
ctx.scale(scale, scale)
|
||||||
ctx.clearRect(0, 0, width, height)
|
|
||||||
|
|
||||||
function outline() {
|
function drawTopPath() {
|
||||||
ctx.beginPath()
|
ctx.beginPath()
|
||||||
|
|
||||||
ctx.moveTo(RT, 0)
|
ctx.moveTo(RT, 0)
|
||||||
ctx.lineTo(W - RT, 0)
|
ctx.lineTo(W - RT, 0)
|
||||||
ctx.arcTo(W, 0, W, RT, RT)
|
ctx.arcTo(W, 0, W, RT, RT)
|
||||||
@@ -344,13 +358,25 @@ PanelWindow {
|
|||||||
|
|
||||||
ctx.lineTo(0, RT)
|
ctx.lineTo(0, RT)
|
||||||
ctx.arcTo(0, 0, RT, 0, RT)
|
ctx.arcTo(0, 0, RT, 0, RT)
|
||||||
|
|
||||||
ctx.closePath()
|
ctx.closePath()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ctx.reset()
|
||||||
|
ctx.clearRect(0, 0, W, H_raw)
|
||||||
|
|
||||||
|
if (isBottom) {
|
||||||
|
ctx.save()
|
||||||
|
ctx.translate(0, H_raw)
|
||||||
|
ctx.scale(1, -1)
|
||||||
|
drawTopPath()
|
||||||
|
ctx.restore()
|
||||||
|
} else {
|
||||||
|
drawTopPath()
|
||||||
|
}
|
||||||
|
|
||||||
ctx.fillStyle = root._bgColor
|
ctx.fillStyle = root._bgColor
|
||||||
outline()
|
|
||||||
ctx.fill()
|
ctx.fill()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -359,49 +385,81 @@ PanelWindow {
|
|||||||
id: barTint
|
id: barTint
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
antialiasing: true
|
antialiasing: true
|
||||||
renderTarget: Canvas.FramebufferObject
|
renderTarget: Canvas.Image
|
||||||
|
canvasSize: Qt.size(px(width), px(height))
|
||||||
|
|
||||||
Connections {
|
property real wing: SettingsData.dankBarGothCornersEnabled ? root._wingR : 0
|
||||||
target: barShape
|
property real rt: SettingsData.dankBarSquareCorners ? 0 : Theme.cornerRadius
|
||||||
function onRbChanged() { barTint.requestPaint() }
|
property real h: height
|
||||||
function onRtChanged() { barTint.requestPaint() }
|
property real contentH: height - wing
|
||||||
}
|
property real y0: SettingsData.dankBarAtBottom ? wing : 0
|
||||||
|
property real alphaTint: (root._bgColor?.a ?? 1) < 0.99 ? (Theme.stateLayerOpacity ?? 0) : 0
|
||||||
|
|
||||||
|
onWingChanged: requestPaint()
|
||||||
|
onRtChanged: requestPaint()
|
||||||
|
onAlphaTintChanged: requestPaint()
|
||||||
|
onWidthChanged: requestPaint()
|
||||||
|
onHeightChanged: requestPaint()
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: root
|
target: root
|
||||||
function on_BgColorChanged() { barTint.requestPaint() }
|
function on_BgColorChanged() { barTint.requestPaint() }
|
||||||
|
function on_DprChanged() { barTint.requestPaint() }
|
||||||
}
|
}
|
||||||
|
|
||||||
onPaint: {
|
onPaint: {
|
||||||
const ctx = getContext("2d")
|
const ctx = getContext("2d")
|
||||||
const W = width, H = barShape.h, R = barShape.rb, RT = barShape.rt
|
const scale = root._dpr
|
||||||
|
const W = px(width)
|
||||||
|
const H_raw = px(height)
|
||||||
|
const R = px(wing)
|
||||||
|
const RT = px(rt)
|
||||||
|
const H = H_raw - (R > 0 ? R : 0)
|
||||||
|
const isBottom = SettingsData.dankBarAtBottom
|
||||||
|
|
||||||
|
ctx.scale(scale, scale)
|
||||||
|
|
||||||
|
function drawTopPath() {
|
||||||
|
ctx.beginPath()
|
||||||
|
ctx.moveTo(RT, 0)
|
||||||
|
ctx.lineTo(W - RT, 0)
|
||||||
|
ctx.arcTo(W, 0, W, RT, RT)
|
||||||
|
ctx.lineTo(W, H)
|
||||||
|
|
||||||
|
if (R > 0) {
|
||||||
|
ctx.lineTo(W, H + R)
|
||||||
|
ctx.arc(W - R, H + R, R, 0, -Math.PI / 2, true)
|
||||||
|
ctx.lineTo(R, H)
|
||||||
|
ctx.arc(R, H + R, R, -Math.PI / 2, -Math.PI, true)
|
||||||
|
ctx.lineTo(0, H + R)
|
||||||
|
} else {
|
||||||
|
ctx.lineTo(W, H - RT)
|
||||||
|
ctx.arcTo(W, H, W - RT, H, RT)
|
||||||
|
ctx.lineTo(RT, H)
|
||||||
|
ctx.arcTo(0, H, 0, H - RT, RT)
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx.lineTo(0, RT)
|
||||||
|
ctx.arcTo(0, 0, RT, 0, RT)
|
||||||
|
ctx.closePath()
|
||||||
|
}
|
||||||
|
|
||||||
ctx.reset()
|
ctx.reset()
|
||||||
ctx.clearRect(0, 0, width, height)
|
ctx.clearRect(0, 0, W, H_raw)
|
||||||
|
|
||||||
ctx.beginPath()
|
if (isBottom) {
|
||||||
ctx.moveTo(RT, 0)
|
ctx.save()
|
||||||
ctx.lineTo(W - RT, 0)
|
ctx.translate(0, H_raw)
|
||||||
ctx.arcTo(W, 0, W, RT, RT)
|
ctx.scale(1, -1)
|
||||||
ctx.lineTo(W, H)
|
drawTopPath()
|
||||||
if (R > 0) {
|
ctx.restore()
|
||||||
ctx.lineTo(W, H + R)
|
|
||||||
ctx.arc(W - R, H + R, R, 0, -Math.PI / 2, true)
|
|
||||||
ctx.lineTo(R, H)
|
|
||||||
ctx.arc(R, H + R, R, -Math.PI / 2, -Math.PI, true)
|
|
||||||
ctx.lineTo(0, H + R)
|
|
||||||
} else {
|
} else {
|
||||||
ctx.lineTo(W, H - RT)
|
drawTopPath()
|
||||||
ctx.arcTo(W, H, W - RT, H, RT)
|
|
||||||
ctx.lineTo(RT, H)
|
|
||||||
ctx.arcTo(0, H, 0, H - RT, RT)
|
|
||||||
}
|
}
|
||||||
ctx.lineTo(0, RT)
|
|
||||||
ctx.arcTo(0, 0, RT, 0, RT)
|
|
||||||
ctx.closePath()
|
|
||||||
|
|
||||||
ctx.fillStyle = root._bgColor
|
ctx.fillStyle = Qt.rgba(Theme.surface.r, Theme.surface.g, Theme.surface.b, alphaTint)
|
||||||
ctx.fill()
|
ctx.fill()
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -409,10 +467,10 @@ PanelWindow {
|
|||||||
Item {
|
Item {
|
||||||
id: topBarContent
|
id: topBarContent
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.leftMargin: Math.max(Theme.spacingXS, SettingsData.topBarInnerPadding * 0.8)
|
anchors.leftMargin: Math.max(Theme.spacingXS, SettingsData.dankBarInnerPadding * 0.8)
|
||||||
anchors.rightMargin: Math.max(Theme.spacingXS, SettingsData.topBarInnerPadding * 0.8)
|
anchors.rightMargin: Math.max(Theme.spacingXS, SettingsData.dankBarInnerPadding * 0.8)
|
||||||
anchors.topMargin: SettingsData.topBarInnerPadding / 2
|
anchors.topMargin: SettingsData.dankBarInnerPadding / 2
|
||||||
anchors.bottomMargin: SettingsData.topBarInnerPadding / 2
|
anchors.bottomMargin: SettingsData.dankBarInnerPadding / 2
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
readonly property int availableWidth: width
|
readonly property int availableWidth: width
|
||||||
@@ -507,12 +565,12 @@ PanelWindow {
|
|||||||
id: leftSection
|
id: leftSection
|
||||||
|
|
||||||
height: parent.height
|
height: parent.height
|
||||||
spacing: SettingsData.topBarNoBackground ? 2 : Theme.spacingXS
|
spacing: SettingsData.dankBarNoBackground ? 2 : Theme.spacingXS
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
model: SettingsData.topBarLeftWidgetsModel
|
model: SettingsData.dankBarLeftWidgetsModel
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
property string widgetId: model.widgetId
|
property string widgetId: model.widgetId
|
||||||
@@ -534,7 +592,7 @@ PanelWindow {
|
|||||||
property var centerWidgets: []
|
property var centerWidgets: []
|
||||||
property int totalWidgets: 0
|
property int totalWidgets: 0
|
||||||
property real totalWidth: 0
|
property real totalWidth: 0
|
||||||
property real spacing: SettingsData.topBarNoBackground ? 2 : Theme.spacingXS
|
property real spacing: SettingsData.dankBarNoBackground ? 2 : Theme.spacingXS
|
||||||
|
|
||||||
function updateLayout() {
|
function updateLayout() {
|
||||||
if (width <= 0 || height <= 0 || !visible) {
|
if (width <= 0 || height <= 0 || !visible) {
|
||||||
@@ -729,7 +787,7 @@ PanelWindow {
|
|||||||
Repeater {
|
Repeater {
|
||||||
id: centerRepeater
|
id: centerRepeater
|
||||||
|
|
||||||
model: SettingsData.topBarCenterWidgetsModel
|
model: SettingsData.dankBarCenterWidgetsModel
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
property string widgetId: model.widgetId
|
property string widgetId: model.widgetId
|
||||||
@@ -763,7 +821,7 @@ PanelWindow {
|
|||||||
Qt.callLater(centerSection.updateLayout)
|
Qt.callLater(centerSection.updateLayout)
|
||||||
}
|
}
|
||||||
|
|
||||||
target: SettingsData.topBarCenterWidgetsModel
|
target: SettingsData.dankBarCenterWidgetsModel
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -771,12 +829,12 @@ PanelWindow {
|
|||||||
id: rightSection
|
id: rightSection
|
||||||
|
|
||||||
height: parent.height
|
height: parent.height
|
||||||
spacing: SettingsData.topBarNoBackground ? 2 : Theme.spacingXS
|
spacing: SettingsData.dankBarNoBackground ? 2 : Theme.spacingXS
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
model: SettingsData.topBarRightWidgetsModel
|
model: SettingsData.dankBarRightWidgetsModel
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
property string widgetId: model.widgetId
|
property string widgetId: model.widgetId
|
||||||
@@ -796,12 +854,12 @@ PanelWindow {
|
|||||||
id: clipboardComponent
|
id: clipboardComponent
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
readonly property real horizontalPadding: SettingsData.topBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (root.widgetHeight / 30))
|
readonly property real horizontalPadding: SettingsData.dankBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (root.widgetHeight / 30))
|
||||||
width: clipboardIcon.width + horizontalPadding * 2
|
width: clipboardIcon.width + horizontalPadding * 2
|
||||||
height: root.widgetHeight
|
height: root.widgetHeight
|
||||||
radius: SettingsData.topBarNoBackground ? 0 : Theme.cornerRadius
|
radius: SettingsData.dankBarNoBackground ? 0 : Theme.cornerRadius
|
||||||
color: {
|
color: {
|
||||||
if (SettingsData.topBarNoBackground) {
|
if (SettingsData.dankBarNoBackground) {
|
||||||
return "transparent"
|
return "transparent"
|
||||||
}
|
}
|
||||||
const baseColor = clipboardArea.containsMouse ? Theme.widgetBaseHoverColor : Theme.widgetBaseBackgroundColor
|
const baseColor = clipboardArea.containsMouse ? Theme.widgetBaseHoverColor : Theme.widgetBaseBackgroundColor
|
||||||
@@ -951,6 +1009,7 @@ PanelWindow {
|
|||||||
parentWindow: root
|
parentWindow: root
|
||||||
parentScreen: root.screen
|
parentScreen: root.screen
|
||||||
widgetHeight: root.widgetHeight
|
widgetHeight: root.widgetHeight
|
||||||
|
isAtBottom: SettingsData.dankBarAtBottom
|
||||||
visible: SettingsData.getFilteredScreens("systemTray").includes(root.screen)
|
visible: SettingsData.getFilteredScreens("systemTray").includes(root.screen)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -10,7 +10,7 @@ Rectangle {
|
|||||||
property var widgetData: null
|
property var widgetData: null
|
||||||
property real widgetHeight: 30
|
property real widgetHeight: 30
|
||||||
property string mountPath: (widgetData && widgetData.mountPath !== undefined) ? widgetData.mountPath : "/"
|
property string mountPath: (widgetData && widgetData.mountPath !== undefined) ? widgetData.mountPath : "/"
|
||||||
readonly property real horizontalPadding: SettingsData.topBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
|
readonly property real horizontalPadding: SettingsData.dankBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
|
||||||
|
|
||||||
property var selectedMount: {
|
property var selectedMount: {
|
||||||
if (!DgopService.diskMounts || DgopService.diskMounts.length === 0) {
|
if (!DgopService.diskMounts || DgopService.diskMounts.length === 0) {
|
||||||
@@ -48,9 +48,9 @@ Rectangle {
|
|||||||
|
|
||||||
width: diskContent.implicitWidth + horizontalPadding * 2
|
width: diskContent.implicitWidth + horizontalPadding * 2
|
||||||
height: widgetHeight
|
height: widgetHeight
|
||||||
radius: SettingsData.topBarNoBackground ? 0 : Theme.cornerRadius
|
radius: SettingsData.dankBarNoBackground ? 0 : Theme.cornerRadius
|
||||||
color: {
|
color: {
|
||||||
if (SettingsData.topBarNoBackground) {
|
if (SettingsData.dankBarNoBackground) {
|
||||||
return "transparent"
|
return "transparent"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@ Rectangle {
|
|||||||
property bool compactMode: SettingsData.focusedWindowCompactMode
|
property bool compactMode: SettingsData.focusedWindowCompactMode
|
||||||
property int availableWidth: 400
|
property int availableWidth: 400
|
||||||
property real widgetHeight: 30
|
property real widgetHeight: 30
|
||||||
readonly property real horizontalPadding: SettingsData.topBarNoBackground ? 2 : Theme.spacingS
|
readonly property real horizontalPadding: SettingsData.dankBarNoBackground ? 2 : Theme.spacingS
|
||||||
readonly property int baseWidth: contentRow.implicitWidth + horizontalPadding * 2
|
readonly property int baseWidth: contentRow.implicitWidth + horizontalPadding * 2
|
||||||
readonly property int maxNormalWidth: 456
|
readonly property int maxNormalWidth: 456
|
||||||
readonly property int maxCompactWidth: 288
|
readonly property int maxCompactWidth: 288
|
||||||
@@ -56,13 +56,13 @@ Rectangle {
|
|||||||
|
|
||||||
width: !hasWindowsOnCurrentWorkspace ? 0 : (compactMode ? Math.min(baseWidth, maxCompactWidth) : Math.min(baseWidth, maxNormalWidth))
|
width: !hasWindowsOnCurrentWorkspace ? 0 : (compactMode ? Math.min(baseWidth, maxCompactWidth) : Math.min(baseWidth, maxNormalWidth))
|
||||||
height: widgetHeight
|
height: widgetHeight
|
||||||
radius: SettingsData.topBarNoBackground ? 0 : Theme.cornerRadius
|
radius: SettingsData.dankBarNoBackground ? 0 : Theme.cornerRadius
|
||||||
color: {
|
color: {
|
||||||
if (!activeWindow || !activeWindow.title) {
|
if (!activeWindow || !activeWindow.title) {
|
||||||
return "transparent";
|
return "transparent";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SettingsData.topBarNoBackground) {
|
if (SettingsData.dankBarNoBackground) {
|
||||||
return "transparent";
|
return "transparent";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ Rectangle {
|
|||||||
property real barHeight: 48
|
property real barHeight: 48
|
||||||
property real widgetHeight: 30
|
property real widgetHeight: 30
|
||||||
property int selectedGpuIndex: (widgetData && widgetData.selectedGpuIndex !== undefined) ? widgetData.selectedGpuIndex : 0
|
property int selectedGpuIndex: (widgetData && widgetData.selectedGpuIndex !== undefined) ? widgetData.selectedGpuIndex : 0
|
||||||
readonly property real horizontalPadding: SettingsData.topBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
|
readonly property real horizontalPadding: SettingsData.dankBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
|
||||||
property real displayTemp: {
|
property real displayTemp: {
|
||||||
if (!DgopService.availableGpus || DgopService.availableGpus.length === 0) {
|
if (!DgopService.availableGpus || DgopService.availableGpus.length === 0) {
|
||||||
return 0;
|
return 0;
|
||||||
@@ -37,11 +37,11 @@ Rectangle {
|
|||||||
const sectionId = sections[s];
|
const sectionId = sections[s];
|
||||||
let widgets = [];
|
let widgets = [];
|
||||||
if (sectionId === "left") {
|
if (sectionId === "left") {
|
||||||
widgets = SettingsData.topBarLeftWidgets.slice();
|
widgets = SettingsData.dankBarLeftWidgets.slice();
|
||||||
} else if (sectionId === "center") {
|
} else if (sectionId === "center") {
|
||||||
widgets = SettingsData.topBarCenterWidgets.slice();
|
widgets = SettingsData.dankBarCenterWidgets.slice();
|
||||||
} else if (sectionId === "right") {
|
} else if (sectionId === "right") {
|
||||||
widgets = SettingsData.topBarRightWidgets.slice();
|
widgets = SettingsData.dankBarRightWidgets.slice();
|
||||||
}
|
}
|
||||||
for (let i = 0; i < widgets.length; i++) {
|
for (let i = 0; i < widgets.length; i++) {
|
||||||
const widget = widgets[i];
|
const widget = widgets[i];
|
||||||
@@ -53,11 +53,11 @@ Rectangle {
|
|||||||
"pciId": pciId
|
"pciId": pciId
|
||||||
};
|
};
|
||||||
if (sectionId === "left") {
|
if (sectionId === "left") {
|
||||||
SettingsData.setTopBarLeftWidgets(widgets);
|
SettingsData.setDankBarLeftWidgets(widgets);
|
||||||
} else if (sectionId === "center") {
|
} else if (sectionId === "center") {
|
||||||
SettingsData.setTopBarCenterWidgets(widgets);
|
SettingsData.setDankBarCenterWidgets(widgets);
|
||||||
} else if (sectionId === "right") {
|
} else if (sectionId === "right") {
|
||||||
SettingsData.setTopBarRightWidgets(widgets);
|
SettingsData.setDankBarRightWidgets(widgets);
|
||||||
}
|
}
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
@@ -67,9 +67,9 @@ Rectangle {
|
|||||||
|
|
||||||
width: gpuTempContent.implicitWidth + horizontalPadding * 2
|
width: gpuTempContent.implicitWidth + horizontalPadding * 2
|
||||||
height: widgetHeight
|
height: widgetHeight
|
||||||
radius: SettingsData.topBarNoBackground ? 0 : Theme.cornerRadius
|
radius: SettingsData.dankBarNoBackground ? 0 : Theme.cornerRadius
|
||||||
color: {
|
color: {
|
||||||
if (SettingsData.topBarNoBackground) {
|
if (SettingsData.dankBarNoBackground) {
|
||||||
return "transparent";
|
return "transparent";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,7 +121,7 @@ Rectangle {
|
|||||||
const currentScreen = parentScreen || Screen;
|
const currentScreen = parentScreen || Screen;
|
||||||
const screenX = currentScreen.x || 0;
|
const screenX = currentScreen.x || 0;
|
||||||
const relativeX = globalPos.x - screenX;
|
const relativeX = globalPos.x - screenX;
|
||||||
popupTarget.setTriggerPosition(relativeX, barHeight + SettingsData.topBarSpacing + SettingsData.topBarBottomGap - 2 + Theme.popupDistance, width, section, currentScreen);
|
popupTarget.setTriggerPosition(relativeX, SettingsData.getPopupYPosition(barHeight), width, section, currentScreen);
|
||||||
}
|
}
|
||||||
DgopService.setSortBy("cpu");
|
DgopService.setSortBy("cpu");
|
||||||
if (root.toggleProcessList) {
|
if (root.toggleProcessList) {
|
||||||
@@ -12,13 +12,13 @@ Rectangle {
|
|||||||
property var popupTarget: null
|
property var popupTarget: null
|
||||||
property var parentScreen: null
|
property var parentScreen: null
|
||||||
property real widgetHeight: 30
|
property real widgetHeight: 30
|
||||||
readonly property real horizontalPadding: SettingsData.topBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
|
readonly property real horizontalPadding: SettingsData.dankBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
|
||||||
|
|
||||||
width: idleIcon.width + horizontalPadding * 2
|
width: idleIcon.width + horizontalPadding * 2
|
||||||
height: widgetHeight
|
height: widgetHeight
|
||||||
radius: SettingsData.topBarNoBackground ? 0 : Theme.cornerRadius
|
radius: SettingsData.dankBarNoBackground ? 0 : Theme.cornerRadius
|
||||||
color: {
|
color: {
|
||||||
if (SettingsData.topBarNoBackground) {
|
if (SettingsData.dankBarNoBackground) {
|
||||||
return "transparent";
|
return "transparent";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -10,15 +10,15 @@ import qs.Widgets
|
|||||||
Rectangle {
|
Rectangle {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
readonly property real horizontalPadding: SettingsData.topBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
|
readonly property real horizontalPadding: SettingsData.dankBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
|
||||||
property string currentLayout: ""
|
property string currentLayout: ""
|
||||||
property string hyprlandKeyboard: ""
|
property string hyprlandKeyboard: ""
|
||||||
|
|
||||||
width: contentRow.implicitWidth + horizontalPadding * 2
|
width: contentRow.implicitWidth + horizontalPadding * 2
|
||||||
height: widgetHeight
|
height: widgetHeight
|
||||||
radius: SettingsData.topBarNoBackground ? 0 : Theme.cornerRadius
|
radius: SettingsData.dankBarNoBackground ? 0 : Theme.cornerRadius
|
||||||
color: {
|
color: {
|
||||||
if (SettingsData.topBarNoBackground) {
|
if (SettingsData.dankBarNoBackground) {
|
||||||
return "transparent";
|
return "transparent";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -12,7 +12,7 @@ Item {
|
|||||||
property var parentScreen: null
|
property var parentScreen: null
|
||||||
property real widgetHeight: 30
|
property real widgetHeight: 30
|
||||||
property real barHeight: 48
|
property real barHeight: 48
|
||||||
readonly property real horizontalPadding: SettingsData.topBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
|
readonly property real horizontalPadding: SettingsData.dankBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
|
||||||
|
|
||||||
signal clicked()
|
signal clicked()
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ Item {
|
|||||||
const currentScreen = parentScreen || Screen;
|
const currentScreen = parentScreen || Screen;
|
||||||
const screenX = currentScreen.x || 0;
|
const screenX = currentScreen.x || 0;
|
||||||
const relativeX = globalPos.x - screenX;
|
const relativeX = globalPos.x - screenX;
|
||||||
popupTarget.setTriggerPosition(relativeX, barHeight + SettingsData.topBarSpacing + SettingsData.topBarBottomGap - 2 + Theme.popupDistance, width, section, currentScreen);
|
popupTarget.setTriggerPosition(relativeX, SettingsData.getPopupYPosition(barHeight), width, section, currentScreen);
|
||||||
}
|
}
|
||||||
root.clicked();
|
root.clicked();
|
||||||
}
|
}
|
||||||
@@ -42,9 +42,9 @@ Item {
|
|||||||
id: launcherContent
|
id: launcherContent
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
radius: SettingsData.topBarNoBackground ? 0 : Theme.cornerRadius
|
radius: SettingsData.dankBarNoBackground ? 0 : Theme.cornerRadius
|
||||||
color: {
|
color: {
|
||||||
if (SettingsData.topBarNoBackground) {
|
if (SettingsData.dankBarNoBackground) {
|
||||||
return "transparent";
|
return "transparent";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,14 +34,14 @@ Rectangle {
|
|||||||
property var parentScreen: null
|
property var parentScreen: null
|
||||||
property real barHeight: 48
|
property real barHeight: 48
|
||||||
property real widgetHeight: 30
|
property real widgetHeight: 30
|
||||||
readonly property real horizontalPadding: SettingsData.topBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
|
readonly property real horizontalPadding: SettingsData.dankBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
|
||||||
|
|
||||||
signal clicked()
|
signal clicked()
|
||||||
|
|
||||||
height: widgetHeight
|
height: widgetHeight
|
||||||
radius: SettingsData.topBarNoBackground ? 0 : Theme.cornerRadius
|
radius: SettingsData.dankBarNoBackground ? 0 : Theme.cornerRadius
|
||||||
color: {
|
color: {
|
||||||
if (SettingsData.topBarNoBackground) {
|
if (SettingsData.dankBarNoBackground) {
|
||||||
return "transparent";
|
return "transparent";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -212,7 +212,7 @@ Rectangle {
|
|||||||
const currentScreen = root.parentScreen || Screen;
|
const currentScreen = root.parentScreen || Screen;
|
||||||
const screenX = currentScreen.x || 0;
|
const screenX = currentScreen.x || 0;
|
||||||
const relativeX = globalPos.x - screenX;
|
const relativeX = globalPos.x - screenX;
|
||||||
root.popupTarget.setTriggerPosition(relativeX, barHeight + SettingsData.topBarSpacing + SettingsData.topBarBottomGap - 2 + Theme.popupDistance, root.width, root.section, currentScreen);
|
root.popupTarget.setTriggerPosition(relativeX, SettingsData.getPopupYPosition(barHeight), root.width, root.section, currentScreen);
|
||||||
}
|
}
|
||||||
root.clicked();
|
root.clicked();
|
||||||
}
|
}
|
||||||
@@ -11,7 +11,7 @@ Rectangle {
|
|||||||
property int availableWidth: 400
|
property int availableWidth: 400
|
||||||
readonly property int baseWidth: contentRow.implicitWidth + Theme.spacingS * 2
|
readonly property int baseWidth: contentRow.implicitWidth + Theme.spacingS * 2
|
||||||
readonly property int maxNormalWidth: 456
|
readonly property int maxNormalWidth: 456
|
||||||
readonly property real horizontalPadding: SettingsData.topBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
|
readonly property real horizontalPadding: SettingsData.dankBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
|
||||||
|
|
||||||
function formatNetworkSpeed(bytesPerSec) {
|
function formatNetworkSpeed(bytesPerSec) {
|
||||||
if (bytesPerSec < 1024) {
|
if (bytesPerSec < 1024) {
|
||||||
@@ -27,9 +27,9 @@ Rectangle {
|
|||||||
|
|
||||||
width: contentRow.implicitWidth + horizontalPadding * 2
|
width: contentRow.implicitWidth + horizontalPadding * 2
|
||||||
height: widgetHeight
|
height: widgetHeight
|
||||||
radius: SettingsData.topBarNoBackground ? 0 : Theme.cornerRadius
|
radius: SettingsData.dankBarNoBackground ? 0 : Theme.cornerRadius
|
||||||
color: {
|
color: {
|
||||||
if (SettingsData.topBarNoBackground) {
|
if (SettingsData.dankBarNoBackground) {
|
||||||
return "transparent";
|
return "transparent";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -12,15 +12,15 @@ Rectangle {
|
|||||||
property var parentScreen: null
|
property var parentScreen: null
|
||||||
property real widgetHeight: 30
|
property real widgetHeight: 30
|
||||||
property real barHeight: 48
|
property real barHeight: 48
|
||||||
readonly property real horizontalPadding: SettingsData.topBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
|
readonly property real horizontalPadding: SettingsData.dankBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
|
||||||
|
|
||||||
signal clicked()
|
signal clicked()
|
||||||
|
|
||||||
width: notepadIcon.width + horizontalPadding * 2
|
width: notepadIcon.width + horizontalPadding * 2
|
||||||
height: widgetHeight
|
height: widgetHeight
|
||||||
radius: SettingsData.topBarNoBackground ? 0 : Theme.cornerRadius
|
radius: SettingsData.dankBarNoBackground ? 0 : Theme.cornerRadius
|
||||||
color: {
|
color: {
|
||||||
if (SettingsData.topBarNoBackground) {
|
if (SettingsData.dankBarNoBackground) {
|
||||||
return "transparent";
|
return "transparent";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,8 +44,8 @@ Rectangle {
|
|||||||
color: Theme.primary
|
color: Theme.primary
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.rightMargin: SettingsData.topBarNoBackground ? 0 : 4
|
anchors.rightMargin: SettingsData.dankBarNoBackground ? 0 : 4
|
||||||
anchors.topMargin: SettingsData.topBarNoBackground ? 0 : 4
|
anchors.topMargin: SettingsData.dankBarNoBackground ? 0 : 4
|
||||||
visible: NotepadStorageService.tabs && NotepadStorageService.tabs.length > 0
|
visible: NotepadStorageService.tabs && NotepadStorageService.tabs.length > 0
|
||||||
opacity: 0.8
|
opacity: 0.8
|
||||||
}
|
}
|
||||||
@@ -12,15 +12,15 @@ Rectangle {
|
|||||||
property var parentScreen: null
|
property var parentScreen: null
|
||||||
property real widgetHeight: 30
|
property real widgetHeight: 30
|
||||||
property real barHeight: 48
|
property real barHeight: 48
|
||||||
readonly property real horizontalPadding: SettingsData.topBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
|
readonly property real horizontalPadding: SettingsData.dankBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
|
||||||
|
|
||||||
signal clicked()
|
signal clicked()
|
||||||
|
|
||||||
width: notificationIcon.width + horizontalPadding * 2
|
width: notificationIcon.width + horizontalPadding * 2
|
||||||
height: widgetHeight
|
height: widgetHeight
|
||||||
radius: SettingsData.topBarNoBackground ? 0 : Theme.cornerRadius
|
radius: SettingsData.dankBarNoBackground ? 0 : Theme.cornerRadius
|
||||||
color: {
|
color: {
|
||||||
if (SettingsData.topBarNoBackground) {
|
if (SettingsData.dankBarNoBackground) {
|
||||||
return "transparent";
|
return "transparent";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,8 +44,8 @@ Rectangle {
|
|||||||
color: Theme.error
|
color: Theme.error
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.rightMargin: SettingsData.topBarNoBackground ? 0 : 6
|
anchors.rightMargin: SettingsData.dankBarNoBackground ? 0 : 6
|
||||||
anchors.topMargin: SettingsData.topBarNoBackground ? 0 : 6
|
anchors.topMargin: SettingsData.dankBarNoBackground ? 0 : 6
|
||||||
visible: root.hasUnread
|
visible: root.hasUnread
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ Rectangle {
|
|||||||
const currentScreen = parentScreen || Screen;
|
const currentScreen = parentScreen || Screen;
|
||||||
const screenX = currentScreen.x || 0;
|
const screenX = currentScreen.x || 0;
|
||||||
const relativeX = globalPos.x - screenX;
|
const relativeX = globalPos.x - screenX;
|
||||||
popupTarget.setTriggerPosition(relativeX, barHeight + SettingsData.topBarSpacing + SettingsData.topBarBottomGap - 2 + Theme.popupDistance, width, section, currentScreen);
|
popupTarget.setTriggerPosition(relativeX, SettingsData.getPopupYPosition(barHeight), width, section, currentScreen);
|
||||||
}
|
}
|
||||||
root.clicked();
|
root.clicked();
|
||||||
}
|
}
|
||||||
@@ -11,19 +11,19 @@ Rectangle {
|
|||||||
property var popupTarget: null
|
property var popupTarget: null
|
||||||
property var parentScreen: null
|
property var parentScreen: null
|
||||||
property real widgetHeight: 30
|
property real widgetHeight: 30
|
||||||
readonly property real horizontalPadding: SettingsData.topBarNoBackground ? 2 : Theme.spacingS
|
readonly property real horizontalPadding: SettingsData.dankBarNoBackground ? 2 : Theme.spacingS
|
||||||
readonly property bool hasActivePrivacy: PrivacyService.anyPrivacyActive
|
readonly property bool hasActivePrivacy: PrivacyService.anyPrivacyActive
|
||||||
readonly property int activeCount: PrivacyService.microphoneActive + PrivacyService.cameraActive + PrivacyService.screensharingActive
|
readonly property int activeCount: PrivacyService.microphoneActive + PrivacyService.cameraActive + PrivacyService.screensharingActive
|
||||||
readonly property real contentWidth: hasActivePrivacy ? (activeCount * 18 + (activeCount - 1) * Theme.spacingXS) : 0
|
readonly property real contentWidth: hasActivePrivacy ? (activeCount * 18 + (activeCount - 1) * Theme.spacingXS) : 0
|
||||||
|
|
||||||
width: hasActivePrivacy ? (contentWidth + horizontalPadding * 2) : 0
|
width: hasActivePrivacy ? (contentWidth + horizontalPadding * 2) : 0
|
||||||
height: hasActivePrivacy ? widgetHeight : 0
|
height: hasActivePrivacy ? widgetHeight : 0
|
||||||
radius: SettingsData.topBarNoBackground ? 0 : Theme.cornerRadius
|
radius: SettingsData.dankBarNoBackground ? 0 : Theme.cornerRadius
|
||||||
visible: hasActivePrivacy
|
visible: hasActivePrivacy
|
||||||
opacity: hasActivePrivacy ? 1 : 0
|
opacity: hasActivePrivacy ? 1 : 0
|
||||||
enabled: hasActivePrivacy
|
enabled: hasActivePrivacy
|
||||||
color: {
|
color: {
|
||||||
if (SettingsData.topBarNoBackground) {
|
if (SettingsData.dankBarNoBackground) {
|
||||||
return "transparent";
|
return "transparent";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -15,13 +15,13 @@ Rectangle {
|
|||||||
property var parentScreen: null
|
property var parentScreen: null
|
||||||
property real barHeight: 48
|
property real barHeight: 48
|
||||||
property real widgetHeight: 30
|
property real widgetHeight: 30
|
||||||
readonly property real horizontalPadding: SettingsData.topBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
|
readonly property real horizontalPadding: SettingsData.dankBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
|
||||||
|
|
||||||
width: ramContent.implicitWidth + horizontalPadding * 2
|
width: ramContent.implicitWidth + horizontalPadding * 2
|
||||||
height: widgetHeight
|
height: widgetHeight
|
||||||
radius: SettingsData.topBarNoBackground ? 0 : Theme.cornerRadius
|
radius: SettingsData.dankBarNoBackground ? 0 : Theme.cornerRadius
|
||||||
color: {
|
color: {
|
||||||
if (SettingsData.topBarNoBackground) {
|
if (SettingsData.dankBarNoBackground) {
|
||||||
return "transparent";
|
return "transparent";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ Rectangle {
|
|||||||
const currentScreen = parentScreen || Screen;
|
const currentScreen = parentScreen || Screen;
|
||||||
const screenX = currentScreen.x || 0;
|
const screenX = currentScreen.x || 0;
|
||||||
const relativeX = globalPos.x - screenX;
|
const relativeX = globalPos.x - screenX;
|
||||||
popupTarget.setTriggerPosition(relativeX, barHeight + SettingsData.topBarSpacing + SettingsData.topBarBottomGap - 2 + Theme.popupDistance, width, section, currentScreen);
|
popupTarget.setTriggerPosition(relativeX, SettingsData.getPopupYPosition(barHeight), width, section, currentScreen);
|
||||||
}
|
}
|
||||||
DgopService.setSortBy("memory");
|
DgopService.setSortBy("memory");
|
||||||
if (root.toggleProcessList) {
|
if (root.toggleProcessList) {
|
||||||
@@ -15,7 +15,7 @@ Rectangle {
|
|||||||
property var hoveredItem: null
|
property var hoveredItem: null
|
||||||
property var topBar: null
|
property var topBar: null
|
||||||
property real widgetHeight: 30
|
property real widgetHeight: 30
|
||||||
readonly property real horizontalPadding: SettingsData.topBarNoBackground ? 2 : Theme.spacingS
|
readonly property real horizontalPadding: SettingsData.dankBarNoBackground ? 2 : Theme.spacingS
|
||||||
// The visual root for this window
|
// The visual root for this window
|
||||||
property Item windowRoot: (Window.window ? Window.window.contentItem : null)
|
property Item windowRoot: (Window.window ? Window.window.contentItem : null)
|
||||||
readonly property var sortedToplevels: {
|
readonly property var sortedToplevels: {
|
||||||
@@ -39,7 +39,7 @@ Rectangle {
|
|||||||
|
|
||||||
width: calculatedWidth
|
width: calculatedWidth
|
||||||
height: widgetHeight
|
height: widgetHeight
|
||||||
radius: SettingsData.topBarNoBackground ? 0 : Theme.cornerRadius
|
radius: SettingsData.dankBarNoBackground ? 0 : Theme.cornerRadius
|
||||||
visible: windowCount > 0
|
visible: windowCount > 0
|
||||||
clip: false
|
clip: false
|
||||||
color: {
|
color: {
|
||||||
@@ -47,7 +47,7 @@ Rectangle {
|
|||||||
return "transparent";
|
return "transparent";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SettingsData.topBarNoBackground) {
|
if (SettingsData.dankBarNoBackground) {
|
||||||
return "transparent";
|
return "transparent";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -299,7 +299,7 @@ Rectangle {
|
|||||||
const screenX = root.parentScreen ? root.parentScreen.x : 0;
|
const screenX = root.parentScreen ? root.parentScreen.x : 0;
|
||||||
const screenY = root.parentScreen ? root.parentScreen.y : 0;
|
const screenY = root.parentScreen ? root.parentScreen.y : 0;
|
||||||
const relativeX = globalPos.x - screenX;
|
const relativeX = globalPos.x - screenX;
|
||||||
const yPos = Theme.barHeight + SettingsData.topBarSpacing - 7;
|
const yPos = Theme.barHeight + SettingsData.dankBarSpacing - 7;
|
||||||
windowContextMenuLoader.item.showAt(relativeX, yPos);
|
windowContextMenuLoader.item.showAt(relativeX, yPos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -311,7 +311,7 @@ Rectangle {
|
|||||||
tooltipLoader.active = true;
|
tooltipLoader.active = true;
|
||||||
if (tooltipLoader.item) {
|
if (tooltipLoader.item) {
|
||||||
const tooltipY = Theme.barHeight
|
const tooltipY = Theme.barHeight
|
||||||
+ SettingsData.topBarSpacing + Theme.spacingXS;
|
+ SettingsData.dankBarSpacing + Theme.spacingXS;
|
||||||
tooltipLoader.item.showTooltip(
|
tooltipLoader.item.showTooltip(
|
||||||
delegateItem.tooltipText, globalPos.x,
|
delegateItem.tooltipText, globalPos.x,
|
||||||
tooltipY, root.parentScreen);
|
tooltipY, root.parentScreen);
|
||||||
510
Modules/DankBar/SystemTrayBar.qml
Normal file
510
Modules/DankBar/SystemTrayBar.qml
Normal file
@@ -0,0 +1,510 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import Quickshell
|
||||||
|
import Quickshell.Services.SystemTray
|
||||||
|
import Quickshell.Wayland
|
||||||
|
import Quickshell.Widgets
|
||||||
|
import qs.Common
|
||||||
|
import qs.Widgets
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
property var parentWindow: null
|
||||||
|
property var parentScreen: null
|
||||||
|
property real widgetHeight: 30
|
||||||
|
property bool isAtBottom: false
|
||||||
|
readonly property real horizontalPadding: SettingsData.dankBarNoBackground ? 2 : Theme.spacingS
|
||||||
|
readonly property int calculatedWidth: SystemTray.items.values.length > 0 ? SystemTray.items.values.length * 24 + horizontalPadding * 2 : 0
|
||||||
|
|
||||||
|
width: calculatedWidth
|
||||||
|
height: widgetHeight
|
||||||
|
radius: SettingsData.dankBarNoBackground ? 0 : Theme.cornerRadius
|
||||||
|
color: {
|
||||||
|
if (SystemTray.items.values.length === 0) {
|
||||||
|
return "transparent";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (SettingsData.dankBarNoBackground) {
|
||||||
|
return "transparent";
|
||||||
|
}
|
||||||
|
|
||||||
|
const baseColor = Theme.widgetBaseBackgroundColor;
|
||||||
|
return Qt.rgba(baseColor.r, baseColor.g, baseColor.b, baseColor.a * Theme.widgetTransparency);
|
||||||
|
}
|
||||||
|
visible: SystemTray.items.values.length > 0
|
||||||
|
|
||||||
|
Row {
|
||||||
|
id: systemTrayRow
|
||||||
|
|
||||||
|
anchors.centerIn: parent
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
|
Repeater {
|
||||||
|
model: SystemTray.items.values
|
||||||
|
|
||||||
|
delegate: Item {
|
||||||
|
property var trayItem: modelData
|
||||||
|
property string iconSource: {
|
||||||
|
let icon = trayItem && trayItem.icon;
|
||||||
|
if (typeof icon === 'string' || icon instanceof String) {
|
||||||
|
if (icon === "") {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
if (icon.includes("?path=")) {
|
||||||
|
const split = icon.split("?path=");
|
||||||
|
if (split.length !== 2) {
|
||||||
|
return icon;
|
||||||
|
}
|
||||||
|
|
||||||
|
const name = split[0];
|
||||||
|
const path = split[1];
|
||||||
|
const fileName = name.substring(name.lastIndexOf("/") + 1);
|
||||||
|
return `file://${path}/${fileName}`;
|
||||||
|
}
|
||||||
|
if (icon.startsWith("/") && !icon.startsWith("file://")) {
|
||||||
|
return `file://${icon}`;
|
||||||
|
}
|
||||||
|
return icon;
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
width: 24
|
||||||
|
height: 24
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
anchors.fill: parent
|
||||||
|
radius: Theme.cornerRadius
|
||||||
|
color: trayItemArea.containsMouse ? Theme.primaryHover : "transparent"
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
IconImage {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
width: 16
|
||||||
|
height: 16
|
||||||
|
source: parent.iconSource
|
||||||
|
asynchronous: true
|
||||||
|
smooth: true
|
||||||
|
mipmap: true
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: trayItemArea
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||||
|
hoverEnabled: true
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
onClicked: (mouse) => {
|
||||||
|
if (!trayItem) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mouse.button === Qt.LeftButton && !trayItem.onlyMenu) {
|
||||||
|
trayItem.activate();
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
if (trayItem.hasMenu) {
|
||||||
|
root.showForTrayItem(trayItem, parent, parentScreen, root.isAtBottom);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: trayMenuComponent
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: menuRoot
|
||||||
|
|
||||||
|
property var trayItem: null
|
||||||
|
property var anchorItem: null
|
||||||
|
property var parentScreen: null
|
||||||
|
property bool isAtBottom: false
|
||||||
|
property bool showMenu: false
|
||||||
|
property var menuHandle: null
|
||||||
|
|
||||||
|
ListModel { id: entryStack }
|
||||||
|
function topEntry() {
|
||||||
|
return entryStack.count ? entryStack.get(entryStack.count - 1).handle : null
|
||||||
|
}
|
||||||
|
|
||||||
|
function showForTrayItem(item, anchor, screen, atBottom) {
|
||||||
|
trayItem = item
|
||||||
|
anchorItem = anchor
|
||||||
|
parentScreen = screen
|
||||||
|
isAtBottom = atBottom
|
||||||
|
menuHandle = item?.menu
|
||||||
|
|
||||||
|
if (parentScreen) {
|
||||||
|
for (var i = 0; i < Quickshell.screens.length; i++) {
|
||||||
|
const s = Quickshell.screens[i]
|
||||||
|
if (s === parentScreen) {
|
||||||
|
menuWindow.screen = s
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
showMenu = true
|
||||||
|
}
|
||||||
|
|
||||||
|
function close() {
|
||||||
|
showMenu = false
|
||||||
|
}
|
||||||
|
|
||||||
|
function showSubMenu(entry) {
|
||||||
|
if (!entry || !entry.hasChildren) return;
|
||||||
|
|
||||||
|
entryStack.append({ handle: entry });
|
||||||
|
|
||||||
|
const h = entry.menu || entry;
|
||||||
|
if (h && typeof h.updateLayout === "function") h.updateLayout();
|
||||||
|
|
||||||
|
submenuHydrator.menu = h;
|
||||||
|
submenuHydrator.open();
|
||||||
|
Qt.callLater(() => submenuHydrator.close());
|
||||||
|
}
|
||||||
|
|
||||||
|
function goBack() {
|
||||||
|
if (!entryStack.count) return;
|
||||||
|
entryStack.remove(entryStack.count - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
width: 0
|
||||||
|
height: 0
|
||||||
|
color: "transparent"
|
||||||
|
|
||||||
|
PanelWindow {
|
||||||
|
id: menuWindow
|
||||||
|
visible: menuRoot.showMenu && menuRoot.trayItem?.hasMenu
|
||||||
|
WlrLayershell.layer: WlrLayershell.Overlay
|
||||||
|
WlrLayershell.exclusiveZone: -1
|
||||||
|
WlrLayershell.keyboardFocus: WlrKeyboardFocus.None
|
||||||
|
color: "transparent"
|
||||||
|
|
||||||
|
anchors {
|
||||||
|
top: true
|
||||||
|
left: true
|
||||||
|
right: true
|
||||||
|
bottom: true
|
||||||
|
}
|
||||||
|
|
||||||
|
property point anchorPos: Qt.point(screen.width / 2, screen.height / 2)
|
||||||
|
|
||||||
|
onVisibleChanged: {
|
||||||
|
if (visible) {
|
||||||
|
updatePosition()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function updatePosition() {
|
||||||
|
if (!menuRoot.anchorItem || !menuRoot.trayItem) {
|
||||||
|
anchorPos = Qt.point(screen.width / 2, screen.height / 2)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const globalPos = menuRoot.anchorItem.mapToGlobal(0, 0)
|
||||||
|
const screenX = screen.x || 0
|
||||||
|
const screenY = screen.y || 0
|
||||||
|
const relativeX = globalPos.x - screenX
|
||||||
|
const relativeY = globalPos.y - screenY
|
||||||
|
|
||||||
|
const widgetHeight = Math.max(20, 26 + SettingsData.dankBarInnerPadding * 0.6)
|
||||||
|
const effectiveBarHeight = Math.max(widgetHeight + SettingsData.dankBarInnerPadding + 4, Theme.barHeight - 4 - (8 - SettingsData.dankBarInnerPadding))
|
||||||
|
|
||||||
|
let targetY
|
||||||
|
if (menuRoot.isAtBottom) {
|
||||||
|
const popupY = effectiveBarHeight + SettingsData.dankBarSpacing + SettingsData.dankBarBottomGap - 2 + Theme.popupDistance
|
||||||
|
targetY = screen.height - popupY
|
||||||
|
} else {
|
||||||
|
targetY = effectiveBarHeight + SettingsData.dankBarSpacing + SettingsData.dankBarBottomGap - 2 + Theme.popupDistance
|
||||||
|
}
|
||||||
|
|
||||||
|
anchorPos = Qt.point(relativeX + menuRoot.anchorItem.width / 2, targetY)
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: menuContainer
|
||||||
|
|
||||||
|
width: Math.min(500, Math.max(250, menuColumn.implicitWidth + Theme.spacingS * 2))
|
||||||
|
height: Math.max(40, menuColumn.implicitHeight + Theme.spacingS * 2)
|
||||||
|
|
||||||
|
x: {
|
||||||
|
const left = 10
|
||||||
|
const right = menuWindow.width - width - 10
|
||||||
|
const want = menuWindow.anchorPos.x - width / 2
|
||||||
|
return Math.max(left, Math.min(right, want))
|
||||||
|
}
|
||||||
|
|
||||||
|
y: {
|
||||||
|
if (menuRoot.isAtBottom) {
|
||||||
|
const targetY = menuWindow.anchorPos.y - height
|
||||||
|
return Math.max(10, targetY)
|
||||||
|
} else {
|
||||||
|
const targetY = menuWindow.anchorPos.y
|
||||||
|
return Math.min(menuWindow.screen.height - height - 10, targetY)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
color: Theme.popupBackground()
|
||||||
|
radius: Theme.cornerRadius
|
||||||
|
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
||||||
|
border.width: 1
|
||||||
|
|
||||||
|
opacity: menuRoot.showMenu ? 1 : 0
|
||||||
|
scale: menuRoot.showMenu ? 1 : 0.85
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.topMargin: 4
|
||||||
|
anchors.leftMargin: 2
|
||||||
|
anchors.rightMargin: -2
|
||||||
|
anchors.bottomMargin: -4
|
||||||
|
radius: parent.radius
|
||||||
|
color: Qt.rgba(0, 0, 0, 0.15)
|
||||||
|
z: parent.z - 1
|
||||||
|
}
|
||||||
|
|
||||||
|
QsMenuAnchor {
|
||||||
|
id: submenuHydrator
|
||||||
|
anchor.window: menuWindow
|
||||||
|
}
|
||||||
|
|
||||||
|
QsMenuOpener {
|
||||||
|
id: rootOpener
|
||||||
|
menu: menuRoot.menuHandle
|
||||||
|
}
|
||||||
|
|
||||||
|
QsMenuOpener {
|
||||||
|
id: subOpener
|
||||||
|
menu: {
|
||||||
|
const e = menuRoot.topEntry();
|
||||||
|
return e ? (e.menu || e) : null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Column {
|
||||||
|
id: menuColumn
|
||||||
|
|
||||||
|
width: parent.width - Theme.spacingS * 2
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.topMargin: Theme.spacingS
|
||||||
|
spacing: 1
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
visible: entryStack.count > 0
|
||||||
|
width: parent.width
|
||||||
|
height: 28
|
||||||
|
radius: Theme.cornerRadius
|
||||||
|
color: backArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : "transparent"
|
||||||
|
|
||||||
|
Row {
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.leftMargin: Theme.spacingS
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
spacing: Theme.spacingXS
|
||||||
|
|
||||||
|
DankIcon {
|
||||||
|
name: "arrow_back"
|
||||||
|
size: 16
|
||||||
|
color: Theme.surfaceText
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: "Back"
|
||||||
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
|
color: Theme.surfaceText
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: backArea
|
||||||
|
anchors.fill: parent
|
||||||
|
hoverEnabled: true
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
onClicked: menuRoot.goBack()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
visible: entryStack.count > 0
|
||||||
|
width: parent.width
|
||||||
|
height: 1
|
||||||
|
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
|
||||||
|
}
|
||||||
|
|
||||||
|
Repeater {
|
||||||
|
model: entryStack.count
|
||||||
|
? (subOpener.children ? subOpener.children
|
||||||
|
: (menuRoot.topEntry()?.children || []))
|
||||||
|
: rootOpener.children
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
property var menuEntry: modelData
|
||||||
|
|
||||||
|
width: menuColumn.width
|
||||||
|
height: menuEntry?.isSeparator ? 1 : 28
|
||||||
|
radius: menuEntry?.isSeparator ? 0 : Theme.cornerRadius
|
||||||
|
color: {
|
||||||
|
if (menuEntry?.isSeparator) {
|
||||||
|
return Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
|
||||||
|
}
|
||||||
|
return itemArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : "transparent"
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: itemArea
|
||||||
|
anchors.fill: parent
|
||||||
|
enabled: !menuEntry?.isSeparator && (menuEntry?.enabled !== false)
|
||||||
|
hoverEnabled: true
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
if (!menuEntry || menuEntry.isSeparator) return;
|
||||||
|
|
||||||
|
if (menuEntry.hasChildren) {
|
||||||
|
console.log("Opening submenu for:", menuEntry.text);
|
||||||
|
menuRoot.showSubMenu(menuEntry);
|
||||||
|
} else {
|
||||||
|
if (typeof menuEntry.activate === "function") {
|
||||||
|
menuEntry.activate(); // preferred
|
||||||
|
} else if (typeof menuEntry.triggered === "function") {
|
||||||
|
menuEntry.triggered();
|
||||||
|
}
|
||||||
|
// optional: small delay to let provider flip state before closing
|
||||||
|
Qt.createQmlObject('import QtQuick; Timer { interval: 80; running: true; repeat: false; onTriggered: menuRoot.close() }', menuRoot);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.leftMargin: Theme.spacingS
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.rightMargin: Theme.spacingS
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
spacing: Theme.spacingXS
|
||||||
|
visible: !menuEntry?.isSeparator
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
width: 16
|
||||||
|
height: 16
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
visible: menuEntry?.buttonType !== undefined && menuEntry.buttonType !== 0
|
||||||
|
radius: menuEntry?.buttonType === 2 ? 8 : 2
|
||||||
|
border.width: 1
|
||||||
|
border.color: Theme.outline
|
||||||
|
color: "transparent"
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
width: parent.width - 6
|
||||||
|
height: parent.height - 6
|
||||||
|
radius: parent.radius - 3
|
||||||
|
color: Theme.primary
|
||||||
|
visible: menuEntry?.checkState === 2
|
||||||
|
}
|
||||||
|
|
||||||
|
DankIcon {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
name: "check"
|
||||||
|
size: 10
|
||||||
|
color: Theme.primaryText
|
||||||
|
visible: menuEntry?.buttonType === 1 && menuEntry?.checkState === 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
width: 16
|
||||||
|
height: 16
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
visible: menuEntry?.icon && menuEntry.icon !== ""
|
||||||
|
|
||||||
|
Image {
|
||||||
|
anchors.fill: parent
|
||||||
|
source: menuEntry?.icon || ""
|
||||||
|
sourceSize.width: 16
|
||||||
|
sourceSize.height: 16
|
||||||
|
fillMode: Image.PreserveAspectFit
|
||||||
|
smooth: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: menuEntry?.text || ""
|
||||||
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
|
color: (menuEntry?.enabled !== false) ? Theme.surfaceText : Theme.surfaceTextMedium
|
||||||
|
elide: Text.ElideRight
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
width: Math.max(150, parent.width - 64)
|
||||||
|
wrapMode: Text.NoWrap
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
width: 16
|
||||||
|
height: 16
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
||||||
|
DankIcon {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
name: "chevron_right"
|
||||||
|
size: 14
|
||||||
|
color: Theme.surfaceText
|
||||||
|
visible: menuEntry?.hasChildren ?? false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
NumberAnimation {
|
||||||
|
duration: Theme.mediumDuration
|
||||||
|
easing.type: Theme.emphasizedEasing
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Behavior on scale {
|
||||||
|
NumberAnimation {
|
||||||
|
duration: Theme.mediumDuration
|
||||||
|
easing.type: Theme.emphasizedEasing
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
z: -1
|
||||||
|
onClicked: menuRoot.close()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
property var currentTrayMenu: null
|
||||||
|
|
||||||
|
function showForTrayItem(item, anchor, screen, atBottom) {
|
||||||
|
if (currentTrayMenu) {
|
||||||
|
currentTrayMenu.destroy()
|
||||||
|
}
|
||||||
|
currentTrayMenu = trayMenuComponent.createObject(null)
|
||||||
|
if (currentTrayMenu) {
|
||||||
|
currentTrayMenu.showForTrayItem(item, anchor, screen, atBottom)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -12,7 +12,7 @@ Rectangle {
|
|||||||
property var parentScreen: null
|
property var parentScreen: null
|
||||||
property real widgetHeight: 30
|
property real widgetHeight: 30
|
||||||
property real barHeight: 48
|
property real barHeight: 48
|
||||||
readonly property real horizontalPadding: SettingsData.topBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
|
readonly property real horizontalPadding: SettingsData.dankBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
|
||||||
readonly property bool hasUpdates: SystemUpdateService.updateCount > 0
|
readonly property bool hasUpdates: SystemUpdateService.updateCount > 0
|
||||||
readonly property bool isChecking: SystemUpdateService.isChecking
|
readonly property bool isChecking: SystemUpdateService.isChecking
|
||||||
|
|
||||||
@@ -20,9 +20,9 @@ Rectangle {
|
|||||||
|
|
||||||
width: updaterIcon.width + horizontalPadding * 2
|
width: updaterIcon.width + horizontalPadding * 2
|
||||||
height: widgetHeight
|
height: widgetHeight
|
||||||
radius: SettingsData.topBarNoBackground ? 0 : Theme.cornerRadius
|
radius: SettingsData.dankBarNoBackground ? 0 : Theme.cornerRadius
|
||||||
color: {
|
color: {
|
||||||
if (SettingsData.topBarNoBackground) {
|
if (SettingsData.dankBarNoBackground) {
|
||||||
return "transparent";
|
return "transparent";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,7 +95,7 @@ Rectangle {
|
|||||||
const currentScreen = parentScreen || Screen;
|
const currentScreen = parentScreen || Screen;
|
||||||
const screenX = currentScreen.x || 0;
|
const screenX = currentScreen.x || 0;
|
||||||
const relativeX = globalPos.x - screenX;
|
const relativeX = globalPos.x - screenX;
|
||||||
popupTarget.setTriggerPosition(relativeX, barHeight + SettingsData.topBarSpacing + SettingsData.topBarBottomGap - 2 + Theme.popupDistance, width, section, currentScreen);
|
popupTarget.setTriggerPosition(relativeX, SettingsData.getPopupYPosition(barHeight), width, section, currentScreen);
|
||||||
}
|
}
|
||||||
root.clicked();
|
root.clicked();
|
||||||
}
|
}
|
||||||
@@ -13,15 +13,15 @@ Rectangle {
|
|||||||
property string section: "right"
|
property string section: "right"
|
||||||
property var popupTarget: null
|
property var popupTarget: null
|
||||||
property var parentScreen: null
|
property var parentScreen: null
|
||||||
readonly property real horizontalPadding: SettingsData.topBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
|
readonly property real horizontalPadding: SettingsData.dankBarNoBackground ? 0 : Math.max(Theme.spacingXS, Theme.spacingS * (widgetHeight / 30))
|
||||||
|
|
||||||
signal toggleVpnPopup()
|
signal toggleVpnPopup()
|
||||||
|
|
||||||
width: Theme.iconSize + horizontalPadding * 2
|
width: Theme.iconSize + horizontalPadding * 2
|
||||||
height: widgetHeight
|
height: widgetHeight
|
||||||
radius: SettingsData.topBarNoBackground ? 0 : Theme.cornerRadius
|
radius: SettingsData.dankBarNoBackground ? 0 : Theme.cornerRadius
|
||||||
color: {
|
color: {
|
||||||
if (SettingsData.topBarNoBackground) {
|
if (SettingsData.dankBarNoBackground) {
|
||||||
return "transparent";
|
return "transparent";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ Rectangle {
|
|||||||
const currentScreen = parentScreen || Screen;
|
const currentScreen = parentScreen || Screen;
|
||||||
const screenX = currentScreen.x || 0;
|
const screenX = currentScreen.x || 0;
|
||||||
const relativeX = globalPos.x - screenX;
|
const relativeX = globalPos.x - screenX;
|
||||||
popupTarget.setTriggerPosition(relativeX, barHeight + SettingsData.topBarSpacing + SettingsData.topBarBottomGap - 2 + Theme.popupDistance, width, section, currentScreen);
|
popupTarget.setTriggerPosition(relativeX, SettingsData.getPopupYPosition(barHeight), width, section, currentScreen);
|
||||||
}
|
}
|
||||||
root.toggleVpnPopup();
|
root.toggleVpnPopup();
|
||||||
}
|
}
|
||||||
@@ -27,7 +27,7 @@ DankPopout {
|
|||||||
popupWidth: 360
|
popupWidth: 360
|
||||||
popupHeight: Math.min(Screen.height - 100, contentLoader.item ? contentLoader.item.implicitHeight : 260)
|
popupHeight: Math.min(Screen.height - 100, contentLoader.item ? contentLoader.item.implicitHeight : 260)
|
||||||
triggerX: Screen.width - 380 - Theme.spacingL
|
triggerX: Screen.width - 380 - Theme.spacingL
|
||||||
triggerY: Theme.barHeight - 4 + SettingsData.topBarSpacing + Theme.popupDistance
|
triggerY: Theme.barHeight - 4 + SettingsData.dankBarSpacing + Theme.popupDistance
|
||||||
triggerWidth: 70
|
triggerWidth: 70
|
||||||
positioning: "center"
|
positioning: "center"
|
||||||
screen: triggerScreen
|
screen: triggerScreen
|
||||||
@@ -11,16 +11,16 @@ Rectangle {
|
|||||||
property var parentScreen: null
|
property var parentScreen: null
|
||||||
property real barHeight: 48
|
property real barHeight: 48
|
||||||
property real widgetHeight: 30
|
property real widgetHeight: 30
|
||||||
readonly property real horizontalPadding: SettingsData.topBarNoBackground ? 2 : Theme.spacingS
|
readonly property real horizontalPadding: SettingsData.dankBarNoBackground ? 2 : Theme.spacingS
|
||||||
|
|
||||||
signal clicked()
|
signal clicked()
|
||||||
|
|
||||||
visible: SettingsData.weatherEnabled
|
visible: SettingsData.weatherEnabled
|
||||||
width: visible ? Math.min(100, weatherRow.implicitWidth + horizontalPadding * 2) : 0
|
width: visible ? Math.min(100, weatherRow.implicitWidth + horizontalPadding * 2) : 0
|
||||||
height: widgetHeight
|
height: widgetHeight
|
||||||
radius: SettingsData.topBarNoBackground ? 0 : Theme.cornerRadius
|
radius: SettingsData.dankBarNoBackground ? 0 : Theme.cornerRadius
|
||||||
color: {
|
color: {
|
||||||
if (SettingsData.topBarNoBackground) {
|
if (SettingsData.dankBarNoBackground) {
|
||||||
return "transparent";
|
return "transparent";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ Rectangle {
|
|||||||
const currentScreen = parentScreen || Screen;
|
const currentScreen = parentScreen || Screen;
|
||||||
const screenX = currentScreen.x || 0;
|
const screenX = currentScreen.x || 0;
|
||||||
const relativeX = globalPos.x - screenX;
|
const relativeX = globalPos.x - screenX;
|
||||||
popupTarget.setTriggerPosition(relativeX, barHeight + SettingsData.topBarSpacing + SettingsData.topBarBottomGap - 2 + Theme.popupDistance, width, section, currentScreen);
|
popupTarget.setTriggerPosition(relativeX, SettingsData.getPopupYPosition(barHeight), width, section, currentScreen);
|
||||||
}
|
}
|
||||||
root.clicked();
|
root.clicked();
|
||||||
}
|
}
|
||||||
@@ -223,9 +223,9 @@ Rectangle {
|
|||||||
|
|
||||||
width: workspaceRow.implicitWidth + padding * 2
|
width: workspaceRow.implicitWidth + padding * 2
|
||||||
height: widgetHeight
|
height: widgetHeight
|
||||||
radius: SettingsData.topBarNoBackground ? 0 : Theme.cornerRadius
|
radius: SettingsData.dankBarNoBackground ? 0 : Theme.cornerRadius
|
||||||
color: {
|
color: {
|
||||||
if (SettingsData.topBarNoBackground)
|
if (SettingsData.dankBarNoBackground)
|
||||||
return "transparent"
|
return "transparent"
|
||||||
const baseColor = Theme.widgetBaseBackgroundColor
|
const baseColor = Theme.widgetBaseBackgroundColor
|
||||||
return Qt.rgba(baseColor.r, baseColor.g, baseColor.b, baseColor.a * Theme.widgetTransparency)
|
return Qt.rgba(baseColor.r, baseColor.g, baseColor.b, baseColor.a * Theme.widgetTransparency)
|
||||||
@@ -34,7 +34,7 @@ DankPopout {
|
|||||||
popupWidth: 700
|
popupWidth: 700
|
||||||
popupHeight: contentLoader.item ? contentLoader.item.implicitHeight : 500
|
popupHeight: contentLoader.item ? contentLoader.item.implicitHeight : 500
|
||||||
triggerX: Screen.width - 620 - Theme.spacingL
|
triggerX: Screen.width - 620 - Theme.spacingL
|
||||||
triggerY: Math.max(26 + SettingsData.topBarInnerPadding + 4, Theme.barHeight - 4 - (8 - SettingsData.topBarInnerPadding)) + SettingsData.topBarSpacing + SettingsData.topBarBottomGap - 2 + Theme.popupDistance
|
triggerY: Math.max(26 + SettingsData.dankBarInnerPadding + 4, Theme.barHeight - 4 - (8 - SettingsData.dankBarInnerPadding)) + SettingsData.dankBarSpacing + SettingsData.dankBarBottomGap - 2 + Theme.popupDistance
|
||||||
triggerWidth: 80
|
triggerWidth: 80
|
||||||
positioning: "center"
|
positioning: "center"
|
||||||
shouldBeVisible: dashVisible
|
shouldBeVisible: dashVisible
|
||||||
|
|||||||
@@ -25,6 +25,27 @@ Item {
|
|||||||
property string windowTitle: ""
|
property string windowTitle: ""
|
||||||
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
|
||||||
|
|
||||||
|
function updateDesktopEntry() {
|
||||||
|
if (!appData || appData.appId === "__SEPARATOR__") {
|
||||||
|
cachedDesktopEntry = null
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const moddedId = Paths.moddedAppId(appData.appId)
|
||||||
|
cachedDesktopEntry = DesktopEntries.heuristicLookup(moddedId)
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: updateDesktopEntry()
|
||||||
|
|
||||||
|
onAppDataChanged: updateDesktopEntry()
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: DesktopEntries
|
||||||
|
function onApplicationsChanged() {
|
||||||
|
updateDesktopEntry()
|
||||||
|
}
|
||||||
|
}
|
||||||
property bool isWindowFocused: {
|
property bool isWindowFocused: {
|
||||||
if (!appData) {
|
if (!appData) {
|
||||||
return false
|
return false
|
||||||
@@ -55,8 +76,7 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((appData.type === "window" && showWindowTitle) || (appData.type === "grouped" && appData.windowTitle)) {
|
if ((appData.type === "window" && showWindowTitle) || (appData.type === "grouped" && appData.windowTitle)) {
|
||||||
const desktopEntry = DesktopEntries.heuristicLookup(appData.appId)
|
const appName = cachedDesktopEntry && cachedDesktopEntry.name ? cachedDesktopEntry.name : appData.appId
|
||||||
const appName = desktopEntry && desktopEntry.name ? desktopEntry.name : appData.appId
|
|
||||||
const title = appData.type === "window" ? windowTitle : appData.windowTitle
|
const title = appData.type === "window" ? windowTitle : appData.windowTitle
|
||||||
return appName + (title ? " • " + title : "")
|
return appName + (title ? " • " + title : "")
|
||||||
}
|
}
|
||||||
@@ -65,8 +85,7 @@ Item {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
const desktopEntry = DesktopEntries.heuristicLookup(appData.appId)
|
return cachedDesktopEntry && cachedDesktopEntry.name ? cachedDesktopEntry.name : appData.appId
|
||||||
return desktopEntry && desktopEntry.name ? desktopEntry.name : appData.appId
|
|
||||||
}
|
}
|
||||||
|
|
||||||
width: 40
|
width: 40
|
||||||
@@ -255,7 +274,7 @@ Item {
|
|||||||
if (mouse.button === Qt.LeftButton) {
|
if (mouse.button === Qt.LeftButton) {
|
||||||
if (appData.type === "pinned") {
|
if (appData.type === "pinned") {
|
||||||
if (appData && appData.appId) {
|
if (appData && appData.appId) {
|
||||||
const desktopEntry = DesktopEntries.heuristicLookup(appData.appId)
|
const desktopEntry = cachedDesktopEntry
|
||||||
if (desktopEntry) {
|
if (desktopEntry) {
|
||||||
AppUsageHistoryData.addAppUsage({
|
AppUsageHistoryData.addAppUsage({
|
||||||
"id": appData.appId,
|
"id": appData.appId,
|
||||||
@@ -275,7 +294,7 @@ Item {
|
|||||||
} else if (appData.type === "grouped") {
|
} else if (appData.type === "grouped") {
|
||||||
if (appData.windowCount === 0) {
|
if (appData.windowCount === 0) {
|
||||||
if (appData && appData.appId) {
|
if (appData && appData.appId) {
|
||||||
const desktopEntry = DesktopEntries.heuristicLookup(appData.appId)
|
const desktopEntry = cachedDesktopEntry
|
||||||
if (desktopEntry) {
|
if (desktopEntry) {
|
||||||
AppUsageHistoryData.addAppUsage({
|
AppUsageHistoryData.addAppUsage({
|
||||||
"id": appData.appId,
|
"id": appData.appId,
|
||||||
@@ -305,7 +324,7 @@ Item {
|
|||||||
}
|
}
|
||||||
} else if (mouse.button === Qt.MiddleButton) {
|
} else if (mouse.button === Qt.MiddleButton) {
|
||||||
if (appData && appData.appId) {
|
if (appData && appData.appId) {
|
||||||
const desktopEntry = DesktopEntries.heuristicLookup(appData.appId)
|
const desktopEntry = cachedDesktopEntry
|
||||||
if (desktopEntry) {
|
if (desktopEntry) {
|
||||||
AppUsageHistoryData.addAppUsage({
|
AppUsageHistoryData.addAppUsage({
|
||||||
"id": appData.appId,
|
"id": appData.appId,
|
||||||
@@ -341,8 +360,7 @@ Item {
|
|||||||
if (moddedId.toLowerCase().includes("steam_app")) {
|
if (moddedId.toLowerCase().includes("steam_app")) {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
const desktopEntry = DesktopEntries.heuristicLookup(moddedId)
|
return cachedDesktopEntry && cachedDesktopEntry.icon ? Quickshell.iconPath(cachedDesktopEntry.icon, true) : ""
|
||||||
return desktopEntry && desktopEntry.icon ? Quickshell.iconPath(desktopEntry.icon, true) : ""
|
|
||||||
}
|
}
|
||||||
mipmap: true
|
mipmap: true
|
||||||
smooth: true
|
smooth: true
|
||||||
@@ -381,7 +399,7 @@ Item {
|
|||||||
return "?"
|
return "?"
|
||||||
}
|
}
|
||||||
|
|
||||||
const desktopEntry = DesktopEntries.heuristicLookup(appData.appId)
|
const desktopEntry = cachedDesktopEntry
|
||||||
if (desktopEntry && desktopEntry.name) {
|
if (desktopEntry && desktopEntry.name) {
|
||||||
return desktopEntry.name.charAt(0).toUpperCase()
|
return desktopEntry.name.charAt(0).toUpperCase()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ DankPopout {
|
|||||||
popupWidth: 400
|
popupWidth: 400
|
||||||
popupHeight: contentLoader.item ? contentLoader.item.implicitHeight : 400
|
popupHeight: contentLoader.item ? contentLoader.item.implicitHeight : 400
|
||||||
triggerX: Screen.width - 400 - Theme.spacingL
|
triggerX: Screen.width - 400 - Theme.spacingL
|
||||||
triggerY: Theme.barHeight - 4 + SettingsData.topBarSpacing + Theme.popupDistance
|
triggerY: Theme.barHeight - 4 + SettingsData.dankBarSpacing + Theme.popupDistance
|
||||||
triggerWidth: 40
|
triggerWidth: 40
|
||||||
positioning: "center"
|
positioning: "center"
|
||||||
screen: triggerScreen
|
screen: triggerScreen
|
||||||
|
|||||||
@@ -76,7 +76,13 @@ PanelWindow {
|
|||||||
color: "transparent"
|
color: "transparent"
|
||||||
implicitWidth: 400
|
implicitWidth: 400
|
||||||
implicitHeight: 122
|
implicitHeight: 122
|
||||||
onScreenYChanged: margins.top = Theme.barHeight - 4 + SettingsData.topBarSpacing + 4 + screenY
|
onScreenYChanged: {
|
||||||
|
if (SettingsData.dankBarAtBottom) {
|
||||||
|
margins.bottom = Theme.barHeight - 4 + SettingsData.dankBarSpacing + 4 + screenY
|
||||||
|
} else {
|
||||||
|
margins.top = Theme.barHeight - 4 + SettingsData.dankBarSpacing + 4 + screenY
|
||||||
|
}
|
||||||
|
}
|
||||||
onHasValidDataChanged: {
|
onHasValidDataChanged: {
|
||||||
if (!hasValidData && !exiting && !_isDestroying) {
|
if (!hasValidData && !exiting && !_isDestroying) {
|
||||||
forceExit()
|
forceExit()
|
||||||
@@ -109,12 +115,14 @@ PanelWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
top: true
|
top: !SettingsData.dankBarAtBottom
|
||||||
|
bottom: SettingsData.dankBarAtBottom
|
||||||
right: true
|
right: true
|
||||||
}
|
}
|
||||||
|
|
||||||
margins {
|
margins {
|
||||||
top: Theme.barHeight - 4 + SettingsData.topBarSpacing + 4
|
top: SettingsData.dankBarAtBottom ? 0 : (Theme.barHeight - 4 + SettingsData.dankBarSpacing + 4)
|
||||||
|
bottom: SettingsData.dankBarAtBottom ? (Theme.barHeight - 4 + SettingsData.dankBarSpacing + 4) : 0
|
||||||
right: 12
|
right: 12
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ DankPopout {
|
|||||||
popupWidth: 600
|
popupWidth: 600
|
||||||
popupHeight: 600
|
popupHeight: 600
|
||||||
triggerX: Screen.width - 600 - Theme.spacingL
|
triggerX: Screen.width - 600 - Theme.spacingL
|
||||||
triggerY: Math.max(26 + SettingsData.topBarInnerPadding + 4, Theme.barHeight - 4 - (8 - SettingsData.topBarInnerPadding)) + SettingsData.topBarSpacing + SettingsData.topBarBottomGap - 2 + Theme.popupDistance
|
triggerY: Math.max(26 + SettingsData.dankBarInnerPadding + 4, Theme.barHeight - 4 - (8 - SettingsData.dankBarInnerPadding)) + SettingsData.dankBarSpacing + SettingsData.dankBarBottomGap - 2 + Theme.popupDistance
|
||||||
triggerWidth: 55
|
triggerWidth: 55
|
||||||
positioning: "center"
|
positioning: "center"
|
||||||
screen: triggerScreen
|
screen: triggerScreen
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import qs.Services
|
|||||||
import qs.Widgets
|
import qs.Widgets
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: topBarTab
|
id: dankBarTab
|
||||||
|
|
||||||
property var baseWidgetDefinitions: [{
|
property var baseWidgetDefinitions: [{
|
||||||
"id": "launcherButton",
|
"id": "launcherButton",
|
||||||
@@ -236,51 +236,51 @@ Item {
|
|||||||
|
|
||||||
var widgets = []
|
var widgets = []
|
||||||
if (targetSection === "left") {
|
if (targetSection === "left") {
|
||||||
widgets = SettingsData.topBarLeftWidgets.slice()
|
widgets = SettingsData.dankBarLeftWidgets.slice()
|
||||||
widgets.push(widgetObj)
|
widgets.push(widgetObj)
|
||||||
SettingsData.setTopBarLeftWidgets(widgets)
|
SettingsData.setDankBarLeftWidgets(widgets)
|
||||||
} else if (targetSection === "center") {
|
} else if (targetSection === "center") {
|
||||||
widgets = SettingsData.topBarCenterWidgets.slice()
|
widgets = SettingsData.dankBarCenterWidgets.slice()
|
||||||
widgets.push(widgetObj)
|
widgets.push(widgetObj)
|
||||||
SettingsData.setTopBarCenterWidgets(widgets)
|
SettingsData.setDankBarCenterWidgets(widgets)
|
||||||
} else if (targetSection === "right") {
|
} else if (targetSection === "right") {
|
||||||
widgets = SettingsData.topBarRightWidgets.slice()
|
widgets = SettingsData.dankBarRightWidgets.slice()
|
||||||
widgets.push(widgetObj)
|
widgets.push(widgetObj)
|
||||||
SettingsData.setTopBarRightWidgets(widgets)
|
SettingsData.setDankBarRightWidgets(widgets)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeWidgetFromSection(sectionId, widgetIndex) {
|
function removeWidgetFromSection(sectionId, widgetIndex) {
|
||||||
var widgets = []
|
var widgets = []
|
||||||
if (sectionId === "left") {
|
if (sectionId === "left") {
|
||||||
widgets = SettingsData.topBarLeftWidgets.slice()
|
widgets = SettingsData.dankBarLeftWidgets.slice()
|
||||||
if (widgetIndex >= 0 && widgetIndex < widgets.length) {
|
if (widgetIndex >= 0 && widgetIndex < widgets.length) {
|
||||||
widgets.splice(widgetIndex, 1)
|
widgets.splice(widgetIndex, 1)
|
||||||
}
|
}
|
||||||
SettingsData.setTopBarLeftWidgets(widgets)
|
SettingsData.setDankBarLeftWidgets(widgets)
|
||||||
} else if (sectionId === "center") {
|
} else if (sectionId === "center") {
|
||||||
widgets = SettingsData.topBarCenterWidgets.slice()
|
widgets = SettingsData.dankBarCenterWidgets.slice()
|
||||||
if (widgetIndex >= 0 && widgetIndex < widgets.length) {
|
if (widgetIndex >= 0 && widgetIndex < widgets.length) {
|
||||||
widgets.splice(widgetIndex, 1)
|
widgets.splice(widgetIndex, 1)
|
||||||
}
|
}
|
||||||
SettingsData.setTopBarCenterWidgets(widgets)
|
SettingsData.setDankBarCenterWidgets(widgets)
|
||||||
} else if (sectionId === "right") {
|
} else if (sectionId === "right") {
|
||||||
widgets = SettingsData.topBarRightWidgets.slice()
|
widgets = SettingsData.dankBarRightWidgets.slice()
|
||||||
if (widgetIndex >= 0 && widgetIndex < widgets.length) {
|
if (widgetIndex >= 0 && widgetIndex < widgets.length) {
|
||||||
widgets.splice(widgetIndex, 1)
|
widgets.splice(widgetIndex, 1)
|
||||||
}
|
}
|
||||||
SettingsData.setTopBarRightWidgets(widgets)
|
SettingsData.setDankBarRightWidgets(widgets)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleItemEnabledChanged(sectionId, itemId, enabled) {
|
function handleItemEnabledChanged(sectionId, itemId, enabled) {
|
||||||
var widgets = []
|
var widgets = []
|
||||||
if (sectionId === "left")
|
if (sectionId === "left")
|
||||||
widgets = SettingsData.topBarLeftWidgets.slice()
|
widgets = SettingsData.dankBarLeftWidgets.slice()
|
||||||
else if (sectionId === "center")
|
else if (sectionId === "center")
|
||||||
widgets = SettingsData.topBarCenterWidgets.slice()
|
widgets = SettingsData.dankBarCenterWidgets.slice()
|
||||||
else if (sectionId === "right")
|
else if (sectionId === "right")
|
||||||
widgets = SettingsData.topBarRightWidgets.slice()
|
widgets = SettingsData.dankBarRightWidgets.slice()
|
||||||
for (var i = 0; i < widgets.length; i++) {
|
for (var i = 0; i < widgets.length; i++) {
|
||||||
var widget = widgets[i]
|
var widget = widgets[i]
|
||||||
var widgetId = typeof widget === "string" ? widget : widget.id
|
var widgetId = typeof widget === "string" ? widget : widget.id
|
||||||
@@ -316,30 +316,30 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (sectionId === "left")
|
if (sectionId === "left")
|
||||||
SettingsData.setTopBarLeftWidgets(widgets)
|
SettingsData.setDankBarLeftWidgets(widgets)
|
||||||
else if (sectionId === "center")
|
else if (sectionId === "center")
|
||||||
SettingsData.setTopBarCenterWidgets(widgets)
|
SettingsData.setDankBarCenterWidgets(widgets)
|
||||||
else if (sectionId === "right")
|
else if (sectionId === "right")
|
||||||
SettingsData.setTopBarRightWidgets(widgets)
|
SettingsData.setDankBarRightWidgets(widgets)
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleItemOrderChanged(sectionId, newOrder) {
|
function handleItemOrderChanged(sectionId, newOrder) {
|
||||||
if (sectionId === "left")
|
if (sectionId === "left")
|
||||||
SettingsData.setTopBarLeftWidgets(newOrder)
|
SettingsData.setDankBarLeftWidgets(newOrder)
|
||||||
else if (sectionId === "center")
|
else if (sectionId === "center")
|
||||||
SettingsData.setTopBarCenterWidgets(newOrder)
|
SettingsData.setDankBarCenterWidgets(newOrder)
|
||||||
else if (sectionId === "right")
|
else if (sectionId === "right")
|
||||||
SettingsData.setTopBarRightWidgets(newOrder)
|
SettingsData.setDankBarRightWidgets(newOrder)
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleSpacerSizeChanged(sectionId, widgetIndex, newSize) {
|
function handleSpacerSizeChanged(sectionId, widgetIndex, newSize) {
|
||||||
var widgets = []
|
var widgets = []
|
||||||
if (sectionId === "left")
|
if (sectionId === "left")
|
||||||
widgets = SettingsData.topBarLeftWidgets.slice()
|
widgets = SettingsData.dankBarLeftWidgets.slice()
|
||||||
else if (sectionId === "center")
|
else if (sectionId === "center")
|
||||||
widgets = SettingsData.topBarCenterWidgets.slice()
|
widgets = SettingsData.dankBarCenterWidgets.slice()
|
||||||
else if (sectionId === "right")
|
else if (sectionId === "right")
|
||||||
widgets = SettingsData.topBarRightWidgets.slice()
|
widgets = SettingsData.dankBarRightWidgets.slice()
|
||||||
|
|
||||||
if (widgetIndex >= 0 && widgetIndex < widgets.length) {
|
if (widgetIndex >= 0 && widgetIndex < widgets.length) {
|
||||||
var widget = widgets[widgetIndex]
|
var widget = widgets[widgetIndex]
|
||||||
@@ -372,21 +372,21 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (sectionId === "left")
|
if (sectionId === "left")
|
||||||
SettingsData.setTopBarLeftWidgets(widgets)
|
SettingsData.setDankBarLeftWidgets(widgets)
|
||||||
else if (sectionId === "center")
|
else if (sectionId === "center")
|
||||||
SettingsData.setTopBarCenterWidgets(widgets)
|
SettingsData.setDankBarCenterWidgets(widgets)
|
||||||
else if (sectionId === "right")
|
else if (sectionId === "right")
|
||||||
SettingsData.setTopBarRightWidgets(widgets)
|
SettingsData.setDankBarRightWidgets(widgets)
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleGpuSelectionChanged(sectionId, widgetIndex, selectedGpuIndex) {
|
function handleGpuSelectionChanged(sectionId, widgetIndex, selectedGpuIndex) {
|
||||||
var widgets = []
|
var widgets = []
|
||||||
if (sectionId === "left")
|
if (sectionId === "left")
|
||||||
widgets = SettingsData.topBarLeftWidgets.slice()
|
widgets = SettingsData.dankBarLeftWidgets.slice()
|
||||||
else if (sectionId === "center")
|
else if (sectionId === "center")
|
||||||
widgets = SettingsData.topBarCenterWidgets.slice()
|
widgets = SettingsData.dankBarCenterWidgets.slice()
|
||||||
else if (sectionId === "right")
|
else if (sectionId === "right")
|
||||||
widgets = SettingsData.topBarRightWidgets.slice()
|
widgets = SettingsData.dankBarRightWidgets.slice()
|
||||||
|
|
||||||
if (widgetIndex >= 0 && widgetIndex < widgets.length) {
|
if (widgetIndex >= 0 && widgetIndex < widgets.length) {
|
||||||
var widget = widgets[widgetIndex]
|
var widget = widgets[widgetIndex]
|
||||||
@@ -415,21 +415,21 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (sectionId === "left")
|
if (sectionId === "left")
|
||||||
SettingsData.setTopBarLeftWidgets(widgets)
|
SettingsData.setDankBarLeftWidgets(widgets)
|
||||||
else if (sectionId === "center")
|
else if (sectionId === "center")
|
||||||
SettingsData.setTopBarCenterWidgets(widgets)
|
SettingsData.setDankBarCenterWidgets(widgets)
|
||||||
else if (sectionId === "right")
|
else if (sectionId === "right")
|
||||||
SettingsData.setTopBarRightWidgets(widgets)
|
SettingsData.setDankBarRightWidgets(widgets)
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleDiskMountSelectionChanged(sectionId, widgetIndex, mountPath) {
|
function handleDiskMountSelectionChanged(sectionId, widgetIndex, mountPath) {
|
||||||
var widgets = []
|
var widgets = []
|
||||||
if (sectionId === "left")
|
if (sectionId === "left")
|
||||||
widgets = SettingsData.topBarLeftWidgets.slice()
|
widgets = SettingsData.dankBarLeftWidgets.slice()
|
||||||
else if (sectionId === "center")
|
else if (sectionId === "center")
|
||||||
widgets = SettingsData.topBarCenterWidgets.slice()
|
widgets = SettingsData.dankBarCenterWidgets.slice()
|
||||||
else if (sectionId === "right")
|
else if (sectionId === "right")
|
||||||
widgets = SettingsData.topBarRightWidgets.slice()
|
widgets = SettingsData.dankBarRightWidgets.slice()
|
||||||
|
|
||||||
if (widgetIndex >= 0 && widgetIndex < widgets.length) {
|
if (widgetIndex >= 0 && widgetIndex < widgets.length) {
|
||||||
var widget = widgets[widgetIndex]
|
var widget = widgets[widgetIndex]
|
||||||
@@ -461,11 +461,11 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (sectionId === "left")
|
if (sectionId === "left")
|
||||||
SettingsData.setTopBarLeftWidgets(widgets)
|
SettingsData.setDankBarLeftWidgets(widgets)
|
||||||
else if (sectionId === "center")
|
else if (sectionId === "center")
|
||||||
SettingsData.setTopBarCenterWidgets(widgets)
|
SettingsData.setDankBarCenterWidgets(widgets)
|
||||||
else if (sectionId === "right")
|
else if (sectionId === "right")
|
||||||
SettingsData.setTopBarRightWidgets(widgets)
|
SettingsData.setDankBarRightWidgets(widgets)
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleControlCenterSettingChanged(sectionId, widgetIndex, settingName, value) {
|
function handleControlCenterSettingChanged(sectionId, widgetIndex, settingName, value) {
|
||||||
@@ -483,11 +483,11 @@ Item {
|
|||||||
var widgets = []
|
var widgets = []
|
||||||
var widgetData = []
|
var widgetData = []
|
||||||
if (sectionId === "left")
|
if (sectionId === "left")
|
||||||
widgetData = SettingsData.topBarLeftWidgets || []
|
widgetData = SettingsData.dankBarLeftWidgets || []
|
||||||
else if (sectionId === "center")
|
else if (sectionId === "center")
|
||||||
widgetData = SettingsData.topBarCenterWidgets || []
|
widgetData = SettingsData.dankBarCenterWidgets || []
|
||||||
else if (sectionId === "right")
|
else if (sectionId === "right")
|
||||||
widgetData = SettingsData.topBarRightWidgets || []
|
widgetData = SettingsData.dankBarRightWidgets || []
|
||||||
widgetData.forEach(widget => {
|
widgetData.forEach(widget => {
|
||||||
var widgetId = typeof widget === "string" ? widget : widget.id
|
var widgetId = typeof widget === "string" ? widget : widget.id
|
||||||
var widgetEnabled = typeof widget
|
var widgetEnabled = typeof widget
|
||||||
@@ -531,23 +531,23 @@ Item {
|
|||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
// Only set defaults if widgets have never been configured (null/undefined, not empty array)
|
// Only set defaults if widgets have never been configured (null/undefined, not empty array)
|
||||||
if (!SettingsData.topBarLeftWidgets)
|
if (!SettingsData.dankBarLeftWidgets)
|
||||||
SettingsData.setTopBarLeftWidgets(defaultLeftWidgets)
|
SettingsData.setDankBarLeftWidgets(defaultLeftWidgets)
|
||||||
|
|
||||||
if (!SettingsData.topBarCenterWidgets)
|
if (!SettingsData.dankBarCenterWidgets)
|
||||||
SettingsData.setTopBarCenterWidgets(defaultCenterWidgets)
|
SettingsData.setDankBarCenterWidgets(defaultCenterWidgets)
|
||||||
|
|
||||||
if (!SettingsData.topBarRightWidgets)
|
if (!SettingsData.dankBarRightWidgets)
|
||||||
SettingsData.setTopBarRightWidgets(defaultRightWidgets)
|
SettingsData.setDankBarRightWidgets(defaultRightWidgets)
|
||||||
const sections = ["left", "center", "right"]
|
const sections = ["left", "center", "right"]
|
||||||
sections.forEach(sectionId => {
|
sections.forEach(sectionId => {
|
||||||
var widgets = []
|
var widgets = []
|
||||||
if (sectionId === "left")
|
if (sectionId === "left")
|
||||||
widgets = SettingsData.topBarLeftWidgets.slice()
|
widgets = SettingsData.dankBarLeftWidgets.slice()
|
||||||
else if (sectionId === "center")
|
else if (sectionId === "center")
|
||||||
widgets = SettingsData.topBarCenterWidgets.slice()
|
widgets = SettingsData.dankBarCenterWidgets.slice()
|
||||||
else if (sectionId === "right")
|
else if (sectionId === "right")
|
||||||
widgets = SettingsData.topBarRightWidgets.slice()
|
widgets = SettingsData.dankBarRightWidgets.slice()
|
||||||
var updated = false
|
var updated = false
|
||||||
for (var i = 0; i < widgets.length; i++) {
|
for (var i = 0; i < widgets.length; i++) {
|
||||||
var widget = widgets[i]
|
var widget = widgets[i]
|
||||||
@@ -562,11 +562,11 @@ Item {
|
|||||||
}
|
}
|
||||||
if (updated) {
|
if (updated) {
|
||||||
if (sectionId === "left")
|
if (sectionId === "left")
|
||||||
SettingsData.setTopBarLeftWidgets(widgets)
|
SettingsData.setDankBarLeftWidgets(widgets)
|
||||||
else if (sectionId === "center")
|
else if (sectionId === "center")
|
||||||
SettingsData.setTopBarCenterWidgets(widgets)
|
SettingsData.setDankBarCenterWidgets(widgets)
|
||||||
else if (sectionId === "right")
|
else if (sectionId === "right")
|
||||||
SettingsData.setTopBarRightWidgets(widgets)
|
SettingsData.setDankBarRightWidgets(widgets)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -584,10 +584,10 @@ Item {
|
|||||||
width: parent.width
|
width: parent.width
|
||||||
spacing: Theme.spacingXL
|
spacing: Theme.spacingXL
|
||||||
|
|
||||||
// TopBar Auto-hide Section
|
// Position Section
|
||||||
StyledRect {
|
StyledRect {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: topBarAutoHideSection.implicitHeight + Theme.spacingL * 2
|
height: positionSection.implicitHeight + Theme.spacingL * 2
|
||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
color: Theme.surfaceContainerHigh
|
color: Theme.surfaceContainerHigh
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
|
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
|
||||||
@@ -595,7 +595,58 @@ Item {
|
|||||||
border.width: 0
|
border.width: 0
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
id: topBarAutoHideSection
|
id: positionSection
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.margins: Theme.spacingL
|
||||||
|
spacing: Theme.spacingM
|
||||||
|
|
||||||
|
Row {
|
||||||
|
width: parent.width
|
||||||
|
spacing: Theme.spacingM
|
||||||
|
|
||||||
|
DankIcon {
|
||||||
|
name: "vertical_align_center"
|
||||||
|
size: Theme.iconSize
|
||||||
|
color: Theme.primary
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: "Position"
|
||||||
|
font.pixelSize: Theme.fontSizeLarge
|
||||||
|
font.weight: Font.Medium
|
||||||
|
color: Theme.surfaceText
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
DankButtonGroup {
|
||||||
|
id: positionButtonGroup
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
model: ["Top", "Bottom"]
|
||||||
|
currentIndex: SettingsData.dankBarAtBottom ? 1 : 0
|
||||||
|
onSelectionChanged: (index, selected) => {
|
||||||
|
if (selected) {
|
||||||
|
SettingsData.setDankBarAtBottom(index === 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// DankBar Auto-hide Section
|
||||||
|
StyledRect {
|
||||||
|
width: parent.width
|
||||||
|
height: dankBarAutoHideSection.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
|
||||||
|
|
||||||
|
Column {
|
||||||
|
id: dankBarAutoHideSection
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: Theme.spacingL
|
anchors.margins: Theme.spacingL
|
||||||
@@ -638,9 +689,9 @@ Item {
|
|||||||
id: autoHideToggle
|
id: autoHideToggle
|
||||||
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
checked: SettingsData.topBarAutoHide
|
checked: SettingsData.dankBarAutoHide
|
||||||
onToggled: toggled => {
|
onToggled: toggled => {
|
||||||
return SettingsData.setTopBarAutoHide(
|
return SettingsData.setDankBarAutoHide(
|
||||||
toggled)
|
toggled)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -690,9 +741,9 @@ Item {
|
|||||||
id: visibilityToggle
|
id: visibilityToggle
|
||||||
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
checked: SettingsData.topBarVisible
|
checked: SettingsData.dankBarVisible
|
||||||
onToggled: toggled => {
|
onToggled: toggled => {
|
||||||
return SettingsData.setTopBarVisible(
|
return SettingsData.setDankBarVisible(
|
||||||
toggled)
|
toggled)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -744,9 +795,9 @@ Item {
|
|||||||
id: overviewToggle
|
id: overviewToggle
|
||||||
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
checked: SettingsData.topBarOpenOnOverview
|
checked: SettingsData.dankBarOpenOnOverview
|
||||||
onToggled: toggled => {
|
onToggled: toggled => {
|
||||||
return SettingsData.setTopBarOpenOnOverview(
|
return SettingsData.setDankBarOpenOnOverview(
|
||||||
toggled)
|
toggled)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -758,7 +809,7 @@ Item {
|
|||||||
// Spacing
|
// Spacing
|
||||||
StyledRect {
|
StyledRect {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: topBarSpacingSection.implicitHeight + Theme.spacingL * 2
|
height: dankBarSpacingSection.implicitHeight + Theme.spacingL * 2
|
||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
color: Theme.surfaceContainerHigh
|
color: Theme.surfaceContainerHigh
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
|
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
|
||||||
@@ -766,7 +817,7 @@ Item {
|
|||||||
border.width: 0
|
border.width: 0
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
id: topBarSpacingSection
|
id: dankBarSpacingSection
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: Theme.spacingL
|
anchors.margins: Theme.spacingL
|
||||||
@@ -797,7 +848,7 @@ Item {
|
|||||||
spacing: Theme.spacingS
|
spacing: Theme.spacingS
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: "Top/Left/Right Gaps (0 = edge-to-edge)"
|
text: "Edge Spacing (0 = edge-to-edge)"
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
font.weight: Font.Medium
|
font.weight: Font.Medium
|
||||||
@@ -806,7 +857,7 @@ Item {
|
|||||||
DankSlider {
|
DankSlider {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: 24
|
height: 24
|
||||||
value: SettingsData.topBarSpacing
|
value: SettingsData.dankBarSpacing
|
||||||
minimum: 0
|
minimum: 0
|
||||||
maximum: 32
|
maximum: 32
|
||||||
unit: ""
|
unit: ""
|
||||||
@@ -814,7 +865,7 @@ Item {
|
|||||||
wheelEnabled: false
|
wheelEnabled: false
|
||||||
thumbOutlineColor: Theme.surfaceContainerHigh
|
thumbOutlineColor: Theme.surfaceContainerHigh
|
||||||
onSliderValueChanged: newValue => {
|
onSliderValueChanged: newValue => {
|
||||||
SettingsData.setTopBarSpacing(
|
SettingsData.setDankBarSpacing(
|
||||||
newValue)
|
newValue)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -825,7 +876,7 @@ Item {
|
|||||||
spacing: Theme.spacingS
|
spacing: Theme.spacingS
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: "Bottom Gap (Exclusive Zone)"
|
text: "Height to Edge Gap (Exclusive Zone)"
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
font.weight: Font.Medium
|
font.weight: Font.Medium
|
||||||
@@ -834,7 +885,7 @@ Item {
|
|||||||
DankSlider {
|
DankSlider {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: 24
|
height: 24
|
||||||
value: SettingsData.topBarBottomGap
|
value: SettingsData.dankBarBottomGap
|
||||||
minimum: -100
|
minimum: -100
|
||||||
maximum: 100
|
maximum: 100
|
||||||
unit: ""
|
unit: ""
|
||||||
@@ -842,7 +893,7 @@ Item {
|
|||||||
wheelEnabled: false
|
wheelEnabled: false
|
||||||
thumbOutlineColor: Theme.surfaceContainerHigh
|
thumbOutlineColor: Theme.surfaceContainerHigh
|
||||||
onSliderValueChanged: newValue => {
|
onSliderValueChanged: newValue => {
|
||||||
SettingsData.setTopBarBottomGap(
|
SettingsData.setDankBarBottomGap(
|
||||||
newValue)
|
newValue)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -862,7 +913,7 @@ Item {
|
|||||||
DankSlider {
|
DankSlider {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: 24
|
height: 24
|
||||||
value: SettingsData.topBarInnerPadding
|
value: SettingsData.dankBarInnerPadding
|
||||||
minimum: 0
|
minimum: 0
|
||||||
maximum: 24
|
maximum: 24
|
||||||
unit: ""
|
unit: ""
|
||||||
@@ -870,7 +921,7 @@ Item {
|
|||||||
wheelEnabled: false
|
wheelEnabled: false
|
||||||
thumbOutlineColor: Theme.surfaceContainerHigh
|
thumbOutlineColor: Theme.surfaceContainerHigh
|
||||||
onSliderValueChanged: newValue => {
|
onSliderValueChanged: newValue => {
|
||||||
SettingsData.setTopBarInnerPadding(
|
SettingsData.setDankBarInnerPadding(
|
||||||
newValue)
|
newValue)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -881,9 +932,9 @@ Item {
|
|||||||
width: parent.width
|
width: parent.width
|
||||||
text: "Square Corners"
|
text: "Square Corners"
|
||||||
description: "Removes rounded corners from bar container."
|
description: "Removes rounded corners from bar container."
|
||||||
checked: SettingsData.topBarSquareCorners
|
checked: SettingsData.dankBarSquareCorners
|
||||||
onToggled: checked => {
|
onToggled: checked => {
|
||||||
SettingsData.setTopBarSquareCorners(
|
SettingsData.setDankBarSquareCorners(
|
||||||
checked)
|
checked)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -892,9 +943,9 @@ Item {
|
|||||||
width: parent.width
|
width: parent.width
|
||||||
text: "No Background"
|
text: "No Background"
|
||||||
description: "Remove widget backgrounds for a minimal look with tighter spacing."
|
description: "Remove widget backgrounds for a minimal look with tighter spacing."
|
||||||
checked: SettingsData.topBarNoBackground
|
checked: SettingsData.dankBarNoBackground
|
||||||
onToggled: checked => {
|
onToggled: checked => {
|
||||||
SettingsData.setTopBarNoBackground(
|
SettingsData.setDankBarNoBackground(
|
||||||
checked)
|
checked)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -903,9 +954,9 @@ Item {
|
|||||||
width: parent.width
|
width: parent.width
|
||||||
text: "Goth Corners"
|
text: "Goth Corners"
|
||||||
description: "Add curved swooping tips at the bottom of the bar."
|
description: "Add curved swooping tips at the bottom of the bar."
|
||||||
checked: SettingsData.topBarGothCornersEnabled
|
checked: SettingsData.dankBarGothCornersEnabled
|
||||||
onToggled: checked => {
|
onToggled: checked => {
|
||||||
SettingsData.setTopBarGothCornersEnabled(
|
SettingsData.setDankBarGothCornersEnabled(
|
||||||
checked)
|
checked)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -996,11 +1047,11 @@ Item {
|
|||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: {
|
||||||
SettingsData.setTopBarLeftWidgets(
|
SettingsData.setDankBarLeftWidgets(
|
||||||
defaultLeftWidgets)
|
defaultLeftWidgets)
|
||||||
SettingsData.setTopBarCenterWidgets(
|
SettingsData.setDankBarCenterWidgets(
|
||||||
defaultCenterWidgets)
|
defaultCenterWidgets)
|
||||||
SettingsData.setTopBarRightWidgets(
|
SettingsData.setDankBarRightWidgets(
|
||||||
defaultRightWidgets)
|
defaultRightWidgets)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1052,29 +1103,29 @@ Item {
|
|||||||
title: "Left Section"
|
title: "Left Section"
|
||||||
titleIcon: "format_align_left"
|
titleIcon: "format_align_left"
|
||||||
sectionId: "left"
|
sectionId: "left"
|
||||||
allWidgets: topBarTab.baseWidgetDefinitions
|
allWidgets: dankBarTab.baseWidgetDefinitions
|
||||||
items: topBarTab.getItemsForSection("left")
|
items: dankBarTab.getItemsForSection("left")
|
||||||
onItemEnabledChanged: (sectionId, itemId, enabled) => {
|
onItemEnabledChanged: (sectionId, itemId, enabled) => {
|
||||||
topBarTab.handleItemEnabledChanged(
|
dankBarTab.handleItemEnabledChanged(
|
||||||
sectionId,
|
sectionId,
|
||||||
itemId, enabled)
|
itemId, enabled)
|
||||||
}
|
}
|
||||||
onItemOrderChanged: newOrder => {
|
onItemOrderChanged: newOrder => {
|
||||||
topBarTab.handleItemOrderChanged(
|
dankBarTab.handleItemOrderChanged(
|
||||||
"left", newOrder)
|
"left", newOrder)
|
||||||
}
|
}
|
||||||
onAddWidget: sectionId => {
|
onAddWidget: sectionId => {
|
||||||
widgetSelectionPopup.allWidgets
|
widgetSelectionPopup.allWidgets
|
||||||
= topBarTab.baseWidgetDefinitions
|
= dankBarTab.baseWidgetDefinitions
|
||||||
widgetSelectionPopup.targetSection = sectionId
|
widgetSelectionPopup.targetSection = sectionId
|
||||||
widgetSelectionPopup.safeOpen()
|
widgetSelectionPopup.safeOpen()
|
||||||
}
|
}
|
||||||
onRemoveWidget: (sectionId, widgetIndex) => {
|
onRemoveWidget: (sectionId, widgetIndex) => {
|
||||||
topBarTab.removeWidgetFromSection(
|
dankBarTab.removeWidgetFromSection(
|
||||||
sectionId, widgetIndex)
|
sectionId, widgetIndex)
|
||||||
}
|
}
|
||||||
onSpacerSizeChanged: (sectionId, widgetIndex, newSize) => {
|
onSpacerSizeChanged: (sectionId, widgetIndex, newSize) => {
|
||||||
topBarTab.handleSpacerSizeChanged(
|
dankBarTab.handleSpacerSizeChanged(
|
||||||
sectionId, widgetIndex, newSize)
|
sectionId, widgetIndex, newSize)
|
||||||
}
|
}
|
||||||
onCompactModeChanged: (widgetId, value) => {
|
onCompactModeChanged: (widgetId, value) => {
|
||||||
@@ -1096,12 +1147,12 @@ Item {
|
|||||||
handleControlCenterSettingChanged(sectionId, widgetIndex, settingName, value)
|
handleControlCenterSettingChanged(sectionId, widgetIndex, settingName, value)
|
||||||
}
|
}
|
||||||
onGpuSelectionChanged: (sectionId, widgetIndex, selectedIndex) => {
|
onGpuSelectionChanged: (sectionId, widgetIndex, selectedIndex) => {
|
||||||
topBarTab.handleGpuSelectionChanged(
|
dankBarTab.handleGpuSelectionChanged(
|
||||||
sectionId, widgetIndex,
|
sectionId, widgetIndex,
|
||||||
selectedIndex)
|
selectedIndex)
|
||||||
}
|
}
|
||||||
onDiskMountSelectionChanged: (sectionId, widgetIndex, mountPath) => {
|
onDiskMountSelectionChanged: (sectionId, widgetIndex, mountPath) => {
|
||||||
topBarTab.handleDiskMountSelectionChanged(
|
dankBarTab.handleDiskMountSelectionChanged(
|
||||||
sectionId, widgetIndex, mountPath)
|
sectionId, widgetIndex, mountPath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1124,29 +1175,29 @@ Item {
|
|||||||
title: "Center Section"
|
title: "Center Section"
|
||||||
titleIcon: "format_align_center"
|
titleIcon: "format_align_center"
|
||||||
sectionId: "center"
|
sectionId: "center"
|
||||||
allWidgets: topBarTab.baseWidgetDefinitions
|
allWidgets: dankBarTab.baseWidgetDefinitions
|
||||||
items: topBarTab.getItemsForSection("center")
|
items: dankBarTab.getItemsForSection("center")
|
||||||
onItemEnabledChanged: (sectionId, itemId, enabled) => {
|
onItemEnabledChanged: (sectionId, itemId, enabled) => {
|
||||||
topBarTab.handleItemEnabledChanged(
|
dankBarTab.handleItemEnabledChanged(
|
||||||
sectionId,
|
sectionId,
|
||||||
itemId, enabled)
|
itemId, enabled)
|
||||||
}
|
}
|
||||||
onItemOrderChanged: newOrder => {
|
onItemOrderChanged: newOrder => {
|
||||||
topBarTab.handleItemOrderChanged(
|
dankBarTab.handleItemOrderChanged(
|
||||||
"center", newOrder)
|
"center", newOrder)
|
||||||
}
|
}
|
||||||
onAddWidget: sectionId => {
|
onAddWidget: sectionId => {
|
||||||
widgetSelectionPopup.allWidgets
|
widgetSelectionPopup.allWidgets
|
||||||
= topBarTab.baseWidgetDefinitions
|
= dankBarTab.baseWidgetDefinitions
|
||||||
widgetSelectionPopup.targetSection = sectionId
|
widgetSelectionPopup.targetSection = sectionId
|
||||||
widgetSelectionPopup.safeOpen()
|
widgetSelectionPopup.safeOpen()
|
||||||
}
|
}
|
||||||
onRemoveWidget: (sectionId, widgetIndex) => {
|
onRemoveWidget: (sectionId, widgetIndex) => {
|
||||||
topBarTab.removeWidgetFromSection(
|
dankBarTab.removeWidgetFromSection(
|
||||||
sectionId, widgetIndex)
|
sectionId, widgetIndex)
|
||||||
}
|
}
|
||||||
onSpacerSizeChanged: (sectionId, widgetIndex, newSize) => {
|
onSpacerSizeChanged: (sectionId, widgetIndex, newSize) => {
|
||||||
topBarTab.handleSpacerSizeChanged(
|
dankBarTab.handleSpacerSizeChanged(
|
||||||
sectionId, widgetIndex, newSize)
|
sectionId, widgetIndex, newSize)
|
||||||
}
|
}
|
||||||
onCompactModeChanged: (widgetId, value) => {
|
onCompactModeChanged: (widgetId, value) => {
|
||||||
@@ -1168,12 +1219,12 @@ Item {
|
|||||||
handleControlCenterSettingChanged(sectionId, widgetIndex, settingName, value)
|
handleControlCenterSettingChanged(sectionId, widgetIndex, settingName, value)
|
||||||
}
|
}
|
||||||
onGpuSelectionChanged: (sectionId, widgetIndex, selectedIndex) => {
|
onGpuSelectionChanged: (sectionId, widgetIndex, selectedIndex) => {
|
||||||
topBarTab.handleGpuSelectionChanged(
|
dankBarTab.handleGpuSelectionChanged(
|
||||||
sectionId, widgetIndex,
|
sectionId, widgetIndex,
|
||||||
selectedIndex)
|
selectedIndex)
|
||||||
}
|
}
|
||||||
onDiskMountSelectionChanged: (sectionId, widgetIndex, mountPath) => {
|
onDiskMountSelectionChanged: (sectionId, widgetIndex, mountPath) => {
|
||||||
topBarTab.handleDiskMountSelectionChanged(
|
dankBarTab.handleDiskMountSelectionChanged(
|
||||||
sectionId, widgetIndex, mountPath)
|
sectionId, widgetIndex, mountPath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1196,29 +1247,29 @@ Item {
|
|||||||
title: "Right Section"
|
title: "Right Section"
|
||||||
titleIcon: "format_align_right"
|
titleIcon: "format_align_right"
|
||||||
sectionId: "right"
|
sectionId: "right"
|
||||||
allWidgets: topBarTab.baseWidgetDefinitions
|
allWidgets: dankBarTab.baseWidgetDefinitions
|
||||||
items: topBarTab.getItemsForSection("right")
|
items: dankBarTab.getItemsForSection("right")
|
||||||
onItemEnabledChanged: (sectionId, itemId, enabled) => {
|
onItemEnabledChanged: (sectionId, itemId, enabled) => {
|
||||||
topBarTab.handleItemEnabledChanged(
|
dankBarTab.handleItemEnabledChanged(
|
||||||
sectionId,
|
sectionId,
|
||||||
itemId, enabled)
|
itemId, enabled)
|
||||||
}
|
}
|
||||||
onItemOrderChanged: newOrder => {
|
onItemOrderChanged: newOrder => {
|
||||||
topBarTab.handleItemOrderChanged(
|
dankBarTab.handleItemOrderChanged(
|
||||||
"right", newOrder)
|
"right", newOrder)
|
||||||
}
|
}
|
||||||
onAddWidget: sectionId => {
|
onAddWidget: sectionId => {
|
||||||
widgetSelectionPopup.allWidgets
|
widgetSelectionPopup.allWidgets
|
||||||
= topBarTab.baseWidgetDefinitions
|
= dankBarTab.baseWidgetDefinitions
|
||||||
widgetSelectionPopup.targetSection = sectionId
|
widgetSelectionPopup.targetSection = sectionId
|
||||||
widgetSelectionPopup.safeOpen()
|
widgetSelectionPopup.safeOpen()
|
||||||
}
|
}
|
||||||
onRemoveWidget: (sectionId, widgetIndex) => {
|
onRemoveWidget: (sectionId, widgetIndex) => {
|
||||||
topBarTab.removeWidgetFromSection(
|
dankBarTab.removeWidgetFromSection(
|
||||||
sectionId, widgetIndex)
|
sectionId, widgetIndex)
|
||||||
}
|
}
|
||||||
onSpacerSizeChanged: (sectionId, widgetIndex, newSize) => {
|
onSpacerSizeChanged: (sectionId, widgetIndex, newSize) => {
|
||||||
topBarTab.handleSpacerSizeChanged(
|
dankBarTab.handleSpacerSizeChanged(
|
||||||
sectionId, widgetIndex, newSize)
|
sectionId, widgetIndex, newSize)
|
||||||
}
|
}
|
||||||
onCompactModeChanged: (widgetId, value) => {
|
onCompactModeChanged: (widgetId, value) => {
|
||||||
@@ -1240,12 +1291,12 @@ Item {
|
|||||||
handleControlCenterSettingChanged(sectionId, widgetIndex, settingName, value)
|
handleControlCenterSettingChanged(sectionId, widgetIndex, settingName, value)
|
||||||
}
|
}
|
||||||
onGpuSelectionChanged: (sectionId, widgetIndex, selectedIndex) => {
|
onGpuSelectionChanged: (sectionId, widgetIndex, selectedIndex) => {
|
||||||
topBarTab.handleGpuSelectionChanged(
|
dankBarTab.handleGpuSelectionChanged(
|
||||||
sectionId, widgetIndex,
|
sectionId, widgetIndex,
|
||||||
selectedIndex)
|
selectedIndex)
|
||||||
}
|
}
|
||||||
onDiskMountSelectionChanged: (sectionId, widgetIndex, mountPath) => {
|
onDiskMountSelectionChanged: (sectionId, widgetIndex, mountPath) => {
|
||||||
topBarTab.handleDiskMountSelectionChanged(
|
dankBarTab.handleDiskMountSelectionChanged(
|
||||||
sectionId, widgetIndex, mountPath)
|
sectionId, widgetIndex, mountPath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1259,7 +1310,7 @@ Item {
|
|||||||
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
onWidgetSelected: (widgetId, targetSection) => {
|
onWidgetSelected: (widgetId, targetSection) => {
|
||||||
topBarTab.addWidgetToSection(widgetId,
|
dankBarTab.addWidgetToSection(widgetId,
|
||||||
targetSection)
|
targetSection)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -764,7 +764,7 @@ Item {
|
|||||||
spacing: Theme.spacingS
|
spacing: Theme.spacingS
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: "Top Bar Transparency"
|
text: "Dank Bar Transparency"
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
font.weight: Font.Medium
|
font.weight: Font.Medium
|
||||||
@@ -774,7 +774,7 @@ Item {
|
|||||||
width: parent.width
|
width: parent.width
|
||||||
height: 24
|
height: 24
|
||||||
value: Math.round(
|
value: Math.round(
|
||||||
SettingsData.topBarTransparency * 100)
|
SettingsData.dankBarTransparency * 100)
|
||||||
minimum: 0
|
minimum: 0
|
||||||
maximum: 100
|
maximum: 100
|
||||||
unit: ""
|
unit: ""
|
||||||
@@ -782,7 +782,7 @@ Item {
|
|||||||
wheelEnabled: false
|
wheelEnabled: false
|
||||||
thumbOutlineColor: Theme.surfaceContainerHigh
|
thumbOutlineColor: Theme.surfaceContainerHigh
|
||||||
onSliderValueChanged: newValue => {
|
onSliderValueChanged: newValue => {
|
||||||
SettingsData.setTopBarTransparency(
|
SettingsData.setDankBarTransparency(
|
||||||
newValue / 100)
|
newValue / 100)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -798,7 +798,7 @@ Item {
|
|||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
id: transparencyLabel
|
id: transparencyLabel
|
||||||
text: "Top Bar Widget Transparency"
|
text: "Dank Bar Widget Transparency"
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
font.weight: Font.Medium
|
font.weight: Font.Medium
|
||||||
@@ -843,7 +843,7 @@ Item {
|
|||||||
width: parent.width
|
width: parent.width
|
||||||
height: 24
|
height: 24
|
||||||
value: Math.round(
|
value: Math.round(
|
||||||
SettingsData.topBarWidgetTransparency * 100)
|
SettingsData.dankBarWidgetTransparency * 100)
|
||||||
minimum: 0
|
minimum: 0
|
||||||
maximum: 100
|
maximum: 100
|
||||||
unit: ""
|
unit: ""
|
||||||
@@ -851,7 +851,7 @@ Item {
|
|||||||
wheelEnabled: false
|
wheelEnabled: false
|
||||||
thumbOutlineColor: Theme.surfaceContainerHigh
|
thumbOutlineColor: Theme.surfaceContainerHigh
|
||||||
onSliderValueChanged: newValue => {
|
onSliderValueChanged: newValue => {
|
||||||
SettingsData.setTopBarWidgetTransparency(
|
SettingsData.setDankBarWidgetTransparency(
|
||||||
newValue / 100)
|
newValue / 100)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ DankPopout {
|
|||||||
popupWidth: 400
|
popupWidth: 400
|
||||||
popupHeight: 500
|
popupHeight: 500
|
||||||
triggerX: Screen.width - 600 - Theme.spacingL
|
triggerX: Screen.width - 600 - Theme.spacingL
|
||||||
triggerY: Math.max(26 + SettingsData.topBarInnerPadding + 4, Theme.barHeight - 4 - (8 - SettingsData.topBarInnerPadding)) + SettingsData.topBarSpacing + SettingsData.topBarBottomGap - 2 + Theme.popupDistance
|
triggerY: Math.max(26 + SettingsData.dankBarInnerPadding + 4, Theme.barHeight - 4 - (8 - SettingsData.dankBarInnerPadding)) + SettingsData.dankBarSpacing + SettingsData.dankBarBottomGap - 2 + Theme.popupDistance
|
||||||
triggerWidth: 55
|
triggerWidth: 55
|
||||||
positioning: "center"
|
positioning: "center"
|
||||||
screen: triggerScreen
|
screen: triggerScreen
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ PanelWindow {
|
|||||||
width: shouldBeVisible ? (ToastService.hasDetails ? 380 : 350) : frozenWidth
|
width: shouldBeVisible ? (ToastService.hasDetails ? 380 : 350) : frozenWidth
|
||||||
height: toastContent.height + Theme.spacingL * 2
|
height: toastContent.height + Theme.spacingL * 2
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
y: Theme.barHeight - 4 + SettingsData.topBarSpacing + 2
|
y: Theme.barHeight - 4 + SettingsData.dankBarSpacing + 2
|
||||||
color: {
|
color: {
|
||||||
switch (ToastService.currentLevel) {
|
switch (ToastService.currentLevel) {
|
||||||
case ToastService.levelError:
|
case ToastService.levelError:
|
||||||
|
|||||||
@@ -1,123 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Services.SystemTray
|
|
||||||
import Quickshell.Widgets
|
|
||||||
import qs.Common
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property var parentWindow: null
|
|
||||||
property var parentScreen: null
|
|
||||||
property real widgetHeight: 30
|
|
||||||
readonly property real horizontalPadding: SettingsData.topBarNoBackground ? 2 : Theme.spacingS
|
|
||||||
readonly property int calculatedWidth: SystemTray.items.values.length > 0 ? SystemTray.items.values.length * 24 + horizontalPadding * 2 : 0
|
|
||||||
|
|
||||||
width: calculatedWidth
|
|
||||||
height: widgetHeight
|
|
||||||
radius: SettingsData.topBarNoBackground ? 0 : Theme.cornerRadius
|
|
||||||
color: {
|
|
||||||
if (SystemTray.items.values.length === 0) {
|
|
||||||
return "transparent";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (SettingsData.topBarNoBackground) {
|
|
||||||
return "transparent";
|
|
||||||
}
|
|
||||||
|
|
||||||
const baseColor = Theme.widgetBaseBackgroundColor;
|
|
||||||
return Qt.rgba(baseColor.r, baseColor.g, baseColor.b, baseColor.a * Theme.widgetTransparency);
|
|
||||||
}
|
|
||||||
visible: SystemTray.items.values.length > 0
|
|
||||||
|
|
||||||
Row {
|
|
||||||
id: systemTrayRow
|
|
||||||
|
|
||||||
anchors.centerIn: parent
|
|
||||||
spacing: 0
|
|
||||||
|
|
||||||
Repeater {
|
|
||||||
model: SystemTray.items.values
|
|
||||||
|
|
||||||
delegate: Item {
|
|
||||||
property var trayItem: modelData
|
|
||||||
property string iconSource: {
|
|
||||||
let icon = trayItem && trayItem.icon;
|
|
||||||
if (typeof icon === 'string' || icon instanceof String) {
|
|
||||||
if (icon.includes("?path=")) {
|
|
||||||
const split = icon.split("?path=");
|
|
||||||
if (split.length !== 2) {
|
|
||||||
return icon;
|
|
||||||
}
|
|
||||||
|
|
||||||
const name = split[0];
|
|
||||||
const path = split[1];
|
|
||||||
const fileName = name.substring(name.lastIndexOf("/") + 1);
|
|
||||||
return `file://${path}/${fileName}`;
|
|
||||||
}
|
|
||||||
return icon;
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
width: 24
|
|
||||||
height: 24
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
anchors.fill: parent
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: trayItemArea.containsMouse ? Theme.primaryHover : "transparent"
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
IconImage {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
width: 16
|
|
||||||
height: 16
|
|
||||||
source: parent.iconSource
|
|
||||||
asynchronous: true
|
|
||||||
smooth: true
|
|
||||||
mipmap: true
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: trayItemArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: (mouse) => {
|
|
||||||
if (!trayItem) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mouse.button === Qt.LeftButton && !trayItem.onlyMenu) {
|
|
||||||
trayItem.activate();
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
if (trayItem.hasMenu) {
|
|
||||||
const globalPos = mapToGlobal(0, 0);
|
|
||||||
const currentScreen = parentScreen || Screen;
|
|
||||||
const screenX = currentScreen.x || 0;
|
|
||||||
const relativeX = globalPos.x - screenX;
|
|
||||||
menuAnchor.menu = trayItem.menu;
|
|
||||||
menuAnchor.anchor.window = parentWindow;
|
|
||||||
menuAnchor.anchor.rect = Qt.rect(relativeX, parentWindow.effectiveBarHeight + SettingsData.topBarSpacing, parent.width, 1);
|
|
||||||
menuAnchor.open();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
QsMenuAnchor {
|
|
||||||
id: menuAnchor
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -727,5 +727,6 @@ DankMaterialShell welcomes contributions! Whether it's bug fixes, new widgets, t
|
|||||||
|
|
||||||
- [quickshell](https://quickshell.org/) the core of what makes a shell like this possible.
|
- [quickshell](https://quickshell.org/) the core of what makes a shell like this possible.
|
||||||
- [niri](https://github.com/YaLTeR/niri) for the awesome scrolling compositor.
|
- [niri](https://github.com/YaLTeR/niri) for the awesome scrolling compositor.
|
||||||
|
- [Ly-sec](http://github.com/ly-sec) for awesome wallpaper effects among other things from [Noctalia](https://github.com/noctalia-dev/noctalia-shell)
|
||||||
- [soramanew](https://github.com/soramanew) who built [caelestia](https://github.com/caelestia-dots/shell) which served as inspiration and guidance for many dank widgets.
|
- [soramanew](https://github.com/soramanew) who built [caelestia](https://github.com/caelestia-dots/shell) which served as inspiration and guidance for many dank widgets.
|
||||||
- [end-4](https://github.com/end-4) for [dots-hyprland](https://github.com/end-4/dots-hyprland) which also served as inspiration and guidance for many dank widgets.
|
- [end-4](https://github.com/end-4) for [dots-hyprland](https://github.com/end-4/dots-hyprland) which also served as inspiration and guidance for many dank widgets.
|
||||||
|
|||||||
@@ -103,8 +103,14 @@ PanelWindow {
|
|||||||
}
|
}
|
||||||
return triggerX
|
return triggerX
|
||||||
}
|
}
|
||||||
readonly property real calculatedY: Math.max(0, Math.min(screenHeight - popupHeight - Theme.spacingM, triggerY))
|
readonly property real calculatedY: {
|
||||||
|
if (SettingsData.dankBarAtBottom) {
|
||||||
|
return Math.max(Theme.spacingM, Math.min(screenHeight - popupHeight - Theme.spacingM, screenHeight - triggerY - popupHeight - SettingsData.dankBarSpacing - 10))
|
||||||
|
} else {
|
||||||
|
return Math.max(0, Math.min(screenHeight - popupHeight - Theme.spacingM, triggerY + SettingsData.dankBarSpacing + 10))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
width: popupWidth
|
width: popupWidth
|
||||||
height: popupHeight
|
height: popupHeight
|
||||||
x: calculatedX
|
x: calculatedX
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import qs.Modules.Notifications.Popup
|
|||||||
import qs.Modules.OSD
|
import qs.Modules.OSD
|
||||||
import qs.Modules.ProcessList
|
import qs.Modules.ProcessList
|
||||||
import qs.Modules.Settings
|
import qs.Modules.Settings
|
||||||
import qs.Modules.TopBar
|
import qs.Modules.DankBar
|
||||||
import qs.Services
|
import qs.Services
|
||||||
|
|
||||||
ShellRoot {
|
ShellRoot {
|
||||||
@@ -47,9 +47,9 @@ ShellRoot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Variants {
|
Variants {
|
||||||
model: SettingsData.getFilteredScreens("topBar")
|
model: SettingsData.getFilteredScreens("dankBar")
|
||||||
|
|
||||||
delegate: TopBar {
|
delegate: DankBar {
|
||||||
modelData: item
|
modelData: item
|
||||||
notepadVariants: notepadSlideoutVariants
|
notepadVariants: notepadSlideoutVariants
|
||||||
onColorPickerRequested: colorPickerModal.show()
|
onColorPickerRequested: colorPickerModal.show()
|
||||||
|
|||||||
Reference in New Issue
Block a user