Vertical bar: simpler management
This commit is contained in:
parent
b443c9f492
commit
101e3125a9
11 changed files with 25 additions and 139 deletions
|
|
@ -16,22 +16,6 @@ Item {
|
|||
property string section: ""
|
||||
property int sectionWidgetIndex: -1
|
||||
property int sectionWidgetsCount: 0
|
||||
property string barPosition: "top"
|
||||
|
||||
// Listen to BarService position changes
|
||||
Connections {
|
||||
target: BarService
|
||||
function onBarPositionChanged(newPosition) {
|
||||
barPosition = newPosition
|
||||
// Force re-evaluation of implicit sizing
|
||||
implicitWidth = Qt.binding(function () {
|
||||
return (barPosition === "left" || barPosition === "right") ? Math.round(Style.capsuleHeight * scaling) : (horizontalLayout.implicitWidth + Style.marginL * 2 * scaling)
|
||||
})
|
||||
implicitHeight = Qt.binding(function () {
|
||||
return (barPosition === "left" || barPosition === "right") ? calculatedVerticalHeight() : Math.round(Style.barHeight * scaling)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
property var widgetMetadata: BarWidgetRegistry.widgetMetadata[widgetId]
|
||||
property var widgetSettings: {
|
||||
|
|
@ -44,6 +28,8 @@ Item {
|
|||
return {}
|
||||
}
|
||||
|
||||
readonly property string barPosition: Settings.data.bar.position
|
||||
|
||||
readonly property bool showCpuUsage: (widgetSettings.showCpuUsage !== undefined) ? widgetSettings.showCpuUsage : widgetMetadata.showCpuUsage
|
||||
readonly property bool showCpuTemp: (widgetSettings.showCpuTemp !== undefined) ? widgetSettings.showCpuTemp : widgetMetadata.showCpuTemp
|
||||
readonly property bool showMemoryUsage: (widgetSettings.showMemoryUsage !== undefined) ? widgetSettings.showMemoryUsage : widgetMetadata.showMemoryUsage
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue