1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-29 16:02:51 -05:00

scalable topbar

This commit is contained in:
bbedward
2025-08-23 15:15:07 -04:00
parent 9d7b617cd6
commit 3f6d330f5f
21 changed files with 162 additions and 110 deletions

View File

@@ -84,6 +84,7 @@ Singleton {
property bool notificationOverlayEnabled: false property bool notificationOverlayEnabled: false
property bool topBarAutoHide: false property bool topBarAutoHide: false
property real topBarSpacing: 4 property real topBarSpacing: 4
property real topBarInnerPadding: 8
property bool topBarSquareCorners: false property bool topBarSquareCorners: false
property int notificationTimeoutLow: 5000 property int notificationTimeoutLow: 5000
property int notificationTimeoutNormal: 5000 property int notificationTimeoutNormal: 5000
@@ -273,6 +274,7 @@ Singleton {
notificationTimeoutCritical = settings.notificationTimeoutCritical notificationTimeoutCritical = settings.notificationTimeoutCritical
!== undefined ? settings.notificationTimeoutCritical : 0 !== undefined ? settings.notificationTimeoutCritical : 0
topBarSpacing = settings.topBarSpacing !== undefined ? settings.topBarSpacing : 4 topBarSpacing = settings.topBarSpacing !== undefined ? settings.topBarSpacing : 4
topBarInnerPadding = settings.topBarInnerPadding !== undefined ? settings.topBarInnerPadding : 8
topBarSquareCorners = settings.topBarSquareCorners topBarSquareCorners = settings.topBarSquareCorners
!== undefined ? settings.topBarSquareCorners : false !== undefined ? settings.topBarSquareCorners : false
applyStoredTheme() applyStoredTheme()
@@ -355,6 +357,7 @@ Singleton {
"notificationOverlayEnabled": notificationOverlayEnabled, "notificationOverlayEnabled": notificationOverlayEnabled,
"topBarAutoHide": topBarAutoHide, "topBarAutoHide": topBarAutoHide,
"topBarSpacing": topBarSpacing, "topBarSpacing": topBarSpacing,
"topBarInnerPadding": topBarInnerPadding,
"topBarSquareCorners": topBarSquareCorners, "topBarSquareCorners": topBarSquareCorners,
"notificationTimeoutLow": notificationTimeoutLow, "notificationTimeoutLow": notificationTimeoutLow,
"notificationTimeoutNormal": notificationTimeoutNormal, "notificationTimeoutNormal": notificationTimeoutNormal,
@@ -875,6 +878,11 @@ Singleton {
saveSettings() saveSettings()
} }
function setTopBarInnerPadding(padding) {
topBarInnerPadding = padding
saveSettings()
}
function setTopBarSquareCorners(enabled) { function setTopBarSquareCorners(enabled) {
topBarSquareCorners = enabled topBarSquareCorners = enabled
saveSettings() saveSettings()

View File

@@ -896,71 +896,6 @@ Item {
} }
} }
// Corner Radius
StyledRect {
width: parent.width
height: cornerRadiusSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
border.width: 1
Column {
id: cornerRadiusSection
anchors.fill: parent
anchors.margins: Theme.spacingL
spacing: Theme.spacingM
Row {
width: parent.width
spacing: Theme.spacingM
DankIcon {
name: "rounded_corner"
size: Theme.iconSize
color: Theme.primary
anchors.verticalCenter: parent.verticalCenter
}
StyledText {
text: "Corner Radius"
font.pixelSize: Theme.fontSizeLarge
font.weight: Font.Medium
color: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
}
}
Column {
width: parent.width
spacing: Theme.spacingS
StyledText {
text: "Bar & Widget Corner Roundness"
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceText
font.weight: Font.Medium
}
DankSlider {
width: parent.width
height: 24
value: SettingsData.cornerRadius
minimum: 0
maximum: 32
unit: ""
showValue: true
onSliderValueChanged: newValue => {
SettingsData.setCornerRadius(
newValue)
}
}
}
}
}
} }
} }

View File

@@ -618,10 +618,62 @@ Item {
} }
} }
Column {
width: parent.width
spacing: Theme.spacingS
StyledText {
text: "Vertical Padding (0 = minimal height)"
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceText
font.weight: Font.Medium
}
DankSlider {
width: parent.width
height: 24
value: SettingsData.topBarInnerPadding
minimum: 0
maximum: 24
unit: ""
showValue: true
onSliderValueChanged: newValue => {
SettingsData.setTopBarInnerPadding(
newValue)
}
}
}
Column {
width: parent.width
spacing: Theme.spacingS
StyledText {
text: "Corner Radius (0 = square corners)"
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceText
font.weight: Font.Medium
}
DankSlider {
width: parent.width
height: 24
value: SettingsData.cornerRadius
minimum: 0
maximum: 32
unit: ""
showValue: true
onSliderValueChanged: newValue => {
SettingsData.setCornerRadius(
newValue)
}
}
}
DankToggle { DankToggle {
width: parent.width width: parent.width
text: "Square Corners" text: "Square Corners"
description: "Disable corner radius for the top bar (always square corners)" description: "Removes rounded corners from bar container."
checked: SettingsData.topBarSquareCorners checked: SettingsData.topBarSquareCorners
onToggled: checked => { onToggled: checked => {
SettingsData.setTopBarSquareCorners( SettingsData.setTopBarSquareCorners(

View File

@@ -11,11 +11,13 @@ 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
property real widgetHeight: 30
property real barHeight: 48
signal toggleBatteryPopup signal toggleBatteryPopup
width: BatteryService.batteryAvailable ? 70 : 40 width: BatteryService.batteryAvailable ? 70 : 40
height: 30 height: widgetHeight
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: { color: {
const baseColor = batteryArea.containsMouse const baseColor = batteryArea.containsMouse
@@ -132,7 +134,7 @@ Rectangle {
var screenX = currentScreen.x || 0 var screenX = currentScreen.x || 0
var relativeX = globalPos.x - screenX var relativeX = globalPos.x - screenX
popupTarget.setTriggerPosition( popupTarget.setTriggerPosition(
relativeX, Theme.barHeight + Theme.spacingXS, relativeX, barHeight + Theme.spacingXS,
width, section, currentScreen) width, section, currentScreen)
} }
toggleBatteryPopup() toggleBatteryPopup()

View File

@@ -11,11 +11,13 @@ Rectangle {
property string section: "center" property string section: "center"
property var popupTarget: null property var popupTarget: null
property var parentScreen: null property var parentScreen: null
property real barHeight: 48
property real widgetHeight: 30
signal clockClicked signal clockClicked
width: clockRow.implicitWidth + Theme.spacingS * 2 width: clockRow.implicitWidth + Theme.spacingS * 2
height: 30 height: widgetHeight
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: { color: {
const baseColor = clockMouseArea.containsMouse ? Theme.primaryHover : Theme.surfaceTextHover const baseColor = clockMouseArea.containsMouse ? Theme.primaryHover : Theme.surfaceTextHover
@@ -79,7 +81,7 @@ Rectangle {
var screenX = currentScreen.x || 0 var screenX = currentScreen.x || 0
var relativeX = globalPos.x - screenX var relativeX = globalPos.x - screenX
popupTarget.setTriggerPosition( popupTarget.setTriggerPosition(
relativeX, Theme.barHeight + Theme.spacingXS, relativeX, barHeight + Theme.spacingXS,
width, section, currentScreen) width, section, currentScreen)
} }
root.clockClicked() root.clockClicked()

View File

@@ -15,12 +15,14 @@ Rectangle {
property bool showNetworkIcon: SettingsData.controlCenterShowNetworkIcon property bool showNetworkIcon: SettingsData.controlCenterShowNetworkIcon
property bool showBluetoothIcon: SettingsData.controlCenterShowBluetoothIcon property bool showBluetoothIcon: SettingsData.controlCenterShowBluetoothIcon
property bool showAudioIcon: SettingsData.controlCenterShowAudioIcon property bool showAudioIcon: SettingsData.controlCenterShowAudioIcon
property real widgetHeight: 30
property real barHeight: 48
signal clicked signal clicked
signal iconClicked(string tab) signal iconClicked(string tab)
width: controlIndicators.implicitWidth + Theme.spacingS * 2 width: controlIndicators.implicitWidth + Theme.spacingS * 2
height: 30 height: widgetHeight
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: { color: {
const baseColor = controlCenterArea.containsMouse const baseColor = controlCenterArea.containsMouse
@@ -143,7 +145,7 @@ Rectangle {
var screenX = currentScreen.x || 0 var screenX = currentScreen.x || 0
var relativeX = globalPos.x - screenX var relativeX = globalPos.x - screenX
popupTarget.setTriggerPosition( popupTarget.setTriggerPosition(
relativeX, Theme.barHeight + Theme.spacingXS, relativeX, barHeight + Theme.spacingXS,
width, section, currentScreen) width, section, currentScreen)
} }

View File

@@ -13,9 +13,11 @@ 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
property real barHeight: 48
property real widgetHeight: 30
width: 55 width: 55
height: 30 height: widgetHeight
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: { color: {
const baseColor = cpuArea.containsMouse ? Theme.primaryPressed : Theme.secondaryHover const baseColor = cpuArea.containsMouse ? Theme.primaryPressed : Theme.secondaryHover
@@ -42,7 +44,7 @@ Rectangle {
var screenX = currentScreen.x || 0 var screenX = currentScreen.x || 0
var relativeX = globalPos.x - screenX var relativeX = globalPos.x - screenX
popupTarget.setTriggerPosition( popupTarget.setTriggerPosition(
relativeX, Theme.barHeight + Theme.spacingXS, relativeX, barHeight + Theme.spacingXS,
width, section, currentScreen) width, section, currentScreen)
} }
DgopService.setSortBy("cpu") DgopService.setSortBy("cpu")

View File

@@ -13,9 +13,11 @@ 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
property real barHeight: 48
property real widgetHeight: 30
width: 55 width: 55
height: 30 height: widgetHeight
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: { color: {
const baseColor = cpuTempArea.containsMouse ? Theme.primaryPressed : Theme.secondaryHover const baseColor = cpuTempArea.containsMouse ? Theme.primaryPressed : Theme.secondaryHover
@@ -42,7 +44,7 @@ Rectangle {
var screenX = currentScreen.x || 0 var screenX = currentScreen.x || 0
var relativeX = globalPos.x - screenX var relativeX = globalPos.x - screenX
popupTarget.setTriggerPosition( popupTarget.setTriggerPosition(
relativeX, Theme.barHeight + Theme.spacingXS, relativeX, barHeight + Theme.spacingXS,
width, section, currentScreen) width, section, currentScreen)
} }
DgopService.setSortBy("cpu") DgopService.setSortBy("cpu")

View File

@@ -10,6 +10,7 @@ Rectangle {
property bool compactMode: SettingsData.focusedWindowCompactMode property bool compactMode: SettingsData.focusedWindowCompactMode
property int availableWidth: 400 property int availableWidth: 400
property real widgetHeight: 30
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 int maxCompactWidth: 288 readonly property int maxCompactWidth: 288
@@ -18,7 +19,7 @@ Rectangle {
width: compactMode ? Math.min(baseWidth, width: compactMode ? Math.min(baseWidth,
maxCompactWidth) : Math.min(baseWidth, maxCompactWidth) : Math.min(baseWidth,
maxNormalWidth) maxNormalWidth)
height: 30 height: widgetHeight
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: { color: {
if (!activeWindow || !activeWindow.title) if (!activeWindow || !activeWindow.title)

View File

@@ -14,6 +14,8 @@ Rectangle {
property var popupTarget: null property var popupTarget: null
property var parentScreen: null property var parentScreen: null
property var widgetData: null property var widgetData: null
property real barHeight: 48
property real widgetHeight: 30
property int selectedGpuIndex: (widgetData && widgetData.selectedGpuIndex property int selectedGpuIndex: (widgetData && widgetData.selectedGpuIndex
!== undefined) ? widgetData.selectedGpuIndex : 0 !== undefined) ? widgetData.selectedGpuIndex : 0
@@ -29,7 +31,7 @@ Rectangle {
} }
width: 55 width: 55
height: 30 height: widgetHeight
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: { color: {
const baseColor = gpuArea.containsMouse ? Theme.primaryPressed : Theme.secondaryHover const baseColor = gpuArea.containsMouse ? Theme.primaryPressed : Theme.secondaryHover
@@ -84,7 +86,7 @@ Rectangle {
var screenX = currentScreen.x || 0 var screenX = currentScreen.x || 0
var relativeX = globalPos.x - screenX var relativeX = globalPos.x - screenX
popupTarget.setTriggerPosition( popupTarget.setTriggerPosition(
relativeX, Theme.barHeight + Theme.spacingXS, relativeX, barHeight + Theme.spacingXS,
width, section, currentScreen) width, section, currentScreen)
} }
DgopService.setSortBy("cpu") DgopService.setSortBy("cpu")

View File

@@ -11,9 +11,10 @@ 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
property real widgetHeight: 30
width: 40 width: 40
height: 30 height: widgetHeight
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: { color: {
const baseColor = mouseArea.containsMouse ? Theme.primaryPressed : (SessionService.idleInhibited ? Theme.primaryHover : Theme.secondaryHover) const baseColor = mouseArea.containsMouse ? Theme.primaryPressed : (SessionService.idleInhibited ? Theme.primaryHover : Theme.secondaryHover)

View File

@@ -10,11 +10,13 @@ Item {
property string section: "left" property string section: "left"
property var popupTarget: null property var popupTarget: null
property var parentScreen: null property var parentScreen: null
property real widgetHeight: 30
property real barHeight: 48
signal clicked signal clicked
width: 40 width: 40
height: 30 height: widgetHeight
MouseArea { MouseArea {
id: launcherArea id: launcherArea
@@ -30,7 +32,7 @@ Item {
var screenX = currentScreen.x || 0 var screenX = currentScreen.x || 0
var relativeX = globalPos.x - screenX var relativeX = globalPos.x - screenX
popupTarget.setTriggerPosition( popupTarget.setTriggerPosition(
relativeX, Theme.barHeight + Theme.spacingXS, relativeX, barHeight + Theme.spacingXS,
width, section, currentScreen) width, section, currentScreen)
} }
root.clicked() root.clicked()

View File

@@ -29,10 +29,12 @@ Rectangle {
property string section: "center" property string section: "center"
property var popupTarget: null property var popupTarget: null
property var parentScreen: null property var parentScreen: null
property real barHeight: 48
property real widgetHeight: 30
signal clicked signal clicked
height: 30 height: widgetHeight
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: { color: {
const baseColor = Theme.surfaceTextHover const baseColor = Theme.surfaceTextHover
@@ -210,7 +212,7 @@ Rectangle {
var relativeX = globalPos.x - screenX var relativeX = globalPos.x - screenX
root.popupTarget.setTriggerPosition( root.popupTarget.setTriggerPosition(
relativeX, relativeX,
Theme.barHeight + Theme.spacingXS, barHeight + Theme.spacingXS,
root.width, root.section, currentScreen) root.width, root.section, currentScreen)
} }
root.clicked() root.clicked()

View File

@@ -10,11 +10,13 @@ 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
property real widgetHeight: 30
property real barHeight: 48
signal clicked signal clicked
width: 40 width: 40
height: 30 height: widgetHeight
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: { color: {
const baseColor = notificationArea.containsMouse const baseColor = notificationArea.containsMouse
@@ -56,7 +58,7 @@ Rectangle {
var screenX = currentScreen.x || 0 var screenX = currentScreen.x || 0
var relativeX = globalPos.x - screenX var relativeX = globalPos.x - screenX
popupTarget.setTriggerPosition( popupTarget.setTriggerPosition(
relativeX, Theme.barHeight + Theme.spacingXS, relativeX, barHeight + Theme.spacingXS,
width, section, currentScreen) width, section, currentScreen)
} }
root.clicked() root.clicked()

View File

@@ -10,13 +10,14 @@ 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
property real widgetHeight: 30
readonly property bool hasActivePrivacy: PrivacyService.anyPrivacyActive readonly property bool hasActivePrivacy: PrivacyService.anyPrivacyActive
readonly property int activeCount: PrivacyService.microphoneActive + PrivacyService.cameraActive readonly property int activeCount: PrivacyService.microphoneActive + PrivacyService.cameraActive
+ PrivacyService.screensharingActive + PrivacyService.screensharingActive
width: hasActivePrivacy ? (activeCount > 1 ? 80 : 60) : 0 width: hasActivePrivacy ? (activeCount > 1 ? 80 : 60) : 0
height: hasActivePrivacy ? 30 : 0 height: hasActivePrivacy ? widgetHeight : 0
radius: Theme.cornerRadius radius: Theme.cornerRadius
visible: hasActivePrivacy visible: hasActivePrivacy
opacity: hasActivePrivacy ? 1 : 0 opacity: hasActivePrivacy ? 1 : 0

View File

@@ -13,9 +13,11 @@ 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
property real barHeight: 48
property real widgetHeight: 30
width: 55 width: 55
height: 30 height: widgetHeight
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: { color: {
const baseColor = ramArea.containsMouse ? Theme.primaryPressed : Theme.secondaryHover const baseColor = ramArea.containsMouse ? Theme.primaryPressed : Theme.secondaryHover
@@ -42,7 +44,7 @@ Rectangle {
var screenX = currentScreen.x || 0 var screenX = currentScreen.x || 0
var relativeX = globalPos.x - screenX var relativeX = globalPos.x - screenX
popupTarget.setTriggerPosition( popupTarget.setTriggerPosition(
relativeX, Theme.barHeight + Theme.spacingXS, relativeX, barHeight + Theme.spacingXS,
width, section, currentScreen) width, section, currentScreen)
} }
DgopService.setSortBy("memory") DgopService.setSortBy("memory")

View File

@@ -14,6 +14,7 @@ Rectangle {
property var parentScreen property var parentScreen
property var hoveredItem: null property var hoveredItem: null
property var topBar: null property var topBar: null
property real widgetHeight: 30
// 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: CompositorService.sortedToplevels readonly property var sortedToplevels: CompositorService.sortedToplevels
@@ -30,7 +31,7 @@ Rectangle {
} }
width: calculatedWidth width: calculatedWidth
height: 30 height: widgetHeight
radius: Theme.cornerRadius radius: Theme.cornerRadius
visible: windowCount > 0 visible: windowCount > 0
clip: false clip: false

View File

@@ -9,13 +9,14 @@ Rectangle {
property var parentWindow: null property var parentWindow: null
property var parentScreen: null property var parentScreen: null
property real widgetHeight: 30
readonly property int calculatedWidth: SystemTray.items.values.length readonly property int calculatedWidth: SystemTray.items.values.length
> 0 ? SystemTray.items.values.length > 0 ? SystemTray.items.values.length
* 24 + Theme.spacingS * 2 : 0 * 24 + Theme.spacingS * 2 : 0
width: calculatedWidth width: calculatedWidth
height: 30 height: widgetHeight
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: { color: {
if (SystemTray.items.values.length === 0) if (SystemTray.items.values.length === 0)

View File

@@ -23,9 +23,11 @@ PanelWindow {
readonly property int notificationCount: NotificationService.notifications.length readonly property int notificationCount: NotificationService.notifications.length
property bool autoHide: SettingsData.topBarAutoHide property bool autoHide: SettingsData.topBarAutoHide
property bool reveal: !autoHide || topBarMouseArea.containsMouse property bool reveal: !autoHide || topBarMouseArea.containsMouse
readonly property real effectiveBarHeight: Math.max(root.widgetHeight + SettingsData.topBarInnerPadding + 4, Theme.barHeight - 4 - (8 - SettingsData.topBarInnerPadding))
readonly property real widgetHeight: Math.max(20, 26 + SettingsData.topBarInnerPadding * 0.6)
screen: modelData screen: modelData
implicitHeight: Theme.barHeight - 4 + SettingsData.topBarSpacing implicitHeight: effectiveBarHeight + SettingsData.topBarSpacing
color: "transparent" color: "transparent"
Component.onCompleted: { Component.onCompleted: {
let fonts = Qt.fontFamilies() let fonts = Qt.fontFamilies()
@@ -153,7 +155,7 @@ PanelWindow {
right: true right: true
} }
exclusiveZone: autoHide ? -1 : Theme.barHeight - 4 + SettingsData.topBarSpacing exclusiveZone: autoHide ? -1 : root.effectiveBarHeight + SettingsData.topBarSpacing - 2
mask: Region { mask: Region {
item: topBarMouseArea item: topBarMouseArea
@@ -161,7 +163,7 @@ PanelWindow {
MouseArea { MouseArea {
id: topBarMouseArea id: topBarMouseArea
height: root.reveal ? Theme.barHeight - 4 + SettingsData.topBarSpacing : 4 height: root.reveal ? effectiveBarHeight + SettingsData.topBarSpacing : 4
anchors { anchors {
top: parent.top top: parent.top
left: parent.left left: parent.left
@@ -182,7 +184,7 @@ PanelWindow {
transform: Translate { transform: Translate {
id: topBarSlide id: topBarSlide
y: root.reveal ? 0 : -(Theme.barHeight - 8) y: root.reveal ? 0 : -(effectiveBarHeight - 4)
Behavior on y { Behavior on y {
NumberAnimation { NumberAnimation {
@@ -386,10 +388,10 @@ PanelWindow {
} }
anchors.fill: parent anchors.fill: parent
anchors.leftMargin: Theme.spacingM anchors.leftMargin: Math.max(Theme.spacingXS, SettingsData.topBarInnerPadding * 0.8)
anchors.rightMargin: Theme.spacingM anchors.rightMargin: Math.max(Theme.spacingXS, SettingsData.topBarInnerPadding * 0.8)
anchors.topMargin: Theme.spacingXS anchors.topMargin: SettingsData.topBarInnerPadding / 2
anchors.bottomMargin: Theme.spacingXS anchors.bottomMargin: SettingsData.topBarInnerPadding / 2
clip: true clip: true
Row { Row {
@@ -604,7 +606,7 @@ PanelWindow {
Rectangle { Rectangle {
width: 40 width: 40
height: 30 height: root.widgetHeight
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: { color: {
const baseColor = clipboardArea.containsMouse ? Theme.primaryHover : Theme.secondaryHover const baseColor = clipboardArea.containsMouse ? Theme.primaryHover : Theme.secondaryHover
@@ -646,6 +648,8 @@ PanelWindow {
LauncherButton { LauncherButton {
isActive: false isActive: false
widgetHeight: root.widgetHeight
barHeight: root.effectiveBarHeight
section: { section: {
if (parent && parent.parent) { if (parent && parent.parent) {
if (parent.parent === leftSection) if (parent.parent === leftSection)
@@ -672,6 +676,7 @@ PanelWindow {
WorkspaceSwitcher { WorkspaceSwitcher {
screenName: root.screenName screenName: root.screenName
widgetHeight: root.widgetHeight
} }
} }
@@ -680,6 +685,7 @@ PanelWindow {
FocusedApp { FocusedApp {
availableWidth: topBarContent.leftToMediaGap availableWidth: topBarContent.leftToMediaGap
widgetHeight: root.widgetHeight
} }
} }
@@ -687,6 +693,7 @@ PanelWindow {
id: runningAppsComponent id: runningAppsComponent
RunningApps { RunningApps {
widgetHeight: root.widgetHeight
section: { section: {
if (parent && parent.parent === leftSection) if (parent && parent.parent === leftSection)
return "left" return "left"
@@ -706,6 +713,8 @@ PanelWindow {
Clock { Clock {
compactMode: topBarContent.overlapping compactMode: topBarContent.overlapping
barHeight: root.effectiveBarHeight
widgetHeight: root.widgetHeight
section: { section: {
if (parent && parent.parent === leftSection) if (parent && parent.parent === leftSection)
return "left" return "left"
@@ -736,6 +745,8 @@ PanelWindow {
Media { Media {
compactMode: topBarContent.spacingTight compactMode: topBarContent.spacingTight
|| topBarContent.overlapping || topBarContent.overlapping
barHeight: root.effectiveBarHeight
widgetHeight: root.widgetHeight
section: { section: {
if (parent && parent.parent === leftSection) if (parent && parent.parent === leftSection)
return "left" return "left"
@@ -764,6 +775,8 @@ PanelWindow {
id: weatherComponent id: weatherComponent
Weather { Weather {
barHeight: root.effectiveBarHeight
widgetHeight: root.widgetHeight
section: { section: {
if (parent && parent.parent === leftSection) if (parent && parent.parent === leftSection)
return "left" return "left"
@@ -794,6 +807,7 @@ PanelWindow {
SystemTrayBar { SystemTrayBar {
parentWindow: root parentWindow: root
parentScreen: root.screen parentScreen: root.screen
widgetHeight: root.widgetHeight
} }
} }
@@ -801,6 +815,7 @@ PanelWindow {
id: privacyIndicatorComponent id: privacyIndicatorComponent
PrivacyIndicator { PrivacyIndicator {
widgetHeight: root.widgetHeight
section: { section: {
if (parent && parent.parent === leftSection) if (parent && parent.parent === leftSection)
return "left" return "left"
@@ -818,6 +833,8 @@ PanelWindow {
id: cpuUsageComponent id: cpuUsageComponent
CpuMonitor { CpuMonitor {
barHeight: root.effectiveBarHeight
widgetHeight: root.widgetHeight
section: { section: {
if (parent && parent.parent === leftSection) if (parent && parent.parent === leftSection)
return "left" return "left"
@@ -844,6 +861,8 @@ PanelWindow {
id: memUsageComponent id: memUsageComponent
RamMonitor { RamMonitor {
barHeight: root.effectiveBarHeight
widgetHeight: root.widgetHeight
section: { section: {
if (parent && parent.parent === leftSection) if (parent && parent.parent === leftSection)
return "left" return "left"
@@ -870,6 +889,8 @@ PanelWindow {
id: cpuTempComponent id: cpuTempComponent
CpuTemperature { CpuTemperature {
barHeight: root.effectiveBarHeight
widgetHeight: root.widgetHeight
section: { section: {
if (parent && parent.parent === leftSection) if (parent && parent.parent === leftSection)
return "left" return "left"
@@ -896,6 +917,8 @@ PanelWindow {
id: gpuTempComponent id: gpuTempComponent
GpuTemperature { GpuTemperature {
barHeight: root.effectiveBarHeight
widgetHeight: root.widgetHeight
section: { section: {
if (parent && parent.parent === leftSection) if (parent && parent.parent === leftSection)
return "left" return "left"
@@ -925,6 +948,8 @@ PanelWindow {
NotificationCenterButton { NotificationCenterButton {
hasUnread: root.notificationCount > 0 hasUnread: root.notificationCount > 0
isActive: notificationCenterLoader.item ? notificationCenterLoader.item.shouldBeVisible : false isActive: notificationCenterLoader.item ? notificationCenterLoader.item.shouldBeVisible : false
widgetHeight: root.widgetHeight
barHeight: root.effectiveBarHeight
section: { section: {
if (parent && parent.parent === leftSection) if (parent && parent.parent === leftSection)
return "left" return "left"
@@ -953,6 +978,8 @@ PanelWindow {
Battery { Battery {
batteryPopupVisible: batteryPopoutLoader.item ? batteryPopoutLoader.item.shouldBeVisible : false batteryPopupVisible: batteryPopoutLoader.item ? batteryPopoutLoader.item.shouldBeVisible : false
widgetHeight: root.widgetHeight
barHeight: root.effectiveBarHeight
section: { section: {
if (parent && parent.parent === leftSection) if (parent && parent.parent === leftSection)
return "left" return "left"
@@ -981,6 +1008,8 @@ PanelWindow {
ControlCenterButton { ControlCenterButton {
isActive: controlCenterLoader.item ? controlCenterLoader.item.shouldBeVisible : false isActive: controlCenterLoader.item ? controlCenterLoader.item.shouldBeVisible : false
widgetHeight: root.widgetHeight
barHeight: root.effectiveBarHeight
section: { section: {
if (parent && parent.parent === leftSection) if (parent && parent.parent === leftSection)
return "left" return "left"
@@ -1023,6 +1052,7 @@ PanelWindow {
id: idleInhibitorComponent id: idleInhibitorComponent
IdleInhibitor { IdleInhibitor {
widgetHeight: root.widgetHeight
section: { section: {
if (parent && parent.parent === leftSection) if (parent && parent.parent === leftSection)
return "left" return "left"
@@ -1041,7 +1071,7 @@ PanelWindow {
Item { Item {
width: parent.spacerSize || 20 width: parent.spacerSize || 20
height: 30 height: root.widgetHeight
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
@@ -1068,7 +1098,7 @@ PanelWindow {
Rectangle { Rectangle {
width: 1 width: 1
height: 20 height: root.widgetHeight * 0.67
color: Theme.outline color: Theme.outline
opacity: 0.3 opacity: 0.3
} }

View File

@@ -9,13 +9,15 @@ Rectangle {
property string section: "center" property string section: "center"
property var popupTarget: null property var popupTarget: null
property var parentScreen: null property var parentScreen: null
property real barHeight: 48
property real widgetHeight: 30
signal clicked signal clicked
visible: SettingsData.weatherEnabled visible: SettingsData.weatherEnabled
width: visible ? Math.min(100, width: visible ? Math.min(100,
weatherRow.implicitWidth + Theme.spacingS * 2) : 0 weatherRow.implicitWidth + Theme.spacingS * 2) : 0
height: 30 height: widgetHeight
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: { color: {
const baseColor = weatherArea.containsMouse ? Theme.primaryHover : Theme.surfaceTextHover const baseColor = weatherArea.containsMouse ? Theme.primaryHover : Theme.surfaceTextHover
@@ -67,7 +69,7 @@ Rectangle {
var screenX = currentScreen.x || 0 var screenX = currentScreen.x || 0
var relativeX = globalPos.x - screenX var relativeX = globalPos.x - screenX
popupTarget.setTriggerPosition( popupTarget.setTriggerPosition(
relativeX, Theme.barHeight + Theme.spacingXS, relativeX, barHeight + Theme.spacingXS,
width, section, currentScreen) width, section, currentScreen)
} }
root.clicked() root.clicked()

View File

@@ -10,6 +10,7 @@ Rectangle {
id: root id: root
property string screenName: "" property string screenName: ""
property real widgetHeight: 30
property int currentWorkspace: { property int currentWorkspace: {
if (CompositorService.isNiri) { if (CompositorService.isNiri) {
return getNiriActiveWorkspace() return getNiriActiveWorkspace()
@@ -78,10 +79,10 @@ Rectangle {
width: SettingsData.showWorkspacePadding ? Math.max( width: SettingsData.showWorkspacePadding ? Math.max(
120, 120,
workspaceRow.implicitWidth + Theme.spacingL workspaceRow.implicitWidth + SettingsData.topBarInnerPadding
* 2) : workspaceRow.implicitWidth * 2) : workspaceRow.implicitWidth
+ Theme.spacingL * 2 + SettingsData.topBarInnerPadding * 2
height: 30 height: widgetHeight
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: { color: {
const baseColor = Theme.surfaceTextHover const baseColor = Theme.surfaceTextHover
@@ -192,9 +193,8 @@ Rectangle {
workspaceData.name) : null workspaceData.name) : null
property bool hasIcon: iconData !== null property bool hasIcon: iconData !== null
width: isActive ? Theme.spacingXL + Theme.spacingM : Theme.spacingL width: isActive ? widgetHeight * 1.2 + Theme.spacingXS : widgetHeight * 0.8
+ Theme.spacingXS height: widgetHeight * 0.6
height: Theme.spacingL
radius: height / 2 radius: height / 2
color: isActive ? Theme.primary : isPlaceholder ? Theme.surfaceTextLight : isHovered ? Theme.outlineButton : Theme.surfaceTextAlpha color: isActive ? Theme.primary : isPlaceholder ? Theme.surfaceTextLight : isHovered ? Theme.outlineButton : Theme.surfaceTextAlpha