mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
Added a Spacer widget so people can add spacing between other widgets
(as requested in ##226). Spacer: create variable width invisible rectangle BarWidgetSettingsDialog: add Spacer support BarWidgetRegistry: add Spacer
This commit is contained in:
@@ -68,6 +68,8 @@ Popup {
|
||||
sourceComponent: {
|
||||
if (settingsPopup.widgetId === "CustomButton") {
|
||||
return customButtonSettings
|
||||
} else if (settingsPopup.widgetId === "Spacer") {
|
||||
return spacerSettings
|
||||
}
|
||||
// Add more widget settings components here as needed
|
||||
return null
|
||||
@@ -157,4 +159,28 @@ Popup {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Spacer settings component
|
||||
Component {
|
||||
id: spacerSettings
|
||||
|
||||
ColumnLayout {
|
||||
spacing: Style.marginM * scaling
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, settingsPopup.widgetData)
|
||||
settings.width = parseInt(widthInput.text) || 20
|
||||
return settings
|
||||
}
|
||||
|
||||
NTextInput {
|
||||
id: widthInput
|
||||
Layout.fillWidth: true
|
||||
label: "Width (pixels)"
|
||||
description: "Width of the spacer in pixels."
|
||||
text: settingsPopup.widgetData.width || "20"
|
||||
placeholderText: "Enter width in pixels"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user