Merge pull request #496 from lonerOrz/feat/adapt-bar-density-scaling

feat(bar): Introduce core density scaling mechanism
This commit is contained in:
Lemmy
2025-10-16 20:18:17 -04:00
committed by GitHub
5 changed files with 48 additions and 27 deletions
+7
View File
@@ -12,6 +12,9 @@ Item {
property string section: widgetProps && widgetProps.section || ""
property int sectionIndex: widgetProps && widgetProps.sectionWidgetIndex || 0
property string barDensity: "default"
readonly property real scaling: barDensity === "mini" ? 0.8 : (barDensity === "compact" ? 0.9 : 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 +43,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