mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
Bar: Added a spacious mode and reworked a lot of the scaling stuff so it scales up better for HiDpi.
Bar(e) with me it might have a few side effects.
This commit is contained in:
@@ -672,7 +672,8 @@
|
||||
"comfortable": "Bequem",
|
||||
"compact": "Kompakt",
|
||||
"default": "Standard",
|
||||
"mini": "Mini"
|
||||
"mini": "Mini",
|
||||
"spacious": "Geräumig"
|
||||
},
|
||||
"position": {
|
||||
"bottom": "Unten",
|
||||
|
||||
@@ -672,7 +672,8 @@
|
||||
"comfortable": "Comfortable",
|
||||
"compact": "Compact",
|
||||
"default": "Default",
|
||||
"mini": "Mini"
|
||||
"mini": "Mini",
|
||||
"spacious": "Spacious"
|
||||
},
|
||||
"position": {
|
||||
"bottom": "Bottom",
|
||||
|
||||
@@ -672,7 +672,8 @@
|
||||
"comfortable": "Cómoda",
|
||||
"compact": "Compacta",
|
||||
"default": "Predeterminada",
|
||||
"mini": "Mini"
|
||||
"mini": "Mini",
|
||||
"spacious": "Espacioso/a"
|
||||
},
|
||||
"position": {
|
||||
"bottom": "Inferior",
|
||||
|
||||
@@ -672,7 +672,8 @@
|
||||
"comfortable": "Confortable",
|
||||
"compact": "Compact",
|
||||
"default": "Défaut",
|
||||
"mini": "Mini"
|
||||
"mini": "Mini",
|
||||
"spacious": "Spacieux/Spacieuse"
|
||||
},
|
||||
"position": {
|
||||
"bottom": "Bas",
|
||||
|
||||
@@ -672,7 +672,8 @@
|
||||
"comfortable": "Kényelmes",
|
||||
"compact": "Kompakt",
|
||||
"default": "Alapértelmezett",
|
||||
"mini": "Mini"
|
||||
"mini": "Mini",
|
||||
"spacious": "Tágas"
|
||||
},
|
||||
"position": {
|
||||
"bottom": "Alul",
|
||||
|
||||
@@ -672,7 +672,8 @@
|
||||
"comfortable": "ゆったり",
|
||||
"compact": "コンパクト",
|
||||
"default": "標準",
|
||||
"mini": "ミニ"
|
||||
"mini": "ミニ",
|
||||
"spacious": "広々とした"
|
||||
},
|
||||
"position": {
|
||||
"bottom": "下",
|
||||
|
||||
@@ -672,7 +672,8 @@
|
||||
"comfortable": "Comfortable",
|
||||
"compact": "Compact",
|
||||
"default": "Berdest",
|
||||
"mini": "Mini"
|
||||
"mini": "Mini",
|
||||
"spacious": "Berfireh"
|
||||
},
|
||||
"position": {
|
||||
"bottom": "Jêr",
|
||||
@@ -2796,6 +2797,7 @@
|
||||
"next-media": "Strana pêş",
|
||||
"next-month": "Next month",
|
||||
"night-light-disabled": "Night Light",
|
||||
"night-light-enabled": "Ronahiya Şevê",
|
||||
"night-light-forced": "Night Light",
|
||||
"night-light-not-installed": "Night Light (not available)",
|
||||
"noctalia-performance-disabled": "Noctalia Performance Mode",
|
||||
|
||||
@@ -672,7 +672,8 @@
|
||||
"comfortable": "Comfortabel",
|
||||
"compact": "Compact",
|
||||
"default": "Standaard",
|
||||
"mini": "Mini"
|
||||
"mini": "Mini",
|
||||
"spacious": "Ruim"
|
||||
},
|
||||
"position": {
|
||||
"bottom": "Onder",
|
||||
|
||||
@@ -672,7 +672,8 @@
|
||||
"comfortable": "Komfortowy",
|
||||
"compact": "Kompaktowy",
|
||||
"default": "Domyślny",
|
||||
"mini": "Mini"
|
||||
"mini": "Mini",
|
||||
"spacious": "Przestronny"
|
||||
},
|
||||
"position": {
|
||||
"bottom": "Dół",
|
||||
|
||||
@@ -672,7 +672,8 @@
|
||||
"comfortable": "Confortável",
|
||||
"compact": "Compacta",
|
||||
"default": "Padrão",
|
||||
"mini": "Mini"
|
||||
"mini": "Mini",
|
||||
"spacious": "Espaçoso(a)"
|
||||
},
|
||||
"position": {
|
||||
"bottom": "Inferior",
|
||||
|
||||
@@ -672,7 +672,8 @@
|
||||
"comfortable": "Комфортная",
|
||||
"compact": "Компактная",
|
||||
"default": "По умолчанию",
|
||||
"mini": "Мини"
|
||||
"mini": "Мини",
|
||||
"spacious": "Просторный"
|
||||
},
|
||||
"position": {
|
||||
"bottom": "Внизу",
|
||||
|
||||
@@ -672,7 +672,8 @@
|
||||
"comfortable": "Rahat",
|
||||
"compact": "Sıkı",
|
||||
"default": "Varsayılan",
|
||||
"mini": "Ufak"
|
||||
"mini": "Ufak",
|
||||
"spacious": "Geniş"
|
||||
},
|
||||
"position": {
|
||||
"bottom": "Alt",
|
||||
|
||||
@@ -672,7 +672,8 @@
|
||||
"comfortable": "Просторий",
|
||||
"compact": "Компактний",
|
||||
"default": "Стандартний",
|
||||
"mini": "Міні"
|
||||
"mini": "Міні",
|
||||
"spacious": "Просторий"
|
||||
},
|
||||
"position": {
|
||||
"bottom": "Знизу",
|
||||
|
||||
@@ -672,7 +672,8 @@
|
||||
"comfortable": "舒适",
|
||||
"compact": "紧凑",
|
||||
"default": "默认",
|
||||
"mini": "迷你"
|
||||
"mini": "迷你",
|
||||
"spacious": "宽敞"
|
||||
},
|
||||
"position": {
|
||||
"bottom": "底部",
|
||||
|
||||
+7
-1
@@ -98,6 +98,9 @@ Singleton {
|
||||
case "comfortable":
|
||||
h = (Settings.data.bar.position === "left" || Settings.data.bar.position === "right") ? 39 : 37;
|
||||
break;
|
||||
case "spacious":
|
||||
h = (Settings.data.bar.position === "left" || Settings.data.bar.position === "right") ? 53 : 51;
|
||||
break;
|
||||
default:
|
||||
case "default":
|
||||
h = (Settings.data.bar.position === "left" || Settings.data.bar.position === "right") ? 33 : 31;
|
||||
@@ -114,7 +117,10 @@ Singleton {
|
||||
h = Math.round(barHeight * 0.85);
|
||||
break;
|
||||
case "comfortable":
|
||||
h = Math.round(barHeight * 0.73);
|
||||
h = Math.round(barHeight * 0.75);
|
||||
break;
|
||||
case "spacious":
|
||||
h = Math.round(barHeight * 0.75);
|
||||
break;
|
||||
default:
|
||||
case "default":
|
||||
|
||||
@@ -12,7 +12,7 @@ Item {
|
||||
required property var widgetProps
|
||||
|
||||
property string barDensity: "default"
|
||||
readonly property real scaling: barDensity === "mini" ? 0.8 : (barDensity === "compact" ? 0.9 : 1.0)
|
||||
readonly property real barScaling: barDensity === "mini" ? 0.8 : (barDensity === "compact" ? 0.9 : 1.0)
|
||||
|
||||
// Extract section info from widgetProps
|
||||
readonly property string section: widgetProps ? (widgetProps.section || "") : ""
|
||||
@@ -81,10 +81,10 @@ Item {
|
||||
item.screen = widgetScreen;
|
||||
}
|
||||
|
||||
// Set scaling property
|
||||
if (item.hasOwnProperty("scaling")) {
|
||||
item.scaling = Qt.binding(function () {
|
||||
return root.scaling;
|
||||
// Set bar scaling property
|
||||
if (item.hasOwnProperty("barScaling")) {
|
||||
item.barScaling = Qt.binding(function () {
|
||||
return root.barScaling;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ Item {
|
||||
property string section: ""
|
||||
property int sectionWidgetIndex: -1
|
||||
property int sectionWidgetsCount: 0
|
||||
property real scaling: 1.0
|
||||
property real barScaling: 1.0
|
||||
|
||||
property var widgetMetadata: BarWidgetRegistry.widgetMetadata[widgetId] || {}
|
||||
property var widgetSettings: {
|
||||
@@ -47,8 +47,12 @@ Item {
|
||||
readonly property string windowTitle: CompositorService.getFocusedWindowTitle() || "No active window"
|
||||
readonly property string fallbackIcon: "user-desktop"
|
||||
|
||||
implicitHeight: visible ? (isVerticalBar ? (((!hasFocusedWindow) && hideMode === "hidden") ? 0 : calculatedVerticalDimension()) : Style.capsuleHeight) : 0
|
||||
implicitWidth: visible ? (isVerticalBar ? (((!hasFocusedWindow) && hideMode === "hidden") ? 0 : calculatedVerticalDimension()) : (((!hasFocusedWindow) && hideMode === "hidden") ? 0 : dynamicWidth)) : 0
|
||||
readonly property int iconSize: Style.toOdd(Style.capsuleHeight * 0.75 * barScaling)
|
||||
readonly property int textSize: Style.toOdd(root.iconSize * 0.6)
|
||||
readonly property int verticalSize: Style.toOdd(Style.capsuleHeight * 0.85 * barScaling)
|
||||
|
||||
implicitHeight: visible ? (isVerticalBar ? (((!hasFocusedWindow) && hideMode === "hidden") ? 0 : verticalSize) : Style.capsuleHeight) : 0
|
||||
implicitWidth: visible ? (isVerticalBar ? (((!hasFocusedWindow) && hideMode === "hidden") ? 0 : verticalSize) : (((!hasFocusedWindow) && hideMode === "hidden") ? 0 : dynamicWidth)) : 0
|
||||
|
||||
// "visible": Always Visible, "hidden": Hide When Empty, "transparent": Transparent When Empty
|
||||
visible: (hideMode !== "hidden" || hasFocusedWindow) || opacity > 0
|
||||
@@ -74,22 +78,15 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
function calculatedVerticalDimension() {
|
||||
return Style.toOdd((Style.baseWidgetSize - 5) * scaling);
|
||||
}
|
||||
|
||||
// Icon size for consistent sizing
|
||||
readonly property int iconSize: Style.toOdd(18 * scaling)
|
||||
|
||||
function calculateContentWidth() {
|
||||
// Calculate the actual content width based on visible elements
|
||||
var contentWidth = 0;
|
||||
var margins = Style.marginS * scaling * 2; // Left and right margins
|
||||
var margins = Style.marginS * barScaling * 2; // Left and right margins
|
||||
|
||||
// Icon width (if visible)
|
||||
if (showIcon) {
|
||||
contentWidth += iconSize;
|
||||
contentWidth += Style.marginS * scaling; // Spacing after icon
|
||||
contentWidth += Style.marginS * barScaling; // Spacing after icon
|
||||
}
|
||||
|
||||
// Text width (use the measured width)
|
||||
@@ -166,7 +163,7 @@ Item {
|
||||
id: fullTitleMetrics
|
||||
visible: false
|
||||
text: windowTitle
|
||||
pointSize: Style.fontSizeS * scaling
|
||||
pointSize: root.textSize
|
||||
applyUiScale: false
|
||||
font.weight: Style.fontWeightMedium
|
||||
}
|
||||
@@ -199,8 +196,8 @@ Item {
|
||||
visible: root.visible
|
||||
x: isVerticalBar ? Style.pixelAlignCenter(parent.width, width) : 0
|
||||
y: isVerticalBar ? 0 : Style.pixelAlignCenter(parent.height, height)
|
||||
width: isVerticalBar ? ((!hasFocusedWindow) && hideMode === "hidden" ? 0 : calculatedVerticalDimension()) : ((!hasFocusedWindow) && (hideMode === "hidden") ? 0 : dynamicWidth)
|
||||
height: isVerticalBar ? ((!hasFocusedWindow) && hideMode === "hidden" ? 0 : calculatedVerticalDimension()) : Style.capsuleHeight
|
||||
width: isVerticalBar ? ((!hasFocusedWindow) && hideMode === "hidden" ? 0 : verticalSize) : ((!hasFocusedWindow) && (hideMode === "hidden") ? 0 : dynamicWidth)
|
||||
height: isVerticalBar ? ((!hasFocusedWindow) && hideMode === "hidden" ? 0 : verticalSize) : Style.capsuleHeight
|
||||
radius: Style.radiusM
|
||||
color: Style.capsuleColor
|
||||
border.color: Style.capsuleBorderColor
|
||||
@@ -217,14 +214,14 @@ Item {
|
||||
Item {
|
||||
id: mainContainer
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: isVerticalBar ? 0 : Style.marginS * scaling
|
||||
anchors.rightMargin: isVerticalBar ? 0 : Style.marginS * scaling
|
||||
anchors.leftMargin: isVerticalBar ? 0 : Style.marginS * barScaling
|
||||
anchors.rightMargin: isVerticalBar ? 0 : Style.marginS * barScaling
|
||||
|
||||
// Horizontal layout for top/bottom bars
|
||||
RowLayout {
|
||||
id: rowLayout
|
||||
y: Style.pixelAlignCenter(parent.height, height)
|
||||
spacing: Style.marginS * scaling
|
||||
spacing: Style.marginS * barScaling
|
||||
visible: !isVerticalBar
|
||||
z: 1
|
||||
|
||||
@@ -346,7 +343,7 @@ Item {
|
||||
NText {
|
||||
id: titleText
|
||||
text: windowTitle
|
||||
pointSize: Style.fontSizeS * scaling
|
||||
pointSize: root.textSize
|
||||
applyUiScale: false
|
||||
font.weight: Style.fontWeightMedium
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
@@ -365,7 +362,7 @@ Item {
|
||||
NText {
|
||||
text: windowTitle
|
||||
font: titleText.font
|
||||
pointSize: Style.fontSizeS * scaling
|
||||
pointSize: Style.fontSizeS * barScaling
|
||||
applyUiScale: false
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
color: Color.mOnSurface
|
||||
@@ -411,7 +408,7 @@ Item {
|
||||
// Window icon
|
||||
Item {
|
||||
id: verticalIconContainer
|
||||
width: Style.toOdd(Style.baseWidgetSize * 0.5 * scaling)
|
||||
width: root.iconSize
|
||||
height: width
|
||||
x: Style.pixelAlignCenter(parent.width, width)
|
||||
y: Style.pixelAlignCenter(parent.height, height)
|
||||
|
||||
@@ -17,7 +17,7 @@ Rectangle {
|
||||
property string section: ""
|
||||
property int sectionWidgetIndex: -1
|
||||
property int sectionWidgetsCount: 0
|
||||
property real scaling: 1.0
|
||||
property real barScaling: 1.0
|
||||
|
||||
property var widgetMetadata: BarWidgetRegistry.widgetMetadata[widgetId]
|
||||
property var widgetSettings: {
|
||||
@@ -75,14 +75,14 @@ Rectangle {
|
||||
Binding on pointSize {
|
||||
value: {
|
||||
if (repeater.model.length == 1) {
|
||||
return Style.fontSizeS * scaling;
|
||||
return Style.capsuleHeight * 0.4 * barScaling;
|
||||
} else {
|
||||
return (index == 0) ? Style.fontSizeXS * scaling : Style.fontSizeXXS * scaling;
|
||||
return (index == 0) ? Style.capsuleHeight * 0.35 * barScaling : Style.capsuleHeight * 0.3 * barScaling;
|
||||
}
|
||||
}
|
||||
}
|
||||
applyUiScale: false
|
||||
font.weight: Style.fontWeightBold
|
||||
font.weight: Style.fontWeightSemiBold
|
||||
color: usePrimaryColor ? Color.mPrimary : Color.mOnSurface
|
||||
wrapMode: Text.WordWrap
|
||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
||||
@@ -106,7 +106,7 @@ Rectangle {
|
||||
text: modelData
|
||||
family: useCustomFont && customFont ? customFont : Settings.data.ui.fontDefault
|
||||
Binding on pointSize {
|
||||
value: Style.fontSizeS * scaling
|
||||
value: Style.fontSizeS * barScaling
|
||||
}
|
||||
applyUiScale: false
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ Item {
|
||||
property string section: ""
|
||||
property int sectionWidgetIndex: -1
|
||||
property int sectionWidgetsCount: 0
|
||||
property real scaling: 1.0
|
||||
property real barScaling: 1.0
|
||||
|
||||
// Settings
|
||||
property var widgetMetadata: BarWidgetRegistry.widgetMetadata[widgetId]
|
||||
@@ -47,9 +47,10 @@ Item {
|
||||
readonly property real maxWidth: (widgetSettings.maxWidth !== undefined) ? widgetSettings.maxWidth : Math.max(widgetMetadata.maxWidth, screen ? screen.width * 0.06 : 0)
|
||||
|
||||
// Dimensions
|
||||
readonly property int iconSize: Style.toOdd(18 * scaling)
|
||||
readonly property int artSize: Style.toOdd(21 * scaling)
|
||||
readonly property int verticalSize: Style.toOdd((Style.baseWidgetSize - 5) * scaling)
|
||||
readonly property int artSize: Style.toOdd(Style.capsuleHeight * 0.75 * barScaling)
|
||||
readonly property int iconSize: Style.toOdd(Style.capsuleHeight * 0.75 * barScaling)
|
||||
readonly property int verticalSize: Style.toOdd(Style.capsuleHeight * 0.85 * barScaling)
|
||||
readonly property int textSize: Style.toOdd(root.iconSize * 0.6)
|
||||
|
||||
// State
|
||||
readonly property bool hasPlayer: MediaService.currentPlayer !== null
|
||||
@@ -115,10 +116,10 @@ Item {
|
||||
// Add spacing and text width
|
||||
var textWidth = 0;
|
||||
if (titleMetrics.contentWidth > 0) {
|
||||
textWidth = Style.marginS * scaling + titleMetrics.contentWidth + Style.marginXXS * 2;
|
||||
textWidth = Style.marginS * barScaling + titleMetrics.contentWidth + Style.marginXXS * 2;
|
||||
}
|
||||
|
||||
var margins = isVertical ? 0 : (Style.marginS * scaling * 2);
|
||||
var margins = isVertical ? 0 : (Style.marginS * barScaling * 2);
|
||||
var total = iconWidth + textWidth + margins;
|
||||
return hasPlayer ? Math.min(total, maxWidth) : total;
|
||||
}
|
||||
@@ -148,7 +149,7 @@ Item {
|
||||
visible: false
|
||||
text: title
|
||||
applyUiScale: false
|
||||
pointSize: Style.fontSizeS * scaling
|
||||
pointSize: root.textSize
|
||||
font.weight: Style.fontWeightMedium
|
||||
}
|
||||
|
||||
@@ -230,8 +231,8 @@ Item {
|
||||
|
||||
Item {
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: isVertical ? 0 : Style.marginS * scaling
|
||||
anchors.rightMargin: isVertical ? 0 : Style.marginS * scaling
|
||||
anchors.leftMargin: isVertical ? 0 : Style.marginS * barScaling
|
||||
anchors.rightMargin: isVertical ? 0 : Style.marginS * barScaling
|
||||
clip: true
|
||||
|
||||
// Visualizer
|
||||
@@ -259,7 +260,7 @@ Item {
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: Style.marginS * scaling
|
||||
spacing: Style.marginS * barScaling
|
||||
visible: !isVertical
|
||||
z: 1
|
||||
|
||||
@@ -268,7 +269,7 @@ Item {
|
||||
visible: !hasPlayer || (!showAlbumArt && !showProgressRing)
|
||||
icon: hasPlayer ? (MediaService.isPlaying ? "media-pause" : "media-play") : "disc"
|
||||
color: hasPlayer ? Color.mOnSurface : Color.mOnSurfaceVariant
|
||||
pointSize: Style.fontSizeL * scaling
|
||||
pointSize: iconSize * 0.85
|
||||
Layout.preferredWidth: iconSize
|
||||
Layout.preferredHeight: iconSize
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
@@ -286,17 +287,17 @@ Item {
|
||||
anchors.fill: parent
|
||||
visible: showProgressRing
|
||||
progress: MediaService.trackLength > 0 ? MediaService.currentPosition / MediaService.trackLength : 0
|
||||
lineWidth: 2 * scaling
|
||||
lineWidth: 2 * barScaling
|
||||
}
|
||||
|
||||
Item {
|
||||
anchors.fill: parent
|
||||
anchors.margins: showProgressRing ? (3 * scaling) : 0.5
|
||||
anchors.margins: showProgressRing ? (3 * barScaling) : 0.5
|
||||
|
||||
NImageRounded {
|
||||
visible: showAlbumArt && hasPlayer
|
||||
anchors.fill: parent
|
||||
anchors.margins: showProgressRing ? 0 : -1 * scaling
|
||||
anchors.margins: showProgressRing ? 0 : -1 * barScaling
|
||||
radius: width / 2
|
||||
imagePath: MediaService.trackArtUrl
|
||||
fallbackIcon: MediaService.isPlaying ? "media-pause" : "media-play"
|
||||
@@ -310,7 +311,7 @@ Item {
|
||||
y: Style.pixelAlignCenter(parent.height, contentHeight)
|
||||
icon: MediaService.isPlaying ? "media-pause" : "media-play"
|
||||
color: Color.mOnSurface
|
||||
pointSize: 8 * scaling
|
||||
pointSize: 8 * barScaling
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -320,13 +321,13 @@ Item {
|
||||
id: titleContainer
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
Layout.preferredHeight: titleMetrics.height
|
||||
Layout.preferredHeight: Style.capsuleHeight
|
||||
|
||||
ScrollingText {
|
||||
anchors.fill: parent
|
||||
text: title
|
||||
textColor: hasPlayer ? Color.mOnSurface : Color.mOnSurfaceVariant
|
||||
fontSize: Style.fontSizeS * scaling
|
||||
fontSize: root.textSize
|
||||
scrollMode: scrollingMode
|
||||
needsScroll: titleMetrics.contentWidth > parent.width
|
||||
}
|
||||
@@ -337,7 +338,7 @@ Item {
|
||||
Item {
|
||||
id: verticalLayout
|
||||
visible: isVertical
|
||||
width: Style.toOdd(showProgressRing ? (Style.baseWidgetSize * 0.5 * scaling) : (verticalSize - 4 * scaling))
|
||||
width: verticalSize
|
||||
height: width
|
||||
x: Style.pixelAlignCenter(parent.width, width)
|
||||
y: Style.pixelAlignCenter(parent.height, height)
|
||||
@@ -345,31 +346,29 @@ Item {
|
||||
|
||||
ProgressRing {
|
||||
anchors.fill: parent
|
||||
anchors.margins: -4
|
||||
visible: showProgressRing
|
||||
progress: MediaService.trackLength > 0 ? MediaService.currentPosition / MediaService.trackLength : 0
|
||||
lineWidth: 2.5 * scaling
|
||||
lineWidth: Style.toOdd(2 * barScaling)
|
||||
}
|
||||
|
||||
NImageRounded {
|
||||
visible: showAlbumArt && hasPlayer
|
||||
anchors.fill: parent
|
||||
anchors.margins: showProgressRing ? Style.toOdd(verticalSize * 0.2) : 0
|
||||
radius: width / 2
|
||||
imagePath: MediaService.trackArtUrl
|
||||
fallbackIcon: MediaService.isPlaying ? "media-pause" : "media-play"
|
||||
fallbackIconSize: 12
|
||||
fallbackIconSize: Style.toOdd(verticalSize * 0.65)
|
||||
borderWidth: 0
|
||||
}
|
||||
|
||||
NIcon {
|
||||
visible: !showAlbumArt || !hasPlayer
|
||||
x: Style.pixelAlignCenter(parent.width, width)
|
||||
x: Style.pixelAlignCenter(parent.width, contentWidth)
|
||||
y: Style.pixelAlignCenter(parent.height, contentHeight)
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
icon: hasPlayer ? (MediaService.isPlaying ? "media-pause" : "media-play") : "disc"
|
||||
color: hasPlayer ? Color.mOnSurface : Color.mOnSurfaceVariant
|
||||
pointSize: Style.fontSizeM * scaling
|
||||
pointSize: Style.toOdd(verticalSize * 0.5)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -548,11 +547,12 @@ Item {
|
||||
|
||||
Item {
|
||||
id: scrollContainer
|
||||
height: parent.height
|
||||
y: (parent.height - titleText.contentHeight) / 2
|
||||
height: titleText.contentHeight
|
||||
property real scrollX: 0
|
||||
x: scrollX
|
||||
|
||||
RowLayout {
|
||||
Row {
|
||||
spacing: 50
|
||||
NText {
|
||||
id: titleText
|
||||
|
||||
@@ -13,6 +13,13 @@ NIconButton {
|
||||
|
||||
property ShellScreen screen
|
||||
|
||||
// Widget properties passed from Bar.qml for per-instance settings
|
||||
property string widgetId: ""
|
||||
property string section: ""
|
||||
property int sectionWidgetIndex: -1
|
||||
property int sectionWidgetsCount: 0
|
||||
property real barScaling: 1.0
|
||||
|
||||
icon: ScreenRecorderService.isPending ? "" : "camera-video"
|
||||
tooltipText: ScreenRecorderService.isRecording ? I18n.tr("tooltips.click-to-stop-recording") : I18n.tr("tooltips.click-to-start-recording")
|
||||
tooltipDirection: BarService.getTooltipDirection()
|
||||
@@ -48,14 +55,7 @@ NIconButton {
|
||||
id: pendingSpinner
|
||||
icon: "loader-2"
|
||||
visible: ScreenRecorderService.isPending
|
||||
pointSize: {
|
||||
switch (root.density) {
|
||||
case "compact":
|
||||
return Math.max(1, root.width * 0.65);
|
||||
default:
|
||||
return Math.max(1, root.width * 0.48);
|
||||
}
|
||||
}
|
||||
pointSize: Math.max(1, Style.toOdd(root.width * root.barScaling * 0.65))
|
||||
applyUiScale: root.applyUiScale
|
||||
color: root.enabled && root.hovering ? colorFgHover : colorFg
|
||||
anchors.centerIn: parent
|
||||
|
||||
@@ -19,6 +19,7 @@ Rectangle {
|
||||
property string section: ""
|
||||
property int sectionWidgetIndex: -1
|
||||
property int sectionWidgetsCount: 0
|
||||
property real barScaling: 1.0
|
||||
|
||||
property var widgetMetadata: BarWidgetRegistry.widgetMetadata[widgetId]
|
||||
property var widgetSettings: {
|
||||
@@ -34,6 +35,7 @@ Rectangle {
|
||||
readonly property string barPosition: Settings.data.bar.position
|
||||
readonly property bool isVertical: barPosition === "left" || barPosition === "right"
|
||||
readonly property bool density: Settings.data.bar.density
|
||||
readonly property bool barCompact: Settings.data.bar.density === "compact"
|
||||
|
||||
readonly property bool compactMode: widgetSettings.compactMode !== undefined ? widgetSettings.compactMode : widgetMetadata.compactMode
|
||||
readonly property bool usePrimaryColor: widgetSettings.usePrimaryColor !== undefined ? widgetSettings.usePrimaryColor : widgetMetadata.usePrimaryColor
|
||||
@@ -46,17 +48,11 @@ Rectangle {
|
||||
readonly property bool showNetworkStats: (widgetSettings.showNetworkStats !== undefined) ? widgetSettings.showNetworkStats : widgetMetadata.showNetworkStats
|
||||
readonly property bool showDiskUsage: (widgetSettings.showDiskUsage !== undefined) ? widgetSettings.showDiskUsage : widgetMetadata.showDiskUsage
|
||||
readonly property string diskPath: (widgetSettings.diskPath !== undefined) ? widgetSettings.diskPath : widgetMetadata.diskPath
|
||||
|
||||
readonly property string fontFamily: useMonospaceFont ? Settings.data.ui.fontFixed : Settings.data.ui.fontDefault
|
||||
readonly property real iconSize: compactMode ? textSize * 1.2 : textSize * 1.4
|
||||
readonly property real textSize: {
|
||||
var base = isVertical ? width * 0.82 : height;
|
||||
return Math.max(1, (density === "compact") ? base * 0.43 : base * 0.33);
|
||||
}
|
||||
|
||||
// Mini bar dimensions for compact mode
|
||||
readonly property real miniBarWidth: Math.max(16, Math.round(iconSize * 1.8))
|
||||
readonly property real miniBarHeight: Math.max(3, Math.round(iconSize * 0.25))
|
||||
readonly property real iconSize: Style.toOdd(Style.capsuleHeight * root.barScaling * (root.barCompact ? 0.65 : 0.5))
|
||||
readonly property real miniGaugeWidth: Math.max(3, Style.toOdd(root.iconSize * 0.25))
|
||||
readonly property real textSize: Math.max(7, iconSize * barScaling * 0.6 * (isVertical ? 0.85 : 1.0))
|
||||
|
||||
// Build comprehensive tooltip text with all stats
|
||||
function buildTooltipText() {
|
||||
@@ -91,10 +87,6 @@ Rectangle {
|
||||
return lines.join("\n");
|
||||
}
|
||||
|
||||
// Match Workspace widget pill sizing: base ratio depends on bar density
|
||||
readonly property real pillBaseRatio: (density === "compact") ? 0.85 : 0.65
|
||||
readonly property int pillHeight: Math.round(Style.capsuleHeight * pillBaseRatio)
|
||||
|
||||
readonly property color textColor: usePrimaryColor ? Color.mPrimary : Color.mOnSurface
|
||||
|
||||
// Visibility-aware warning/critical states (delegates to service)
|
||||
@@ -150,6 +142,8 @@ Rectangle {
|
||||
PanelService.getPanel("systemStatsPanel", screen)?.toggle(root);
|
||||
TooltipService.hide();
|
||||
} else if (mouse.button === Qt.RightButton) {
|
||||
TooltipService.hide();
|
||||
5;
|
||||
var popupMenuWindow = PanelService.getPopupMenuWindow(screen);
|
||||
if (popupMenuWindow) {
|
||||
popupMenuWindow.showContextMenu(contextMenu);
|
||||
@@ -187,7 +181,7 @@ Rectangle {
|
||||
property real ratio: 0 // 0..1
|
||||
property color statColor: Color.mPrimary // Color based on warning/critical state
|
||||
|
||||
width: miniBarHeight // Thin vertical gauge
|
||||
width: miniGaugeWidth
|
||||
height: iconSize
|
||||
radius: width / 2
|
||||
color: Color.mOutline
|
||||
|
||||
@@ -19,6 +19,7 @@ Rectangle {
|
||||
property string section: ""
|
||||
property int sectionWidgetIndex: -1
|
||||
property int sectionWidgetsCount: 0
|
||||
property real barScaling: 1.0
|
||||
|
||||
readonly property string barPosition: Settings.data.bar.position
|
||||
readonly property bool isVerticalBar: barPosition === "left" || barPosition === "right"
|
||||
@@ -43,7 +44,7 @@ Rectangle {
|
||||
readonly property bool smartWidth: (widgetSettings.smartWidth !== undefined) ? widgetSettings.smartWidth : widgetMetadata.smartWidth
|
||||
readonly property int maxTaskbarWidthPercent: (widgetSettings.maxTaskbarWidth !== undefined) ? widgetSettings.maxTaskbarWidth : widgetMetadata.maxTaskbarWidth
|
||||
readonly property real iconScale: (widgetSettings.iconScale !== undefined) ? widgetSettings.iconScale : widgetMetadata.iconScale
|
||||
readonly property int itemSize: Style.toOdd(((density === "compact") ? Style.capsuleHeight * 1.0 : Style.capsuleHeight * 0.9) * Math.max(0.1, iconScale))
|
||||
readonly property int itemSize: Style.toOdd(Style.capsuleHeight * barScaling * Math.max(0.1, iconScale))
|
||||
|
||||
// Maximum width for the taskbar widget to prevent overlapping with other widgets
|
||||
readonly property real maxTaskbarWidth: {
|
||||
@@ -454,7 +455,7 @@ Rectangle {
|
||||
|
||||
// Pixel-perfect centering
|
||||
x: isVerticalBar ? Style.pixelAlignCenter(parent.width, width) : ((root.showTitle) ? Style.pixelAlignCenter(parent.width, width) : Style.marginM)
|
||||
y: isVerticalBar ? ((density === "compact") ? Style.pixelAlignCenter(parent.height, height) : Style.marginM) : Style.pixelAlignCenter(parent.height, height)
|
||||
y: Style.pixelAlignCenter(parent.height, height)
|
||||
|
||||
// Configure GridLayout to behave like RowLayout or ColumnLayout
|
||||
rows: isVerticalBar ? -1 : 1 // -1 means unlimited
|
||||
@@ -545,7 +546,7 @@ Rectangle {
|
||||
anchors.bottomMargin: -2
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: 4
|
||||
width: Style.toOdd(root.itemSize * 0.25)
|
||||
height: 4
|
||||
color: taskbarItem.isFocused ? Color.mPrimary : Color.transparent
|
||||
radius: Math.min(Style.radiusXXS, width / 2)
|
||||
|
||||
@@ -22,6 +22,7 @@ Item {
|
||||
property string section: ""
|
||||
property int sectionWidgetIndex: -1
|
||||
property int sectionWidgetsCount: 0
|
||||
property real barScaling: 1.0
|
||||
|
||||
property var widgetMetadata: BarWidgetRegistry.widgetMetadata[widgetId]
|
||||
property var widgetSettings: {
|
||||
@@ -36,14 +37,7 @@ Item {
|
||||
|
||||
readonly property string barPosition: Settings.data.bar.position
|
||||
readonly property bool isVertical: barPosition === "left" || barPosition === "right"
|
||||
readonly property bool density: Settings.data.bar.density
|
||||
readonly property real baseDimensionRatio: {
|
||||
const b = (density === "compact") ? 0.85 : 0.65;
|
||||
if (widgetSettings.labelMode === "none") {
|
||||
return b * 0.75;
|
||||
}
|
||||
return b;
|
||||
}
|
||||
readonly property real baseDimensionRatio: root.barScaling * 0.7 * (widgetSettings.labelMode === "none" ? 0.85 : 1)
|
||||
|
||||
readonly property string labelMode: (widgetSettings.labelMode !== undefined) ? widgetSettings.labelMode : widgetMetadata.labelMode
|
||||
readonly property bool hideUnoccupied: (widgetSettings.hideUnoccupied !== undefined) ? widgetSettings.hideUnoccupied : widgetMetadata.hideUnoccupied
|
||||
|
||||
@@ -18,6 +18,7 @@ SmartPanel {
|
||||
readonly property bool isWindowMode: settingsPanelMode === "window"
|
||||
readonly property bool attachToBar: settingsPanelMode === "attached"
|
||||
|
||||
readonly property string barDensity: Settings.data.bar.density
|
||||
readonly property string barPosition: Settings.data.bar.position
|
||||
readonly property bool barFloating: Settings.data.bar.floating
|
||||
readonly property real barMarginH: barFloating ? Math.ceil(Settings.data.bar.marginHorizontal * Style.marginXL) : 0
|
||||
@@ -43,6 +44,12 @@ SmartPanel {
|
||||
}
|
||||
}
|
||||
|
||||
onBarDensityChanged: {
|
||||
if (isPanelOpen) {
|
||||
Qt.callLater(root.setPosition);
|
||||
}
|
||||
}
|
||||
|
||||
onBarFloatingChanged: {
|
||||
if (isPanelOpen) {
|
||||
Qt.callLater(root.setPosition);
|
||||
|
||||
@@ -78,6 +78,10 @@ ColumnLayout {
|
||||
{
|
||||
"key": "comfortable",
|
||||
"name": I18n.tr("options.bar.density.comfortable")
|
||||
},
|
||||
{
|
||||
"key": "spacious",
|
||||
"name": I18n.tr("options.bar.density.spacious")
|
||||
}
|
||||
]
|
||||
currentKey: Settings.data.bar.density
|
||||
|
||||
@@ -254,6 +254,10 @@ ColumnLayout {
|
||||
{
|
||||
"key": "comfortable",
|
||||
"name": I18n.tr("options.bar.density.comfortable")
|
||||
},
|
||||
{
|
||||
"key": "spacious",
|
||||
"name": I18n.tr("options.bar.density.spacious")
|
||||
}
|
||||
]
|
||||
delegate: Rectangle {
|
||||
|
||||
Reference in New Issue
Block a user