mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-06-06 12:02:24 +00:00
Switched to qmlformat.
This commit is contained in:
@@ -3,8 +3,8 @@ import QtQuick.Controls
|
||||
import QtQuick.Effects
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Widgets
|
||||
import qs.Services.UI
|
||||
import qs.Widgets
|
||||
|
||||
// Widget Settings Dialog Component
|
||||
Popup {
|
||||
@@ -27,7 +27,7 @@ Popup {
|
||||
onOpened: {
|
||||
// Load settings when popup opens with data
|
||||
if (widgetData && widgetId) {
|
||||
loadWidgetSettings()
|
||||
loadWidgetSettings();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,9 +102,9 @@ Popup {
|
||||
icon: "check"
|
||||
onClicked: {
|
||||
if (settingsLoader.item && settingsLoader.item.saveSettings) {
|
||||
var newSettings = settingsLoader.item.saveSettings()
|
||||
root.updateWidgetSettings(root.sectionId, root.widgetIndex, newSettings)
|
||||
root.close()
|
||||
var newSettings = settingsLoader.item.saveSettings();
|
||||
root.updateWidgetSettings(root.sectionId, root.widgetIndex, newSettings);
|
||||
root.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -112,13 +112,13 @@ Popup {
|
||||
}
|
||||
|
||||
function loadWidgetSettings() {
|
||||
const source = BarWidgetRegistry.widgetSettingsMap[widgetId]
|
||||
const source = BarWidgetRegistry.widgetSettingsMap[widgetId];
|
||||
if (source) {
|
||||
// Use setSource to pass properties at creation time
|
||||
settingsLoader.setSource(source, {
|
||||
"widgetData": widgetData,
|
||||
"widgetMetadata": BarWidgetRegistry.widgetMetadata[widgetId]
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,35 +22,39 @@ ColumnLayout {
|
||||
|
||||
Component.onCompleted: {
|
||||
if (widgetData && widgetData.hideMode !== undefined) {
|
||||
valueHideMode = widgetData.hideMode
|
||||
valueHideMode = widgetData.hideMode;
|
||||
}
|
||||
}
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {})
|
||||
settings.hideMode = valueHideMode
|
||||
settings.showIcon = valueShowIcon
|
||||
settings.scrollingMode = valueScrollingMode
|
||||
settings.maxWidth = parseInt(widthInput.text) || widgetMetadata.maxWidth
|
||||
settings.useFixedWidth = valueUseFixedWidth
|
||||
settings.colorizeIcons = valueColorizeIcons
|
||||
return settings
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.hideMode = valueHideMode;
|
||||
settings.showIcon = valueShowIcon;
|
||||
settings.scrollingMode = valueScrollingMode;
|
||||
settings.maxWidth = parseInt(widthInput.text) || widgetMetadata.maxWidth;
|
||||
settings.useFixedWidth = valueUseFixedWidth;
|
||||
settings.colorizeIcons = valueColorizeIcons;
|
||||
return settings;
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.widget-settings.active-window.hide-mode.label")
|
||||
description: I18n.tr("bar.widget-settings.active-window.hide-mode.description")
|
||||
model: [{
|
||||
model: [
|
||||
{
|
||||
"key": "visible",
|
||||
"name": I18n.tr("options.hide-modes.visible")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "hidden",
|
||||
"name": I18n.tr("options.hide-modes.hidden")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "transparent",
|
||||
"name": I18n.tr("options.hide-modes.transparent")
|
||||
}]
|
||||
}
|
||||
]
|
||||
currentKey: root.valueHideMode
|
||||
onSelected: key => root.valueHideMode = key
|
||||
}
|
||||
@@ -91,16 +95,20 @@ ColumnLayout {
|
||||
NComboBox {
|
||||
label: I18n.tr("bar.widget-settings.active-window.scrolling-mode.label")
|
||||
description: I18n.tr("bar.widget-settings.active-window.scrolling-mode.description")
|
||||
model: [{
|
||||
model: [
|
||||
{
|
||||
"key": "always",
|
||||
"name": I18n.tr("options.scrolling-modes.always")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "hover",
|
||||
"name": I18n.tr("options.scrolling-modes.hover")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "never",
|
||||
"name": I18n.tr("options.scrolling-modes.never")
|
||||
}]
|
||||
}
|
||||
]
|
||||
currentKey: valueScrollingMode
|
||||
onSelected: key => valueScrollingMode = key
|
||||
minimumWidth: 200
|
||||
|
||||
@@ -17,11 +17,11 @@ ColumnLayout {
|
||||
property string valueColorName: widgetData.colorName !== undefined ? widgetData.colorName : widgetMetadata.colorName
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {})
|
||||
settings.width = parseInt(widthInput.text) || widgetMetadata.width
|
||||
settings.hideWhenIdle = valueHideWhenIdle
|
||||
settings.colorName = valueColorName
|
||||
return settings
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.width = parseInt(widthInput.text) || widgetMetadata.width;
|
||||
settings.hideWhenIdle = valueHideWhenIdle;
|
||||
settings.colorName = valueColorName;
|
||||
return settings;
|
||||
}
|
||||
|
||||
NTextInput {
|
||||
@@ -37,22 +37,28 @@ ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.widget-settings.audio-visualizer.color-name.label")
|
||||
description: I18n.tr("bar.widget-settings.audio-visualizer.color-name.description")
|
||||
model: [{
|
||||
model: [
|
||||
{
|
||||
"key": "primary",
|
||||
"name": I18n.tr("options.colors.primary")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "secondary",
|
||||
"name": I18n.tr("options.colors.secondary")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "tertiary",
|
||||
"name": I18n.tr("options.colors.tertiary")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "onSurface",
|
||||
"name": I18n.tr("options.colors.onSurface")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "error",
|
||||
"name": I18n.tr("options.colors.error")
|
||||
}]
|
||||
}
|
||||
]
|
||||
currentKey: root.valueColorName
|
||||
onSelected: key => root.valueColorName = key
|
||||
}
|
||||
|
||||
@@ -17,26 +17,30 @@ ColumnLayout {
|
||||
property int valueWarningThreshold: widgetData.warningThreshold !== undefined ? widgetData.warningThreshold : widgetMetadata.warningThreshold
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {})
|
||||
settings.displayMode = valueDisplayMode
|
||||
settings.warningThreshold = valueWarningThreshold
|
||||
return settings
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.displayMode = valueDisplayMode;
|
||||
settings.warningThreshold = valueWarningThreshold;
|
||||
return settings;
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
label: I18n.tr("bar.widget-settings.battery.display-mode.label")
|
||||
description: I18n.tr("bar.widget-settings.battery.display-mode.description")
|
||||
minimumWidth: 134
|
||||
model: [{
|
||||
model: [
|
||||
{
|
||||
"key": "onhover",
|
||||
"name": I18n.tr("options.display-mode.on-hover")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "alwaysShow",
|
||||
"name": I18n.tr("options.display-mode.always-show")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "alwaysHide",
|
||||
"name": I18n.tr("options.display-mode.always-hide")
|
||||
}]
|
||||
}
|
||||
]
|
||||
currentKey: root.valueDisplayMode
|
||||
onSelected: key => root.valueDisplayMode = key
|
||||
}
|
||||
|
||||
@@ -15,25 +15,29 @@ ColumnLayout {
|
||||
property string valueDisplayMode: widgetData.displayMode !== undefined ? widgetData.displayMode : widgetMetadata.displayMode
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {})
|
||||
settings.displayMode = valueDisplayMode
|
||||
return settings
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.displayMode = valueDisplayMode;
|
||||
return settings;
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
label: I18n.tr("bar.widget-settings.battery.display-mode.label")
|
||||
description: I18n.tr("bar.widget-settings.battery.display-mode.description")
|
||||
minimumWidth: 134
|
||||
model: [{
|
||||
model: [
|
||||
{
|
||||
"key": "onhover",
|
||||
"name": I18n.tr("options.display-mode.on-hover")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "alwaysShow",
|
||||
"name": I18n.tr("options.display-mode.always-show")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "alwaysHide",
|
||||
"name": I18n.tr("options.display-mode.always-hide")
|
||||
}]
|
||||
}
|
||||
]
|
||||
currentKey: root.valueDisplayMode
|
||||
onSelected: key => root.valueDisplayMode = key
|
||||
}
|
||||
|
||||
@@ -16,25 +16,29 @@ ColumnLayout {
|
||||
property string valueDisplayMode: widgetData.displayMode !== undefined ? widgetData.displayMode : widgetMetadata.displayMode
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {})
|
||||
settings.displayMode = valueDisplayMode
|
||||
return settings
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.displayMode = valueDisplayMode;
|
||||
return settings;
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
label: I18n.tr("bar.widget-settings.brightness.display-mode.label")
|
||||
description: I18n.tr("bar.widget-settings.brightness.display-mode.description")
|
||||
minimumWidth: 134
|
||||
model: [{
|
||||
model: [
|
||||
{
|
||||
"key": "onhover",
|
||||
"name": I18n.tr("options.display-mode.on-hover")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "alwaysShow",
|
||||
"name": I18n.tr("options.display-mode.always-show")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "alwaysHide",
|
||||
"name": I18n.tr("options.display-mode.always-hide")
|
||||
}]
|
||||
}
|
||||
]
|
||||
currentKey: valueDisplayMode
|
||||
onSelected: key => valueDisplayMode = key
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Widgets
|
||||
import qs.Services.System
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
@@ -28,13 +28,13 @@ ColumnLayout {
|
||||
readonly property var now: Time.now
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {})
|
||||
settings.usePrimaryColor = valueUsePrimaryColor
|
||||
settings.useCustomFont = valueUseCustomFont
|
||||
settings.customFont = valueCustomFont
|
||||
settings.formatHorizontal = valueFormatHorizontal.trim()
|
||||
settings.formatVertical = valueFormatVertical.trim()
|
||||
return settings
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.usePrimaryColor = valueUsePrimaryColor;
|
||||
settings.useCustomFont = valueUseCustomFont;
|
||||
settings.customFont = valueCustomFont;
|
||||
settings.formatHorizontal = valueFormatHorizontal.trim();
|
||||
settings.formatVertical = valueFormatVertical.trim();
|
||||
return settings;
|
||||
}
|
||||
|
||||
// Function to insert token at cursor position in the focused input
|
||||
@@ -42,25 +42,25 @@ ColumnLayout {
|
||||
if (!focusedInput || !focusedInput.inputItem) {
|
||||
// If no input is focused, default to horiz
|
||||
if (inputHoriz.inputItem) {
|
||||
inputHoriz.inputItem.focus = true
|
||||
focusedInput = inputHoriz
|
||||
inputHoriz.inputItem.focus = true;
|
||||
focusedInput = inputHoriz;
|
||||
}
|
||||
}
|
||||
|
||||
if (focusedInput && focusedInput.inputItem) {
|
||||
var input = focusedInput.inputItem
|
||||
var cursorPos = input.cursorPosition
|
||||
var currentText = input.text
|
||||
var input = focusedInput.inputItem;
|
||||
var cursorPos = input.cursorPosition;
|
||||
var currentText = input.text;
|
||||
|
||||
// Insert token at cursor position
|
||||
var newText = currentText.substring(0, cursorPos) + token + currentText.substring(cursorPos)
|
||||
input.text = newText + " "
|
||||
var newText = currentText.substring(0, cursorPos) + token + currentText.substring(cursorPos);
|
||||
input.text = newText + " ";
|
||||
|
||||
// Move cursor after the inserted token
|
||||
input.cursorPosition = cursorPos + token.length + 1
|
||||
input.cursorPosition = cursorPos + token.length + 1;
|
||||
|
||||
// Ensure the input keeps focus
|
||||
input.focus = true
|
||||
input.focus = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ ColumnLayout {
|
||||
popupHeight: 420
|
||||
minimumWidth: 300
|
||||
onSelected: function (key) {
|
||||
valueCustomFont = key
|
||||
valueCustomFont = key;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,9 +131,9 @@ ColumnLayout {
|
||||
if (inputItem) {
|
||||
inputItem.onActiveFocusChanged.connect(function () {
|
||||
if (inputItem.activeFocus) {
|
||||
root.focusedInput = inputHoriz
|
||||
root.focusedInput = inputHoriz;
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -155,9 +155,9 @@ ColumnLayout {
|
||||
if (inputItem) {
|
||||
inputItem.onActiveFocusChanged.connect(function () {
|
||||
if (inputItem.activeFocus) {
|
||||
root.focusedInput = inputVert
|
||||
root.focusedInput = inputVert;
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,12 +20,12 @@ ColumnLayout {
|
||||
property bool valueColorizeDistroLogo: widgetData.colorizeDistroLogo !== undefined ? widgetData.colorizeDistroLogo : (widgetMetadata.colorizeDistroLogo !== undefined ? widgetMetadata.colorizeDistroLogo : false)
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {})
|
||||
settings.icon = valueIcon
|
||||
settings.useDistroLogo = valueUseDistroLogo
|
||||
settings.customIconPath = valueCustomIconPath
|
||||
settings.colorizeDistroLogo = valueColorizeDistroLogo
|
||||
return settings
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.icon = valueIcon;
|
||||
settings.useDistroLogo = valueUseDistroLogo;
|
||||
settings.customIconPath = valueCustomIconPath;
|
||||
settings.colorizeDistroLogo = valueColorizeDistroLogo;
|
||||
return settings;
|
||||
}
|
||||
|
||||
NToggle {
|
||||
@@ -33,10 +33,10 @@ ColumnLayout {
|
||||
description: I18n.tr("bar.widget-settings.control-center.use-distro-logo.description")
|
||||
checked: valueUseDistroLogo
|
||||
onToggled: function (checked) {
|
||||
valueUseDistroLogo = checked
|
||||
valueUseDistroLogo = checked;
|
||||
if (checked) {
|
||||
valueCustomIconPath = ""
|
||||
valueIcon = ""
|
||||
valueCustomIconPath = "";
|
||||
valueIcon = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -47,7 +47,7 @@ ColumnLayout {
|
||||
description: I18n.tr("bar.widget-settings.control-center.colorize-distro-logo.description")
|
||||
checked: valueColorizeDistroLogo
|
||||
onToggled: function (checked) {
|
||||
valueColorizeDistroLogo = checked
|
||||
valueColorizeDistroLogo = checked;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,8 +94,8 @@ ColumnLayout {
|
||||
id: iconPicker
|
||||
initialIcon: valueIcon
|
||||
onIconSelected: iconName => {
|
||||
valueIcon = iconName
|
||||
valueCustomIconPath = ""
|
||||
valueIcon = iconName;
|
||||
valueCustomIconPath = "";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ ColumnLayout {
|
||||
initialPath: Quickshell.env("HOME")
|
||||
onAccepted: paths => {
|
||||
if (paths.length > 0) {
|
||||
valueCustomIconPath = paths[0] // Use first selected file
|
||||
valueCustomIconPath = paths[0]; // Use first selected file
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,21 +19,21 @@ ColumnLayout {
|
||||
property bool valueHideTextInVerticalBar: widgetData.hideTextInVerticalBar !== undefined ? widgetData.hideTextInVerticalBar : widgetMetadata.hideTextInVerticalBar
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {})
|
||||
settings.icon = valueIcon
|
||||
settings.leftClickExec = leftClickExecInput.text
|
||||
settings.leftClickUpdateText = leftClickUpdateText.checked
|
||||
settings.rightClickExec = rightClickExecInput.text
|
||||
settings.rightClickUpdateText = rightClickUpdateText.checked
|
||||
settings.middleClickExec = middleClickExecInput.text
|
||||
settings.middleClickUpdateText = middleClickUpdateText.checked
|
||||
settings.textCommand = textCommandInput.text
|
||||
settings.textCollapse = textCollapseInput.text
|
||||
settings.textStream = valueTextStream
|
||||
settings.parseJson = valueParseJson
|
||||
settings.hideTextInVerticalBar = valueHideTextInVerticalBar
|
||||
settings.textIntervalMs = parseInt(textIntervalInput.text || textIntervalInput.placeholderText, 10)
|
||||
return settings
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.icon = valueIcon;
|
||||
settings.leftClickExec = leftClickExecInput.text;
|
||||
settings.leftClickUpdateText = leftClickUpdateText.checked;
|
||||
settings.rightClickExec = rightClickExecInput.text;
|
||||
settings.rightClickUpdateText = rightClickUpdateText.checked;
|
||||
settings.middleClickExec = middleClickExecInput.text;
|
||||
settings.middleClickUpdateText = middleClickUpdateText.checked;
|
||||
settings.textCommand = textCommandInput.text;
|
||||
settings.textCollapse = textCollapseInput.text;
|
||||
settings.textStream = valueTextStream;
|
||||
settings.parseJson = valueParseJson;
|
||||
settings.hideTextInVerticalBar = valueHideTextInVerticalBar;
|
||||
settings.textIntervalMs = parseInt(textIntervalInput.text || textIntervalInput.placeholderText, 10);
|
||||
return settings;
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
@@ -61,7 +61,7 @@ ColumnLayout {
|
||||
id: iconPicker
|
||||
initialIcon: valueIcon
|
||||
onIconSelected: function (iconName) {
|
||||
valueIcon = iconName
|
||||
valueIcon = iconName;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,25 +16,29 @@ ColumnLayout {
|
||||
property string valueDisplayMode: widgetData.displayMode !== undefined ? widgetData.displayMode : widgetMetadata.displayMode
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {})
|
||||
settings.displayMode = valueDisplayMode
|
||||
return settings
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.displayMode = valueDisplayMode;
|
||||
return settings;
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
label: I18n.tr("bar.widget-settings.keyboard-layout.display-mode.label")
|
||||
description: I18n.tr("bar.widget-settings.keyboard-layout.display-mode.description")
|
||||
minimumWidth: 134
|
||||
model: [{
|
||||
model: [
|
||||
{
|
||||
"key": "onhover",
|
||||
"name": I18n.tr("options.display-mode.on-hover")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "forceOpen",
|
||||
"name": I18n.tr("options.display-mode.force-open")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "alwaysHide",
|
||||
"name": I18n.tr("options.display-mode.always-hide")
|
||||
}]
|
||||
}
|
||||
]
|
||||
currentKey: valueDisplayMode
|
||||
onSelected: key => valueDisplayMode = key
|
||||
}
|
||||
|
||||
@@ -22,14 +22,14 @@ ColumnLayout {
|
||||
property string scrollIcon: widgetData.scrollLockIcon !== undefined ? widgetData.scrollLockIcon : widgetMetadata.scrollLockIcon
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {})
|
||||
settings.showCapsLock = valueShowCapsLock
|
||||
settings.showNumLock = valueShowNumLock
|
||||
settings.showScrollLock = valueShowScrollLock
|
||||
settings.capsLockIcon = capsIcon
|
||||
settings.numLockIcon = numIcon
|
||||
settings.scrollLockIcon = scrollIcon
|
||||
return settings
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.showCapsLock = valueShowCapsLock;
|
||||
settings.showNumLock = valueShowNumLock;
|
||||
settings.showScrollLock = valueShowScrollLock;
|
||||
settings.capsLockIcon = capsIcon;
|
||||
settings.numLockIcon = numIcon;
|
||||
settings.scrollLockIcon = scrollIcon;
|
||||
return settings;
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
@@ -61,7 +61,7 @@ ColumnLayout {
|
||||
initialIcon: capsIcon
|
||||
query: "letter-c"
|
||||
onIconSelected: function (iconName) {
|
||||
capsIcon = iconName
|
||||
capsIcon = iconName;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ ColumnLayout {
|
||||
initialIcon: numIcon
|
||||
query: "letter-n"
|
||||
onIconSelected: function (iconName) {
|
||||
numIcon = iconName
|
||||
numIcon = iconName;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ ColumnLayout {
|
||||
initialIcon: scrollIcon
|
||||
query: "letter-s"
|
||||
onIconSelected: function (iconName) {
|
||||
scrollIcon = iconName
|
||||
scrollIcon = iconName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,40 +25,45 @@ ColumnLayout {
|
||||
|
||||
Component.onCompleted: {
|
||||
if (widgetData && widgetData.hideMode !== undefined) {
|
||||
valueHideMode = widgetData.hideMode
|
||||
valueHideMode = widgetData.hideMode;
|
||||
}
|
||||
}
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {})
|
||||
settings.hideMode = valueHideMode
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.hideMode = valueHideMode;
|
||||
// No longer store hideWhenIdle separately; kept for backward compatibility only
|
||||
settings.showAlbumArt = valueShowAlbumArt
|
||||
settings.showVisualizer = valueShowVisualizer
|
||||
settings.visualizerType = valueVisualizerType
|
||||
settings.scrollingMode = valueScrollingMode
|
||||
settings.maxWidth = parseInt(widthInput.text) || widgetMetadata.maxWidth
|
||||
settings.useFixedWidth = valueUseFixedWidth
|
||||
return settings
|
||||
settings.showAlbumArt = valueShowAlbumArt;
|
||||
settings.showVisualizer = valueShowVisualizer;
|
||||
settings.visualizerType = valueVisualizerType;
|
||||
settings.scrollingMode = valueScrollingMode;
|
||||
settings.maxWidth = parseInt(widthInput.text) || widgetMetadata.maxWidth;
|
||||
settings.useFixedWidth = valueUseFixedWidth;
|
||||
return settings;
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.widget-settings.media-mini.hide-mode.label")
|
||||
description: I18n.tr("bar.widget-settings.media-mini.hide-mode.description")
|
||||
model: [{
|
||||
model: [
|
||||
{
|
||||
"key": "visible",
|
||||
"name": I18n.tr("options.hide-modes.visible")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "hidden",
|
||||
"name": I18n.tr("options.hide-modes.hidden")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "transparent",
|
||||
"name": I18n.tr("options.hide-modes.transparent")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "idle",
|
||||
"name": I18n.tr("options.hide-modes.idle")
|
||||
}]
|
||||
}
|
||||
]
|
||||
currentKey: root.valueHideMode
|
||||
onSelected: key => root.valueHideMode = key
|
||||
}
|
||||
@@ -81,16 +86,20 @@ ColumnLayout {
|
||||
visible: valueShowVisualizer
|
||||
label: I18n.tr("bar.widget-settings.media-mini.visualizer-type.label")
|
||||
description: I18n.tr("bar.widget-settings.media-mini.visualizer-type.description")
|
||||
model: [{
|
||||
model: [
|
||||
{
|
||||
"key": "linear",
|
||||
"name": I18n.tr("options.visualizer-types.linear")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "mirrored",
|
||||
"name": I18n.tr("options.visualizer-types.mirrored")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "wave",
|
||||
"name": I18n.tr("options.visualizer-types.wave")
|
||||
}]
|
||||
}
|
||||
]
|
||||
currentKey: valueVisualizerType
|
||||
onSelected: key => valueVisualizerType = key
|
||||
minimumWidth: 200
|
||||
@@ -115,16 +124,20 @@ ColumnLayout {
|
||||
NComboBox {
|
||||
label: I18n.tr("bar.widget-settings.media-mini.scrolling-mode.label")
|
||||
description: I18n.tr("bar.widget-settings.media-mini.scrolling-mode.description")
|
||||
model: [{
|
||||
model: [
|
||||
{
|
||||
"key": "always",
|
||||
"name": I18n.tr("options.scrolling-modes.always")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "hover",
|
||||
"name": I18n.tr("options.scrolling-modes.hover")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "never",
|
||||
"name": I18n.tr("options.scrolling-modes.never")
|
||||
}]
|
||||
}
|
||||
]
|
||||
currentKey: valueScrollingMode
|
||||
onSelected: key => valueScrollingMode = key
|
||||
minimumWidth: 200
|
||||
|
||||
@@ -16,25 +16,29 @@ ColumnLayout {
|
||||
property string valueDisplayMode: widgetData.displayMode !== undefined ? widgetData.displayMode : widgetMetadata.displayMode
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {})
|
||||
settings.displayMode = valueDisplayMode
|
||||
return settings
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.displayMode = valueDisplayMode;
|
||||
return settings;
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
label: I18n.tr("bar.widget-settings.microphone.display-mode.label")
|
||||
description: I18n.tr("bar.widget-settings.microphone.display-mode.description")
|
||||
minimumWidth: 134
|
||||
model: [{
|
||||
model: [
|
||||
{
|
||||
"key": "onhover",
|
||||
"name": I18n.tr("options.display-mode.on-hover")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "alwaysShow",
|
||||
"name": I18n.tr("options.display-mode.always-show")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "alwaysHide",
|
||||
"name": I18n.tr("options.display-mode.always-hide")
|
||||
}]
|
||||
}
|
||||
]
|
||||
currentKey: valueDisplayMode
|
||||
onSelected: key => valueDisplayMode = key
|
||||
}
|
||||
|
||||
@@ -17,10 +17,10 @@ ColumnLayout {
|
||||
property bool valueHideWhenZero: widgetData.hideWhenZero !== undefined ? widgetData.hideWhenZero : widgetMetadata.hideWhenZero
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {})
|
||||
settings.showUnreadBadge = valueShowUnreadBadge
|
||||
settings.hideWhenZero = valueHideWhenZero
|
||||
return settings
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.showUnreadBadge = valueShowUnreadBadge;
|
||||
settings.hideWhenZero = valueHideWhenZero;
|
||||
return settings;
|
||||
}
|
||||
|
||||
NToggle {
|
||||
|
||||
@@ -2,8 +2,8 @@ import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Widgets
|
||||
import qs.Services.System
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
@@ -18,31 +18,37 @@ ColumnLayout {
|
||||
property string valueColorName: widgetData.colorName !== undefined ? widgetData.colorName : widgetMetadata.colorName
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {})
|
||||
settings.colorName = valueColorName
|
||||
return settings
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.colorName = valueColorName;
|
||||
return settings;
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.widget-settings.audio-visualizer.color-name.label")
|
||||
description: I18n.tr("bar.widget-settings.audio-visualizer.color-name.description")
|
||||
model: [{
|
||||
model: [
|
||||
{
|
||||
"key": "primary",
|
||||
"name": I18n.tr("options.colors.primary")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "secondary",
|
||||
"name": I18n.tr("options.colors.secondary")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "tertiary",
|
||||
"name": I18n.tr("options.colors.tertiary")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "onSurface",
|
||||
"name": I18n.tr("options.colors.onSurface")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "error",
|
||||
"name": I18n.tr("options.colors.error")
|
||||
}]
|
||||
}
|
||||
]
|
||||
currentKey: root.valueColorName
|
||||
onSelected: key => root.valueColorName = key
|
||||
}
|
||||
|
||||
@@ -13,9 +13,9 @@ ColumnLayout {
|
||||
property var widgetMetadata: null
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {})
|
||||
settings.width = parseInt(widthInput.text) || widgetMetadata.width
|
||||
return settings
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.width = parseInt(widthInput.text) || widgetMetadata.width;
|
||||
return settings;
|
||||
}
|
||||
|
||||
NTextInput {
|
||||
|
||||
@@ -22,16 +22,16 @@ ColumnLayout {
|
||||
property bool valueShowDiskUsage: widgetData.showDiskUsage !== undefined ? widgetData.showDiskUsage : widgetMetadata.showDiskUsage
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {})
|
||||
settings.usePrimaryColor = valueUsePrimaryColor
|
||||
settings.showCpuUsage = valueShowCpuUsage
|
||||
settings.showCpuTemp = valueShowCpuTemp
|
||||
settings.showMemoryUsage = valueShowMemoryUsage
|
||||
settings.showMemoryAsPercent = valueShowMemoryAsPercent
|
||||
settings.showNetworkStats = valueShowNetworkStats
|
||||
settings.showDiskUsage = valueShowDiskUsage
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.usePrimaryColor = valueUsePrimaryColor;
|
||||
settings.showCpuUsage = valueShowCpuUsage;
|
||||
settings.showCpuTemp = valueShowCpuTemp;
|
||||
settings.showMemoryUsage = valueShowMemoryUsage;
|
||||
settings.showMemoryAsPercent = valueShowMemoryAsPercent;
|
||||
settings.showNetworkStats = valueShowNetworkStats;
|
||||
settings.showDiskUsage = valueShowDiskUsage;
|
||||
|
||||
return settings
|
||||
return settings;
|
||||
}
|
||||
|
||||
NToggle {
|
||||
|
||||
@@ -19,29 +19,33 @@ ColumnLayout {
|
||||
property bool valueColorizeIcons: widgetData.colorizeIcons !== undefined ? widgetData.colorizeIcons : (widgetMetadata ? widgetMetadata.colorizeIcons : false)
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {})
|
||||
settings.labelMode = valueLabelMode
|
||||
settings.hideUnoccupied = valueHideUnoccupied
|
||||
settings.showWorkspaceNumbers = valueShowWorkspaceNumbers
|
||||
settings.showNumbersOnlyWhenOccupied = valueShowNumbersOnlyWhenOccupied
|
||||
settings.colorizeIcons = valueColorizeIcons
|
||||
return settings
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.labelMode = valueLabelMode;
|
||||
settings.hideUnoccupied = valueHideUnoccupied;
|
||||
settings.showWorkspaceNumbers = valueShowWorkspaceNumbers;
|
||||
settings.showNumbersOnlyWhenOccupied = valueShowNumbersOnlyWhenOccupied;
|
||||
settings.colorizeIcons = valueColorizeIcons;
|
||||
return settings;
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
id: labelModeCombo
|
||||
label: I18n.tr("bar.widget-settings.workspace.label-mode.label")
|
||||
description: I18n.tr("bar.widget-settings.workspace.label-mode.description")
|
||||
model: [{
|
||||
model: [
|
||||
{
|
||||
"key": "none",
|
||||
"name": I18n.tr("options.workspace-labels.none")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "index",
|
||||
"name": I18n.tr("options.workspace-labels.index")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "name",
|
||||
"name": I18n.tr("options.workspace-labels.name")
|
||||
}]
|
||||
}
|
||||
]
|
||||
currentKey: widgetData.labelMode || widgetMetadata.labelMode
|
||||
onSelected: key => valueLabelMode = key
|
||||
minimumWidth: 200
|
||||
|
||||
@@ -20,35 +20,39 @@ ColumnLayout {
|
||||
|
||||
Component.onCompleted: {
|
||||
if (widgetData && widgetData.hideMode !== undefined) {
|
||||
valueHideMode = widgetData.hideMode
|
||||
valueHideMode = widgetData.hideMode;
|
||||
} else if (widgetMetadata && widgetMetadata.hideMode !== undefined) {
|
||||
valueHideMode = widgetMetadata.hideMode
|
||||
valueHideMode = widgetMetadata.hideMode;
|
||||
}
|
||||
}
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {})
|
||||
settings.hideMode = valueHideMode
|
||||
settings.onlySameOutput = valueOnlySameOutput
|
||||
settings.onlyActiveWorkspaces = valueOnlyActiveWorkspaces
|
||||
settings.colorizeIcons = valueColorizeIcons
|
||||
return settings
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.hideMode = valueHideMode;
|
||||
settings.onlySameOutput = valueOnlySameOutput;
|
||||
settings.onlyActiveWorkspaces = valueOnlyActiveWorkspaces;
|
||||
settings.colorizeIcons = valueColorizeIcons;
|
||||
return settings;
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.widget-settings.taskbar.hide-mode.label")
|
||||
description: I18n.tr("bar.widget-settings.taskbar.hide-mode.description")
|
||||
model: [{
|
||||
model: [
|
||||
{
|
||||
"key": "visible",
|
||||
"name": I18n.tr("options.hide-modes.visible")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "hidden",
|
||||
"name": I18n.tr("options.hide-modes.hidden")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "transparent",
|
||||
"name": I18n.tr("options.hide-modes.transparent")
|
||||
}]
|
||||
}
|
||||
]
|
||||
currentKey: root.valueHideMode
|
||||
onSelected: key => root.valueHideMode = key
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ ColumnLayout {
|
||||
for (var i = 0; i < localBlacklist.length; i++) {
|
||||
blacklistModel.append({
|
||||
"rule": localBlacklist[i]
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,19 +66,19 @@ ColumnLayout {
|
||||
buttonIcon: "add"
|
||||
onButtonClicked: {
|
||||
if (newRuleInput.text.length > 0) {
|
||||
var newRule = newRuleInput.text.trim()
|
||||
var exists = false
|
||||
var newRule = newRuleInput.text.trim();
|
||||
var exists = false;
|
||||
for (var i = 0; i < blacklistModel.count; i++) {
|
||||
if (blacklistModel.get(i).rule === newRule) {
|
||||
exists = true
|
||||
break
|
||||
exists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!exists) {
|
||||
blacklistModel.append({
|
||||
"rule": newRule
|
||||
})
|
||||
newRuleInput.text = ""
|
||||
});
|
||||
newRuleInput.text = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -131,7 +131,7 @@ ColumnLayout {
|
||||
colorBgHover: Color.mError
|
||||
colorFgHover: Color.mOnError
|
||||
onClicked: {
|
||||
blacklistModel.remove(index)
|
||||
blacklistModel.remove(index);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -140,16 +140,16 @@ ColumnLayout {
|
||||
|
||||
// This function will be called by the dialog to get the new settings
|
||||
function saveSettings() {
|
||||
var newBlacklist = []
|
||||
var newBlacklist = [];
|
||||
for (var i = 0; i < blacklistModel.count; i++) {
|
||||
newBlacklist.push(blacklistModel.get(i).rule)
|
||||
newBlacklist.push(blacklistModel.get(i).rule);
|
||||
}
|
||||
|
||||
// Return the updated settings for this widget instance
|
||||
var settings = Object.assign({}, widgetData || {})
|
||||
settings.blacklist = newBlacklist
|
||||
settings.colorizeIcons = root.valueColorizeIcons
|
||||
settings.drawerEnabled = root.valueDrawerEnabled
|
||||
return settings
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.blacklist = newBlacklist;
|
||||
settings.colorizeIcons = root.valueColorizeIcons;
|
||||
settings.drawerEnabled = root.valueDrawerEnabled;
|
||||
return settings;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,25 +16,29 @@ ColumnLayout {
|
||||
property string valueDisplayMode: widgetData.displayMode !== undefined ? widgetData.displayMode : widgetMetadata.displayMode
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {})
|
||||
settings.displayMode = valueDisplayMode
|
||||
return settings
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.displayMode = valueDisplayMode;
|
||||
return settings;
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
label: I18n.tr("bar.widget-settings.volume.display-mode.label")
|
||||
description: I18n.tr("bar.widget-settings.volume.display-mode.description")
|
||||
minimumWidth: 134
|
||||
model: [{
|
||||
model: [
|
||||
{
|
||||
"key": "onhover",
|
||||
"name": I18n.tr("options.display-mode.on-hover")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "alwaysShow",
|
||||
"name": I18n.tr("options.display-mode.always-show")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "alwaysHide",
|
||||
"name": I18n.tr("options.display-mode.always-hide")
|
||||
}]
|
||||
}
|
||||
]
|
||||
currentKey: valueDisplayMode
|
||||
onSelected: key => valueDisplayMode = key
|
||||
}
|
||||
|
||||
@@ -15,25 +15,29 @@ ColumnLayout {
|
||||
property string valueDisplayMode: widgetData.displayMode !== undefined ? widgetData.displayMode : widgetMetadata.displayMode
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {})
|
||||
settings.displayMode = valueDisplayMode
|
||||
return settings
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.displayMode = valueDisplayMode;
|
||||
return settings;
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
label: I18n.tr("bar.widget-settings.battery.display-mode.label")
|
||||
description: I18n.tr("bar.widget-settings.battery.display-mode.description")
|
||||
minimumWidth: 134
|
||||
model: [{
|
||||
model: [
|
||||
{
|
||||
"key": "onhover",
|
||||
"name": I18n.tr("options.display-mode.on-hover")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "alwaysShow",
|
||||
"name": I18n.tr("options.display-mode.always-show")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "alwaysHide",
|
||||
"name": I18n.tr("options.display-mode.always-hide")
|
||||
}]
|
||||
}
|
||||
]
|
||||
currentKey: root.valueDisplayMode
|
||||
onSelected: key => root.valueDisplayMode = key
|
||||
}
|
||||
|
||||
@@ -17,27 +17,31 @@ ColumnLayout {
|
||||
property int valueCharacterCount: widgetData.characterCount !== undefined ? widgetData.characterCount : widgetMetadata.characterCount
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {})
|
||||
settings.labelMode = valueLabelMode
|
||||
settings.hideUnoccupied = valueHideUnoccupied
|
||||
settings.characterCount = valueCharacterCount
|
||||
return settings
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.labelMode = valueLabelMode;
|
||||
settings.hideUnoccupied = valueHideUnoccupied;
|
||||
settings.characterCount = valueCharacterCount;
|
||||
return settings;
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
id: labelModeCombo
|
||||
label: I18n.tr("bar.widget-settings.workspace.label-mode.label")
|
||||
description: I18n.tr("bar.widget-settings.workspace.label-mode.description")
|
||||
model: [{
|
||||
model: [
|
||||
{
|
||||
"key": "none",
|
||||
"name": I18n.tr("options.workspace-labels.none")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "index",
|
||||
"name": I18n.tr("options.workspace-labels.index")
|
||||
}, {
|
||||
},
|
||||
{
|
||||
"key": "name",
|
||||
"name": I18n.tr("options.workspace-labels.name")
|
||||
}]
|
||||
}
|
||||
]
|
||||
currentKey: widgetData.labelMode || widgetMetadata.labelMode
|
||||
onSelected: key => valueLabelMode = key
|
||||
minimumWidth: 200
|
||||
|
||||
Reference in New Issue
Block a user