mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
feat(bar): Introduce core density scaling mechanism
This commit is contained in:
@@ -12,6 +12,19 @@ Item {
|
||||
property string section: widgetProps && widgetProps.section || ""
|
||||
property int sectionIndex: widgetProps && widgetProps.sectionWidgetIndex || 0
|
||||
|
||||
property string barDensity: "default"
|
||||
readonly property real scaling: (function() {
|
||||
switch (barDensity) {
|
||||
case "mini":
|
||||
return 0.8
|
||||
case "compact":
|
||||
return 0.9
|
||||
case "comfortable":
|
||||
default:
|
||||
return 1.0
|
||||
}
|
||||
})()
|
||||
|
||||
// Don't reserve space unless the loaded widget is really visible
|
||||
implicitWidth: getImplicitSize(loader.item, "implicitWidth")
|
||||
implicitHeight: getImplicitSize(loader.item, "implicitHeight")
|
||||
@@ -40,6 +53,10 @@ Item {
|
||||
item[prop] = widgetProps[prop]
|
||||
}
|
||||
}
|
||||
// Explicitly set scaling property
|
||||
if (item.hasOwnProperty("scaling")) {
|
||||
item.scaling = Qt.binding(function() { return root.scaling; })
|
||||
}
|
||||
}
|
||||
|
||||
// Register this widget instance with BarService
|
||||
|
||||
Reference in New Issue
Block a user