Merge branch 'main' into file-dialog-builtin

This commit is contained in:
ItsLemmy
2025-09-22 11:54:44 -04:00
11 changed files with 608 additions and 77 deletions
@@ -16,18 +16,34 @@ ColumnLayout {
// Local state
property string valueIcon: widgetData.icon !== undefined ? widgetData.icon : widgetMetadata.icon
property bool valueUseDistroLogo: widgetData.useDistroLogo !== undefined ? widgetData.useDistroLogo : widgetMetadata.useDistroLogo
property string valueCustomIconPath: widgetData.customIconPath !== undefined ? widgetData.customIconPath : ""
function saveSettings() {
var settings = Object.assign({}, widgetData || {})
settings.icon = valueIcon
settings.useDistroLogo = valueUseDistroLogo
settings.customIconPath = valueCustomIconPath
return settings
}
NToggle {
label: "Use distro logo instead of icon"
checked: valueUseDistroLogo
onToggled: checked => valueUseDistroLogo = checked
onToggled: {
valueUseDistroLogo = checked
if (checked) {
valueCustomIconPath = ""
valueIcon = ""
}
}
}
NFilePicker {
id: filePicker
title: "Select a custom icon"
onFileSelected: function (filePath) {
valueCustomIconPath = "file://" + filePath
}
}
RowLayout {
@@ -35,21 +51,35 @@ ColumnLayout {
NLabel {
label: "Icon"
description: "Select an icon from the library."
description: "Select an icon from the library or a custom file."
}
NImageCircled {
Layout.alignment: Qt.AlignVCenter
imagePath: valueCustomIconPath
visible: valueCustomIconPath !== ""
width: Style.fontSizeXL * 2 * scaling
height: Style.fontSizeXL * 2 * scaling
}
NIcon {
Layout.alignment: Qt.AlignVCenter
icon: valueIcon
font.pointSize: Style.fontSizeXL * scaling
visible: valueIcon !== ""
visible: valueIcon !== "" && valueCustomIconPath === ""
}
NButton {
enabled: !valueUseDistroLogo
text: "Browse"
text: "Browse Library"
onClicked: iconPicker.open()
}
NButton {
enabled: !valueUseDistroLogo
text: "Browse File"
onClicked: filePicker.open()
}
}
NIconPicker {
@@ -57,6 +87,7 @@ ColumnLayout {
initialIcon: valueIcon
onIconSelected: function (iconName) {
valueIcon = iconName
valueCustomIconPath = ""
}
}
}
}
@@ -38,6 +38,39 @@ ColumnLayout {
checked: Settings.data.notifications.doNotDisturb
onToggled: checked => Settings.data.notifications.doNotDisturb = checked
}
NComboBox {
label: "Location"
description: "Where notifications appear on screen."
model: ListModel {
ListElement {
key: "top"
name: "Top"
}
ListElement {
key: "top_left"
name: "Top left"
}
ListElement {
key: "top_right"
name: "Top right"
}
ListElement {
key: "bottom"
name: "Bottom"
}
ListElement {
key: "bottom_left"
name: "Bottom left"
}
ListElement {
key: "bottom_right"
name: "Bottom right"
}
}
currentKey: Settings.data.notifications.location || "top_right"
onSelected: key => Settings.data.notifications.location = key
}
}
NDivider {