add noctalia and fuzzel
This commit is contained in:
+193
@@ -0,0 +1,193 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Effects
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Services.UI
|
||||
import qs.Widgets
|
||||
|
||||
// Widget Settings Dialog Component
|
||||
Popup {
|
||||
id: root
|
||||
|
||||
property int widgetIndex: -1
|
||||
property var widgetData: null
|
||||
property string widgetId: ""
|
||||
property string sectionId: ""
|
||||
property var screen: null
|
||||
property var settingsCache: ({})
|
||||
|
||||
readonly property real maxHeight: (screen ? screen.height : (parent ? parent.height : 800)) * 0.8
|
||||
|
||||
signal updateWidgetSettings(string section, int index, var settings)
|
||||
|
||||
width: Math.max(content.implicitWidth + padding * 2, 640)
|
||||
height: Math.min(content.implicitHeight + padding * 2, maxHeight)
|
||||
padding: Style.marginXL
|
||||
modal: true
|
||||
closePolicy: Popup.NoAutoClose
|
||||
dim: false
|
||||
anchors.centerIn: parent
|
||||
|
||||
onOpened: {
|
||||
// Load settings when popup opens with data
|
||||
if (widgetData && widgetId) {
|
||||
loadWidgetSettings();
|
||||
}
|
||||
// Request focus to ensure keyboard input works
|
||||
forceActiveFocus();
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
id: bgRect
|
||||
|
||||
color: Color.mSurface
|
||||
radius: Style.radiusL
|
||||
border.color: Color.mPrimary
|
||||
border.width: Style.borderM
|
||||
}
|
||||
|
||||
contentItem: FocusScope {
|
||||
id: focusScope
|
||||
focus: true
|
||||
|
||||
ColumnLayout {
|
||||
id: content
|
||||
anchors.fill: parent
|
||||
spacing: Style.marginM
|
||||
|
||||
// Title
|
||||
RowLayout {
|
||||
id: titleRow
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: implicitHeight
|
||||
|
||||
NText {
|
||||
text: I18n.tr("system.widget-settings-title", {
|
||||
"widget": root.widgetId
|
||||
})
|
||||
pointSize: Style.fontSizeL
|
||||
font.weight: Style.fontWeightBold
|
||||
color: Color.mPrimary
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
NIconButton {
|
||||
icon: "close"
|
||||
tooltipText: I18n.tr("common.close")
|
||||
onClicked: saveAndClose()
|
||||
}
|
||||
}
|
||||
|
||||
// Separator
|
||||
Rectangle {
|
||||
id: separator
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 1
|
||||
color: Color.mOutline
|
||||
}
|
||||
|
||||
// Scrollable settings area
|
||||
NScrollView {
|
||||
id: scrollView
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
Layout.minimumHeight: 100
|
||||
gradientColor: Color.mSurface
|
||||
|
||||
ColumnLayout {
|
||||
width: scrollView.availableWidth
|
||||
spacing: Style.marginM
|
||||
|
||||
// Settings based on widget type
|
||||
// Will be triggered via settingsLoader.setSource()
|
||||
Loader {
|
||||
id: settingsLoader
|
||||
Layout.fillWidth: true
|
||||
onLoaded: {
|
||||
// Try to focus the first focusable item in the loaded settings
|
||||
if (item) {
|
||||
Qt.callLater(() => {
|
||||
var firstInput = findFirstFocusable(item);
|
||||
if (firstInput) {
|
||||
firstInput.forceActiveFocus();
|
||||
} else {
|
||||
focusScope.forceActiveFocus();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function findFirstFocusable(item) {
|
||||
if (!item)
|
||||
return null;
|
||||
// Check if this item can accept focus
|
||||
if (item.focus !== undefined && item.focus === true)
|
||||
return item;
|
||||
// Check children
|
||||
if (item.children) {
|
||||
for (var i = 0; i < item.children.length; i++) {
|
||||
var child = item.children[i];
|
||||
if (child && child.focus !== undefined && child.focus === true)
|
||||
return child;
|
||||
var found = findFirstFocusable(child);
|
||||
if (found)
|
||||
return found;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: saveTimer
|
||||
running: false
|
||||
interval: 150
|
||||
onTriggered: {
|
||||
root.updateWidgetSettings(root.sectionId, root.widgetIndex, root.settingsCache);
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: settingsLoader.item
|
||||
ignoreUnknownSignals: true
|
||||
function onSettingsChanged(newSettings) {
|
||||
if (newSettings) {
|
||||
root.settingsCache = newSettings;
|
||||
saveTimer.start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function saveAndClose() {
|
||||
if (settingsLoader.item && typeof settingsLoader.item.saveSettings === 'function') {
|
||||
var newSettings = settingsLoader.item.saveSettings();
|
||||
if (newSettings) {
|
||||
root.updateWidgetSettings(root.sectionId, root.widgetIndex, newSettings);
|
||||
}
|
||||
}
|
||||
root.close();
|
||||
}
|
||||
|
||||
function loadWidgetSettings() {
|
||||
const source = BarWidgetRegistry.widgetSettingsMap[widgetId];
|
||||
if (source) {
|
||||
var currentWidgetData = widgetData;
|
||||
if (sectionId && widgetIndex >= 0) {
|
||||
var widgets = Settings.getBarWidgetsForScreen(screen?.name || "")[sectionId];
|
||||
if (widgets && widgetIndex < widgets.length) {
|
||||
currentWidgetData = widgets[widgetIndex];
|
||||
}
|
||||
}
|
||||
settingsLoader.setSource(source, {
|
||||
"screen": screen,
|
||||
"widgetData": currentWidgetData,
|
||||
"widgetMetadata": BarWidgetRegistry.widgetMetadata[widgetId]
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
+230
@@ -0,0 +1,230 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import "../../../../Helpers/QtObj2JS.js" as QtObj2JS
|
||||
import qs.Commons
|
||||
import qs.Services.Noctalia
|
||||
import qs.Services.UI
|
||||
import qs.Widgets
|
||||
|
||||
// Monitor Widgets Configuration (inline)
|
||||
NBox {
|
||||
id: root
|
||||
|
||||
required property var screen
|
||||
readonly property string screenName: screen?.name || ""
|
||||
// determine bar orientation
|
||||
readonly property string barPosition: Settings.getBarPositionForScreen(screenName)
|
||||
readonly property bool barIsVertical: barPosition === "left" || barPosition === "right"
|
||||
|
||||
color: Color.mSurfaceVariant
|
||||
Layout.fillWidth: true
|
||||
implicitHeight: content.implicitHeight + Style.margin2L
|
||||
|
||||
// Helper to get widgets for this screen (ensures override exists)
|
||||
function _getWidgetsContainer() {
|
||||
if (!Settings.hasScreenOverride(screenName, "widgets")) {
|
||||
var currentWidgets = Settings.getBarWidgetsForScreen(screenName);
|
||||
var widgetsCopy = QtObj2JS.qtObjectToPlainObject(currentWidgets);
|
||||
Settings.setScreenOverride(screenName, "widgets", widgetsCopy);
|
||||
}
|
||||
var entry = Settings.getScreenOverrideEntry(screenName);
|
||||
return entry ? entry.widgets : Settings.data.bar.widgets;
|
||||
}
|
||||
|
||||
// Persist widget changes by reassigning the override (triggers change detection)
|
||||
function _saveWidgets(widgets) {
|
||||
Settings.setScreenOverride(screenName, "widgets", widgets);
|
||||
}
|
||||
|
||||
// Widget manipulation functions
|
||||
function _addWidgetToSection(widgetId, section) {
|
||||
var newWidget = {
|
||||
"id": widgetId
|
||||
};
|
||||
if (BarWidgetRegistry.widgetHasUserSettings(widgetId)) {
|
||||
var metadata = BarWidgetRegistry.widgetMetadata[widgetId];
|
||||
if (metadata) {
|
||||
Object.keys(metadata).forEach(function (key) {
|
||||
newWidget[key] = metadata[key];
|
||||
});
|
||||
}
|
||||
}
|
||||
var widgets = _getWidgetsContainer();
|
||||
widgets[section].push(newWidget);
|
||||
_saveWidgets(widgets);
|
||||
BarService.widgetsRevision++;
|
||||
}
|
||||
|
||||
function _removeWidgetFromSection(section, index) {
|
||||
var widgets = _getWidgetsContainer();
|
||||
if (index >= 0 && index < widgets[section].length) {
|
||||
var newArray = widgets[section].slice();
|
||||
var removedWidgets = newArray.splice(index, 1);
|
||||
widgets[section] = newArray;
|
||||
_saveWidgets(widgets);
|
||||
BarService.widgetsRevision++;
|
||||
|
||||
if (removedWidgets[0].id === "ControlCenter" && BarService.lookupWidget("ControlCenter") === undefined) {
|
||||
ToastService.showWarning(I18n.tr("toast.missing-control-center.label"), I18n.tr("toast.missing-control-center.description"), 12000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function _reorderWidgetInSection(section, fromIndex, toIndex) {
|
||||
var widgets = _getWidgetsContainer();
|
||||
if (fromIndex >= 0 && fromIndex < widgets[section].length && toIndex >= 0 && toIndex < widgets[section].length) {
|
||||
var newArray = widgets[section].slice();
|
||||
var item = newArray[fromIndex];
|
||||
newArray.splice(fromIndex, 1);
|
||||
newArray.splice(toIndex, 0, item);
|
||||
widgets[section] = newArray;
|
||||
_saveWidgets(widgets);
|
||||
BarService.widgetsRevision++;
|
||||
}
|
||||
}
|
||||
|
||||
// Note: _updateWidgetSettingsInSection does NOT increment revision
|
||||
// because it only changes settings, not widget structure
|
||||
function _updateWidgetSettingsInSection(section, index, settings) {
|
||||
var widgets = _getWidgetsContainer();
|
||||
widgets[section][index] = settings;
|
||||
_saveWidgets(widgets);
|
||||
}
|
||||
|
||||
function _moveWidgetBetweenSections(fromSection, index, toSection) {
|
||||
var widgets = _getWidgetsContainer();
|
||||
if (index >= 0 && index < widgets[fromSection].length) {
|
||||
var widget = widgets[fromSection][index];
|
||||
var sourceArray = widgets[fromSection].slice();
|
||||
sourceArray.splice(index, 1);
|
||||
widgets[fromSection] = sourceArray;
|
||||
var targetArray = widgets[toSection].slice();
|
||||
targetArray.push(widget);
|
||||
widgets[toSection] = targetArray;
|
||||
_saveWidgets(widgets);
|
||||
BarService.widgetsRevision++;
|
||||
}
|
||||
}
|
||||
|
||||
// Available widgets ListModel
|
||||
function updateAvailableWidgetsModel() {
|
||||
availableWidgetsModel.clear();
|
||||
var widgetIds = BarWidgetRegistry.getAvailableWidgets();
|
||||
if (!widgetIds)
|
||||
return;
|
||||
for (var i = 0; i < widgetIds.length; i++) {
|
||||
var id = widgetIds[i];
|
||||
var displayName = id;
|
||||
const badges = [];
|
||||
if (BarWidgetRegistry.isPluginWidget(id)) {
|
||||
var pluginId = id.replace("plugin:", "");
|
||||
var manifest = PluginRegistry.getPluginManifest(pluginId);
|
||||
if (manifest && manifest.name) {
|
||||
displayName = manifest.name;
|
||||
} else {
|
||||
displayName = pluginId;
|
||||
}
|
||||
badges.push({
|
||||
"icon": "plugin",
|
||||
"color": Color.mSecondary
|
||||
});
|
||||
}
|
||||
if (BarWidgetRegistry.isCpuIntensive(id)) {
|
||||
badges.push({
|
||||
"icon": "cpu-intensive",
|
||||
"color": Color.mSecondary
|
||||
});
|
||||
}
|
||||
availableWidgetsModel.append({
|
||||
"key": id,
|
||||
"name": displayName,
|
||||
"badges": badges
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: Qt.callLater(updateAvailableWidgetsModel)
|
||||
|
||||
ListModel {
|
||||
id: availableWidgetsModel
|
||||
}
|
||||
|
||||
// Get effective widgets for this screen
|
||||
readonly property var effectiveWidgets: Settings.getBarWidgetsForScreen(screenName)
|
||||
|
||||
ColumnLayout {
|
||||
id: content
|
||||
anchors.fill: parent
|
||||
anchors.margins: Style.marginL
|
||||
spacing: Style.marginM
|
||||
|
||||
NText {
|
||||
text: I18n.tr("panels.bar.widgets-desc")
|
||||
wrapMode: Text.WordWrap
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
// Left Section
|
||||
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
|
||||
widgetModel: root.effectiveWidgets.left
|
||||
availableWidgets: availableWidgetsModel
|
||||
onAddWidget: (widgetId, section) => root._addWidgetToSection(widgetId, section)
|
||||
onRemoveWidget: (section, index) => root._removeWidgetFromSection(section, index)
|
||||
onReorderWidget: (section, fromIndex, toIndex) => root._reorderWidgetInSection(section, fromIndex, toIndex)
|
||||
onUpdateWidgetSettings: (section, index, settings) => root._updateWidgetSettingsInSection(section, index, settings)
|
||||
onMoveWidget: (fromSection, index, toSection) => root._moveWidgetBetweenSections(fromSection, index, toSection)
|
||||
onOpenPluginSettingsRequested: manifest => pluginSettingsDialog.openPluginSettings(manifest)
|
||||
}
|
||||
|
||||
// Center Section
|
||||
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
|
||||
widgetModel: root.effectiveWidgets.center
|
||||
availableWidgets: availableWidgetsModel
|
||||
onAddWidget: (widgetId, section) => root._addWidgetToSection(widgetId, section)
|
||||
onRemoveWidget: (section, index) => root._removeWidgetFromSection(section, index)
|
||||
onReorderWidget: (section, fromIndex, toIndex) => root._reorderWidgetInSection(section, fromIndex, toIndex)
|
||||
onUpdateWidgetSettings: (section, index, settings) => root._updateWidgetSettingsInSection(section, index, settings)
|
||||
onMoveWidget: (fromSection, index, toSection) => root._moveWidgetBetweenSections(fromSection, index, toSection)
|
||||
onOpenPluginSettingsRequested: manifest => pluginSettingsDialog.openPluginSettings(manifest)
|
||||
}
|
||||
|
||||
// Right Section
|
||||
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
|
||||
widgetModel: root.effectiveWidgets.right
|
||||
availableWidgets: availableWidgetsModel
|
||||
onAddWidget: (widgetId, section) => root._addWidgetToSection(widgetId, section)
|
||||
onRemoveWidget: (section, index) => root._removeWidgetFromSection(section, index)
|
||||
onReorderWidget: (section, fromIndex, toIndex) => root._reorderWidgetInSection(section, fromIndex, toIndex)
|
||||
onUpdateWidgetSettings: (section, index, settings) => root._updateWidgetSettingsInSection(section, index, settings)
|
||||
onMoveWidget: (fromSection, index, toSection) => root._moveWidgetBetweenSections(fromSection, index, toSection)
|
||||
onOpenPluginSettingsRequested: manifest => pluginSettingsDialog.openPluginSettings(manifest)
|
||||
}
|
||||
}
|
||||
|
||||
// Plugin settings dialog
|
||||
NPluginSettingsPopup {
|
||||
id: pluginSettingsDialog
|
||||
parent: Overlay.overlay
|
||||
showToastOnSave: false
|
||||
}
|
||||
}
|
||||
+168
@@ -0,0 +1,168 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
spacing: Style.marginM
|
||||
|
||||
// Properties to receive data from parent
|
||||
property var screen: null
|
||||
property var widgetData: null
|
||||
property var widgetMetadata: null
|
||||
|
||||
signal settingsChanged(var settings)
|
||||
|
||||
// Local state
|
||||
property bool valueShowIcon: widgetData.showIcon !== undefined ? widgetData.showIcon : widgetMetadata.showIcon
|
||||
property bool valueShowText: widgetData.showText !== undefined ? widgetData.showText : widgetMetadata.showText
|
||||
property string valueHideMode: widgetData.hideMode !== undefined ? widgetData.hideMode : widgetMetadata.hideMode
|
||||
property string valueScrollingMode: widgetData.scrollingMode || widgetMetadata.scrollingMode
|
||||
property int valueMaxWidth: widgetData.maxWidth !== undefined ? widgetData.maxWidth : widgetMetadata.maxWidth
|
||||
property bool valueUseFixedWidth: widgetData.useFixedWidth !== undefined ? widgetData.useFixedWidth : widgetMetadata.useFixedWidth
|
||||
property bool valueColorizeIcons: widgetData.colorizeIcons !== undefined ? widgetData.colorizeIcons : widgetMetadata.colorizeIcons
|
||||
property string valueTextColor: widgetData.textColor !== undefined ? widgetData.textColor : widgetMetadata.textColor
|
||||
|
||||
Component.onCompleted: {
|
||||
if (widgetData && widgetData.hideMode !== undefined) {
|
||||
valueHideMode = widgetData.hideMode;
|
||||
}
|
||||
}
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.hideMode = valueHideMode;
|
||||
settings.showIcon = valueShowIcon;
|
||||
settings.showText = valueShowText;
|
||||
settings.scrollingMode = valueScrollingMode;
|
||||
settings.maxWidth = parseInt(widthInput.text) || widgetMetadata.maxWidth;
|
||||
settings.useFixedWidth = valueUseFixedWidth;
|
||||
settings.colorizeIcons = valueColorizeIcons;
|
||||
settings.textColor = valueTextColor;
|
||||
settingsChanged(settings);
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.taskbar.hide-mode-label")
|
||||
description: I18n.tr("bar.active-window.hide-mode-description")
|
||||
model: [
|
||||
{
|
||||
"key": "visible",
|
||||
"name": I18n.tr("hide-modes.visible")
|
||||
},
|
||||
{
|
||||
"key": "hidden",
|
||||
"name": I18n.tr("hide-modes.hidden")
|
||||
},
|
||||
{
|
||||
"key": "transparent",
|
||||
"name": I18n.tr("hide-modes.transparent")
|
||||
}
|
||||
]
|
||||
currentKey: root.valueHideMode
|
||||
onSelected: key => {
|
||||
root.valueHideMode = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.hideMode
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
label: I18n.tr("common.select-color")
|
||||
currentKey: valueTextColor
|
||||
onSelected: key => {
|
||||
valueTextColor = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.textColor
|
||||
}
|
||||
|
||||
NToggle {
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.active-window.show-app-text-label")
|
||||
description: I18n.tr("bar.active-window.show-app-text-description")
|
||||
checked: root.valueShowText
|
||||
onToggled: checked => {
|
||||
root.valueShowText = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.showText
|
||||
}
|
||||
|
||||
NToggle {
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.active-window.show-app-icon-label")
|
||||
description: I18n.tr("bar.active-window.show-app-icon-description")
|
||||
checked: root.valueShowIcon
|
||||
onToggled: checked => {
|
||||
root.valueShowIcon = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.showIcon
|
||||
}
|
||||
|
||||
NToggle {
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.tray.colorize-icons-label")
|
||||
description: I18n.tr("bar.active-window.colorize-icons-description")
|
||||
checked: root.valueColorizeIcons
|
||||
onToggled: checked => {
|
||||
root.valueColorizeIcons = checked;
|
||||
saveSettings();
|
||||
}
|
||||
visible: root.valueShowIcon
|
||||
defaultValue: widgetMetadata.colorizeIcons
|
||||
}
|
||||
|
||||
NTextInput {
|
||||
id: widthInput
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.taskbar.max-width-label")
|
||||
description: I18n.tr("bar.media-mini.max-width-description")
|
||||
placeholderText: widgetMetadata.maxWidth
|
||||
text: valueMaxWidth
|
||||
onTextChanged: saveSettings()
|
||||
defaultValue: String(widgetMetadata.maxWidth)
|
||||
}
|
||||
|
||||
NToggle {
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.media-mini.use-fixed-width-label")
|
||||
description: I18n.tr("bar.media-mini.use-fixed-width-description")
|
||||
checked: valueUseFixedWidth
|
||||
onToggled: checked => {
|
||||
valueUseFixedWidth = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.useFixedWidth
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
label: I18n.tr("bar.media-mini.scrolling-mode-label")
|
||||
description: I18n.tr("bar.active-window.scrolling-mode-description")
|
||||
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
|
||||
defaultValue: widgetMetadata.scrollingMode
|
||||
onSelected: key => {
|
||||
valueScrollingMode = key;
|
||||
saveSettings();
|
||||
}
|
||||
minimumWidth: 200
|
||||
}
|
||||
}
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
spacing: Style.marginM
|
||||
|
||||
// Properties to receive data from parent
|
||||
property var screen: null
|
||||
property var widgetData: null
|
||||
property var widgetMetadata: null
|
||||
|
||||
signal settingsChanged(var settings)
|
||||
|
||||
// Local state
|
||||
property bool valueHideWhenIdle: widgetData.hideWhenIdle !== undefined ? widgetData.hideWhenIdle : widgetMetadata.hideWhenIdle
|
||||
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;
|
||||
settingsChanged(settings);
|
||||
}
|
||||
|
||||
NTextInput {
|
||||
id: widthInput
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("common.width")
|
||||
description: I18n.tr("bar.audio-visualizer.width-description")
|
||||
text: widgetData.width || widgetMetadata.width
|
||||
placeholderText: I18n.tr("placeholders.enter-width-pixels")
|
||||
onTextChanged: saveSettings()
|
||||
defaultValue: String(widgetMetadata.width)
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.audio-visualizer.color-name-label")
|
||||
description: I18n.tr("bar.audio-visualizer.color-name-description")
|
||||
currentKey: root.valueColorName
|
||||
onSelected: key => {
|
||||
root.valueColorName = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.colorName
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("bar.audio-visualizer.hide-when-idle-label")
|
||||
description: I18n.tr("bar.audio-visualizer.hide-when-idle-description")
|
||||
checked: valueHideWhenIdle
|
||||
onToggled: checked => {
|
||||
valueHideWhenIdle = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.hideWhenIdle
|
||||
}
|
||||
}
|
||||
+138
@@ -0,0 +1,138 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Services.Hardware
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
spacing: Style.marginM
|
||||
|
||||
// Properties to receive data from parent
|
||||
property var screen: null
|
||||
property var widgetData: null
|
||||
property var widgetMetadata: null
|
||||
|
||||
signal settingsChanged(var settings)
|
||||
|
||||
// Local state
|
||||
property string valueDisplayMode: widgetData.displayMode !== undefined ? widgetData.displayMode : widgetMetadata.displayMode
|
||||
property string valueDeviceNativePath: widgetData.deviceNativePath !== undefined ? widgetData.deviceNativePath : widgetMetadata.deviceNativePath
|
||||
property bool valueShowPowerProfiles: widgetData.showPowerProfiles !== undefined ? widgetData.showPowerProfiles : widgetMetadata.showPowerProfiles
|
||||
property bool valueShowNoctaliaPerformance: widgetData.showNoctaliaPerformance !== undefined ? widgetData.showNoctaliaPerformance : widgetMetadata.showNoctaliaPerformance
|
||||
property bool valueHideIfNotDetected: widgetData.hideIfNotDetected !== undefined ? widgetData.hideIfNotDetected : widgetMetadata.hideIfNotDetected
|
||||
property bool valueHideIfIdle: widgetData.hideIfIdle !== undefined ? widgetData.hideIfIdle : widgetMetadata.hideIfIdle
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
if (widgetData && widgetData.id) {
|
||||
settings.id = widgetData.id;
|
||||
}
|
||||
settings.displayMode = valueDisplayMode;
|
||||
settings.showPowerProfiles = valueShowPowerProfiles;
|
||||
settings.showNoctaliaPerformance = valueShowNoctaliaPerformance;
|
||||
settings.hideIfNotDetected = valueHideIfNotDetected;
|
||||
settings.hideIfIdle = valueHideIfIdle;
|
||||
settings.deviceNativePath = valueDeviceNativePath;
|
||||
settingsChanged(settings);
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
id: deviceComboBox
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.battery.device-label")
|
||||
description: I18n.tr("bar.battery.device-description")
|
||||
minimumWidth: 240
|
||||
model: BatteryService.deviceModel
|
||||
currentKey: root.valueDeviceNativePath
|
||||
onSelected: key => {
|
||||
root.valueDeviceNativePath = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.deviceNativePath
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("common.display-mode")
|
||||
description: I18n.tr("bar.battery.display-mode-description")
|
||||
minimumWidth: 240
|
||||
model: [
|
||||
{
|
||||
"key": "graphic",
|
||||
"name": I18n.tr("bar.battery.display-mode-graphic")
|
||||
},
|
||||
{
|
||||
"key": "graphic-clean",
|
||||
"name": I18n.tr("bar.battery.display-mode-graphic-clean")
|
||||
},
|
||||
{
|
||||
"key": "icon-hover",
|
||||
"name": I18n.tr("bar.battery.display-mode-icon-hover")
|
||||
},
|
||||
{
|
||||
"key": "icon-always",
|
||||
"name": I18n.tr("bar.battery.display-mode-icon-always")
|
||||
},
|
||||
{
|
||||
"key": "icon-only",
|
||||
"name": I18n.tr("bar.battery.display-mode-icon-only")
|
||||
}
|
||||
]
|
||||
currentKey: root.valueDisplayMode
|
||||
onSelected: key => {
|
||||
root.valueDisplayMode = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.displayMode
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("bar.battery.hide-if-not-detected-label")
|
||||
description: I18n.tr("bar.battery.hide-if-not-detected-description")
|
||||
checked: valueHideIfNotDetected
|
||||
onToggled: checked => {
|
||||
valueHideIfNotDetected = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.hideIfNotDetected
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("bar.battery.hide-if-idle-label")
|
||||
description: I18n.tr("bar.battery.hide-if-idle-description")
|
||||
checked: valueHideIfIdle
|
||||
onToggled: checked => {
|
||||
valueHideIfIdle = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.hideIfIdle
|
||||
}
|
||||
|
||||
NDivider {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("bar.battery.show-power-profile-label")
|
||||
description: I18n.tr("bar.battery.show-power-profile-description")
|
||||
checked: valueShowPowerProfiles
|
||||
onToggled: checked => {
|
||||
valueShowPowerProfiles = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.showPowerProfiles
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("bar.battery.show-noctalia-performance-label")
|
||||
description: I18n.tr("bar.battery.show-noctalia-performance-description")
|
||||
checked: valueShowNoctaliaPerformance
|
||||
onToggled: checked => {
|
||||
valueShowNoctaliaPerformance = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.showNoctaliaPerformance
|
||||
}
|
||||
}
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
spacing: Style.marginM
|
||||
|
||||
// Properties to receive data from parent
|
||||
property var screen: null
|
||||
property var widgetData: null
|
||||
property var widgetMetadata: null
|
||||
|
||||
signal settingsChanged(var settings)
|
||||
|
||||
// Local state
|
||||
property string valueDisplayMode: widgetData.displayMode !== undefined ? widgetData.displayMode : widgetMetadata.displayMode
|
||||
property string valueIconColor: widgetData.iconColor !== undefined ? widgetData.iconColor : widgetMetadata.iconColor
|
||||
property string valueTextColor: widgetData.textColor !== undefined ? widgetData.textColor : widgetMetadata.textColor
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.displayMode = valueDisplayMode;
|
||||
settings.iconColor = valueIconColor;
|
||||
settings.textColor = valueTextColor;
|
||||
settingsChanged(settings);
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
label: I18n.tr("common.display-mode")
|
||||
description: I18n.tr("bar.volume.display-mode-description")
|
||||
minimumWidth: 200
|
||||
model: [
|
||||
{
|
||||
"key": "onhover",
|
||||
"name": I18n.tr("display-modes.on-hover")
|
||||
},
|
||||
{
|
||||
"key": "alwaysShow",
|
||||
"name": I18n.tr("display-modes.always-show")
|
||||
},
|
||||
{
|
||||
"key": "alwaysHide",
|
||||
"name": I18n.tr("display-modes.always-hide")
|
||||
}
|
||||
]
|
||||
currentKey: root.valueDisplayMode
|
||||
onSelected: key => {
|
||||
root.valueDisplayMode = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.displayMode
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
label: I18n.tr("common.select-icon-color")
|
||||
currentKey: valueIconColor
|
||||
onSelected: key => {
|
||||
valueIconColor = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.iconColor
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
currentKey: valueTextColor
|
||||
onSelected: key => {
|
||||
valueTextColor = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.textColor
|
||||
}
|
||||
}
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import qs.Commons
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
spacing: Style.marginM
|
||||
|
||||
// Properties to receive data from parent
|
||||
property var screen: null
|
||||
property var widgetData: null
|
||||
property var widgetMetadata: null
|
||||
|
||||
signal settingsChanged(var settings)
|
||||
|
||||
// Local state
|
||||
property string valueDisplayMode: widgetData.displayMode !== undefined ? widgetData.displayMode : widgetMetadata.displayMode
|
||||
property string valueIconColor: widgetData.iconColor !== undefined ? widgetData.iconColor : widgetMetadata.iconColor
|
||||
property string valueTextColor: widgetData.textColor !== undefined ? widgetData.textColor : widgetMetadata.textColor
|
||||
property bool valueApplyToAllMonitors: widgetData.applyToAllMonitors !== undefined ? widgetData.applyToAllMonitors : widgetMetadata.applyToAllMonitors
|
||||
|
||||
readonly property bool hasMultipleMonitors: (Quickshell.screens || []).length > 1
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.displayMode = valueDisplayMode;
|
||||
settings.iconColor = valueIconColor;
|
||||
settings.textColor = valueTextColor;
|
||||
settings.applyToAllMonitors = valueApplyToAllMonitors;
|
||||
settingsChanged(settings);
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
label: I18n.tr("common.display-mode")
|
||||
description: I18n.tr("bar.volume.display-mode-description")
|
||||
minimumWidth: 200
|
||||
model: [
|
||||
{
|
||||
"key": "onhover",
|
||||
"name": I18n.tr("display-modes.on-hover")
|
||||
},
|
||||
{
|
||||
"key": "alwaysShow",
|
||||
"name": I18n.tr("display-modes.always-show")
|
||||
},
|
||||
{
|
||||
"key": "alwaysHide",
|
||||
"name": I18n.tr("display-modes.always-hide")
|
||||
}
|
||||
]
|
||||
currentKey: valueDisplayMode
|
||||
onSelected: key => {
|
||||
valueDisplayMode = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.displayMode
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
label: I18n.tr("common.select-icon-color")
|
||||
currentKey: valueIconColor
|
||||
onSelected: key => {
|
||||
valueIconColor = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.iconColor
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
currentKey: valueTextColor
|
||||
onSelected: key => {
|
||||
valueTextColor = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.textColor
|
||||
}
|
||||
|
||||
NToggle {
|
||||
visible: hasMultipleMonitors
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.brightness.apply-all-label")
|
||||
description: I18n.tr("bar.brightness.apply-all-description")
|
||||
checked: valueApplyToAllMonitors
|
||||
onToggled: checked => {
|
||||
valueApplyToAllMonitors = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.applyToAllMonitors
|
||||
}
|
||||
}
|
||||
+315
@@ -0,0 +1,315 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Services.System
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
spacing: Style.marginM
|
||||
width: 700
|
||||
|
||||
// Properties to receive data from parent
|
||||
property var screen: null
|
||||
property var widgetData: null
|
||||
property var widgetMetadata: null
|
||||
|
||||
signal settingsChanged(var settings)
|
||||
|
||||
// Local state
|
||||
property string valueClockColor: widgetData.clockColor !== undefined ? widgetData.clockColor : widgetMetadata.clockColor
|
||||
property bool valueUseCustomFont: widgetData.useCustomFont !== undefined ? widgetData.useCustomFont : widgetMetadata.useCustomFont
|
||||
property string valueCustomFont: widgetData.customFont !== undefined ? widgetData.customFont : widgetMetadata.customFont
|
||||
property string valueFormatHorizontal: widgetData.formatHorizontal !== undefined ? widgetData.formatHorizontal : widgetMetadata.formatHorizontal
|
||||
property string valueFormatVertical: widgetData.formatVertical !== undefined ? widgetData.formatVertical : widgetMetadata.formatVertical
|
||||
property string valueTooltipFormat: widgetData.tooltipFormat !== undefined ? widgetData.tooltipFormat : widgetMetadata.tooltipFormat
|
||||
|
||||
readonly property color textColor: Color.resolveColorKey(valueClockColor)
|
||||
|
||||
// Track the currently focused input field
|
||||
property var focusedInput: null
|
||||
property int focusedLineIndex: -1
|
||||
|
||||
readonly property var now: Time.now
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.clockColor = valueClockColor;
|
||||
settings.useCustomFont = valueUseCustomFont;
|
||||
settings.customFont = valueCustomFont;
|
||||
settings.formatHorizontal = valueFormatHorizontal.trim();
|
||||
settings.formatVertical = valueFormatVertical.trim();
|
||||
settings.tooltipFormat = valueTooltipFormat.trim();
|
||||
settingsChanged(settings);
|
||||
}
|
||||
|
||||
// Function to insert token at cursor position in the focused input
|
||||
function insertToken(token) {
|
||||
if (!focusedInput || !focusedInput.inputItem) {
|
||||
// If no input is focused, default to horiz
|
||||
if (inputHoriz.inputItem) {
|
||||
inputHoriz.inputItem.focus = true;
|
||||
focusedInput = inputHoriz;
|
||||
}
|
||||
}
|
||||
|
||||
if (focusedInput && focusedInput.inputItem) {
|
||||
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 + " ";
|
||||
|
||||
// Move cursor after the inserted token
|
||||
input.cursorPosition = cursorPos + token.length + 1;
|
||||
|
||||
// Ensure the input keeps focus
|
||||
input.focus = true;
|
||||
}
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
currentKey: valueClockColor
|
||||
onSelected: key => {
|
||||
valueClockColor = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.clockColor
|
||||
}
|
||||
|
||||
NToggle {
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.clock.use-custom-font-label")
|
||||
description: I18n.tr("bar.clock.use-custom-font-description")
|
||||
checked: valueUseCustomFont
|
||||
onToggled: checked => {
|
||||
valueUseCustomFont = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.useCustomFont
|
||||
}
|
||||
|
||||
NSearchableComboBox {
|
||||
Layout.fillWidth: true
|
||||
visible: valueUseCustomFont
|
||||
label: I18n.tr("bar.clock.custom-font-label")
|
||||
description: I18n.tr("bar.clock.custom-font-description")
|
||||
model: FontService.availableFonts
|
||||
currentKey: valueCustomFont
|
||||
placeholder: I18n.tr("bar.clock.custom-font-placeholder")
|
||||
searchPlaceholder: I18n.tr("bar.clock.custom-font-search-placeholder")
|
||||
popupHeight: 420
|
||||
minimumWidth: 300
|
||||
onSelected: function (key) {
|
||||
valueCustomFont = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: Settings.data.ui.fontDefault
|
||||
}
|
||||
|
||||
NDivider {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
NHeader {
|
||||
label: I18n.tr("bar.clock.clock-display-label")
|
||||
description: I18n.tr("bar.clock.clock-display-description")
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
id: main
|
||||
|
||||
spacing: Style.marginL
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
|
||||
|
||||
ColumnLayout {
|
||||
spacing: Style.marginM
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredWidth: 1 // Equal sizing hint
|
||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
|
||||
|
||||
NTextInput {
|
||||
id: inputHoriz
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.clock.horizontal-bar-label")
|
||||
description: I18n.tr("bar.clock.horizontal-bar-description")
|
||||
placeholderText: "HH:mm ddd, MMM dd"
|
||||
text: valueFormatHorizontal
|
||||
onTextChanged: {
|
||||
valueFormatHorizontal = text;
|
||||
saveSettings();
|
||||
}
|
||||
Component.onCompleted: {
|
||||
if (inputItem) {
|
||||
inputItem.onActiveFocusChanged.connect(function () {
|
||||
if (inputItem.activeFocus) {
|
||||
root.focusedInput = inputHoriz;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
defaultValue: widgetMetadata.formatHorizontal
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
|
||||
NTextInput {
|
||||
id: inputVert
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.clock.vertical-bar-label")
|
||||
description: I18n.tr("bar.clock.vertical-bar-description")
|
||||
// Tokens are Qt format tokens and must not be localized
|
||||
placeholderText: "HH mm dd MM"
|
||||
text: valueFormatVertical
|
||||
onTextChanged: {
|
||||
valueFormatVertical = text;
|
||||
saveSettings();
|
||||
}
|
||||
Component.onCompleted: {
|
||||
if (inputItem) {
|
||||
inputItem.onActiveFocusChanged.connect(function () {
|
||||
if (inputItem.activeFocus) {
|
||||
root.focusedInput = inputVert;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
defaultValue: widgetMetadata.formatVertical
|
||||
}
|
||||
|
||||
NTextInput {
|
||||
id: inputTooltip
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.clock.tooltip-format-label")
|
||||
description: I18n.tr("bar.clock.tooltip-format-description")
|
||||
placeholderText: "HH:mm, ddd MMM dd"
|
||||
text: valueTooltipFormat
|
||||
onTextChanged: {
|
||||
valueTooltipFormat = text;
|
||||
saveSettings();
|
||||
}
|
||||
Component.onCompleted: {
|
||||
if (inputItem) {
|
||||
inputItem.onActiveFocusChanged.connect(function () {
|
||||
if (inputItem.activeFocus) {
|
||||
root.focusedInput = inputTooltip;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
defaultValue: widgetMetadata.tooltipFormat
|
||||
}
|
||||
}
|
||||
|
||||
// --------------
|
||||
// Preview
|
||||
ColumnLayout {
|
||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
|
||||
Layout.fillWidth: false
|
||||
|
||||
NLabel {
|
||||
label: I18n.tr("bar.clock.preview")
|
||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
Layout.preferredWidth: 320
|
||||
Layout.preferredHeight: 160 // Fixed height instead of fillHeight
|
||||
|
||||
color: Color.mSurfaceVariant
|
||||
radius: Style.radiusM
|
||||
border.color: Color.mSecondary
|
||||
border.width: Style.borderS
|
||||
|
||||
Behavior on border.color {
|
||||
ColorAnimation {
|
||||
duration: Style.animationFast
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
spacing: Style.marginM
|
||||
anchors.centerIn: parent
|
||||
|
||||
ColumnLayout {
|
||||
spacing: -2
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
||||
// Horizontal
|
||||
Repeater {
|
||||
Layout.topMargin: Style.marginM
|
||||
model: I18n.locale.toString(now, valueFormatHorizontal.trim()).split("\\n")
|
||||
delegate: NText {
|
||||
visible: text !== ""
|
||||
text: modelData
|
||||
family: valueUseCustomFont && valueCustomFont ? valueCustomFont : Settings.data.ui.fontDefault
|
||||
pointSize: Style.fontSizeM
|
||||
font.weight: Style.fontWeightBold
|
||||
color: textColor
|
||||
wrapMode: Text.WordWrap
|
||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
||||
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: Style.animationFast
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NDivider {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
// Vertical
|
||||
ColumnLayout {
|
||||
spacing: -2
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
||||
Repeater {
|
||||
Layout.topMargin: Style.marginM
|
||||
model: I18n.locale.toString(now, valueFormatVertical.trim()).split(" ")
|
||||
delegate: NText {
|
||||
visible: text !== ""
|
||||
text: modelData
|
||||
family: valueUseCustomFont && valueCustomFont ? valueCustomFont : Settings.data.ui.fontDefault
|
||||
pointSize: Style.fontSizeM
|
||||
font.weight: Style.fontWeightBold
|
||||
color: textColor
|
||||
wrapMode: Text.WordWrap
|
||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
||||
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: Style.animationFast
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NDivider {
|
||||
Layout.topMargin: Style.marginM
|
||||
Layout.bottomMargin: Style.marginM
|
||||
}
|
||||
|
||||
NDateTimeTokens {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 300
|
||||
|
||||
// Connect to token clicked signal if NDateTimeTokens provides it
|
||||
onTokenClicked: token => root.insertToken(token)
|
||||
}
|
||||
}
|
||||
+134
@@ -0,0 +1,134 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import qs.Commons
|
||||
import qs.Services.UI
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
spacing: Style.marginM
|
||||
|
||||
// Properties to receive data from parent
|
||||
property var screen: null
|
||||
property var widgetData: null
|
||||
property var widgetMetadata: null
|
||||
|
||||
signal settingsChanged(var settings)
|
||||
|
||||
// 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 : widgetMetadata.customIconPath
|
||||
property bool valueEnableColorization: widgetData.enableColorization !== undefined ? widgetData.enableColorization : widgetMetadata.enableColorization
|
||||
property string valueColorizeSystemIcon: widgetData.colorizeSystemIcon !== undefined ? widgetData.colorizeSystemIcon : widgetMetadata.colorizeSystemIcon
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.icon = valueIcon;
|
||||
settings.useDistroLogo = valueUseDistroLogo;
|
||||
settings.customIconPath = valueCustomIconPath;
|
||||
settings.enableColorization = valueEnableColorization;
|
||||
settings.colorizeSystemIcon = valueColorizeSystemIcon;
|
||||
settingsChanged(settings);
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("bar.control-center.use-distro-logo-label")
|
||||
description: I18n.tr("bar.control-center.use-distro-logo-description")
|
||||
checked: valueUseDistroLogo
|
||||
onToggled: checked => {
|
||||
valueUseDistroLogo = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.useDistroLogo
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("bar.custom-button.enable-colorization-label")
|
||||
description: I18n.tr("bar.control-center.enable-colorization-description")
|
||||
checked: valueEnableColorization
|
||||
onToggled: checked => {
|
||||
valueEnableColorization = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.enableColorization
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
visible: valueEnableColorization
|
||||
label: I18n.tr("common.select-icon-color")
|
||||
description: I18n.tr("bar.control-center.color-selection-description")
|
||||
currentKey: valueColorizeSystemIcon
|
||||
onSelected: function (key) {
|
||||
valueColorizeSystemIcon = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.colorizeSystemIcon
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
spacing: Style.marginM
|
||||
|
||||
NLabel {
|
||||
label: I18n.tr("common.icon")
|
||||
description: I18n.tr("bar.control-center.icon-description")
|
||||
}
|
||||
|
||||
NImageRounded {
|
||||
Layout.preferredWidth: Style.fontSizeXL * 2
|
||||
Layout.preferredHeight: Style.fontSizeXL * 2
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
radius: Math.min(Style.radiusL, Layout.preferredWidth / 2)
|
||||
imagePath: valueCustomIconPath
|
||||
visible: valueCustomIconPath !== "" && !valueUseDistroLogo
|
||||
}
|
||||
|
||||
NIcon {
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
icon: valueIcon
|
||||
pointSize: Style.fontSizeXXL * 1.5
|
||||
visible: valueIcon !== "" && valueCustomIconPath === "" && !valueUseDistroLogo
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
spacing: Style.marginM
|
||||
NButton {
|
||||
enabled: !valueUseDistroLogo
|
||||
text: I18n.tr("bar.control-center.browse-library")
|
||||
onClicked: iconPicker.open()
|
||||
}
|
||||
|
||||
NButton {
|
||||
enabled: !valueUseDistroLogo
|
||||
text: I18n.tr("bar.control-center.browse-file")
|
||||
onClicked: imagePicker.openFilePicker()
|
||||
}
|
||||
}
|
||||
|
||||
NIconPicker {
|
||||
id: iconPicker
|
||||
initialIcon: valueIcon
|
||||
onIconSelected: iconName => {
|
||||
valueIcon = iconName;
|
||||
valueCustomIconPath = "";
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
|
||||
NFilePicker {
|
||||
id: imagePicker
|
||||
title: I18n.tr("bar.control-center.select-custom-icon")
|
||||
selectionMode: "files"
|
||||
nameFilters: ImageCacheService.basicImageFilters.concat(["*.svg"])
|
||||
initialPath: Quickshell.env("HOME")
|
||||
onAccepted: paths => {
|
||||
if (paths.length > 0) {
|
||||
valueCustomIconPath = paths[0]; // Use first selected file
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+512
@@ -0,0 +1,512 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
import qs.Commons
|
||||
import qs.Services.UI
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
spacing: Style.marginM
|
||||
|
||||
// Properties to receive data from parent
|
||||
property var screen: null
|
||||
property var widgetData: null
|
||||
property var widgetMetadata: null
|
||||
|
||||
signal settingsChanged(var settings)
|
||||
|
||||
property string valueIcon: widgetData.icon !== undefined ? widgetData.icon : widgetMetadata.icon
|
||||
property bool valueTextStream: widgetData.textStream !== undefined ? widgetData.textStream : widgetMetadata.textStream
|
||||
property bool valueParseJson: widgetData.parseJson !== undefined ? widgetData.parseJson : widgetMetadata.parseJson
|
||||
property int valueMaxTextLengthHorizontal: widgetData?.maxTextLength?.horizontal ?? widgetMetadata?.maxTextLength?.horizontal
|
||||
property int valueMaxTextLengthVertical: widgetData?.maxTextLength?.vertical ?? widgetMetadata?.maxTextLength?.vertical
|
||||
property string valueHideMode: (widgetData.hideMode !== undefined) ? widgetData.hideMode : widgetMetadata.hideMode
|
||||
property bool valueShowIcon: (widgetData.showIcon !== undefined) ? widgetData.showIcon : widgetMetadata.showIcon
|
||||
property bool valueShowExecTooltip: widgetData.showExecTooltip !== undefined ? widgetData.showExecTooltip : widgetMetadata.showExecTooltip
|
||||
property bool valueShowTextTooltip: widgetData.showTextTooltip !== undefined ? widgetData.showTextTooltip : widgetMetadata.showTextTooltip
|
||||
property bool valueEnableColorization: widgetData.enableColorization !== undefined ? widgetData.enableColorization : widgetMetadata.enableColorization
|
||||
property string valueColorizeSystemIcon: widgetData.colorizeSystemIcon !== undefined ? widgetData.colorizeSystemIcon : widgetMetadata.colorizeSystemIcon
|
||||
property string valueIpcIdentifier: widgetData.ipcIdentifier !== undefined ? widgetData.ipcIdentifier : widgetMetadata.ipcIdentifier
|
||||
property string valueGeneralTooltipText: widgetData.generalTooltipText !== undefined ? widgetData.generalTooltipText : widgetMetadata.generalTooltipText
|
||||
|
||||
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.wheelMode = separateWheelToggle.internalChecked ? "separate" : "unified";
|
||||
settings.wheelExec = wheelExecInput.text;
|
||||
settings.wheelUpExec = wheelUpExecInput.text;
|
||||
settings.wheelDownExec = wheelDownExecInput.text;
|
||||
settings.wheelUpdateText = wheelUpdateText.checked;
|
||||
settings.wheelUpUpdateText = wheelUpUpdateText.checked;
|
||||
settings.wheelDownUpdateText = wheelDownUpdateText.checked;
|
||||
settings.textCommand = textCommandInput.text;
|
||||
settings.textCollapse = textCollapseInput.text;
|
||||
settings.textStream = valueTextStream;
|
||||
settings.parseJson = valueParseJson;
|
||||
settings.showIcon = valueShowIcon;
|
||||
settings.showExecTooltip = valueShowExecTooltip;
|
||||
settings.showTextTooltip = valueShowTextTooltip;
|
||||
settings.hideMode = valueHideMode;
|
||||
settings.maxTextLength = {
|
||||
"horizontal": valueMaxTextLengthHorizontal,
|
||||
"vertical": valueMaxTextLengthVertical
|
||||
};
|
||||
settings.textIntervalMs = parseInt(textIntervalInput.text || textIntervalInput.placeholderText, 10);
|
||||
settings.enableColorization = valueEnableColorization;
|
||||
settings.colorizeSystemIcon = valueColorizeSystemIcon;
|
||||
settings.ipcIdentifier = valueIpcIdentifier;
|
||||
settings.generalTooltipText = valueGeneralTooltipText;
|
||||
settingsChanged(settings);
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
spacing: Style.marginM
|
||||
|
||||
NLabel {
|
||||
label: I18n.tr("common.icon")
|
||||
description: I18n.tr("bar.custom-button.icon-description")
|
||||
}
|
||||
|
||||
NIcon {
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
icon: valueIcon
|
||||
pointSize: Style.fontSizeXL
|
||||
visible: valueIcon !== ""
|
||||
}
|
||||
|
||||
NButton {
|
||||
text: I18n.tr("common.browse")
|
||||
onClicked: iconPicker.open()
|
||||
}
|
||||
}
|
||||
|
||||
NIconPicker {
|
||||
id: iconPicker
|
||||
initialIcon: valueIcon
|
||||
onIconSelected: function (iconName) {
|
||||
valueIcon = iconName;
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
|
||||
NToggle {
|
||||
id: showIconToggle
|
||||
label: I18n.tr("bar.custom-button.show-icon-label")
|
||||
description: I18n.tr("bar.custom-button.show-icon-description")
|
||||
checked: valueShowIcon
|
||||
onToggled: checked => {
|
||||
valueShowIcon = checked;
|
||||
saveSettings();
|
||||
}
|
||||
visible: textCommandInput.text !== ""
|
||||
defaultValue: widgetMetadata.showIcon
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("bar.custom-button.enable-colorization-label")
|
||||
description: I18n.tr("bar.custom-button.enable-colorization-description")
|
||||
checked: valueEnableColorization
|
||||
onToggled: checked => {
|
||||
valueEnableColorization = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.enableColorization
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
visible: valueEnableColorization
|
||||
label: I18n.tr("common.select-icon-color")
|
||||
description: I18n.tr("bar.custom-button.color-selection-description")
|
||||
currentKey: valueColorizeSystemIcon
|
||||
onSelected: key => {
|
||||
valueColorizeSystemIcon = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.colorizeSystemIcon
|
||||
}
|
||||
|
||||
NTextInput {
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.custom-button.general-tooltip-text-label")
|
||||
description: I18n.tr("bar.custom-button.general-tooltip-text-description")
|
||||
placeholderText: I18n.tr("placeholders.enter-tooltip")
|
||||
text: valueGeneralTooltipText
|
||||
onTextChanged: {
|
||||
valueGeneralTooltipText = text;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.generalTooltipText
|
||||
}
|
||||
|
||||
NToggle {
|
||||
id: showExecTooltipToggle
|
||||
label: I18n.tr("bar.custom-button.show-exec-tooltip-label")
|
||||
description: I18n.tr("bar.custom-button.show-exec-tooltip-description")
|
||||
checked: valueShowExecTooltip
|
||||
onToggled: checked => {
|
||||
valueShowExecTooltip = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.showExecTooltip
|
||||
}
|
||||
|
||||
NToggle {
|
||||
id: showTextTooltipToggle
|
||||
label: I18n.tr("bar.custom-button.show-text-tooltip-label")
|
||||
description: I18n.tr("bar.custom-button.show-text-tooltip-description")
|
||||
checked: valueShowTextTooltip
|
||||
onToggled: checked => {
|
||||
valueShowTextTooltip = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.showTextTooltip
|
||||
}
|
||||
|
||||
NTextInput {
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.custom-button.ipc-identifier-label")
|
||||
description: I18n.tr("bar.custom-button.ipc-identifier-description")
|
||||
placeholderText: I18n.tr("placeholders.enter-ipc-identifier")
|
||||
text: valueIpcIdentifier
|
||||
onTextChanged: {
|
||||
valueIpcIdentifier = text;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.ipcIdentifier
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
spacing: Style.marginM
|
||||
|
||||
NTextInput {
|
||||
id: leftClickExecInput
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.custom-button.left-click-label")
|
||||
description: I18n.tr("bar.custom-button.left-click-description")
|
||||
placeholderText: I18n.tr("placeholders.enter-command")
|
||||
text: widgetData?.leftClickExec || widgetMetadata.leftClickExec
|
||||
onTextChanged: saveSettings()
|
||||
defaultValue: widgetMetadata.leftClickExec
|
||||
}
|
||||
|
||||
NToggle {
|
||||
id: leftClickUpdateText
|
||||
enabled: !valueTextStream
|
||||
Layout.alignment: Qt.AlignRight | Qt.AlignBottom
|
||||
Layout.bottomMargin: Style.marginS
|
||||
onEntered: TooltipService.show(leftClickUpdateText, I18n.tr("bar.custom-button.left-click-update-text"))
|
||||
onExited: TooltipService.hide()
|
||||
checked: widgetData?.leftClickUpdateText ?? widgetMetadata.leftClickUpdateText
|
||||
onToggled: isChecked => {
|
||||
checked = isChecked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.leftClickUpdateText
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
spacing: Style.marginM
|
||||
|
||||
NTextInput {
|
||||
id: rightClickExecInput
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.custom-button.right-click-label")
|
||||
description: I18n.tr("bar.custom-button.right-click-description")
|
||||
placeholderText: I18n.tr("placeholders.enter-command")
|
||||
text: widgetData?.rightClickExec || widgetMetadata.rightClickExec
|
||||
onTextChanged: saveSettings()
|
||||
defaultValue: widgetMetadata.rightClickExec
|
||||
}
|
||||
|
||||
NToggle {
|
||||
id: rightClickUpdateText
|
||||
enabled: !valueTextStream
|
||||
Layout.alignment: Qt.AlignRight | Qt.AlignBottom
|
||||
Layout.bottomMargin: Style.marginS
|
||||
onEntered: TooltipService.show(rightClickUpdateText, I18n.tr("bar.custom-button.right-click-update-text"))
|
||||
onExited: TooltipService.hide()
|
||||
checked: widgetData?.rightClickUpdateText ?? widgetMetadata.rightClickUpdateText
|
||||
onToggled: isChecked => {
|
||||
checked = isChecked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.rightClickUpdateText
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
spacing: Style.marginM
|
||||
|
||||
NTextInput {
|
||||
id: middleClickExecInput
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.custom-button.middle-click-label")
|
||||
description: I18n.tr("bar.custom-button.middle-click-description")
|
||||
placeholderText: I18n.tr("placeholders.enter-command")
|
||||
text: widgetData.middleClickExec || widgetMetadata.middleClickExec
|
||||
onTextChanged: saveSettings()
|
||||
defaultValue: widgetMetadata.middleClickExec
|
||||
}
|
||||
|
||||
NToggle {
|
||||
id: middleClickUpdateText
|
||||
enabled: !valueTextStream
|
||||
Layout.alignment: Qt.AlignRight | Qt.AlignBottom
|
||||
Layout.bottomMargin: Style.marginS
|
||||
onEntered: TooltipService.show(middleClickUpdateText, I18n.tr("bar.custom-button.middle-click-update-text"))
|
||||
onExited: TooltipService.hide()
|
||||
checked: widgetData?.middleClickUpdateText ?? widgetMetadata.middleClickUpdateText
|
||||
onToggled: isChecked => {
|
||||
checked = isChecked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.middleClickUpdateText
|
||||
}
|
||||
}
|
||||
|
||||
// Wheel command settings
|
||||
NToggle {
|
||||
id: separateWheelToggle
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.custom-button.wheel-mode-separate-label")
|
||||
description: I18n.tr("bar.custom-button.wheel-mode-separate-description")
|
||||
property bool internalChecked: (widgetData?.wheelMode || widgetMetadata?.wheelMode) === "separate"
|
||||
checked: internalChecked
|
||||
onToggled: checked => {
|
||||
internalChecked = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.wheelMode === "separate"
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
|
||||
RowLayout {
|
||||
id: unifiedWheelLayout
|
||||
visible: !separateWheelToggle.checked
|
||||
spacing: Style.marginM
|
||||
|
||||
NTextInput {
|
||||
id: wheelExecInput
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.custom-button.wheel-label")
|
||||
description: I18n.tr("bar.custom-button.wheel-description")
|
||||
placeholderText: I18n.tr("placeholders.enter-command")
|
||||
text: widgetData?.wheelExec || widgetMetadata?.wheelExec
|
||||
onTextChanged: saveSettings()
|
||||
defaultValue: widgetMetadata.wheelExec
|
||||
}
|
||||
|
||||
NToggle {
|
||||
id: wheelUpdateText
|
||||
enabled: !valueTextStream
|
||||
Layout.alignment: Qt.AlignRight | Qt.AlignBottom
|
||||
Layout.bottomMargin: Style.marginS
|
||||
onEntered: TooltipService.show(wheelUpdateText, I18n.tr("bar.custom-button.wheel-update-text"))
|
||||
onExited: TooltipService.hide()
|
||||
checked: widgetData?.wheelUpdateText ?? widgetMetadata?.wheelUpdateText
|
||||
onToggled: isChecked => {
|
||||
checked = isChecked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.wheelUpdateText
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
id: separatedWheelLayout
|
||||
Layout.fillWidth: true
|
||||
visible: separateWheelToggle.checked
|
||||
|
||||
RowLayout {
|
||||
spacing: Style.marginM
|
||||
|
||||
NTextInput {
|
||||
id: wheelUpExecInput
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.custom-button.wheel-up-label")
|
||||
description: I18n.tr("bar.custom-button.wheel-up-description")
|
||||
placeholderText: I18n.tr("placeholders.enter-command")
|
||||
text: widgetData?.wheelUpExec || widgetMetadata?.wheelUpExec
|
||||
onTextChanged: saveSettings()
|
||||
defaultValue: widgetMetadata.wheelUpExec
|
||||
}
|
||||
|
||||
NToggle {
|
||||
id: wheelUpUpdateText
|
||||
enabled: !valueTextStream
|
||||
Layout.alignment: Qt.AlignRight | Qt.AlignBottom
|
||||
Layout.bottomMargin: Style.marginS
|
||||
onEntered: TooltipService.show(wheelUpUpdateText, I18n.tr("bar.custom-button.wheel-update-text"))
|
||||
onExited: TooltipService.hide()
|
||||
checked: (widgetData?.wheelUpUpdateText !== undefined) ? widgetData.wheelUpUpdateText : widgetMetadata?.wheelUpUpdateText
|
||||
onToggled: isChecked => {
|
||||
checked = isChecked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.wheelUpUpdateText
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
spacing: Style.marginM
|
||||
|
||||
NTextInput {
|
||||
id: wheelDownExecInput
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.custom-button.wheel-down-label")
|
||||
description: I18n.tr("bar.custom-button.wheel-down-description")
|
||||
placeholderText: I18n.tr("placeholders.enter-command")
|
||||
text: widgetData?.wheelDownExec || widgetMetadata?.wheelDownExec
|
||||
onTextChanged: saveSettings()
|
||||
defaultValue: widgetMetadata.wheelDownExec
|
||||
}
|
||||
|
||||
NToggle {
|
||||
id: wheelDownUpdateText
|
||||
enabled: !valueTextStream
|
||||
Layout.alignment: Qt.AlignRight | Qt.AlignBottom
|
||||
Layout.bottomMargin: Style.marginS
|
||||
onEntered: TooltipService.show(wheelDownUpdateText, I18n.tr("bar.custom-button.wheel-update-text"))
|
||||
onExited: TooltipService.hide()
|
||||
checked: (widgetData?.wheelDownUpdateText !== undefined) ? widgetData.wheelDownUpdateText : widgetMetadata?.wheelDownUpdateText
|
||||
onToggled: isChecked => {
|
||||
checked = isChecked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.wheelDownUpdateText
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NDivider {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
NHeader {
|
||||
label: I18n.tr("bar.custom-button.dynamic-text")
|
||||
}
|
||||
|
||||
NSpinBox {
|
||||
label: I18n.tr("bar.custom-button.max-text-length-horizontal-label")
|
||||
description: I18n.tr("bar.custom-button.max-text-length-horizontal-description")
|
||||
from: 0
|
||||
to: 100
|
||||
value: valueMaxTextLengthHorizontal
|
||||
onValueChanged: {
|
||||
valueMaxTextLengthHorizontal = value;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.maxTextLength.horizontal
|
||||
}
|
||||
|
||||
NSpinBox {
|
||||
label: I18n.tr("bar.custom-button.max-text-length-vertical-label")
|
||||
description: I18n.tr("bar.custom-button.max-text-length-vertical-description")
|
||||
from: 0
|
||||
to: 100
|
||||
value: valueMaxTextLengthVertical
|
||||
onValueChanged: {
|
||||
valueMaxTextLengthVertical = value;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.maxTextLength.vertical
|
||||
}
|
||||
|
||||
NToggle {
|
||||
id: textStreamInput
|
||||
label: I18n.tr("bar.custom-button.text-stream-label")
|
||||
description: I18n.tr("bar.custom-button.text-stream-description")
|
||||
checked: valueTextStream
|
||||
onToggled: checked => {
|
||||
valueTextStream = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.textStream
|
||||
}
|
||||
|
||||
NToggle {
|
||||
id: parseJsonInput
|
||||
label: I18n.tr("bar.custom-button.parse-json-label")
|
||||
description: I18n.tr("bar.custom-button.parse-json-description")
|
||||
checked: valueParseJson
|
||||
onToggled: checked => {
|
||||
valueParseJson = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.parseJson
|
||||
}
|
||||
|
||||
NTextInput {
|
||||
id: textCommandInput
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.custom-button.display-command-output-label")
|
||||
description: valueTextStream ? I18n.tr("bar.custom-button.display-command-output-stream-description") : I18n.tr("bar.custom-button.display-command-output-description")
|
||||
placeholderText: I18n.tr("placeholders.command-example")
|
||||
text: widgetData?.textCommand || widgetMetadata.textCommand
|
||||
onTextChanged: saveSettings()
|
||||
defaultValue: widgetMetadata.textCommand
|
||||
}
|
||||
|
||||
NTextInput {
|
||||
id: textCollapseInput
|
||||
Layout.fillWidth: true
|
||||
visible: valueTextStream
|
||||
label: I18n.tr("bar.custom-button.collapse-condition-label")
|
||||
description: I18n.tr("bar.custom-button.collapse-condition-description")
|
||||
placeholderText: I18n.tr("placeholders.enter-text-to-collapse")
|
||||
text: widgetData?.textCollapse || widgetMetadata.textCollapse
|
||||
onTextChanged: saveSettings()
|
||||
defaultValue: widgetMetadata.textCollapse
|
||||
}
|
||||
|
||||
NTextInput {
|
||||
id: textIntervalInput
|
||||
Layout.fillWidth: true
|
||||
visible: !valueTextStream
|
||||
label: I18n.tr("bar.custom-button.refresh-interval-label")
|
||||
description: I18n.tr("bar.custom-button.refresh-interval-description")
|
||||
placeholderText: String(widgetMetadata.textIntervalMs)
|
||||
text: widgetData && widgetData.textIntervalMs !== undefined ? String(widgetData.textIntervalMs) : ""
|
||||
onTextChanged: saveSettings()
|
||||
defaultValue: String(widgetMetadata.textIntervalMs)
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
id: hideModeComboBox
|
||||
label: I18n.tr("bar.custom-button.hide-mode-label")
|
||||
description: I18n.tr("bar.custom-button.hide-mode-description")
|
||||
model: [
|
||||
{
|
||||
name: I18n.tr("bar.custom-button.hide-mode-always-expanded"),
|
||||
key: "alwaysExpanded"
|
||||
},
|
||||
{
|
||||
name: I18n.tr("bar.custom-button.hide-mode-expand-with-output"),
|
||||
key: "expandWithOutput"
|
||||
},
|
||||
{
|
||||
name: I18n.tr("bar.custom-button.hide-mode-max-transparent"),
|
||||
key: "maxTransparent"
|
||||
}
|
||||
]
|
||||
currentKey: valueHideMode
|
||||
onSelected: key => {
|
||||
valueHideMode = key;
|
||||
saveSettings();
|
||||
}
|
||||
visible: textCommandInput.text !== "" && valueTextStream == true
|
||||
defaultValue: widgetMetadata.hideMode
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
spacing: Style.marginM
|
||||
|
||||
// Properties to receive data from parent
|
||||
property var screen: null
|
||||
property var widgetData: null
|
||||
property var widgetMetadata: null
|
||||
|
||||
signal settingsChanged(var settings)
|
||||
|
||||
property string valueIconColor: widgetData.iconColor !== undefined ? widgetData.iconColor : widgetMetadata.iconColor
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.iconColor = valueIconColor;
|
||||
settingsChanged(settings);
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
label: I18n.tr("common.select-icon-color")
|
||||
currentKey: valueIconColor
|
||||
onSelected: key => {
|
||||
valueIconColor = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.iconColor
|
||||
}
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
spacing: Style.marginM
|
||||
|
||||
// Properties to receive data from parent
|
||||
property var screen: null
|
||||
property var widgetData: null
|
||||
property var widgetMetadata: null
|
||||
|
||||
signal settingsChanged(var settings)
|
||||
|
||||
property string valueIconColor: widgetData.iconColor !== undefined ? widgetData.iconColor : widgetMetadata.iconColor
|
||||
property string valueTextColor: widgetData.textColor !== undefined ? widgetData.textColor : widgetMetadata.textColor
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.iconColor = valueIconColor;
|
||||
settings.textColor = valueTextColor;
|
||||
settingsChanged(settings);
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
label: I18n.tr("common.select-icon-color")
|
||||
currentKey: valueIconColor
|
||||
onSelected: key => {
|
||||
valueIconColor = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.iconColor
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
currentKey: valueTextColor
|
||||
onSelected: key => {
|
||||
valueTextColor = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.textColor
|
||||
}
|
||||
}
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
spacing: Style.marginM
|
||||
|
||||
// Properties to receive data from parent
|
||||
property var screen: null
|
||||
property var widgetData: null
|
||||
property var widgetMetadata: null
|
||||
|
||||
signal settingsChanged(var settings)
|
||||
|
||||
// Local state
|
||||
property string valueDisplayMode: widgetData.displayMode !== undefined ? widgetData.displayMode : widgetMetadata.displayMode
|
||||
property bool valueShowIcon: widgetData.showIcon !== undefined ? widgetData.showIcon : widgetMetadata.showIcon
|
||||
property string valueIconColor: widgetData.iconColor !== undefined ? widgetData.iconColor : widgetMetadata.iconColor
|
||||
property string valueTextColor: widgetData.textColor !== undefined ? widgetData.textColor : widgetMetadata.textColor
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.displayMode = valueDisplayMode;
|
||||
settings.showIcon = valueShowIcon;
|
||||
settings.iconColor = valueIconColor;
|
||||
settings.textColor = valueTextColor;
|
||||
settingsChanged(settings);
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
visible: valueShowIcon // Hide display mode setting when icon is disabled
|
||||
label: I18n.tr("common.display-mode")
|
||||
description: I18n.tr("bar.volume.display-mode-description")
|
||||
minimumWidth: 200
|
||||
model: [
|
||||
{
|
||||
"key": "onhover",
|
||||
"name": I18n.tr("display-modes.on-hover")
|
||||
},
|
||||
{
|
||||
"key": "forceOpen",
|
||||
"name": I18n.tr("display-modes.force-open")
|
||||
},
|
||||
{
|
||||
"key": "alwaysHide",
|
||||
"name": I18n.tr("display-modes.always-hide")
|
||||
}
|
||||
]
|
||||
currentKey: valueDisplayMode
|
||||
onSelected: key => {
|
||||
valueDisplayMode = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.displayMode
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("bar.custom-button.show-icon-label")
|
||||
description: I18n.tr("bar.keyboard-layout.show-icon-description")
|
||||
checked: valueShowIcon
|
||||
onToggled: checked => {
|
||||
valueShowIcon = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.showIcon
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
label: I18n.tr("common.select-icon-color")
|
||||
currentKey: valueIconColor
|
||||
onSelected: key => {
|
||||
valueIconColor = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.iconColor
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
currentKey: valueTextColor
|
||||
onSelected: key => {
|
||||
valueTextColor = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.textColor
|
||||
}
|
||||
}
|
||||
+134
@@ -0,0 +1,134 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import qs.Commons
|
||||
import qs.Services.UI
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
spacing: Style.marginM
|
||||
|
||||
// Properties to receive data from parent
|
||||
property var screen: null
|
||||
property var widgetData: null
|
||||
property var widgetMetadata: null
|
||||
|
||||
signal settingsChanged(var settings)
|
||||
|
||||
// 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 : widgetMetadata.customIconPath
|
||||
property bool valueEnableColorization: widgetData.enableColorization !== undefined ? widgetData.enableColorization : widgetMetadata.enableColorization
|
||||
property string valueColorizeSystemIcon: widgetData.colorizeSystemIcon !== undefined ? widgetData.colorizeSystemIcon : widgetMetadata.colorizeSystemIcon
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.icon = valueIcon;
|
||||
settings.useDistroLogo = valueUseDistroLogo;
|
||||
settings.customIconPath = valueCustomIconPath;
|
||||
settings.enableColorization = valueEnableColorization;
|
||||
settings.colorizeSystemIcon = valueColorizeSystemIcon;
|
||||
settingsChanged(settings);
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("bar.control-center.use-distro-logo-label")
|
||||
description: I18n.tr("bar.control-center.use-distro-logo-description")
|
||||
checked: valueUseDistroLogo
|
||||
onToggled: checked => {
|
||||
valueUseDistroLogo = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.useDistroLogo
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("bar.custom-button.enable-colorization-label")
|
||||
description: I18n.tr("bar.control-center.enable-colorization-description")
|
||||
checked: valueEnableColorization
|
||||
onToggled: checked => {
|
||||
valueEnableColorization = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.enableColorization
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
visible: valueEnableColorization
|
||||
label: I18n.tr("common.select-icon-color")
|
||||
description: I18n.tr("bar.control-center.color-selection-description")
|
||||
currentKey: valueColorizeSystemIcon
|
||||
onSelected: function (key) {
|
||||
valueColorizeSystemIcon = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.colorizeSystemIcon
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
spacing: Style.marginM
|
||||
|
||||
NLabel {
|
||||
label: I18n.tr("common.icon")
|
||||
description: I18n.tr("bar.control-center.icon-description")
|
||||
}
|
||||
|
||||
NImageRounded {
|
||||
Layout.preferredWidth: Style.fontSizeXL * 2
|
||||
Layout.preferredHeight: Style.fontSizeXL * 2
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
radius: Math.min(Style.radiusL, Layout.preferredWidth / 2)
|
||||
imagePath: valueCustomIconPath
|
||||
visible: valueCustomIconPath !== "" && !valueUseDistroLogo
|
||||
}
|
||||
|
||||
NIcon {
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
icon: valueIcon
|
||||
pointSize: Style.fontSizeXXL * 1.5
|
||||
visible: valueIcon !== "" && valueCustomIconPath === "" && !valueUseDistroLogo
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
spacing: Style.marginM
|
||||
NButton {
|
||||
enabled: !valueUseDistroLogo
|
||||
text: I18n.tr("bar.control-center.browse-library")
|
||||
onClicked: iconPicker.open()
|
||||
}
|
||||
|
||||
NButton {
|
||||
enabled: !valueUseDistroLogo
|
||||
text: I18n.tr("bar.control-center.browse-file")
|
||||
onClicked: imagePicker.openFilePicker()
|
||||
}
|
||||
}
|
||||
|
||||
NIconPicker {
|
||||
id: iconPicker
|
||||
initialIcon: valueIcon
|
||||
onIconSelected: iconName => {
|
||||
valueIcon = iconName;
|
||||
valueCustomIconPath = "";
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
|
||||
NFilePicker {
|
||||
id: imagePicker
|
||||
title: I18n.tr("bar.control-center.select-custom-icon")
|
||||
selectionMode: "files"
|
||||
nameFilters: ImageCacheService.basicImageFilters.concat(["*.svg"])
|
||||
initialPath: Quickshell.env("HOME")
|
||||
onAccepted: paths => {
|
||||
if (paths.length > 0) {
|
||||
valueCustomIconPath = paths[0];
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+170
@@ -0,0 +1,170 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
spacing: Style.marginM
|
||||
|
||||
// Properties to receive data from parent
|
||||
property var screen: null
|
||||
property var widgetData: null
|
||||
property var widgetMetadata: null
|
||||
|
||||
signal settingsChanged(var settings)
|
||||
|
||||
// Local state
|
||||
property bool valueShowCapsLock: widgetData.showCapsLock !== undefined ? widgetData.showCapsLock : widgetMetadata.showCapsLock
|
||||
property bool valueShowNumLock: widgetData.showNumLock !== undefined ? widgetData.showNumLock : widgetMetadata.showNumLock
|
||||
property bool valueShowScrollLock: widgetData.showScrollLock !== undefined ? widgetData.showScrollLock : widgetMetadata.showScrollLock
|
||||
|
||||
property string capsIcon: widgetData.capsLockIcon !== undefined ? widgetData.capsLockIcon : widgetMetadata.capsLockIcon
|
||||
property string numIcon: widgetData.numLockIcon !== undefined ? widgetData.numLockIcon : widgetMetadata.numLockIcon
|
||||
property string scrollIcon: widgetData.scrollLockIcon !== undefined ? widgetData.scrollLockIcon : widgetMetadata.scrollLockIcon
|
||||
|
||||
property bool valueHideWhenOff: widgetData.hideWhenOff !== undefined ? widgetData.hideWhenOff : (widgetMetadata.hideWhenOff !== undefined ? widgetMetadata.hideWhenOff : false)
|
||||
|
||||
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;
|
||||
settings.hideWhenOff = valueHideWhenOff;
|
||||
settingsChanged(settings);
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
spacing: Style.marginM
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("bar.lock-keys.show-caps-lock-label")
|
||||
description: I18n.tr("bar.lock-keys.show-caps-lock-description")
|
||||
checked: valueShowCapsLock
|
||||
onToggled: checked => {
|
||||
valueShowCapsLock = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.showCapsLock
|
||||
}
|
||||
|
||||
NIcon {
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
icon: capsIcon
|
||||
pointSize: Style.fontSizeXL
|
||||
visible: capsIcon !== ""
|
||||
}
|
||||
|
||||
NButton {
|
||||
text: I18n.tr("common.browse")
|
||||
onClicked: capsPicker.open()
|
||||
enabled: valueShowCapsLock
|
||||
}
|
||||
}
|
||||
|
||||
NIconPicker {
|
||||
id: capsPicker
|
||||
initialIcon: capsIcon
|
||||
query: "letter-c"
|
||||
onIconSelected: function (iconName) {
|
||||
capsIcon = iconName;
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
spacing: Style.marginM
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("bar.lock-keys.show-num-lock-label")
|
||||
description: I18n.tr("bar.lock-keys.show-num-lock-description")
|
||||
checked: valueShowNumLock
|
||||
onToggled: checked => {
|
||||
valueShowNumLock = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.showNumLock
|
||||
}
|
||||
|
||||
NIcon {
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
icon: numIcon
|
||||
pointSize: Style.fontSizeXL
|
||||
visible: numIcon !== ""
|
||||
}
|
||||
|
||||
NButton {
|
||||
text: I18n.tr("common.browse")
|
||||
onClicked: numPicker.open()
|
||||
enabled: valueShowNumLock
|
||||
}
|
||||
}
|
||||
|
||||
NIconPicker {
|
||||
id: numPicker
|
||||
initialIcon: numIcon
|
||||
query: "letter-n"
|
||||
onIconSelected: function (iconName) {
|
||||
numIcon = iconName;
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
spacing: Style.marginM
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("bar.lock-keys.show-scroll-lock-label")
|
||||
description: I18n.tr("bar.lock-keys.show-scroll-lock-description")
|
||||
checked: valueShowScrollLock
|
||||
onToggled: checked => {
|
||||
valueShowScrollLock = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.showScrollLock
|
||||
}
|
||||
|
||||
NIcon {
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
icon: scrollIcon
|
||||
pointSize: Style.fontSizeXL
|
||||
visible: scrollIcon !== ""
|
||||
}
|
||||
|
||||
NButton {
|
||||
text: I18n.tr("common.browse")
|
||||
onClicked: scrollPicker.open()
|
||||
enabled: valueShowScrollLock
|
||||
}
|
||||
}
|
||||
|
||||
NIconPicker {
|
||||
id: scrollPicker
|
||||
initialIcon: scrollIcon
|
||||
query: "letter-s"
|
||||
onIconSelected: function (iconName) {
|
||||
scrollIcon = iconName;
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
|
||||
NDivider {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
NToggle {
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.lock-keys.hide-when-off-label")
|
||||
description: I18n.tr("bar.lock-keys.hide-when-off-description")
|
||||
checked: valueHideWhenOff
|
||||
onToggled: checked => {
|
||||
valueHideWhenOff = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.hideWhenOff
|
||||
}
|
||||
}
|
||||
+248
@@ -0,0 +1,248 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
spacing: Style.marginM
|
||||
|
||||
// Properties to receive data from parent
|
||||
property var screen: null
|
||||
property var widgetData: null
|
||||
property var widgetMetadata: null
|
||||
|
||||
signal settingsChanged(var settings)
|
||||
|
||||
// Local state
|
||||
property string valueHideMode: widgetData.hideMode !== undefined ? widgetData.hideMode : widgetMetadata.hideMode
|
||||
// Deprecated: hideWhenIdle now folded into hideMode = "idle"
|
||||
property bool valueHideWhenIdle: widgetData.hideWhenIdle !== undefined ? widgetData.hideWhenIdle : widgetMetadata.hideWhenIdle
|
||||
property bool valueShowAlbumArt: widgetData.showAlbumArt !== undefined ? widgetData.showAlbumArt : widgetMetadata.showAlbumArt
|
||||
property bool valuePanelShowAlbumArt: widgetData.panelShowAlbumArt !== undefined ? widgetData.panelShowAlbumArt : widgetMetadata.panelShowAlbumArt
|
||||
property bool valueShowArtistFirst: widgetData.showArtistFirst !== undefined ? widgetData.showArtistFirst : widgetMetadata.showArtistFirst
|
||||
property bool valueShowVisualizer: widgetData.showVisualizer !== undefined ? widgetData.showVisualizer : widgetMetadata.showVisualizer
|
||||
property string valueVisualizerType: widgetData.visualizerType !== undefined ? widgetData.visualizerType : widgetMetadata.visualizerType
|
||||
property string valueScrollingMode: widgetData.scrollingMode !== undefined ? widgetData.scrollingMode : widgetMetadata.scrollingMode
|
||||
property int valueMaxWidth: widgetData.maxWidth !== undefined ? widgetData.maxWidth : widgetMetadata.maxWidth
|
||||
property bool valueUseFixedWidth: widgetData.useFixedWidth !== undefined ? widgetData.useFixedWidth : widgetMetadata.useFixedWidth
|
||||
property bool valueShowProgressRing: widgetData.showProgressRing !== undefined ? widgetData.showProgressRing : widgetMetadata.showProgressRing
|
||||
property bool valueCompactMode: widgetData.compactMode !== undefined ? widgetData.compactMode : widgetMetadata.compactMode
|
||||
property string valueTextColor: widgetData.textColor !== undefined ? widgetData.textColor : widgetMetadata.textColor
|
||||
|
||||
Component.onCompleted: {
|
||||
if (widgetData && widgetData.hideMode !== undefined) {
|
||||
valueHideMode = widgetData.hideMode;
|
||||
}
|
||||
}
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.hideMode = valueHideMode;
|
||||
// No longer store hideWhenIdle separately; kept for backward compatibility only
|
||||
settings.showAlbumArt = valueShowAlbumArt;
|
||||
settings.panelShowAlbumArt = valuePanelShowAlbumArt;
|
||||
settings.showArtistFirst = valueShowArtistFirst;
|
||||
settings.showVisualizer = valueShowVisualizer;
|
||||
settings.visualizerType = valueVisualizerType;
|
||||
settings.scrollingMode = valueScrollingMode;
|
||||
settings.maxWidth = parseInt(widthInput.text) || widgetMetadata.maxWidth;
|
||||
settings.useFixedWidth = valueUseFixedWidth;
|
||||
settings.showProgressRing = valueShowProgressRing;
|
||||
settings.compactMode = valueCompactMode;
|
||||
settings.textColor = valueTextColor;
|
||||
settingsChanged(settings);
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.taskbar.hide-mode-label")
|
||||
description: I18n.tr("bar.media-mini.hide-mode-description")
|
||||
model: [
|
||||
{
|
||||
"key": "visible",
|
||||
"name": I18n.tr("hide-modes.visible")
|
||||
},
|
||||
{
|
||||
"key": "hidden",
|
||||
"name": I18n.tr("hide-modes.hidden")
|
||||
},
|
||||
{
|
||||
"key": "transparent",
|
||||
"name": I18n.tr("hide-modes.transparent")
|
||||
},
|
||||
{
|
||||
"key": "idle",
|
||||
"name": I18n.tr("hide-modes.idle")
|
||||
}
|
||||
]
|
||||
currentKey: root.valueHideMode
|
||||
onSelected: key => {
|
||||
root.valueHideMode = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.hideMode
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("bar.media-mini.show-album-art-label")
|
||||
description: I18n.tr("bar.media-mini.show-album-art-description")
|
||||
checked: valueShowAlbumArt
|
||||
onToggled: checked => {
|
||||
valueShowAlbumArt = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.showAlbumArt
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("bar.media-mini.show-artist-first-label")
|
||||
description: I18n.tr("bar.media-mini.show-artist-first-description")
|
||||
checked: valueShowArtistFirst
|
||||
onToggled: checked => {
|
||||
valueShowArtistFirst = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.showArtistFirst
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("bar.media-mini.show-visualizer-label")
|
||||
description: I18n.tr("bar.media-mini.show-visualizer-description")
|
||||
checked: valueShowVisualizer
|
||||
onToggled: checked => {
|
||||
valueShowVisualizer = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.showVisualizer
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
visible: valueShowVisualizer
|
||||
label: I18n.tr("bar.media-mini.visualizer-type-label")
|
||||
description: I18n.tr("bar.media-mini.visualizer-type-description")
|
||||
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;
|
||||
saveSettings();
|
||||
}
|
||||
minimumWidth: 200
|
||||
defaultValue: widgetMetadata.visualizerType
|
||||
}
|
||||
|
||||
NTextInput {
|
||||
id: widthInput
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.taskbar.max-width-label")
|
||||
description: I18n.tr("bar.media-mini.max-width-description")
|
||||
placeholderText: widgetMetadata.maxWidth
|
||||
text: valueMaxWidth
|
||||
onTextChanged: saveSettings()
|
||||
defaultValue: String(widgetMetadata.maxWidth)
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("bar.media-mini.use-fixed-width-label")
|
||||
description: I18n.tr("bar.media-mini.use-fixed-width-description")
|
||||
checked: valueUseFixedWidth
|
||||
onToggled: checked => {
|
||||
valueUseFixedWidth = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.useFixedWidth
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("bar.media-mini.show-progress-ring-label")
|
||||
description: I18n.tr("bar.media-mini.show-progress-ring-description")
|
||||
checked: valueShowProgressRing
|
||||
onToggled: checked => {
|
||||
valueShowProgressRing = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.showProgressRing
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
currentKey: valueTextColor
|
||||
onSelected: key => {
|
||||
valueTextColor = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.textColor
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
label: I18n.tr("bar.media-mini.scrolling-mode-label")
|
||||
description: I18n.tr("bar.media-mini.scrolling-mode-description")
|
||||
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;
|
||||
saveSettings();
|
||||
}
|
||||
minimumWidth: 200
|
||||
defaultValue: widgetMetadata.scrollingMode
|
||||
}
|
||||
|
||||
NDivider {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: Style.marginS
|
||||
}
|
||||
|
||||
NLabel {
|
||||
label: I18n.tr("bar.media-mini.panel-section-label")
|
||||
description: I18n.tr("bar.media-mini.panel-section-description")
|
||||
labelColor: Color.mPrimary
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("bar.media-mini.show-album-art-label")
|
||||
description: I18n.tr("bar.media-mini.show-album-art-description")
|
||||
checked: valuePanelShowAlbumArt
|
||||
onToggled: checked => {
|
||||
valuePanelShowAlbumArt = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.panelShowAlbumArt
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("bar.media-mini.compact-mode-label")
|
||||
description: I18n.tr("bar.media-mini.compact-mode-description")
|
||||
checked: valueCompactMode
|
||||
onToggled: checked => {
|
||||
valueCompactMode = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.compactMode
|
||||
}
|
||||
}
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
spacing: Style.marginM
|
||||
|
||||
// Properties to receive data from parent
|
||||
property var screen: null
|
||||
property var widgetData: null
|
||||
property var widgetMetadata: null
|
||||
|
||||
signal settingsChanged(var settings)
|
||||
|
||||
// Local state
|
||||
property string valueDisplayMode: widgetData.displayMode !== undefined ? widgetData.displayMode : widgetMetadata.displayMode
|
||||
property string valueMiddleClickCommand: widgetData.middleClickCommand !== undefined ? widgetData.middleClickCommand : widgetMetadata.middleClickCommand
|
||||
property string valueIconColor: widgetData.iconColor !== undefined ? widgetData.iconColor : widgetMetadata.iconColor
|
||||
property string valueTextColor: widgetData.textColor !== undefined ? widgetData.textColor : widgetMetadata.textColor
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.displayMode = valueDisplayMode;
|
||||
settings.middleClickCommand = valueMiddleClickCommand;
|
||||
settings.iconColor = valueIconColor;
|
||||
settings.textColor = valueTextColor;
|
||||
settingsChanged(settings);
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
label: I18n.tr("common.display-mode")
|
||||
description: I18n.tr("bar.volume.display-mode-description")
|
||||
minimumWidth: 200
|
||||
model: [
|
||||
{
|
||||
"key": "onhover",
|
||||
"name": I18n.tr("display-modes.on-hover")
|
||||
},
|
||||
{
|
||||
"key": "alwaysShow",
|
||||
"name": I18n.tr("display-modes.always-show")
|
||||
},
|
||||
{
|
||||
"key": "alwaysHide",
|
||||
"name": I18n.tr("display-modes.always-hide")
|
||||
}
|
||||
]
|
||||
currentKey: valueDisplayMode
|
||||
onSelected: key => {
|
||||
valueDisplayMode = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.displayMode
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
label: I18n.tr("common.select-icon-color")
|
||||
currentKey: valueIconColor
|
||||
onSelected: key => {
|
||||
valueIconColor = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.iconColor
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
currentKey: valueTextColor
|
||||
onSelected: key => {
|
||||
valueTextColor = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.textColor
|
||||
}
|
||||
|
||||
// Middle click command
|
||||
NTextInput {
|
||||
label: I18n.tr("bar.custom-button.middle-click-label")
|
||||
description: I18n.tr("panels.audio.on-middle-clicked-description")
|
||||
placeholderText: I18n.tr("panels.audio.external-mixer-placeholder")
|
||||
text: valueMiddleClickCommand
|
||||
onTextChanged: {
|
||||
valueMiddleClickCommand = text;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.middleClickCommand
|
||||
}
|
||||
}
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
spacing: Style.marginM
|
||||
|
||||
// Properties to receive data from parent
|
||||
property var screen: null
|
||||
property var widgetData: null
|
||||
property var widgetMetadata: null
|
||||
|
||||
signal settingsChanged(var settings)
|
||||
|
||||
// Local state
|
||||
property string valueDisplayMode: widgetData.displayMode !== undefined ? widgetData.displayMode : widgetMetadata.displayMode
|
||||
property string valueIconColor: widgetData.iconColor !== undefined ? widgetData.iconColor : widgetMetadata.iconColor
|
||||
property string valueTextColor: widgetData.textColor !== undefined ? widgetData.textColor : widgetMetadata.textColor
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.displayMode = valueDisplayMode;
|
||||
settings.iconColor = valueIconColor;
|
||||
settings.textColor = valueTextColor;
|
||||
settingsChanged(settings);
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
label: I18n.tr("common.display-mode")
|
||||
description: I18n.tr("bar.volume.display-mode-description")
|
||||
minimumWidth: 200
|
||||
model: [
|
||||
{
|
||||
"key": "onhover",
|
||||
"name": I18n.tr("display-modes.on-hover")
|
||||
},
|
||||
{
|
||||
"key": "alwaysShow",
|
||||
"name": I18n.tr("display-modes.always-show")
|
||||
},
|
||||
{
|
||||
"key": "alwaysHide",
|
||||
"name": I18n.tr("display-modes.always-hide")
|
||||
}
|
||||
]
|
||||
currentKey: root.valueDisplayMode
|
||||
onSelected: key => {
|
||||
root.valueDisplayMode = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.displayMode
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
label: I18n.tr("common.select-icon-color")
|
||||
currentKey: valueIconColor
|
||||
onSelected: key => {
|
||||
valueIconColor = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.iconColor
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
currentKey: valueTextColor
|
||||
onSelected: key => {
|
||||
valueTextColor = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.textColor
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
spacing: Style.marginM
|
||||
|
||||
// Properties to receive data from parent
|
||||
property var screen: null
|
||||
property var widgetData: null
|
||||
property var widgetMetadata: null
|
||||
|
||||
signal settingsChanged(var settings)
|
||||
|
||||
property string valueIconColor: widgetData.iconColor !== undefined ? widgetData.iconColor : widgetMetadata.iconColor
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.iconColor = valueIconColor;
|
||||
settingsChanged(settings);
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
label: I18n.tr("common.select-icon-color")
|
||||
currentKey: valueIconColor
|
||||
onSelected: key => {
|
||||
valueIconColor = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.iconColor
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
spacing: Style.marginM
|
||||
|
||||
// Properties to receive data from parent
|
||||
property var screen: null
|
||||
property var widgetData: null
|
||||
property var widgetMetadata: null
|
||||
|
||||
signal settingsChanged(var settings)
|
||||
|
||||
property string valueIconColor: widgetData.iconColor !== undefined ? widgetData.iconColor : widgetMetadata.iconColor
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.iconColor = valueIconColor;
|
||||
settingsChanged(settings);
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
label: I18n.tr("common.select-icon-color")
|
||||
currentKey: valueIconColor
|
||||
onSelected: key => {
|
||||
valueIconColor = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.iconColor
|
||||
}
|
||||
}
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
spacing: Style.marginM
|
||||
|
||||
// Properties to receive data from parent
|
||||
property var screen: null
|
||||
property var widgetData: null
|
||||
property var widgetMetadata: null
|
||||
|
||||
signal settingsChanged(var settings)
|
||||
|
||||
// Local state
|
||||
property bool valueShowUnreadBadge: widgetData.showUnreadBadge !== undefined ? widgetData.showUnreadBadge : widgetMetadata.showUnreadBadge
|
||||
property bool valueHideWhenZero: widgetData.hideWhenZero !== undefined ? widgetData.hideWhenZero : widgetMetadata.hideWhenZero
|
||||
property bool valueHideWhenZeroUnread: widgetData.hideWhenZeroUnread !== undefined ? widgetData.hideWhenZeroUnread : widgetMetadata.hideWhenZeroUnread
|
||||
property string valueUnreadBadgeColor: widgetData.unreadBadgeColor !== undefined ? widgetData.unreadBadgeColor : widgetMetadata.unreadBadgeColor
|
||||
property string valueIconColor: widgetData.iconColor !== undefined ? widgetData.iconColor : widgetMetadata.iconColor
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.showUnreadBadge = valueShowUnreadBadge;
|
||||
settings.hideWhenZero = valueHideWhenZero;
|
||||
settings.hideWhenZeroUnread = valueHideWhenZeroUnread;
|
||||
settings.unreadBadgeColor = valueUnreadBadgeColor;
|
||||
settings.iconColor = valueIconColor;
|
||||
settingsChanged(settings);
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("bar.notification-history.show-unread-badge-label")
|
||||
description: I18n.tr("bar.notification-history.show-unread-badge-description")
|
||||
checked: valueShowUnreadBadge
|
||||
onToggled: checked => {
|
||||
valueShowUnreadBadge = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.showUnreadBadge
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
label: I18n.tr("common.select-icon-color")
|
||||
currentKey: valueIconColor
|
||||
onSelected: key => {
|
||||
valueIconColor = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.iconColor
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
label: I18n.tr("bar.notification-history.unread-badge-color-label")
|
||||
description: I18n.tr("bar.notification-history.unread-badge-color-description")
|
||||
currentKey: valueUnreadBadgeColor
|
||||
onSelected: key => {
|
||||
valueUnreadBadgeColor = key;
|
||||
saveSettings();
|
||||
}
|
||||
visible: valueShowUnreadBadge
|
||||
defaultValue: widgetMetadata.unreadBadgeColor
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("bar.notification-history.hide-widget-when-zero-label")
|
||||
description: I18n.tr("bar.notification-history.hide-widget-when-zero-description")
|
||||
checked: valueHideWhenZero
|
||||
onToggled: checked => {
|
||||
valueHideWhenZero = checked;
|
||||
saveSettings();
|
||||
}
|
||||
enabled: !valueHideWhenZeroUnread
|
||||
defaultValue: widgetMetadata.hideWhenZero
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("bar.notification-history.hide-widget-when-zero-unread-label")
|
||||
description: I18n.tr("bar.notification-history.hide-widget-when-zero-unread-description")
|
||||
checked: valueHideWhenZeroUnread
|
||||
onToggled: checked => {
|
||||
valueHideWhenZeroUnread = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.hideWhenZeroUnread
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
spacing: Style.marginM
|
||||
|
||||
// Properties to receive data from parent
|
||||
property var screen: null
|
||||
property var widgetData: null
|
||||
property var widgetMetadata: null
|
||||
|
||||
signal settingsChanged(var settings)
|
||||
|
||||
property string valueIconColor: widgetData.iconColor !== undefined ? widgetData.iconColor : widgetMetadata.iconColor
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.iconColor = valueIconColor;
|
||||
settingsChanged(settings);
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
label: I18n.tr("common.select-icon-color")
|
||||
currentKey: valueIconColor
|
||||
onSelected: key => {
|
||||
valueIconColor = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.iconColor
|
||||
}
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Services.System
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
spacing: Style.marginM
|
||||
width: 700
|
||||
|
||||
// Properties to receive data from parent
|
||||
property var screen: null
|
||||
property var widgetData: null
|
||||
property var widgetMetadata: null
|
||||
|
||||
signal settingsChanged(var settings)
|
||||
|
||||
// Local state
|
||||
property string valueIconColor: widgetData.iconColor !== undefined ? widgetData.iconColor : widgetMetadata.iconColor
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.iconColor = valueIconColor;
|
||||
settingsChanged(settings);
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
label: I18n.tr("common.select-icon-color")
|
||||
currentKey: root.valueIconColor
|
||||
onSelected: key => {
|
||||
root.valueIconColor = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.iconColor
|
||||
}
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
spacing: Style.marginM
|
||||
|
||||
// Properties to receive data from parent
|
||||
property var screen: null
|
||||
property var widgetData: null
|
||||
property var widgetMetadata: null
|
||||
|
||||
signal settingsChanged(var settings)
|
||||
|
||||
// Local state
|
||||
property string valueIconColor: widgetData.iconColor !== undefined ? widgetData.iconColor : widgetMetadata.iconColor
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.iconColor = valueIconColor;
|
||||
settingsChanged(settings);
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
label: I18n.tr("common.select-icon-color")
|
||||
currentKey: valueIconColor
|
||||
onSelected: key => {
|
||||
valueIconColor = key;
|
||||
saveSettings();
|
||||
}
|
||||
valueDefault: widgetMetadata.iconColor
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
spacing: Style.marginM
|
||||
|
||||
// Properties to receive data from parent
|
||||
property var screen: null
|
||||
property var widgetData: null
|
||||
property var widgetMetadata: null
|
||||
|
||||
signal settingsChanged(var settings)
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.width = parseInt(widthInput.text) || widgetMetadata.width;
|
||||
settingsChanged(settings);
|
||||
}
|
||||
|
||||
NTextInput {
|
||||
id: widthInput
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("common.width")
|
||||
description: I18n.tr("bar.spacer.width-description")
|
||||
text: widgetData.width || widgetMetadata.width
|
||||
placeholderText: I18n.tr("placeholders.enter-width-pixels")
|
||||
onTextChanged: saveSettings()
|
||||
defaultValue: String(widgetMetadata.width)
|
||||
}
|
||||
}
|
||||
+325
@@ -0,0 +1,325 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Services.System
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
spacing: Style.marginM
|
||||
|
||||
// Properties to receive data from parent
|
||||
property var screen: null
|
||||
property var widgetData: null
|
||||
property var widgetMetadata: null
|
||||
|
||||
signal settingsChanged(var settings)
|
||||
|
||||
readonly property string barPosition: Settings.getBarPositionForScreen(screen?.name)
|
||||
readonly property bool isVerticalBar: barPosition === "left" || barPosition === "right"
|
||||
|
||||
// Local, editable state for checkboxes
|
||||
property bool valueCompactMode: widgetData.compactMode !== undefined ? widgetData.compactMode : widgetMetadata.compactMode
|
||||
property string valueIconColor: widgetData.iconColor !== undefined ? widgetData.iconColor : widgetMetadata.iconColor
|
||||
property string valueTextColor: widgetData.textColor !== undefined ? widgetData.textColor : widgetMetadata.textColor
|
||||
property bool valueUseMonospaceFont: widgetData.useMonospaceFont !== undefined ? widgetData.useMonospaceFont : widgetMetadata.useMonospaceFont
|
||||
property bool valueUsePadding: widgetData.usePadding !== undefined ? widgetData.usePadding : widgetMetadata.usePadding
|
||||
property bool valueShowCpuUsage: widgetData.showCpuUsage !== undefined ? widgetData.showCpuUsage : widgetMetadata.showCpuUsage
|
||||
property bool valueShowCpuCores: widgetData.showCpuCores !== undefined ? widgetData.showCpuCores : widgetMetadata.showCpuCores
|
||||
property bool valueShowCpuFreq: widgetData.showCpuFreq !== undefined ? widgetData.showCpuFreq : widgetMetadata.showCpuFreq
|
||||
property bool valueShowCpuTemp: widgetData.showCpuTemp !== undefined ? widgetData.showCpuTemp : widgetMetadata.showCpuTemp
|
||||
property bool valueShowGpuTemp: widgetData.showGpuTemp !== undefined ? widgetData.showGpuTemp : widgetMetadata.showGpuTemp
|
||||
property bool valueShowLoadAverage: widgetData.showLoadAverage !== undefined ? widgetData.showLoadAverage : widgetMetadata.showLoadAverage
|
||||
property bool valueShowMemoryUsage: widgetData.showMemoryUsage !== undefined ? widgetData.showMemoryUsage : widgetMetadata.showMemoryUsage
|
||||
property bool valueShowMemoryAsPercent: widgetData.showMemoryAsPercent !== undefined ? widgetData.showMemoryAsPercent : widgetMetadata.showMemoryAsPercent
|
||||
property bool valueShowSwapUsage: widgetData.showSwapUsage !== undefined ? widgetData.showSwapUsage : widgetMetadata.showSwapUsage
|
||||
property bool valueShowNetworkStats: widgetData.showNetworkStats !== undefined ? widgetData.showNetworkStats : widgetMetadata.showNetworkStats
|
||||
property bool valueShowDiskUsage: widgetData.showDiskUsage !== undefined ? widgetData.showDiskUsage : widgetMetadata.showDiskUsage
|
||||
property bool valueShowDiskUsageAsPercent: widgetData.showDiskUsageAsPercent !== undefined ? widgetData.showDiskUsageAsPercent : widgetMetadata.showDiskUsageAsPercent
|
||||
property bool valueShowDiskAvailable: widgetData.showDiskAvailable !== undefined ? widgetData.showDiskAvailable : widgetMetadata.showDiskAvailable
|
||||
property string valueDiskPath: widgetData.diskPath !== undefined ? widgetData.diskPath : widgetMetadata.diskPath
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.compactMode = valueCompactMode;
|
||||
settings.iconColor = valueIconColor;
|
||||
settings.textColor = valueTextColor;
|
||||
settings.useMonospaceFont = valueUseMonospaceFont;
|
||||
settings.usePadding = valueUsePadding;
|
||||
settings.showCpuUsage = valueShowCpuUsage;
|
||||
settings.showCpuCores = valueShowCpuCores;
|
||||
settings.showCpuFreq = valueShowCpuFreq;
|
||||
settings.showCpuTemp = valueShowCpuTemp;
|
||||
settings.showGpuTemp = valueShowGpuTemp;
|
||||
settings.showLoadAverage = valueShowLoadAverage;
|
||||
settings.showMemoryUsage = valueShowMemoryUsage;
|
||||
settings.showMemoryAsPercent = valueShowMemoryAsPercent;
|
||||
settings.showSwapUsage = valueShowSwapUsage;
|
||||
settings.showNetworkStats = valueShowNetworkStats;
|
||||
settings.showDiskUsage = valueShowDiskUsage;
|
||||
settings.showDiskUsageAsPercent = valueShowDiskUsageAsPercent;
|
||||
settings.showDiskAvailable = valueShowDiskAvailable;
|
||||
settings.diskPath = valueDiskPath;
|
||||
|
||||
settingsChanged(settings);
|
||||
}
|
||||
|
||||
NToggle {
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.system-monitor.compact-mode-label")
|
||||
description: I18n.tr("bar.system-monitor.compact-mode-description")
|
||||
checked: valueCompactMode
|
||||
onToggled: checked => {
|
||||
valueCompactMode = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.compactMode
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
label: I18n.tr("common.select-icon-color")
|
||||
currentKey: valueIconColor
|
||||
onSelected: key => {
|
||||
valueIconColor = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.iconColor
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
currentKey: valueTextColor
|
||||
onSelected: key => {
|
||||
valueTextColor = key;
|
||||
saveSettings();
|
||||
}
|
||||
visible: !valueCompactMode
|
||||
defaultValue: widgetMetadata.textColor
|
||||
}
|
||||
|
||||
NToggle {
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.system-monitor.use-monospace-font-label")
|
||||
description: I18n.tr("bar.system-monitor.use-monospace-font-description")
|
||||
checked: valueUseMonospaceFont
|
||||
onToggled: checked => {
|
||||
valueUseMonospaceFont = checked;
|
||||
saveSettings();
|
||||
}
|
||||
visible: !valueCompactMode
|
||||
defaultValue: widgetMetadata.useMonospaceFont
|
||||
}
|
||||
|
||||
NToggle {
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.system-monitor.use-padding-label")
|
||||
description: isVerticalBar ? I18n.tr("bar.system-monitor.use-padding-description-disabled-vertical") : !valueUseMonospaceFont ? I18n.tr("bar.system-monitor.use-padding-description-disabled-monospace-font") : I18n.tr("bar.system-monitor.use-padding-description")
|
||||
checked: valueUsePadding && !isVerticalBar && valueUseMonospaceFont
|
||||
onToggled: checked => {
|
||||
valueUsePadding = checked;
|
||||
saveSettings();
|
||||
}
|
||||
visible: !valueCompactMode
|
||||
enabled: !isVerticalBar && valueUseMonospaceFont
|
||||
defaultValue: widgetMetadata.usePadding
|
||||
}
|
||||
|
||||
NDivider {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
NToggle {
|
||||
id: showCpuUsage
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.system-monitor.cpu-usage-label")
|
||||
description: I18n.tr("bar.system-monitor.cpu-usage-description")
|
||||
checked: valueShowCpuUsage
|
||||
onToggled: checked => {
|
||||
valueShowCpuUsage = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.showCpuUsage
|
||||
}
|
||||
|
||||
NToggle {
|
||||
id: showCpuCores
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.system-monitor.cpu-cores-label")
|
||||
description: I18n.tr("bar.system-monitor.cpu-cores-description")
|
||||
checked: valueShowCpuCores
|
||||
onToggled: checked => {
|
||||
valueShowCpuCores = checked;
|
||||
saveSettings();
|
||||
}
|
||||
visible: valueCompactMode
|
||||
}
|
||||
|
||||
NToggle {
|
||||
id: showCpuFreq
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.system-monitor.cpu-frequency-label")
|
||||
description: I18n.tr("bar.system-monitor.cpu-frequency-description")
|
||||
checked: valueShowCpuFreq
|
||||
onToggled: checked => {
|
||||
valueShowCpuFreq = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.showCpuFreq
|
||||
}
|
||||
|
||||
NToggle {
|
||||
id: showCpuTemp
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.system-monitor.cpu-temperature-label")
|
||||
description: I18n.tr("bar.system-monitor.cpu-temperature-description")
|
||||
checked: valueShowCpuTemp
|
||||
onToggled: checked => {
|
||||
valueShowCpuTemp = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.showCpuTemp
|
||||
}
|
||||
|
||||
NToggle {
|
||||
id: showLoadAverage
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.system-monitor.load-average-label")
|
||||
description: I18n.tr("bar.system-monitor.load-average-description")
|
||||
checked: valueShowLoadAverage
|
||||
onToggled: checked => {
|
||||
valueShowLoadAverage = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.showLoadAverage
|
||||
}
|
||||
|
||||
NToggle {
|
||||
id: showGpuTemp
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("panels.system-monitor.gpu-section-label")
|
||||
description: I18n.tr("bar.system-monitor.gpu-temperature-description")
|
||||
checked: valueShowGpuTemp
|
||||
onToggled: checked => {
|
||||
valueShowGpuTemp = checked;
|
||||
saveSettings();
|
||||
}
|
||||
visible: SystemStatService.gpuAvailable
|
||||
defaultValue: widgetMetadata.showGpuTemp
|
||||
}
|
||||
|
||||
NToggle {
|
||||
id: showMemoryUsage
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.system-monitor.memory-usage-label")
|
||||
description: I18n.tr("bar.system-monitor.memory-usage-description")
|
||||
checked: valueShowMemoryUsage
|
||||
onToggled: checked => {
|
||||
valueShowMemoryUsage = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.showMemoryUsage
|
||||
}
|
||||
|
||||
NToggle {
|
||||
id: showMemoryAsPercent
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.system-monitor.memory-percentage-label")
|
||||
description: I18n.tr("bar.system-monitor.memory-percentage-description")
|
||||
checked: valueShowMemoryAsPercent
|
||||
onToggled: checked => {
|
||||
valueShowMemoryAsPercent = checked;
|
||||
saveSettings();
|
||||
}
|
||||
visible: valueShowMemoryUsage
|
||||
defaultValue: widgetMetadata.showMemoryAsPercent
|
||||
}
|
||||
|
||||
NToggle {
|
||||
id: showSwapUsage
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.system-monitor.swap-usage-label")
|
||||
description: I18n.tr("bar.system-monitor.swap-usage-description")
|
||||
checked: valueShowSwapUsage
|
||||
onToggled: checked => {
|
||||
valueShowSwapUsage = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.showSwapUsage
|
||||
}
|
||||
|
||||
NToggle {
|
||||
id: showNetworkStats
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.system-monitor.network-traffic-label")
|
||||
description: I18n.tr("bar.system-monitor.network-traffic-description")
|
||||
checked: valueShowNetworkStats
|
||||
onToggled: checked => {
|
||||
valueShowNetworkStats = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.showNetworkStats
|
||||
}
|
||||
|
||||
NDivider {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
NToggle {
|
||||
id: showDiskUsage
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.system-monitor.storage-usage-label")
|
||||
description: I18n.tr("bar.system-monitor.storage-usage-description")
|
||||
checked: valueShowDiskUsage
|
||||
onToggled: checked => {
|
||||
valueShowDiskUsage = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.showDiskUsage
|
||||
}
|
||||
|
||||
NToggle {
|
||||
id: showDiskUsageAsPercent
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.system-monitor.storage-as-percentage-label")
|
||||
description: I18n.tr("bar.system-monitor.storage-as-percentage-description")
|
||||
checked: valueShowDiskUsageAsPercent
|
||||
onToggled: checked => {
|
||||
valueShowDiskUsageAsPercent = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.showDiskUsageAsPercent
|
||||
}
|
||||
|
||||
NToggle {
|
||||
id: showDiskAvailable
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.system-monitor.storage-available-label")
|
||||
description: I18n.tr("bar.system-monitor.storage-available-description")
|
||||
checked: valueShowDiskAvailable
|
||||
onToggled: checked => {
|
||||
valueShowDiskAvailable = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.showDiskAvailable
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
id: diskPathComboBox
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.system-monitor.disk-path-label")
|
||||
description: I18n.tr("bar.system-monitor.disk-path-description")
|
||||
model: {
|
||||
const paths = Object.keys(SystemStatService.diskPercents).sort();
|
||||
return paths.map(path => ({
|
||||
key: path,
|
||||
name: path
|
||||
}));
|
||||
}
|
||||
currentKey: valueDiskPath
|
||||
onSelected: key => {
|
||||
valueDiskPath = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.diskPath
|
||||
}
|
||||
}
|
||||
+201
@@ -0,0 +1,201 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
spacing: Style.marginM
|
||||
|
||||
// Properties to receive data from parent
|
||||
property var screen: null
|
||||
property var widgetData: null
|
||||
property var widgetMetadata: null
|
||||
|
||||
signal settingsChanged(var settings)
|
||||
|
||||
readonly property bool isVerticalBar: Settings.data.bar.position === "left" || Settings.data.bar.position === "right"
|
||||
|
||||
// Local state
|
||||
property string valueHideMode: widgetData.hideMode !== undefined ? widgetData.hideMode : widgetMetadata.hideMode
|
||||
property bool valueOnlyActiveWorkspaces: widgetData.onlyActiveWorkspaces !== undefined ? widgetData.onlyActiveWorkspaces : widgetMetadata.onlyActiveWorkspaces
|
||||
property bool valueOnlySameOutput: widgetData.onlySameOutput !== undefined ? widgetData.onlySameOutput : widgetMetadata.onlySameOutput
|
||||
property bool valueColorizeIcons: widgetData.colorizeIcons !== undefined ? widgetData.colorizeIcons : widgetMetadata.colorizeIcons
|
||||
property bool valueShowTitle: isVerticalBar ? false : widgetData.showTitle !== undefined ? widgetData.showTitle : widgetMetadata.showTitle
|
||||
property bool valueSmartWidth: widgetData.smartWidth !== undefined ? widgetData.smartWidth : widgetMetadata.smartWidth
|
||||
property int valueMaxTaskbarWidth: widgetData.maxTaskbarWidth !== undefined ? widgetData.maxTaskbarWidth : widgetMetadata.maxTaskbarWidth
|
||||
property int valueTitleWidth: widgetData.titleWidth !== undefined ? widgetData.titleWidth : widgetMetadata.titleWidth
|
||||
property bool valueShowPinnedApps: widgetData.showPinnedApps !== undefined ? widgetData.showPinnedApps : widgetMetadata.showPinnedApps
|
||||
property real valueIconScale: widgetData.iconScale !== undefined ? widgetData.iconScale : widgetMetadata.iconScale
|
||||
|
||||
Component.onCompleted: {
|
||||
if (widgetData && widgetData.hideMode !== undefined) {
|
||||
valueHideMode = widgetData.hideMode;
|
||||
} else if (widgetMetadata && widgetMetadata.hideMode !== undefined) {
|
||||
valueHideMode = widgetMetadata.hideMode;
|
||||
}
|
||||
}
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.hideMode = valueHideMode;
|
||||
settings.onlySameOutput = valueOnlySameOutput;
|
||||
settings.onlyActiveWorkspaces = valueOnlyActiveWorkspaces;
|
||||
settings.colorizeIcons = valueColorizeIcons;
|
||||
settings.showTitle = valueShowTitle;
|
||||
settings.smartWidth = valueSmartWidth;
|
||||
settings.maxTaskbarWidth = valueMaxTaskbarWidth;
|
||||
settings.titleWidth = parseInt(titleWidthInput.text) || widgetMetadata.titleWidth;
|
||||
settings.showPinnedApps = valueShowPinnedApps;
|
||||
settings.iconScale = valueIconScale;
|
||||
settingsChanged(settings);
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.taskbar.hide-mode-label")
|
||||
description: I18n.tr("bar.taskbar.hide-mode-description")
|
||||
model: [
|
||||
{
|
||||
"key": "visible",
|
||||
"name": I18n.tr("hide-modes.visible")
|
||||
},
|
||||
{
|
||||
"key": "hidden",
|
||||
"name": I18n.tr("hide-modes.hidden")
|
||||
},
|
||||
{
|
||||
"key": "transparent",
|
||||
"name": I18n.tr("hide-modes.transparent")
|
||||
}
|
||||
]
|
||||
currentKey: root.valueHideMode
|
||||
onSelected: key => {
|
||||
root.valueHideMode = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.hideMode
|
||||
}
|
||||
|
||||
NToggle {
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.taskbar.only-same-monitor-label")
|
||||
description: I18n.tr("bar.taskbar.only-same-monitor-description")
|
||||
checked: root.valueOnlySameOutput
|
||||
onToggled: checked => {
|
||||
root.valueOnlySameOutput = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.onlySameOutput
|
||||
}
|
||||
|
||||
NToggle {
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.taskbar.only-active-workspaces-label")
|
||||
description: I18n.tr("bar.taskbar.only-active-workspaces-description")
|
||||
checked: root.valueOnlyActiveWorkspaces
|
||||
onToggled: checked => {
|
||||
root.valueOnlyActiveWorkspaces = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.onlyActiveWorkspaces
|
||||
}
|
||||
|
||||
NToggle {
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.tray.colorize-icons-label")
|
||||
description: I18n.tr("bar.taskbar.colorize-icons-description")
|
||||
checked: root.valueColorizeIcons
|
||||
onToggled: checked => {
|
||||
root.valueColorizeIcons = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.colorizeIcons
|
||||
}
|
||||
|
||||
NToggle {
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.taskbar.show-pinned-apps-label")
|
||||
description: I18n.tr("bar.taskbar.show-pinned-apps-description")
|
||||
checked: root.valueShowPinnedApps
|
||||
onToggled: checked => {
|
||||
root.valueShowPinnedApps = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.showPinnedApps
|
||||
}
|
||||
|
||||
NValueSlider {
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.taskbar.icon-scale-label")
|
||||
description: I18n.tr("bar.taskbar.icon-scale-description")
|
||||
from: 0.5
|
||||
to: 1
|
||||
stepSize: 0.01
|
||||
showReset: true
|
||||
value: root.valueIconScale
|
||||
defaultValue: widgetMetadata.iconScale
|
||||
onMoved: value => {
|
||||
root.valueIconScale = value;
|
||||
saveSettings();
|
||||
}
|
||||
text: Math.round(root.valueIconScale * 100) + "%"
|
||||
}
|
||||
|
||||
NToggle {
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.taskbar.show-title-label")
|
||||
description: isVerticalBar ? I18n.tr("bar.taskbar.show-title-description-disabled") : I18n.tr("bar.taskbar.show-title-description")
|
||||
checked: root.valueShowTitle
|
||||
onToggled: checked => {
|
||||
root.valueShowTitle = checked;
|
||||
saveSettings();
|
||||
}
|
||||
enabled: !isVerticalBar
|
||||
defaultValue: widgetMetadata.showTitle
|
||||
}
|
||||
|
||||
NTextInput {
|
||||
id: titleWidthInput
|
||||
visible: root.valueShowTitle && !isVerticalBar
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.taskbar.title-width-label")
|
||||
description: I18n.tr("bar.taskbar.title-width-description")
|
||||
text: widgetData.titleWidth || widgetMetadata.titleWidth
|
||||
placeholderText: I18n.tr("placeholders.enter-width-pixels")
|
||||
onTextChanged: saveSettings()
|
||||
defaultValue: String(widgetMetadata.titleWidth)
|
||||
}
|
||||
|
||||
NToggle {
|
||||
Layout.fillWidth: true
|
||||
visible: !isVerticalBar && root.valueShowTitle
|
||||
label: I18n.tr("bar.taskbar.smart-width-label")
|
||||
description: I18n.tr("bar.taskbar.smart-width-description")
|
||||
checked: root.valueSmartWidth
|
||||
onToggled: checked => {
|
||||
root.valueSmartWidth = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.smartWidth
|
||||
}
|
||||
|
||||
NValueSlider {
|
||||
visible: root.valueSmartWidth && !isVerticalBar
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.taskbar.max-width-label")
|
||||
description: I18n.tr("bar.taskbar.max-width-description")
|
||||
from: 10
|
||||
to: 100
|
||||
stepSize: 5
|
||||
showReset: true
|
||||
value: root.valueMaxTaskbarWidth
|
||||
defaultValue: widgetMetadata.maxTaskbarWidth
|
||||
onMoved: value => {
|
||||
root.valueMaxTaskbarWidth = Math.round(value);
|
||||
saveSettings();
|
||||
}
|
||||
text: Math.round(root.valueMaxTaskbarWidth) + "%"
|
||||
}
|
||||
}
|
||||
+199
@@ -0,0 +1,199 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
|
||||
// Properties to receive data from parent
|
||||
property var screen: null
|
||||
property var widgetData: null
|
||||
property var widgetMetadata: null
|
||||
|
||||
signal settingsChanged(var settings)
|
||||
|
||||
// Local state
|
||||
property var localBlacklist: widgetData.blacklist || []
|
||||
property bool valueColorizeIcons: widgetData.colorizeIcons !== undefined ? widgetData.colorizeIcons : widgetMetadata.colorizeIcons
|
||||
property string valueChevronColor: widgetData.chevronColor !== undefined ? widgetData.chevronColor : widgetMetadata.chevronColor
|
||||
property bool valueDrawerEnabled: widgetData.drawerEnabled !== undefined ? widgetData.drawerEnabled : widgetMetadata.drawerEnabled
|
||||
property bool valueHidePassive: widgetData.hidePassive !== undefined ? widgetData.hidePassive : widgetMetadata.hidePassive
|
||||
|
||||
ListModel {
|
||||
id: blacklistModel
|
||||
}
|
||||
|
||||
function populateBlacklist() {
|
||||
for (var i = 0; i < localBlacklist.length; i++) {
|
||||
blacklistModel.append({
|
||||
"rule": localBlacklist[i]
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
Qt.callLater(populateBlacklist);
|
||||
}
|
||||
|
||||
spacing: Style.marginM
|
||||
|
||||
NToggle {
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.tray.drawer-enabled-label")
|
||||
description: I18n.tr("bar.tray.drawer-enabled-description")
|
||||
checked: root.valueDrawerEnabled
|
||||
onToggled: checked => {
|
||||
root.valueDrawerEnabled = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.drawerEnabled
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
label: I18n.tr("bar.tray.chevron-color-label")
|
||||
description: I18n.tr("bar.tray.chevron-color-description")
|
||||
currentKey: root.valueChevronColor
|
||||
onSelected: key => {
|
||||
root.valueChevronColor = key;
|
||||
saveSettings();
|
||||
}
|
||||
visible: root.valueDrawerEnabled
|
||||
defaultValue: widgetMetadata.chevronColor
|
||||
}
|
||||
|
||||
NToggle {
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.tray.colorize-icons-label")
|
||||
description: I18n.tr("bar.tray.colorize-icons-description")
|
||||
checked: root.valueColorizeIcons
|
||||
onToggled: checked => {
|
||||
root.valueColorizeIcons = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.colorizeIcons
|
||||
}
|
||||
|
||||
NToggle {
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("bar.tray.hide-passive-label")
|
||||
description: I18n.tr("bar.tray.hide-passive-description")
|
||||
checked: root.valueHidePassive
|
||||
onToggled: checked => {
|
||||
root.valueHidePassive = checked;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.hidePassive
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: Style.marginS
|
||||
|
||||
NLabel {
|
||||
label: I18n.tr("panels.bar.tray-blacklist-label")
|
||||
description: I18n.tr("panels.bar.tray-blacklist-description")
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: Style.marginS
|
||||
|
||||
NTextInputButton {
|
||||
id: newRuleInput
|
||||
Layout.fillWidth: true
|
||||
placeholderText: I18n.tr("panels.bar.tray-blacklist-placeholder")
|
||||
buttonIcon: "add"
|
||||
onButtonClicked: {
|
||||
if (newRuleInput.text.length > 0) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
if (!exists) {
|
||||
blacklistModel.append({
|
||||
"rule": newRule
|
||||
});
|
||||
newRuleInput.text = "";
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// List of current blacklist items
|
||||
NListView {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 150
|
||||
Layout.topMargin: Style.marginL // Increased top margin
|
||||
gradientColor: Color.mSurface
|
||||
|
||||
model: blacklistModel
|
||||
delegate: Item {
|
||||
width: ListView.width
|
||||
height: 40
|
||||
|
||||
Rectangle {
|
||||
id: itemBackground
|
||||
anchors.fill: parent
|
||||
anchors.margins: Style.marginXS
|
||||
color: "transparent" // Make background transparent
|
||||
border.color: Color.mOutline
|
||||
border.width: Style.borderS
|
||||
radius: Style.radiusS
|
||||
visible: model.rule !== undefined && model.rule !== "" // Only visible if rule exists
|
||||
}
|
||||
|
||||
Row {
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: Style.marginS
|
||||
anchors.rightMargin: Style.marginS
|
||||
spacing: Style.marginS
|
||||
|
||||
NText {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: model.rule
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
NIconButton {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
icon: "close"
|
||||
baseSize: 12 * Style.uiScaleRatio
|
||||
colorBg: Color.mSurfaceVariant
|
||||
colorFg: Color.mOnSurfaceVariant
|
||||
colorBgHover: Color.mError
|
||||
colorFgHover: Color.mOnError
|
||||
onClicked: {
|
||||
blacklistModel.remove(index);
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This function will be called by the dialog to get the new settings
|
||||
function saveSettings() {
|
||||
var newBlacklist = [];
|
||||
for (var i = 0; i < blacklistModel.count; i++) {
|
||||
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.chevronColor = root.valueChevronColor;
|
||||
settings.drawerEnabled = root.valueDrawerEnabled;
|
||||
settings.hidePassive = root.valueHidePassive;
|
||||
settingsChanged(settings);
|
||||
}
|
||||
}
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
spacing: Style.marginM
|
||||
|
||||
// Properties to receive data from parent
|
||||
property var screen: null
|
||||
property var widgetData: null
|
||||
property var widgetMetadata: null
|
||||
|
||||
signal settingsChanged(var settings)
|
||||
|
||||
property string valueDisplayMode: widgetData.displayMode !== undefined ? widgetData.displayMode : widgetMetadata.displayMode
|
||||
property string valueIconColor: widgetData.iconColor !== undefined ? widgetData.iconColor : widgetMetadata.iconColor
|
||||
property string valueTextColor: widgetData.textColor !== undefined ? widgetData.textColor : widgetMetadata.textColor
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.displayMode = valueDisplayMode;
|
||||
settings.iconColor = valueIconColor;
|
||||
settings.textColor = valueTextColor;
|
||||
settingsChanged(settings);
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
label: I18n.tr("common.display-mode")
|
||||
description: I18n.tr("bar.volume.display-mode-description")
|
||||
minimumWidth: 200
|
||||
model: [
|
||||
{
|
||||
"key": "onhover",
|
||||
"name": I18n.tr("display-modes.on-hover")
|
||||
},
|
||||
{
|
||||
"key": "alwaysShow",
|
||||
"name": I18n.tr("display-modes.always-show")
|
||||
},
|
||||
{
|
||||
"key": "alwaysHide",
|
||||
"name": I18n.tr("display-modes.always-hide")
|
||||
}
|
||||
]
|
||||
currentKey: root.valueDisplayMode
|
||||
onSelected: key => {
|
||||
root.valueDisplayMode = key;
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
label: I18n.tr("common.select-icon-color")
|
||||
currentKey: valueIconColor
|
||||
onSelected: key => {
|
||||
valueIconColor = key;
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
currentKey: valueTextColor
|
||||
onSelected: key => {
|
||||
valueTextColor = key;
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
}
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
spacing: Style.marginM
|
||||
|
||||
// Properties to receive data from parent
|
||||
property var screen: null
|
||||
property var widgetData: null
|
||||
property var widgetMetadata: null
|
||||
|
||||
signal settingsChanged(var settings)
|
||||
|
||||
// Local state
|
||||
property string valueDisplayMode: widgetData.displayMode !== undefined ? widgetData.displayMode : widgetMetadata.displayMode
|
||||
property string valueMiddleClickCommand: widgetData.middleClickCommand !== undefined ? widgetData.middleClickCommand : widgetMetadata.middleClickCommand
|
||||
property string valueIconColor: widgetData.iconColor !== undefined ? widgetData.iconColor : widgetMetadata.iconColor
|
||||
property string valueTextColor: widgetData.textColor !== undefined ? widgetData.textColor : widgetMetadata.textColor
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.displayMode = valueDisplayMode;
|
||||
settings.middleClickCommand = valueMiddleClickCommand;
|
||||
settings.iconColor = valueIconColor;
|
||||
settings.textColor = valueTextColor;
|
||||
settingsChanged(settings);
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
label: I18n.tr("common.display-mode")
|
||||
description: I18n.tr("bar.volume.display-mode-description")
|
||||
minimumWidth: 200
|
||||
model: [
|
||||
{
|
||||
"key": "onhover",
|
||||
"name": I18n.tr("display-modes.on-hover")
|
||||
},
|
||||
{
|
||||
"key": "alwaysShow",
|
||||
"name": I18n.tr("display-modes.always-show")
|
||||
},
|
||||
{
|
||||
"key": "alwaysHide",
|
||||
"name": I18n.tr("display-modes.always-hide")
|
||||
}
|
||||
]
|
||||
currentKey: valueDisplayMode
|
||||
onSelected: key => {
|
||||
valueDisplayMode = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.displayMode
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
label: I18n.tr("common.select-icon-color")
|
||||
currentKey: valueIconColor
|
||||
onSelected: key => {
|
||||
valueIconColor = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.iconColor
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
currentKey: valueTextColor
|
||||
onSelected: key => {
|
||||
valueTextColor = key;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.textColor
|
||||
}
|
||||
|
||||
// Middle click command
|
||||
NTextInput {
|
||||
label: I18n.tr("bar.custom-button.middle-click-label")
|
||||
description: I18n.tr("panels.audio.on-middle-clicked-description")
|
||||
placeholderText: I18n.tr("panels.audio.external-mixer-placeholder")
|
||||
text: valueMiddleClickCommand
|
||||
onTextChanged: {
|
||||
valueMiddleClickCommand = text;
|
||||
saveSettings();
|
||||
}
|
||||
defaultValue: widgetMetadata.middleClickCommand
|
||||
}
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
spacing: Style.marginM
|
||||
|
||||
// Properties to receive data from parent
|
||||
property var screen: null
|
||||
property var widgetData: null
|
||||
property var widgetMetadata: null
|
||||
|
||||
signal settingsChanged(var settings)
|
||||
|
||||
property string valueIconColor: widgetData.iconColor !== undefined ? widgetData.iconColor : widgetMetadata.iconColor
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.iconColor = valueIconColor;
|
||||
settingsChanged(settings);
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
label: I18n.tr("common.select-icon-color")
|
||||
currentKey: valueIconColor
|
||||
onSelected: key => {
|
||||
valueIconColor = key;
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
}
|
||||
+323
@@ -0,0 +1,323 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
spacing: Style.marginM
|
||||
|
||||
// Properties to receive data from parent
|
||||
property var screen: null
|
||||
property var widgetData: null
|
||||
property var widgetMetadata: null
|
||||
|
||||
signal settingsChanged(var settings)
|
||||
|
||||
property string valueLabelMode: widgetData.labelMode !== undefined ? widgetData.labelMode : widgetMetadata.labelMode
|
||||
property bool valueHideUnoccupied: widgetData.hideUnoccupied !== undefined ? widgetData.hideUnoccupied : widgetMetadata.hideUnoccupied
|
||||
property bool valueFollowFocusedScreen: widgetData.followFocusedScreen !== undefined ? widgetData.followFocusedScreen : widgetMetadata.followFocusedScreen
|
||||
property int valueCharacterCount: widgetData.characterCount !== undefined ? widgetData.characterCount : widgetMetadata.characterCount
|
||||
|
||||
// Grouped mode settings
|
||||
property bool valueShowApplications: widgetData.showApplications !== undefined ? widgetData.showApplications : widgetMetadata.showApplications
|
||||
property bool valueShowApplicationsHover: widgetData.showApplicationsHover !== undefined ? widgetData.showApplicationsHover : widgetMetadata.showApplicationsHover
|
||||
property bool valueShowLabelsOnlyWhenOccupied: widgetData.showLabelsOnlyWhenOccupied !== undefined ? widgetData.showLabelsOnlyWhenOccupied : widgetMetadata.showLabelsOnlyWhenOccupied
|
||||
property bool valueColorizeIcons: widgetData.colorizeIcons !== undefined ? widgetData.colorizeIcons : widgetMetadata.colorizeIcons
|
||||
property real valueUnfocusedIconsOpacity: widgetData.unfocusedIconsOpacity !== undefined ? widgetData.unfocusedIconsOpacity : widgetMetadata.unfocusedIconsOpacity
|
||||
property real valueGroupedBorderOpacity: widgetData.groupedBorderOpacity !== undefined ? widgetData.groupedBorderOpacity : widgetMetadata.groupedBorderOpacity
|
||||
property bool valueEnableScrollWheel: widgetData.enableScrollWheel !== undefined ? widgetData.enableScrollWheel : widgetMetadata.enableScrollWheel
|
||||
property real valueIconScale: widgetData.iconScale !== undefined ? widgetData.iconScale : widgetMetadata.iconScale
|
||||
property string valueFocusedColor: widgetData.focusedColor !== undefined ? widgetData.focusedColor : widgetMetadata.focusedColor
|
||||
property string valueOccupiedColor: widgetData.occupiedColor !== undefined ? widgetData.occupiedColor : widgetMetadata.occupiedColor
|
||||
property string valueEmptyColor: widgetData.emptyColor !== undefined ? widgetData.emptyColor : widgetMetadata.emptyColor
|
||||
property bool valueShowBadge: widgetData.showBadge !== undefined ? widgetData.showBadge : widgetMetadata.showBadge
|
||||
property real valuePillSize: widgetData.pillSize !== undefined ? widgetData.pillSize : widgetMetadata.pillSize
|
||||
property string valueFontWeight: widgetData.fontWeight !== undefined ? widgetData.fontWeight : widgetMetadata.fontWeight
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {});
|
||||
settings.labelMode = valueLabelMode;
|
||||
settings.hideUnoccupied = valueHideUnoccupied;
|
||||
settings.characterCount = valueCharacterCount;
|
||||
settings.followFocusedScreen = valueFollowFocusedScreen;
|
||||
settings.showApplications = valueShowApplications;
|
||||
settings.showApplicationsHover = valueShowApplicationsHover;
|
||||
settings.showLabelsOnlyWhenOccupied = valueShowLabelsOnlyWhenOccupied;
|
||||
settings.colorizeIcons = valueColorizeIcons;
|
||||
settings.unfocusedIconsOpacity = valueUnfocusedIconsOpacity;
|
||||
settings.groupedBorderOpacity = valueGroupedBorderOpacity;
|
||||
settings.enableScrollWheel = valueEnableScrollWheel;
|
||||
settings.iconScale = valueIconScale;
|
||||
settings.focusedColor = valueFocusedColor;
|
||||
settings.occupiedColor = valueOccupiedColor;
|
||||
settings.emptyColor = valueEmptyColor;
|
||||
settings.showBadge = valueShowBadge;
|
||||
settings.pillSize = valuePillSize;
|
||||
settings.fontWeight = valueFontWeight;
|
||||
settingsChanged(settings);
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
id: labelModeCombo
|
||||
label: I18n.tr("bar.workspace.label-mode-label")
|
||||
description: I18n.tr("bar.workspace.label-mode-description")
|
||||
model: [
|
||||
{
|
||||
"key": "none",
|
||||
"name": I18n.tr("common.none")
|
||||
},
|
||||
{
|
||||
"key": "index",
|
||||
"name": I18n.tr("options.workspace-labels.index")
|
||||
},
|
||||
{
|
||||
"key": "name",
|
||||
"name": I18n.tr("options.workspace-labels.name")
|
||||
},
|
||||
{
|
||||
"key": "index+name",
|
||||
"name": I18n.tr("options.workspace-labels.index-and-name")
|
||||
}
|
||||
]
|
||||
currentKey: widgetData.labelMode || widgetMetadata.labelMode
|
||||
onSelected: key => {
|
||||
valueLabelMode = key;
|
||||
saveSettings();
|
||||
}
|
||||
minimumWidth: 200
|
||||
}
|
||||
|
||||
NSpinBox {
|
||||
label: I18n.tr("bar.workspace.character-count-label")
|
||||
description: I18n.tr("bar.workspace.character-count-description")
|
||||
from: 1
|
||||
to: 10
|
||||
value: valueCharacterCount
|
||||
onValueChanged: {
|
||||
valueCharacterCount = value;
|
||||
saveSettings();
|
||||
}
|
||||
visible: valueLabelMode === "name"
|
||||
}
|
||||
|
||||
NValueSlider {
|
||||
label: I18n.tr("bar.workspace.pill-size-label")
|
||||
description: I18n.tr("bar.workspace.pill-size-description")
|
||||
from: 0.4
|
||||
to: 1.0
|
||||
stepSize: 0.01
|
||||
value: valuePillSize
|
||||
defaultValue: widgetMetadata.pillSize
|
||||
showReset: true
|
||||
onMoved: value => {
|
||||
valuePillSize = value;
|
||||
saveSettings();
|
||||
}
|
||||
text: Math.round(valuePillSize * 100) + "%"
|
||||
visible: !valueShowApplications
|
||||
}
|
||||
|
||||
NComboBox {
|
||||
id: fontWeightCombo
|
||||
label: I18n.tr("bar.workspace.font-weight-label")
|
||||
description: I18n.tr("bar.workspace.font-weight-description")
|
||||
model: [
|
||||
{
|
||||
"key": "regular",
|
||||
"name": I18n.tr("common.font-weight-regular")
|
||||
},
|
||||
{
|
||||
"key": "medium",
|
||||
"name": I18n.tr("common.font-weight-medium")
|
||||
},
|
||||
{
|
||||
"key": "semibold",
|
||||
"name": I18n.tr("common.font-weight-semibold")
|
||||
},
|
||||
{
|
||||
"key": "bold",
|
||||
"name": I18n.tr("common.font-weight-bold")
|
||||
},
|
||||
]
|
||||
currentKey: widgetData.fontWeight || widgetMetadata.fontWeight
|
||||
onSelected: key => {
|
||||
valueFontWeight = key;
|
||||
saveSettings();
|
||||
}
|
||||
minimumWidth: 200
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("bar.workspace.hide-unoccupied-label")
|
||||
description: I18n.tr("bar.workspace.hide-unoccupied-description")
|
||||
checked: valueHideUnoccupied
|
||||
onToggled: checked => {
|
||||
valueHideUnoccupied = checked;
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("bar.workspace.show-labels-only-when-occupied-label")
|
||||
description: I18n.tr("bar.workspace.show-labels-only-when-occupied-description")
|
||||
checked: valueShowLabelsOnlyWhenOccupied
|
||||
onToggled: checked => {
|
||||
valueShowLabelsOnlyWhenOccupied = checked;
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("bar.workspace.follow-focused-screen-label")
|
||||
description: I18n.tr("bar.workspace.follow-focused-screen-description")
|
||||
checked: valueFollowFocusedScreen
|
||||
onToggled: checked => {
|
||||
valueFollowFocusedScreen = checked;
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("bar.workspace.enable-scrollwheel-label")
|
||||
description: I18n.tr("bar.workspace.enable-scrollwheel-description")
|
||||
checked: valueEnableScrollWheel
|
||||
onToggled: checked => {
|
||||
valueEnableScrollWheel = checked;
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
|
||||
NDivider {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("bar.workspace.show-applications-label")
|
||||
description: I18n.tr("bar.workspace.show-applications-description")
|
||||
checked: valueShowApplications
|
||||
onToggled: checked => {
|
||||
valueShowApplications = checked;
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("bar.workspace.show-applications-hover-label")
|
||||
description: I18n.tr("bar.workspace.show-applications-hover-description")
|
||||
checked: valueShowApplicationsHover
|
||||
onToggled: checked => {
|
||||
valueShowApplicationsHover = checked;
|
||||
saveSettings();
|
||||
}
|
||||
visible: valueShowApplications
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("bar.workspace.show-badge-label")
|
||||
description: I18n.tr("bar.workspace.show-badge-description")
|
||||
checked: valueShowBadge
|
||||
onToggled: checked => {
|
||||
valueShowBadge = checked;
|
||||
saveSettings();
|
||||
}
|
||||
visible: valueShowApplications
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("bar.tray.colorize-icons-label")
|
||||
description: I18n.tr("bar.active-window.colorize-icons-description")
|
||||
checked: valueColorizeIcons
|
||||
onToggled: checked => {
|
||||
valueColorizeIcons = checked;
|
||||
saveSettings();
|
||||
}
|
||||
visible: valueShowApplications
|
||||
}
|
||||
|
||||
NValueSlider {
|
||||
label: I18n.tr("bar.workspace.unfocused-icons-opacity-label")
|
||||
description: I18n.tr("bar.workspace.unfocused-icons-opacity-description")
|
||||
from: 0
|
||||
to: 1
|
||||
stepSize: 0.01
|
||||
showReset: true
|
||||
value: valueUnfocusedIconsOpacity
|
||||
defaultValue: widgetMetadata.unfocusedIconsOpacity
|
||||
onMoved: value => {
|
||||
valueUnfocusedIconsOpacity = value;
|
||||
saveSettings();
|
||||
}
|
||||
text: Math.floor(valueUnfocusedIconsOpacity * 100) + "%"
|
||||
visible: valueShowApplications
|
||||
}
|
||||
|
||||
NValueSlider {
|
||||
label: I18n.tr("bar.workspace.grouped-border-opacity-label")
|
||||
description: I18n.tr("bar.workspace.grouped-border-opacity-description")
|
||||
from: 0
|
||||
to: 1
|
||||
stepSize: 0.01
|
||||
showReset: true
|
||||
value: valueGroupedBorderOpacity
|
||||
defaultValue: widgetMetadata.groupedBorderOpacity
|
||||
onMoved: value => {
|
||||
valueGroupedBorderOpacity = value;
|
||||
saveSettings();
|
||||
}
|
||||
text: Math.floor(valueGroupedBorderOpacity * 100) + "%"
|
||||
visible: valueShowApplications
|
||||
}
|
||||
|
||||
NValueSlider {
|
||||
label: I18n.tr("bar.taskbar.icon-scale-label")
|
||||
description: I18n.tr("bar.taskbar.icon-scale-description")
|
||||
from: 0.5
|
||||
to: 1
|
||||
stepSize: 0.01
|
||||
showReset: true
|
||||
value: valueIconScale
|
||||
defaultValue: widgetMetadata.iconScale
|
||||
onMoved: value => {
|
||||
valueIconScale = value;
|
||||
saveSettings();
|
||||
}
|
||||
text: Math.round(valueIconScale * 100) + "%"
|
||||
visible: valueShowApplications
|
||||
}
|
||||
|
||||
NDivider {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
label: I18n.tr("bar.workspace.focused-color-label")
|
||||
description: I18n.tr("bar.workspace.focused-color-description")
|
||||
currentKey: valueFocusedColor
|
||||
onSelected: key => {
|
||||
valueFocusedColor = key;
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
label: I18n.tr("bar.workspace.occupied-color-label")
|
||||
description: I18n.tr("bar.workspace.occupied-color-description")
|
||||
currentKey: valueOccupiedColor
|
||||
onSelected: key => {
|
||||
valueOccupiedColor = key;
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
|
||||
NColorChoice {
|
||||
label: I18n.tr("bar.workspace.empty-color-label")
|
||||
description: I18n.tr("bar.workspace.empty-color-description")
|
||||
currentKey: valueEmptyColor
|
||||
onSelected: key => {
|
||||
valueEmptyColor = key;
|
||||
saveSettings();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user