bug fix for the widgets position context menu not respecting orientation. Also some minor readibility improvments.

This commit is contained in:
tuibird
2026-02-08 13:52:29 +13:00
parent 5ad9cb8584
commit 166a66a61a
3 changed files with 21 additions and 9 deletions
@@ -14,11 +14,9 @@ NBox {
required property var screen
readonly property string screenName: screen?.name || ""
// Determine if the bar on a per screen basis is vertical
readonly property bool barIsVertical: {
var pos = Settings.getBarPositionForScreen(screenName);
return pos === "left" || pos === "right";
}
// determine bar orientation
readonly property string barPosition: Settings.getBarPositionForScreen(screenName)
readonly property bool barIsVertical: barPosition === "left" || barPosition === "right"
color: Color.mSurfaceVariant
Layout.fillWidth: true
@@ -160,6 +158,7 @@ NBox {
NSectionEditor {
sectionName: root.barIsVertical ? I18n.tr("positions.top") : I18n.tr("positions.left")
sectionId: "left"
barIsVertical: root.barIsVertical
screen: root.screen
settingsDialogComponent: Qt.resolvedUrl(Quickshell.shellDir + "/Modules/Panels/Settings/Bar/BarWidgetSettingsDialog.qml")
widgetRegistry: BarWidgetRegistry
@@ -177,6 +176,7 @@ NBox {
NSectionEditor {
sectionName: I18n.tr("positions.center")
sectionId: "center"
barIsVertical: root.barIsVertical
screen: root.screen
settingsDialogComponent: Qt.resolvedUrl(Quickshell.shellDir + "/Modules/Panels/Settings/Bar/BarWidgetSettingsDialog.qml")
widgetRegistry: BarWidgetRegistry
@@ -194,6 +194,7 @@ NBox {
NSectionEditor {
sectionName: root.barIsVertical ? I18n.tr("positions.bottom") : I18n.tr("positions.right")
sectionId: "right"
barIsVertical: root.barIsVertical
screen: root.screen
settingsDialogComponent: Qt.resolvedUrl(Quickshell.shellDir + "/Modules/Panels/Settings/Bar/BarWidgetSettingsDialog.qml")
widgetRegistry: BarWidgetRegistry
@@ -19,8 +19,9 @@ ColumnLayout {
property var moveWidgetBetweenSections
signal openPluginSettings(var manifest)
// determine if the bar is vertical
readonly property bool barIsVertical: Settings.data.bar.position === "left" || Settings.data.bar.position === "right"
// determine bar orientation
readonly property string barPosition: Settings.data.bar.position
readonly property bool barIsVertical: barPosition === "left" || barPosition === "right"
function getSectionIcons() {
return {
@@ -40,6 +41,7 @@ ColumnLayout {
NSectionEditor {
sectionName: root.barIsVertical ? I18n.tr("positions.top") : I18n.tr("positions.left")
sectionId: "left"
barIsVertical: root.barIsVertical
settingsDialogComponent: Qt.resolvedUrl(Quickshell.shellDir + "/Modules/Panels/Settings/Bar/BarWidgetSettingsDialog.qml")
widgetRegistry: BarWidgetRegistry
widgetModel: Settings.data.bar.widgets.left
@@ -57,6 +59,7 @@ ColumnLayout {
NSectionEditor {
sectionName: I18n.tr("positions.center")
sectionId: "center"
barIsVertical: root.barIsVertical
settingsDialogComponent: Qt.resolvedUrl(Quickshell.shellDir + "/Modules/Panels/Settings/Bar/BarWidgetSettingsDialog.qml")
widgetRegistry: BarWidgetRegistry
widgetModel: Settings.data.bar.widgets.center
@@ -74,6 +77,7 @@ ColumnLayout {
NSectionEditor {
sectionName: root.barIsVertical ? I18n.tr("positions.bottom") : I18n.tr("positions.right")
sectionId: "right"
barIsVertical: root.barIsVertical
settingsDialogComponent: Qt.resolvedUrl(Quickshell.shellDir + "/Modules/Panels/Settings/Bar/BarWidgetSettingsDialog.qml")
widgetRegistry: BarWidgetRegistry
widgetModel: Settings.data.bar.widgets.right