add noctalia and fuzzel
This commit is contained in:
+50
@@ -0,0 +1,50 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Modules.OSD
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
spacing: Style.marginL
|
||||
Layout.fillWidth: true
|
||||
|
||||
property var addType
|
||||
property var removeType
|
||||
|
||||
Repeater {
|
||||
model: [
|
||||
{
|
||||
type: OSD.Type.Volume,
|
||||
key: "types-volume"
|
||||
},
|
||||
{
|
||||
type: OSD.Type.InputVolume,
|
||||
key: "types-input-volume"
|
||||
},
|
||||
{
|
||||
type: OSD.Type.Brightness,
|
||||
key: "types-brightness"
|
||||
},
|
||||
{
|
||||
type: OSD.Type.LockKey,
|
||||
key: "types-lockkey"
|
||||
}
|
||||
]
|
||||
delegate: NCheckbox {
|
||||
required property var modelData
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("panels.osd." + modelData.key + "-label")
|
||||
description: I18n.tr("panels.osd." + modelData.key + "-description")
|
||||
checked: (Settings.data.osd.enabledTypes || []).includes(modelData.type)
|
||||
onToggled: checked => {
|
||||
if (checked) {
|
||||
Settings.data.osd.enabledTypes = root.addType(Settings.data.osd.enabledTypes, modelData.type);
|
||||
} else {
|
||||
Settings.data.osd.enabledTypes = root.removeType(Settings.data.osd.enabledTypes, modelData.type);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+140
@@ -0,0 +1,140 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import qs.Commons
|
||||
import qs.Services.Compositor
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
spacing: Style.marginL
|
||||
Layout.fillWidth: true
|
||||
|
||||
property var addMonitor
|
||||
property var removeMonitor
|
||||
|
||||
NComboBox {
|
||||
label: I18n.tr("common.position")
|
||||
description: I18n.tr("panels.osd.location-description")
|
||||
model: [
|
||||
{
|
||||
"key": "top",
|
||||
"name": I18n.tr("positions.top-center")
|
||||
},
|
||||
{
|
||||
"key": "top_left",
|
||||
"name": I18n.tr("positions.top-left")
|
||||
},
|
||||
{
|
||||
"key": "top_right",
|
||||
"name": I18n.tr("positions.top-right")
|
||||
},
|
||||
{
|
||||
"key": "bottom",
|
||||
"name": I18n.tr("positions.bottom-center")
|
||||
},
|
||||
{
|
||||
"key": "bottom_left",
|
||||
"name": I18n.tr("positions.bottom-left")
|
||||
},
|
||||
{
|
||||
"key": "bottom_right",
|
||||
"name": I18n.tr("positions.bottom-right")
|
||||
},
|
||||
{
|
||||
"key": "left",
|
||||
"name": I18n.tr("positions.center-left")
|
||||
},
|
||||
{
|
||||
"key": "right",
|
||||
"name": I18n.tr("positions.center-right")
|
||||
}
|
||||
]
|
||||
currentKey: Settings.data.osd.location || "top_right"
|
||||
defaultValue: Settings.getDefaultValue("osd.location")
|
||||
onSelected: key => Settings.data.osd.location = key
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("panels.osd.enabled-label")
|
||||
description: I18n.tr("panels.osd.enabled-description")
|
||||
checked: Settings.data.osd.enabled
|
||||
defaultValue: Settings.getDefaultValue("osd.enabled")
|
||||
onToggled: checked => Settings.data.osd.enabled = checked
|
||||
}
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("panels.osd.always-on-top-label")
|
||||
description: I18n.tr("panels.osd.always-on-top-description")
|
||||
checked: Settings.data.osd.overlayLayer
|
||||
defaultValue: Settings.getDefaultValue("osd.overlayLayer")
|
||||
onToggled: checked => Settings.data.osd.overlayLayer = checked
|
||||
}
|
||||
|
||||
NValueSlider {
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("panels.osd.background-opacity-label")
|
||||
description: I18n.tr("panels.osd.background-opacity-description")
|
||||
from: 0
|
||||
to: 100
|
||||
stepSize: 1
|
||||
showReset: true
|
||||
value: Settings.data.osd.backgroundOpacity * 100
|
||||
defaultValue: (Settings.getDefaultValue("osd.backgroundOpacity") || 1) * 100
|
||||
onMoved: value => Settings.data.osd.backgroundOpacity = value / 100
|
||||
text: Math.round(Settings.data.osd.backgroundOpacity * 100) + "%"
|
||||
}
|
||||
|
||||
NValueSlider {
|
||||
Layout.fillWidth: true
|
||||
label: I18n.tr("panels.osd.duration-auto-hide-label")
|
||||
description: I18n.tr("panels.osd.duration-auto-hide-description")
|
||||
from: 500
|
||||
to: 5000
|
||||
stepSize: 100
|
||||
showReset: true
|
||||
value: Settings.data.osd.autoHideMs
|
||||
defaultValue: Settings.getDefaultValue("osd.autoHideMs")
|
||||
onMoved: value => Settings.data.osd.autoHideMs = value
|
||||
text: Math.round(Settings.data.osd.autoHideMs / 1000 * 10) / 10 + "s"
|
||||
}
|
||||
|
||||
NDivider {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
NText {
|
||||
text: I18n.tr("panels.osd.monitors-desc")
|
||||
wrapMode: Text.WordWrap
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
Repeater {
|
||||
model: Quickshell.screens || []
|
||||
delegate: NCheckbox {
|
||||
Layout.fillWidth: true
|
||||
readonly property real compositorScale: {
|
||||
const info = CompositorService.displayScales[modelData.name];
|
||||
return (info && info.scale) ? info.scale : 1.0;
|
||||
}
|
||||
label: modelData.name || I18n.tr("common.unknown")
|
||||
description: {
|
||||
I18n.tr("system.monitor-description", {
|
||||
"model": modelData.model,
|
||||
"width": modelData.width * compositorScale,
|
||||
"height": modelData.height * compositorScale,
|
||||
"scale": compositorScale
|
||||
});
|
||||
}
|
||||
checked: (Settings.data.osd.monitors || []).indexOf(modelData.name) !== -1
|
||||
onToggled: checked => {
|
||||
if (checked) {
|
||||
Settings.data.osd.monitors = root.addMonitor(Settings.data.osd.monitors, modelData.name);
|
||||
} else {
|
||||
Settings.data.osd.monitors = root.removeMonitor(Settings.data.osd.monitors, modelData.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import qs.Commons
|
||||
import qs.Widgets
|
||||
|
||||
ColumnLayout {
|
||||
id: root
|
||||
spacing: 0
|
||||
|
||||
// Helper functions to update arrays immutably
|
||||
function addMonitor(list, name) {
|
||||
const arr = (list || []).slice();
|
||||
if (!arr.includes(name))
|
||||
arr.push(name);
|
||||
return arr;
|
||||
}
|
||||
function removeMonitor(list, name) {
|
||||
return (list || []).filter(function (n) {
|
||||
return n !== name;
|
||||
});
|
||||
}
|
||||
function addType(list, type) {
|
||||
const arr = (list || []).slice();
|
||||
if (!arr.includes(type))
|
||||
arr.push(type);
|
||||
return arr;
|
||||
}
|
||||
function removeType(list, type) {
|
||||
return (list || []).filter(function (t) {
|
||||
return t !== type;
|
||||
});
|
||||
}
|
||||
|
||||
NTabBar {
|
||||
id: subTabBar
|
||||
Layout.fillWidth: true
|
||||
Layout.bottomMargin: Style.marginM
|
||||
distributeEvenly: true
|
||||
currentIndex: tabView.currentIndex
|
||||
|
||||
NTabButton {
|
||||
text: I18n.tr("common.general")
|
||||
tabIndex: 0
|
||||
checked: subTabBar.currentIndex === 0
|
||||
}
|
||||
NTabButton {
|
||||
text: I18n.tr("common.events")
|
||||
tabIndex: 1
|
||||
checked: subTabBar.currentIndex === 1
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: Style.marginL
|
||||
}
|
||||
|
||||
NTabView {
|
||||
id: tabView
|
||||
currentIndex: subTabBar.currentIndex
|
||||
|
||||
GeneralSubTab {
|
||||
addMonitor: root.addMonitor
|
||||
removeMonitor: root.removeMonitor
|
||||
}
|
||||
EventsSubTab {
|
||||
addType: root.addType
|
||||
removeType: root.removeType
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user