mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-30 16:32:50 -05:00
Compare commits
3 Commits
aab4b6765d
...
doctor-dbu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
17ec547737 | ||
|
|
f9a2ed025f | ||
|
|
f8cfbdcd90 |
@@ -108,6 +108,7 @@ func (o *OpenSUSEDistribution) GetPackageMappingWithVariants(wm deps.WindowManag
|
|||||||
packages := map[string]PackageMapping{
|
packages := map[string]PackageMapping{
|
||||||
// Standard zypper packages
|
// Standard zypper packages
|
||||||
"git": {Name: "git", Repository: RepoTypeSystem},
|
"git": {Name: "git", Repository: RepoTypeSystem},
|
||||||
|
"ghostty": {Name: "ghostty", Repository: RepoTypeSystem},
|
||||||
"kitty": {Name: "kitty", Repository: RepoTypeSystem},
|
"kitty": {Name: "kitty", Repository: RepoTypeSystem},
|
||||||
"alacritty": {Name: "alacritty", Repository: RepoTypeSystem},
|
"alacritty": {Name: "alacritty", Repository: RepoTypeSystem},
|
||||||
"xdg-desktop-portal-gtk": {Name: "xdg-desktop-portal-gtk", Repository: RepoTypeSystem},
|
"xdg-desktop-portal-gtk": {Name: "xdg-desktop-portal-gtk", Repository: RepoTypeSystem},
|
||||||
@@ -116,7 +117,6 @@ func (o *OpenSUSEDistribution) GetPackageMappingWithVariants(wm deps.WindowManag
|
|||||||
// DMS packages from OBS
|
// DMS packages from OBS
|
||||||
"dms (DankMaterialShell)": o.getDmsMapping(variants["dms (DankMaterialShell)"]),
|
"dms (DankMaterialShell)": o.getDmsMapping(variants["dms (DankMaterialShell)"]),
|
||||||
"quickshell": o.getQuickshellMapping(variants["quickshell"]),
|
"quickshell": o.getQuickshellMapping(variants["quickshell"]),
|
||||||
"ghostty": {Name: "ghostty", Repository: RepoTypeOBS, RepoURL: "home:AvengeMedia:danklinux"},
|
|
||||||
"matugen": {Name: "matugen", Repository: RepoTypeOBS, RepoURL: "home:AvengeMedia:danklinux"},
|
"matugen": {Name: "matugen", Repository: RepoTypeOBS, RepoURL: "home:AvengeMedia:danklinux"},
|
||||||
"dgop": {Name: "dgop", Repository: RepoTypeOBS, RepoURL: "home:AvengeMedia:danklinux"},
|
"dgop": {Name: "dgop", Repository: RepoTypeOBS, RepoURL: "home:AvengeMedia:danklinux"},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -73,12 +73,6 @@ in
|
|||||||
default = hasPluginSettings;
|
default = hasPluginSettings;
|
||||||
description = ''Whether to manage plugin settings. Automatically enabled if any plugins have settings configured.'';
|
description = ''Whether to manage plugin settings. Automatically enabled if any plugins have settings configured.'';
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.target = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
default = config.wayland.systemd.target;
|
|
||||||
defaultText = lib.literalExpression "config.wayland.systemd.target";
|
|
||||||
description = "Systemd target to bind to.";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
@@ -90,8 +84,8 @@ in
|
|||||||
systemd.user.services.dms = lib.mkIf cfg.systemd.enable {
|
systemd.user.services.dms = lib.mkIf cfg.systemd.enable {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "DankMaterialShell";
|
Description = "DankMaterialShell";
|
||||||
PartOf = [ cfg.systemd.target ];
|
PartOf = [ config.wayland.systemd.target ];
|
||||||
After = [ cfg.systemd.target ];
|
After = [ config.wayland.systemd.target ];
|
||||||
};
|
};
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
@@ -99,7 +93,7 @@ in
|
|||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
};
|
};
|
||||||
|
|
||||||
Install.WantedBy = [ cfg.systemd.target ];
|
Install.WantedBy = [ config.wayland.systemd.target ];
|
||||||
};
|
};
|
||||||
|
|
||||||
xdg.stateFile."DankMaterialShell/session.json" = lib.mkIf (cfg.session != { }) {
|
xdg.stateFile."DankMaterialShell/session.json" = lib.mkIf (cfg.session != { }) {
|
||||||
|
|||||||
@@ -20,19 +20,15 @@ in
|
|||||||
imports = [
|
imports = [
|
||||||
(import ./options.nix args)
|
(import ./options.nix args)
|
||||||
];
|
];
|
||||||
options.programs.dank-material-shell.systemd.target = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
description = "Systemd target to bind to.";
|
|
||||||
default = "graphical-session.target";
|
|
||||||
};
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
systemd.user.services.dms = lib.mkIf cfg.systemd.enable {
|
systemd.user.services.dms = lib.mkIf cfg.systemd.enable {
|
||||||
description = "DankMaterialShell";
|
description = "DankMaterialShell";
|
||||||
path = lib.mkForce [ ];
|
path = lib.mkForce [ ];
|
||||||
|
|
||||||
partOf = [ cfg.systemd.target ];
|
partOf = [ "graphical-session.target" ];
|
||||||
after = [ cfg.systemd.target ];
|
after = [ "graphical-session.target" ];
|
||||||
wantedBy = [ cfg.systemd.target ];
|
wantedBy = [ "graphical-session.target" ];
|
||||||
restartIfChanged = cfg.systemd.restartIfChanged;
|
restartIfChanged = cfg.systemd.restartIfChanged;
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
|
|||||||
@@ -45,10 +45,6 @@ Singleton {
|
|||||||
Quickshell.execDetached(["cp", strip(from), strip(to)]);
|
Quickshell.execDetached(["cp", strip(from), strip(to)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function isSteamApp(appId: string): bool {
|
|
||||||
return appId && /^steam_app_\d+$/.test(appId);
|
|
||||||
}
|
|
||||||
|
|
||||||
function moddedAppId(appId: string): string {
|
function moddedAppId(appId: string): string {
|
||||||
const subs = SettingsData.appIdSubstitutions || [];
|
const subs = SettingsData.appIdSubstitutions || [];
|
||||||
for (let i = 0; i < subs.length; i++) {
|
for (let i = 0; i < subs.length; i++) {
|
||||||
@@ -64,9 +60,6 @@ Singleton {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const steamMatch = appId.match(/^steam_app_(\d+)$/);
|
|
||||||
if (steamMatch)
|
|
||||||
return `steam_icon_${steamMatch[1]}`;
|
|
||||||
return appId;
|
return appId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -122,21 +122,6 @@ Rectangle {
|
|||||||
contentHeight: audioColumn.height
|
contentHeight: audioColumn.height
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
property int maxPinnedInputs: 3
|
|
||||||
|
|
||||||
function normalizePinList(value) {
|
|
||||||
if (Array.isArray(value))
|
|
||||||
return value.filter(v => v)
|
|
||||||
if (typeof value === "string" && value.length > 0)
|
|
||||||
return [value]
|
|
||||||
return []
|
|
||||||
}
|
|
||||||
|
|
||||||
function getPinnedInputs() {
|
|
||||||
const pins = SettingsData.audioInputDevicePins || {}
|
|
||||||
return normalizePinList(pins["preferredInput"])
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
id: audioColumn
|
id: audioColumn
|
||||||
width: parent.width
|
width: parent.width
|
||||||
@@ -148,20 +133,16 @@ Rectangle {
|
|||||||
const nodes = Pipewire.nodes.values.filter(node => {
|
const nodes = Pipewire.nodes.values.filter(node => {
|
||||||
return node.audio && !node.isSink && !node.isStream;
|
return node.audio && !node.isSink && !node.isStream;
|
||||||
});
|
});
|
||||||
const pinnedList = audioContent.getPinnedInputs();
|
const pins = SettingsData.audioInputDevicePins || {};
|
||||||
|
const pinnedName = pins["preferredInput"];
|
||||||
|
|
||||||
let sorted = [...nodes];
|
let sorted = [...nodes];
|
||||||
sorted.sort((a, b) => {
|
sorted.sort((a, b) => {
|
||||||
// Pinned device first
|
// Pinned device first
|
||||||
const aPinnedIndex = pinnedList.indexOf(a.name)
|
if (a.name === pinnedName && b.name !== pinnedName)
|
||||||
const bPinnedIndex = pinnedList.indexOf(b.name)
|
return -1;
|
||||||
if (aPinnedIndex !== -1 || bPinnedIndex !== -1) {
|
if (b.name === pinnedName && a.name !== pinnedName)
|
||||||
if (aPinnedIndex === -1)
|
return 1;
|
||||||
return 1
|
|
||||||
if (bPinnedIndex === -1)
|
|
||||||
return -1
|
|
||||||
return aPinnedIndex - bPinnedIndex
|
|
||||||
}
|
|
||||||
// Then active device
|
// Then active device
|
||||||
if (a === AudioService.source && b !== AudioService.source)
|
if (a === AudioService.source && b !== AudioService.source)
|
||||||
return -1;
|
return -1;
|
||||||
@@ -243,7 +224,7 @@ Rectangle {
|
|||||||
height: 28
|
height: 28
|
||||||
radius: height / 2
|
radius: height / 2
|
||||||
color: {
|
color: {
|
||||||
const isThisDevicePinned = audioContent.getPinnedInputs().includes(modelData.name);
|
const isThisDevicePinned = (SettingsData.audioInputDevicePins || {})["preferredInput"] === modelData.name;
|
||||||
return isThisDevicePinned ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : Theme.withAlpha(Theme.surfaceText, 0.05);
|
return isThisDevicePinned ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : Theme.withAlpha(Theme.surfaceText, 0.05);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -256,7 +237,7 @@ Rectangle {
|
|||||||
name: "push_pin"
|
name: "push_pin"
|
||||||
size: 16
|
size: 16
|
||||||
color: {
|
color: {
|
||||||
const isThisDevicePinned = audioContent.getPinnedInputs().includes(modelData.name);
|
const isThisDevicePinned = (SettingsData.audioInputDevicePins || {})["preferredInput"] === modelData.name;
|
||||||
return isThisDevicePinned ? Theme.primary : Theme.surfaceText;
|
return isThisDevicePinned ? Theme.primary : Theme.surfaceText;
|
||||||
}
|
}
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
@@ -264,12 +245,12 @@ Rectangle {
|
|||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: {
|
text: {
|
||||||
const isThisDevicePinned = audioContent.getPinnedInputs().includes(modelData.name);
|
const isThisDevicePinned = (SettingsData.audioInputDevicePins || {})["preferredInput"] === modelData.name;
|
||||||
return isThisDevicePinned ? I18n.tr("Pinned") : I18n.tr("Pin");
|
return isThisDevicePinned ? I18n.tr("Pinned") : I18n.tr("Pin");
|
||||||
}
|
}
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: {
|
color: {
|
||||||
const isThisDevicePinned = audioContent.getPinnedInputs().includes(modelData.name);
|
const isThisDevicePinned = (SettingsData.audioInputDevicePins || {})["preferredInput"] === modelData.name;
|
||||||
return isThisDevicePinned ? Theme.primary : Theme.surfaceText;
|
return isThisDevicePinned ? Theme.primary : Theme.surfaceText;
|
||||||
}
|
}
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
@@ -280,24 +261,16 @@ Rectangle {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: {
|
||||||
const pins = JSON.parse(JSON.stringify(SettingsData.audioInputDevicePins || {}))
|
const pins = JSON.parse(JSON.stringify(SettingsData.audioInputDevicePins || {}));
|
||||||
let pinnedList = audioContent.normalizePinList(pins["preferredInput"])
|
const isCurrentlyPinned = pins["preferredInput"] === modelData.name;
|
||||||
const pinIndex = pinnedList.indexOf(modelData.name)
|
|
||||||
|
|
||||||
if (pinIndex !== -1) {
|
if (isCurrentlyPinned) {
|
||||||
pinnedList.splice(pinIndex, 1)
|
delete pins["preferredInput"];
|
||||||
} else {
|
} else {
|
||||||
pinnedList.unshift(modelData.name)
|
pins["preferredInput"] = modelData.name;
|
||||||
if (pinnedList.length > audioContent.maxPinnedInputs)
|
|
||||||
pinnedList = pinnedList.slice(0, audioContent.maxPinnedInputs)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pinnedList.length > 0)
|
SettingsData.set("audioInputDevicePins", pins);
|
||||||
pins["preferredInput"] = pinnedList
|
|
||||||
else
|
|
||||||
delete pins["preferredInput"]
|
|
||||||
|
|
||||||
SettingsData.set("audioInputDevicePins", pins)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -132,21 +132,6 @@ Rectangle {
|
|||||||
contentHeight: audioColumn.height
|
contentHeight: audioColumn.height
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
property int maxPinnedOutputs: 3
|
|
||||||
|
|
||||||
function normalizePinList(value) {
|
|
||||||
if (Array.isArray(value))
|
|
||||||
return value.filter(v => v)
|
|
||||||
if (typeof value === "string" && value.length > 0)
|
|
||||||
return [value]
|
|
||||||
return []
|
|
||||||
}
|
|
||||||
|
|
||||||
function getPinnedOutputs() {
|
|
||||||
const pins = SettingsData.audioOutputDevicePins || {}
|
|
||||||
return normalizePinList(pins["preferredOutput"])
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
id: audioColumn
|
id: audioColumn
|
||||||
width: parent.width
|
width: parent.width
|
||||||
@@ -158,20 +143,16 @@ Rectangle {
|
|||||||
const nodes = Pipewire.nodes.values.filter(node => {
|
const nodes = Pipewire.nodes.values.filter(node => {
|
||||||
return node.audio && node.isSink && !node.isStream;
|
return node.audio && node.isSink && !node.isStream;
|
||||||
});
|
});
|
||||||
const pinnedList = audioContent.getPinnedOutputs();
|
const pins = SettingsData.audioOutputDevicePins || {};
|
||||||
|
const pinnedName = pins["preferredOutput"];
|
||||||
|
|
||||||
let sorted = [...nodes];
|
let sorted = [...nodes];
|
||||||
sorted.sort((a, b) => {
|
sorted.sort((a, b) => {
|
||||||
// Pinned device first
|
// Pinned device first
|
||||||
const aPinnedIndex = pinnedList.indexOf(a.name)
|
if (a.name === pinnedName && b.name !== pinnedName)
|
||||||
const bPinnedIndex = pinnedList.indexOf(b.name)
|
return -1;
|
||||||
if (aPinnedIndex !== -1 || bPinnedIndex !== -1) {
|
if (b.name === pinnedName && a.name !== pinnedName)
|
||||||
if (aPinnedIndex === -1)
|
return 1;
|
||||||
return 1
|
|
||||||
if (bPinnedIndex === -1)
|
|
||||||
return -1
|
|
||||||
return aPinnedIndex - bPinnedIndex
|
|
||||||
}
|
|
||||||
// Then active device
|
// Then active device
|
||||||
if (a === AudioService.sink && b !== AudioService.sink)
|
if (a === AudioService.sink && b !== AudioService.sink)
|
||||||
return -1;
|
return -1;
|
||||||
@@ -255,7 +236,7 @@ Rectangle {
|
|||||||
height: 28
|
height: 28
|
||||||
radius: height / 2
|
radius: height / 2
|
||||||
color: {
|
color: {
|
||||||
const isThisDevicePinned = audioContent.getPinnedOutputs().includes(modelData.name);
|
const isThisDevicePinned = (SettingsData.audioOutputDevicePins || {})["preferredOutput"] === modelData.name;
|
||||||
return isThisDevicePinned ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : Theme.withAlpha(Theme.surfaceText, 0.05);
|
return isThisDevicePinned ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : Theme.withAlpha(Theme.surfaceText, 0.05);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -268,7 +249,7 @@ Rectangle {
|
|||||||
name: "push_pin"
|
name: "push_pin"
|
||||||
size: 16
|
size: 16
|
||||||
color: {
|
color: {
|
||||||
const isThisDevicePinned = audioContent.getPinnedOutputs().includes(modelData.name);
|
const isThisDevicePinned = (SettingsData.audioOutputDevicePins || {})["preferredOutput"] === modelData.name;
|
||||||
return isThisDevicePinned ? Theme.primary : Theme.surfaceText;
|
return isThisDevicePinned ? Theme.primary : Theme.surfaceText;
|
||||||
}
|
}
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
@@ -276,12 +257,12 @@ Rectangle {
|
|||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: {
|
text: {
|
||||||
const isThisDevicePinned = audioContent.getPinnedOutputs().includes(modelData.name);
|
const isThisDevicePinned = (SettingsData.audioOutputDevicePins || {})["preferredOutput"] === modelData.name;
|
||||||
return isThisDevicePinned ? I18n.tr("Pinned") : I18n.tr("Pin");
|
return isThisDevicePinned ? I18n.tr("Pinned") : I18n.tr("Pin");
|
||||||
}
|
}
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: {
|
color: {
|
||||||
const isThisDevicePinned = audioContent.getPinnedOutputs().includes(modelData.name);
|
const isThisDevicePinned = (SettingsData.audioOutputDevicePins || {})["preferredOutput"] === modelData.name;
|
||||||
return isThisDevicePinned ? Theme.primary : Theme.surfaceText;
|
return isThisDevicePinned ? Theme.primary : Theme.surfaceText;
|
||||||
}
|
}
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
@@ -292,24 +273,16 @@ Rectangle {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: {
|
||||||
const pins = JSON.parse(JSON.stringify(SettingsData.audioOutputDevicePins || {}))
|
const pins = JSON.parse(JSON.stringify(SettingsData.audioOutputDevicePins || {}));
|
||||||
let pinnedList = audioContent.normalizePinList(pins["preferredOutput"])
|
const isCurrentlyPinned = pins["preferredOutput"] === modelData.name;
|
||||||
const pinIndex = pinnedList.indexOf(modelData.name)
|
|
||||||
|
|
||||||
if (pinIndex !== -1) {
|
if (isCurrentlyPinned) {
|
||||||
pinnedList.splice(pinIndex, 1)
|
delete pins["preferredOutput"];
|
||||||
} else {
|
} else {
|
||||||
pinnedList.unshift(modelData.name)
|
pins["preferredOutput"] = modelData.name;
|
||||||
if (pinnedList.length > audioContent.maxPinnedOutputs)
|
|
||||||
pinnedList = pinnedList.slice(0, audioContent.maxPinnedOutputs)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pinnedList.length > 0)
|
SettingsData.set("audioOutputDevicePins", pins);
|
||||||
pins["preferredOutput"] = pinnedList
|
|
||||||
else
|
|
||||||
delete pins["preferredOutput"]
|
|
||||||
|
|
||||||
SettingsData.set("audioOutputDevicePins", pins)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,21 +150,6 @@ Rectangle {
|
|||||||
contentHeight: bluetoothColumn.height
|
contentHeight: bluetoothColumn.height
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
property int maxPinnedDevices: 3
|
|
||||||
|
|
||||||
function normalizePinList(value) {
|
|
||||||
if (Array.isArray(value))
|
|
||||||
return value.filter(v => v)
|
|
||||||
if (typeof value === "string" && value.length > 0)
|
|
||||||
return [value]
|
|
||||||
return []
|
|
||||||
}
|
|
||||||
|
|
||||||
function getPinnedDevices() {
|
|
||||||
const pins = SettingsData.bluetoothDevicePins || {}
|
|
||||||
return normalizePinList(pins["preferredDevice"])
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
id: bluetoothColumn
|
id: bluetoothColumn
|
||||||
width: parent.width
|
width: parent.width
|
||||||
@@ -177,18 +162,14 @@ Rectangle {
|
|||||||
if (!BluetoothService.adapter || !BluetoothService.adapter.devices)
|
if (!BluetoothService.adapter || !BluetoothService.adapter.devices)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
const pinnedList = bluetoothContent.getPinnedDevices()
|
const pins = SettingsData.bluetoothDevicePins || {}
|
||||||
|
const pinnedAddr = pins["preferredDevice"]
|
||||||
|
|
||||||
let devices = [...BluetoothService.adapter.devices.values.filter(dev => dev && (dev.paired || dev.trusted))]
|
let devices = [...BluetoothService.adapter.devices.values.filter(dev => dev && (dev.paired || dev.trusted))]
|
||||||
devices.sort((a, b) => {
|
devices.sort((a, b) => {
|
||||||
// Pinned device first
|
// Pinned device first
|
||||||
const aPinnedIndex = pinnedList.indexOf(a.address)
|
if (a.address === pinnedAddr && b.address !== pinnedAddr) return -1
|
||||||
const bPinnedIndex = pinnedList.indexOf(b.address)
|
if (b.address === pinnedAddr && a.address !== pinnedAddr) return 1
|
||||||
if (aPinnedIndex !== -1 || bPinnedIndex !== -1) {
|
|
||||||
if (aPinnedIndex === -1) return 1
|
|
||||||
if (bPinnedIndex === -1) return -1
|
|
||||||
return aPinnedIndex - bPinnedIndex
|
|
||||||
}
|
|
||||||
// Then connected devices
|
// Then connected devices
|
||||||
if (a.connected && !b.connected) return -1
|
if (a.connected && !b.connected) return -1
|
||||||
if (!a.connected && b.connected) return 1
|
if (!a.connected && b.connected) return 1
|
||||||
@@ -321,7 +302,7 @@ Rectangle {
|
|||||||
height: 28
|
height: 28
|
||||||
radius: height / 2
|
radius: height / 2
|
||||||
color: {
|
color: {
|
||||||
const isThisDevicePinned = bluetoothContent.getPinnedDevices().includes(modelData.address)
|
const isThisDevicePinned = (SettingsData.bluetoothDevicePins || {})["preferredDevice"] === modelData.address
|
||||||
return isThisDevicePinned ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : Theme.withAlpha(Theme.surfaceText, 0.05)
|
return isThisDevicePinned ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : Theme.withAlpha(Theme.surfaceText, 0.05)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -334,7 +315,7 @@ Rectangle {
|
|||||||
name: "push_pin"
|
name: "push_pin"
|
||||||
size: 16
|
size: 16
|
||||||
color: {
|
color: {
|
||||||
const isThisDevicePinned = bluetoothContent.getPinnedDevices().includes(modelData.address)
|
const isThisDevicePinned = (SettingsData.bluetoothDevicePins || {})["preferredDevice"] === modelData.address
|
||||||
return isThisDevicePinned ? Theme.primary : Theme.surfaceText
|
return isThisDevicePinned ? Theme.primary : Theme.surfaceText
|
||||||
}
|
}
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
@@ -342,12 +323,12 @@ Rectangle {
|
|||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: {
|
text: {
|
||||||
const isThisDevicePinned = bluetoothContent.getPinnedDevices().includes(modelData.address)
|
const isThisDevicePinned = (SettingsData.bluetoothDevicePins || {})["preferredDevice"] === modelData.address
|
||||||
return isThisDevicePinned ? I18n.tr("Pinned") : I18n.tr("Pin")
|
return isThisDevicePinned ? I18n.tr("Pinned") : I18n.tr("Pin")
|
||||||
}
|
}
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: {
|
color: {
|
||||||
const isThisDevicePinned = bluetoothContent.getPinnedDevices().includes(modelData.address)
|
const isThisDevicePinned = (SettingsData.bluetoothDevicePins || {})["preferredDevice"] === modelData.address
|
||||||
return isThisDevicePinned ? Theme.primary : Theme.surfaceText
|
return isThisDevicePinned ? Theme.primary : Theme.surfaceText
|
||||||
}
|
}
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
@@ -359,21 +340,13 @@ Rectangle {
|
|||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: {
|
||||||
const pins = JSON.parse(JSON.stringify(SettingsData.bluetoothDevicePins || {}))
|
const pins = JSON.parse(JSON.stringify(SettingsData.bluetoothDevicePins || {}))
|
||||||
let pinnedList = bluetoothContent.normalizePinList(pins["preferredDevice"])
|
const isCurrentlyPinned = pins["preferredDevice"] === modelData.address
|
||||||
const pinIndex = pinnedList.indexOf(modelData.address)
|
|
||||||
|
|
||||||
if (pinIndex !== -1) {
|
if (isCurrentlyPinned) {
|
||||||
pinnedList.splice(pinIndex, 1)
|
|
||||||
} else {
|
|
||||||
pinnedList.unshift(modelData.address)
|
|
||||||
if (pinnedList.length > bluetoothContent.maxPinnedDevices)
|
|
||||||
pinnedList = pinnedList.slice(0, bluetoothContent.maxPinnedDevices)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pinnedList.length > 0)
|
|
||||||
pins["preferredDevice"] = pinnedList
|
|
||||||
else
|
|
||||||
delete pins["preferredDevice"]
|
delete pins["preferredDevice"]
|
||||||
|
} else {
|
||||||
|
pins["preferredDevice"] = modelData.address
|
||||||
|
}
|
||||||
|
|
||||||
SettingsData.set("bluetoothDevicePins", pins)
|
SettingsData.set("bluetoothDevicePins", pins)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -463,39 +463,20 @@ Rectangle {
|
|||||||
contentHeight: wifiColumn.height
|
contentHeight: wifiColumn.height
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
property int maxPinnedNetworks: 3
|
|
||||||
|
|
||||||
function normalizePinList(value) {
|
|
||||||
if (Array.isArray(value))
|
|
||||||
return value.filter(v => v)
|
|
||||||
if (typeof value === "string" && value.length > 0)
|
|
||||||
return [value]
|
|
||||||
return []
|
|
||||||
}
|
|
||||||
|
|
||||||
function getPinnedNetworks() {
|
|
||||||
const pins = SettingsData.wifiNetworkPins || {}
|
|
||||||
return normalizePinList(pins["preferredWifi"])
|
|
||||||
}
|
|
||||||
|
|
||||||
property var frozenNetworks: []
|
property var frozenNetworks: []
|
||||||
property bool menuOpen: false
|
property bool menuOpen: false
|
||||||
property var sortedNetworks: {
|
property var sortedNetworks: {
|
||||||
const ssid = NetworkService.currentWifiSSID;
|
const ssid = NetworkService.currentWifiSSID;
|
||||||
const networks = NetworkService.wifiNetworks;
|
const networks = NetworkService.wifiNetworks;
|
||||||
const pinnedList = getPinnedNetworks()
|
const pins = SettingsData.wifiNetworkPins || {};
|
||||||
|
const pinnedSSID = pins["preferredWifi"];
|
||||||
|
|
||||||
let sorted = [...networks];
|
let sorted = [...networks];
|
||||||
sorted.sort((a, b) => {
|
sorted.sort((a, b) => {
|
||||||
const aPinnedIndex = pinnedList.indexOf(a.ssid)
|
if (a.ssid === pinnedSSID && b.ssid !== pinnedSSID)
|
||||||
const bPinnedIndex = pinnedList.indexOf(b.ssid)
|
return -1;
|
||||||
if (aPinnedIndex !== -1 || bPinnedIndex !== -1) {
|
if (b.ssid === pinnedSSID && a.ssid !== pinnedSSID)
|
||||||
if (aPinnedIndex === -1)
|
return 1;
|
||||||
return 1
|
|
||||||
if (bPinnedIndex === -1)
|
|
||||||
return -1
|
|
||||||
return aPinnedIndex - bPinnedIndex
|
|
||||||
}
|
|
||||||
if (a.ssid === ssid)
|
if (a.ssid === ssid)
|
||||||
return -1;
|
return -1;
|
||||||
if (b.ssid === ssid)
|
if (b.ssid === ssid)
|
||||||
@@ -644,7 +625,7 @@ Rectangle {
|
|||||||
height: 28
|
height: 28
|
||||||
radius: height / 2
|
radius: height / 2
|
||||||
color: {
|
color: {
|
||||||
const isThisNetworkPinned = wifiContent.getPinnedNetworks().includes(modelData.ssid);
|
const isThisNetworkPinned = (SettingsData.wifiNetworkPins || {})["preferredWifi"] === modelData.ssid;
|
||||||
return isThisNetworkPinned ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : Theme.withAlpha(Theme.surfaceText, 0.05);
|
return isThisNetworkPinned ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : Theme.withAlpha(Theme.surfaceText, 0.05);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -657,7 +638,7 @@ Rectangle {
|
|||||||
name: "push_pin"
|
name: "push_pin"
|
||||||
size: 16
|
size: 16
|
||||||
color: {
|
color: {
|
||||||
const isThisNetworkPinned = wifiContent.getPinnedNetworks().includes(modelData.ssid);
|
const isThisNetworkPinned = (SettingsData.wifiNetworkPins || {})["preferredWifi"] === modelData.ssid;
|
||||||
return isThisNetworkPinned ? Theme.primary : Theme.surfaceText;
|
return isThisNetworkPinned ? Theme.primary : Theme.surfaceText;
|
||||||
}
|
}
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
@@ -665,12 +646,12 @@ Rectangle {
|
|||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: {
|
text: {
|
||||||
const isThisNetworkPinned = wifiContent.getPinnedNetworks().includes(modelData.ssid);
|
const isThisNetworkPinned = (SettingsData.wifiNetworkPins || {})["preferredWifi"] === modelData.ssid;
|
||||||
return isThisNetworkPinned ? I18n.tr("Pinned") : I18n.tr("Pin");
|
return isThisNetworkPinned ? I18n.tr("Pinned") : I18n.tr("Pin");
|
||||||
}
|
}
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: {
|
color: {
|
||||||
const isThisNetworkPinned = wifiContent.getPinnedNetworks().includes(modelData.ssid);
|
const isThisNetworkPinned = (SettingsData.wifiNetworkPins || {})["preferredWifi"] === modelData.ssid;
|
||||||
return isThisNetworkPinned ? Theme.primary : Theme.surfaceText;
|
return isThisNetworkPinned ? Theme.primary : Theme.surfaceText;
|
||||||
}
|
}
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
@@ -681,24 +662,16 @@ Rectangle {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: {
|
||||||
const pins = JSON.parse(JSON.stringify(SettingsData.wifiNetworkPins || {}))
|
const pins = JSON.parse(JSON.stringify(SettingsData.wifiNetworkPins || {}));
|
||||||
let pinnedList = wifiContent.normalizePinList(pins["preferredWifi"])
|
const isCurrentlyPinned = pins["preferredWifi"] === modelData.ssid;
|
||||||
const pinIndex = pinnedList.indexOf(modelData.ssid)
|
|
||||||
|
|
||||||
if (pinIndex !== -1) {
|
if (isCurrentlyPinned) {
|
||||||
pinnedList.splice(pinIndex, 1)
|
delete pins["preferredWifi"];
|
||||||
} else {
|
} else {
|
||||||
pinnedList.unshift(modelData.ssid)
|
pins["preferredWifi"] = modelData.ssid;
|
||||||
if (pinnedList.length > wifiContent.maxPinnedNetworks)
|
|
||||||
pinnedList = pinnedList.slice(0, wifiContent.maxPinnedNetworks)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pinnedList.length > 0)
|
SettingsData.set("wifiNetworkPins", pins);
|
||||||
pins["preferredWifi"] = pinnedList
|
|
||||||
else
|
|
||||||
delete pins["preferredWifi"]
|
|
||||||
|
|
||||||
SettingsData.set("wifiNetworkPins", pins)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ BasePill {
|
|||||||
property real micAccumulator: 0
|
property real micAccumulator: 0
|
||||||
property real volumeAccumulator: 0
|
property real volumeAccumulator: 0
|
||||||
property real brightnessAccumulator: 0
|
property real brightnessAccumulator: 0
|
||||||
readonly property real vIconSize: Theme.barIconSize(root.barThickness, -4)
|
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
active: root.showPrinterIcon
|
active: root.showPrinterIcon
|
||||||
@@ -215,25 +214,7 @@ BasePill {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function hasNoVisibleIcons() {
|
function hasNoVisibleIcons() {
|
||||||
if (root.showScreenSharingIcon && NiriService.hasCasts)
|
return !root.showNetworkIcon && !root.showBluetoothIcon && !root.showAudioIcon && !root.showVpnIcon && !root.showBrightnessIcon && !root.showMicIcon && !root.showBatteryIcon && !root.showPrinterIcon && !root.showScreenSharingIcon;
|
||||||
return false;
|
|
||||||
if (root.showNetworkIcon && NetworkService.networkAvailable)
|
|
||||||
return false;
|
|
||||||
if (root.showVpnIcon && NetworkService.vpnAvailable && NetworkService.vpnConnected)
|
|
||||||
return false;
|
|
||||||
if (root.showBluetoothIcon && BluetoothService.available && BluetoothService.enabled)
|
|
||||||
return false;
|
|
||||||
if (root.showAudioIcon)
|
|
||||||
return false;
|
|
||||||
if (root.showMicIcon)
|
|
||||||
return false;
|
|
||||||
if (root.showBrightnessIcon && DisplayService.brightnessAvailable && root.hasPinnedBrightnessDevice())
|
|
||||||
return false;
|
|
||||||
if (root.showBatteryIcon && BatteryService.batteryAvailable)
|
|
||||||
return false;
|
|
||||||
if (root.showPrinterIcon && CupsService.cupsAvailable && root.hasPrintJobs())
|
|
||||||
return false;
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
content: Component {
|
content: Component {
|
||||||
@@ -247,75 +228,53 @@ BasePill {
|
|||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
spacing: Theme.spacingXS
|
spacing: Theme.spacingXS
|
||||||
|
|
||||||
Item {
|
DankIcon {
|
||||||
width: root.vIconSize
|
name: "screen_record"
|
||||||
height: root.vIconSize
|
size: Theme.barIconSize(root.barThickness, -4)
|
||||||
|
color: NiriService.hasActiveCast ? Theme.primary : Theme.surfaceText
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
visible: root.showScreenSharingIcon && NiriService.hasCasts
|
visible: root.showScreenSharingIcon && NiriService.hasCasts
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "screen_record"
|
|
||||||
size: root.vIconSize
|
|
||||||
color: NiriService.hasActiveCast ? Theme.primary : Theme.surfaceText
|
|
||||||
anchors.centerIn: parent
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
DankIcon {
|
||||||
width: root.vIconSize
|
name: root.getNetworkIconName()
|
||||||
height: root.vIconSize
|
size: Theme.barIconSize(root.barThickness, -4)
|
||||||
|
color: root.getNetworkIconColor()
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
visible: root.showNetworkIcon && NetworkService.networkAvailable
|
visible: root.showNetworkIcon && NetworkService.networkAvailable
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: root.getNetworkIconName()
|
|
||||||
size: root.vIconSize
|
|
||||||
color: root.getNetworkIconColor()
|
|
||||||
anchors.centerIn: parent
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
DankIcon {
|
||||||
width: root.vIconSize
|
name: "vpn_lock"
|
||||||
height: root.vIconSize
|
size: Theme.barIconSize(root.barThickness, -4)
|
||||||
|
color: NetworkService.vpnConnected ? Theme.primary : Theme.surfaceText
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
visible: root.showVpnIcon && NetworkService.vpnAvailable && NetworkService.vpnConnected
|
visible: root.showVpnIcon && NetworkService.vpnAvailable && NetworkService.vpnConnected
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "vpn_lock"
|
|
||||||
size: root.vIconSize
|
|
||||||
color: NetworkService.vpnConnected ? Theme.primary : Theme.surfaceText
|
|
||||||
anchors.centerIn: parent
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
DankIcon {
|
||||||
width: root.vIconSize
|
name: "bluetooth"
|
||||||
height: root.vIconSize
|
size: Theme.barIconSize(root.barThickness, -4)
|
||||||
|
color: BluetoothService.connected ? Theme.primary : Theme.surfaceText
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
visible: root.showBluetoothIcon && BluetoothService.available && BluetoothService.enabled
|
visible: root.showBluetoothIcon && BluetoothService.available && BluetoothService.enabled
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "bluetooth"
|
|
||||||
size: root.vIconSize
|
|
||||||
color: BluetoothService.connected ? Theme.primary : Theme.surfaceText
|
|
||||||
anchors.centerIn: parent
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Rectangle {
|
||||||
width: root.vIconSize
|
width: audioIconV.implicitWidth + 4
|
||||||
height: root.vIconSize + (root.showAudioPercent ? audioPercentV.implicitHeight + 2 : 0)
|
height: audioIconV.implicitHeight + (root.showAudioPercent ? audioPercentV.implicitHeight : 0) + 4
|
||||||
|
color: "transparent"
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
visible: root.showAudioIcon
|
visible: root.showAudioIcon
|
||||||
|
|
||||||
DankIcon {
|
DankIcon {
|
||||||
id: audioIconV
|
id: audioIconV
|
||||||
name: root.getVolumeIconName()
|
name: root.getVolumeIconName()
|
||||||
size: root.vIconSize
|
size: Theme.barIconSize(root.barThickness, -4)
|
||||||
color: Theme.widgetIconColor
|
color: Theme.widgetIconColor
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
|
anchors.topMargin: 2
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
@@ -342,19 +301,21 @@ BasePill {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Rectangle {
|
||||||
width: root.vIconSize
|
width: micIconV.implicitWidth + 4
|
||||||
height: root.vIconSize + (root.showMicPercent ? micPercentV.implicitHeight + 2 : 0)
|
height: micIconV.implicitHeight + (root.showAudioPercent ? micPercentV.implicitHeight : 0) + 4
|
||||||
|
color: "transparent"
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
visible: root.showMicIcon
|
visible: root.showMicIcon
|
||||||
|
|
||||||
DankIcon {
|
DankIcon {
|
||||||
id: micIconV
|
id: micIconV
|
||||||
name: root.getMicIconName()
|
name: root.getMicIconName()
|
||||||
size: root.vIconSize
|
size: Theme.barIconSize(root.barThickness, -4)
|
||||||
color: root.getMicIconColor()
|
color: root.getMicIconColor()
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
|
anchors.topMargin: 2
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
@@ -381,19 +342,21 @@ BasePill {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Rectangle {
|
||||||
width: root.vIconSize
|
width: brightnessIconV.implicitWidth + 4
|
||||||
height: root.vIconSize + (root.showBrightnessPercent ? brightnessPercentV.implicitHeight + 2 : 0)
|
height: brightnessIconV.implicitHeight + (root.showBrightnessPercent ? brightnessPercentV.implicitHeight : 0) + 4
|
||||||
|
color: "transparent"
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
visible: root.showBrightnessIcon && DisplayService.brightnessAvailable && root.hasPinnedBrightnessDevice()
|
visible: root.showBrightnessIcon && DisplayService.brightnessAvailable && root.hasPinnedBrightnessDevice()
|
||||||
|
|
||||||
DankIcon {
|
DankIcon {
|
||||||
id: brightnessIconV
|
id: brightnessIconV
|
||||||
name: root.getBrightnessIconName()
|
name: root.getBrightnessIconName()
|
||||||
size: root.vIconSize
|
size: Theme.barIconSize(root.barThickness, -4)
|
||||||
color: Theme.widgetIconColor
|
color: Theme.widgetIconColor
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
|
anchors.topMargin: 2
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
@@ -417,46 +380,28 @@ BasePill {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
DankIcon {
|
||||||
width: root.vIconSize
|
name: Theme.getBatteryIcon(BatteryService.batteryLevel, BatteryService.isCharging, BatteryService.batteryAvailable)
|
||||||
height: root.vIconSize
|
size: Theme.barIconSize(root.barThickness, -4)
|
||||||
|
color: root.getBatteryIconColor()
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
visible: root.showBatteryIcon && BatteryService.batteryAvailable
|
visible: root.showBatteryIcon && BatteryService.batteryAvailable
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: Theme.getBatteryIcon(BatteryService.batteryLevel, BatteryService.isCharging, BatteryService.batteryAvailable)
|
|
||||||
size: root.vIconSize
|
|
||||||
color: root.getBatteryIconColor()
|
|
||||||
anchors.centerIn: parent
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
DankIcon {
|
||||||
width: root.vIconSize
|
name: "print"
|
||||||
height: root.vIconSize
|
size: Theme.barIconSize(root.barThickness, -4)
|
||||||
|
color: Theme.primary
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
visible: root.showPrinterIcon && CupsService.cupsAvailable && root.hasPrintJobs()
|
visible: root.showPrinterIcon && CupsService.cupsAvailable && root.hasPrintJobs()
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "print"
|
|
||||||
size: root.vIconSize
|
|
||||||
color: Theme.primary
|
|
||||||
anchors.centerIn: parent
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
DankIcon {
|
||||||
width: root.vIconSize
|
name: "settings"
|
||||||
height: root.vIconSize
|
size: Theme.barIconSize(root.barThickness, -4)
|
||||||
|
color: root.isActive ? Theme.primary : Theme.widgetIconColor
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
visible: root.hasNoVisibleIcons()
|
visible: root.hasNoVisibleIcons()
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "settings"
|
|
||||||
size: root.vIconSize
|
|
||||||
color: root.isActive ? Theme.primary : Theme.widgetIconColor
|
|
||||||
anchors.centerIn: parent
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -155,17 +155,9 @@ BasePill {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
size: 18
|
|
||||||
name: "sports_esports"
|
|
||||||
color: Theme.widgetTextColor
|
|
||||||
visible: root.isVerticalOrientation && activeWindow && activeWindow.appId && appIcon.status !== Image.Ready && Paths.isSteamApp(activeWindow.appId)
|
|
||||||
}
|
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
visible: root.isVerticalOrientation && activeWindow && activeWindow.appId && appIcon.status !== Image.Ready && !Paths.isSteamApp(activeWindow.appId)
|
visible: root.isVerticalOrientation && activeWindow && activeWindow.appId && appIcon.status !== Image.Ready
|
||||||
text: {
|
text: {
|
||||||
if (!activeWindow || !activeWindow.appId)
|
if (!activeWindow || !activeWindow.appId)
|
||||||
return "?";
|
return "?";
|
||||||
|
|||||||
@@ -393,19 +393,9 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: (widgetData?.runningAppsCompactMode !== undefined ? widgetData.runningAppsCompactMode : SettingsData.runningAppsCompactMode) ? Math.round((parent.width - Theme.barIconSize(root.barThickness)) / 2) : Theme.spacingXS
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
size: Theme.barIconSize(root.barThickness)
|
|
||||||
name: "sports_esports"
|
|
||||||
color: Theme.widgetTextColor
|
|
||||||
visible: !iconImg.visible && Paths.isSteamApp(appId)
|
|
||||||
}
|
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
visible: !iconImg.visible && !Paths.isSteamApp(appId)
|
visible: !iconImg.visible
|
||||||
text: {
|
text: {
|
||||||
root._desktopEntriesUpdateTrigger;
|
root._desktopEntriesUpdateTrigger;
|
||||||
if (!appId)
|
if (!appId)
|
||||||
@@ -638,19 +628,9 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: (widgetData?.runningAppsCompactMode !== undefined ? widgetData.runningAppsCompactMode : SettingsData.runningAppsCompactMode) ? Math.round((parent.width - Theme.barIconSize(root.barThickness)) / 2) : Theme.spacingXS
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
size: Theme.barIconSize(root.barThickness)
|
|
||||||
name: "sports_esports"
|
|
||||||
color: Theme.widgetTextColor
|
|
||||||
visible: !iconImg.visible && Paths.isSteamApp(appId)
|
|
||||||
}
|
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
visible: !iconImg.visible && !Paths.isSteamApp(appId)
|
visible: !iconImg.visible
|
||||||
text: {
|
text: {
|
||||||
root._desktopEntriesUpdateTrigger;
|
root._desktopEntriesUpdateTrigger;
|
||||||
if (!appId)
|
if (!appId)
|
||||||
|
|||||||
@@ -265,7 +265,6 @@ Item {
|
|||||||
|
|
||||||
if (!byApp[key]) {
|
if (!byApp[key]) {
|
||||||
const isQuickshell = keyBase === "org.quickshell";
|
const isQuickshell = keyBase === "org.quickshell";
|
||||||
const isSteamApp = Paths.isSteamApp(keyBase);
|
|
||||||
const moddedId = Paths.moddedAppId(keyBase);
|
const moddedId = Paths.moddedAppId(keyBase);
|
||||||
const desktopEntry = DesktopEntries.heuristicLookup(moddedId);
|
const desktopEntry = DesktopEntries.heuristicLookup(moddedId);
|
||||||
const icon = Paths.getAppIcon(keyBase, desktopEntry);
|
const icon = Paths.getAppIcon(keyBase, desktopEntry);
|
||||||
@@ -273,7 +272,6 @@ Item {
|
|||||||
"type": "icon",
|
"type": "icon",
|
||||||
"icon": icon,
|
"icon": icon,
|
||||||
"isQuickshell": isQuickshell,
|
"isQuickshell": isQuickshell,
|
||||||
"isSteamApp": isSteamApp,
|
|
||||||
"active": !!((w.activated || w.is_focused) || (CompositorService.isNiri && w.is_focused)),
|
"active": !!((w.activated || w.is_focused) || (CompositorService.isNiri && w.is_focused)),
|
||||||
"count": 1,
|
"count": 1,
|
||||||
"windowId": w.address || w.id,
|
"windowId": w.address || w.id,
|
||||||
@@ -1137,7 +1135,7 @@ Item {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
source: modelData.icon
|
source: modelData.icon
|
||||||
opacity: modelData.active ? 1.0 : rowAppMouseArea.containsMouse ? 0.8 : 0.6
|
opacity: modelData.active ? 1.0 : rowAppMouseArea.containsMouse ? 0.8 : 0.6
|
||||||
visible: !modelData.isQuickshell && !modelData.isSteamApp
|
visible: !modelData.isQuickshell
|
||||||
}
|
}
|
||||||
|
|
||||||
IconImage {
|
IconImage {
|
||||||
@@ -1153,22 +1151,6 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IconImage {
|
|
||||||
anchors.fill: parent
|
|
||||||
source: modelData.icon
|
|
||||||
opacity: modelData.active ? 1.0 : rowAppMouseArea.containsMouse ? 0.8 : 0.6
|
|
||||||
visible: modelData.isSteamApp && modelData.icon
|
|
||||||
}
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
size: root.appIconSize
|
|
||||||
name: "sports_esports"
|
|
||||||
color: Theme.widgetTextColor
|
|
||||||
opacity: modelData.active ? 1.0 : rowAppMouseArea.containsMouse ? 0.8 : 0.6
|
|
||||||
visible: modelData.isSteamApp && !modelData.icon
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: rowAppMouseArea
|
id: rowAppMouseArea
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
@@ -1247,7 +1229,7 @@ Item {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
source: modelData.icon
|
source: modelData.icon
|
||||||
opacity: modelData.active ? 1.0 : colAppMouseArea.containsMouse ? 0.8 : 0.6
|
opacity: modelData.active ? 1.0 : colAppMouseArea.containsMouse ? 0.8 : 0.6
|
||||||
visible: !modelData.isQuickshell && !modelData.isSteamApp
|
visible: !modelData.isQuickshell
|
||||||
}
|
}
|
||||||
|
|
||||||
IconImage {
|
IconImage {
|
||||||
@@ -1263,22 +1245,6 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IconImage {
|
|
||||||
anchors.fill: parent
|
|
||||||
source: modelData.icon
|
|
||||||
opacity: modelData.active ? 1.0 : colAppMouseArea.containsMouse ? 0.8 : 0.6
|
|
||||||
visible: modelData.isSteamApp && modelData.icon
|
|
||||||
}
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
size: root.appIconSize
|
|
||||||
name: "sports_esports"
|
|
||||||
color: Theme.widgetTextColor
|
|
||||||
opacity: modelData.active ? 1.0 : colAppMouseArea.containsMouse ? 0.8 : 0.6
|
|
||||||
visible: modelData.isSteamApp && !modelData.icon
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: colAppMouseArea
|
id: colAppMouseArea
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|||||||
@@ -403,7 +403,7 @@ Item {
|
|||||||
width: actualIconSize
|
width: actualIconSize
|
||||||
height: actualIconSize
|
height: actualIconSize
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
visible: iconImg.status !== Image.Ready && appData && appData.appId && !Paths.isSteamApp(appData.appId)
|
visible: iconImg.status !== Image.Ready
|
||||||
color: Theme.surfaceLight
|
color: Theme.surfaceLight
|
||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
border.width: 1
|
border.width: 1
|
||||||
@@ -425,14 +425,6 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
size: actualIconSize
|
|
||||||
name: "sports_esports"
|
|
||||||
color: Theme.surfaceText
|
|
||||||
visible: iconImg.status !== Image.Ready && appData && appData.appId && Paths.isSteamApp(appData.appId)
|
|
||||||
}
|
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
anchors.horizontalCenter: SettingsData.dockPosition === SettingsData.Position.Left || SettingsData.dockPosition === SettingsData.Position.Right ? undefined : parent.horizontalCenter
|
anchors.horizontalCenter: SettingsData.dockPosition === SettingsData.Position.Left || SettingsData.dockPosition === SettingsData.Position.Right ? undefined : parent.horizontalCenter
|
||||||
anchors.verticalCenter: SettingsData.dockPosition === SettingsData.Position.Left || SettingsData.dockPosition === SettingsData.Position.Right ? parent.verticalCenter : undefined
|
anchors.verticalCenter: SettingsData.dockPosition === SettingsData.Position.Left || SettingsData.dockPosition === SettingsData.Position.Right ? parent.verticalCenter : undefined
|
||||||
|
|||||||
@@ -262,7 +262,9 @@ DankOSD {
|
|||||||
target: AudioService.sink && AudioService.sink.audio ? AudioService.sink.audio : null
|
target: AudioService.sink && AudioService.sink.audio ? AudioService.sink.audio : null
|
||||||
|
|
||||||
function onVolumeChanged() {
|
function onVolumeChanged() {
|
||||||
vertSlider.value = Math.min(100, Math.round(AudioService.sink.audio.volume * 100));
|
if (!vertSlider.dragging) {
|
||||||
|
vertSlider.value = Math.min(100, Math.round(AudioService.sink.audio.volume * 100));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -177,11 +177,10 @@ Item {
|
|||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: {
|
text: {
|
||||||
if (!SystemUpdateService.shellVersion && !DMSService.cliVersion)
|
if (!SystemUpdateService.shellVersion)
|
||||||
return "dms";
|
return "dms";
|
||||||
|
|
||||||
let version = SystemUpdateService.shellVersion || "";
|
let version = SystemUpdateService.shellVersion;
|
||||||
let cliVersion = DMSService.cliVersion || "";
|
|
||||||
|
|
||||||
// Debian/Ubuntu/OpenSUSE git format: 1.0.3+git2264.c5c5ce84
|
// Debian/Ubuntu/OpenSUSE git format: 1.0.3+git2264.c5c5ce84
|
||||||
let match = version.match(/^([\d.]+)\+git(\d+)\./);
|
let match = version.match(/^([\d.]+)\+git(\d+)\./);
|
||||||
@@ -192,25 +191,7 @@ Item {
|
|||||||
// Fedora COPR git format: 0.0.git.2267.d430cae9
|
// Fedora COPR git format: 0.0.git.2267.d430cae9
|
||||||
match = version.match(/^[\d.]+\.git\.(\d+)\./);
|
match = version.match(/^[\d.]+\.git\.(\d+)\./);
|
||||||
if (match) {
|
if (match) {
|
||||||
function extractBaseVersion(value) {
|
return `dms (git) v1.0.3-${match[1]}`;
|
||||||
if (!value)
|
|
||||||
return "";
|
|
||||||
let baseMatch = value.match(/(\d+\.\d+\.\d+)/);
|
|
||||||
if (baseMatch)
|
|
||||||
return baseMatch[1];
|
|
||||||
baseMatch = value.match(/(\d+\.\d+)/);
|
|
||||||
if (baseMatch)
|
|
||||||
return baseMatch[1];
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
let baseVersion = extractBaseVersion(cliVersion);
|
|
||||||
if (!baseVersion)
|
|
||||||
baseVersion = extractBaseVersion(SystemUpdateService.semverVersion);
|
|
||||||
if (baseVersion) {
|
|
||||||
return `dms (git) v${baseVersion}-${match[1]}`;
|
|
||||||
}
|
|
||||||
return `dms (git) v${match[1]}`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stable release format: 1.0.3
|
// Stable release format: 1.0.3
|
||||||
@@ -219,18 +200,6 @@ Item {
|
|||||||
return `dms v${match[1]}`;
|
return `dms v${match[1]}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!version && cliVersion) {
|
|
||||||
match = cliVersion.match(/^([\d.]+)\+git(\d+)\./);
|
|
||||||
if (match) {
|
|
||||||
return `dms (git) v${match[1]}-${match[2]}`;
|
|
||||||
}
|
|
||||||
match = cliVersion.match(/^([\d.]+)$/);
|
|
||||||
if (match) {
|
|
||||||
return `dms v${match[1]}`;
|
|
||||||
}
|
|
||||||
return `dms ${cliVersion}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
return `dms ${version}`;
|
return `dms ${version}`;
|
||||||
}
|
}
|
||||||
font.pixelSize: Theme.fontSizeXLarge
|
font.pixelSize: Theme.fontSizeXLarge
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ Item {
|
|||||||
property string expandedVpnUuid: ""
|
property string expandedVpnUuid: ""
|
||||||
property string expandedWifiSsid: ""
|
property string expandedWifiSsid: ""
|
||||||
property string expandedEthDevice: ""
|
property string expandedEthDevice: ""
|
||||||
property int maxPinnedWifiNetworks: 3
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
NetworkService.addRef();
|
NetworkService.addRef();
|
||||||
@@ -31,40 +30,6 @@ Item {
|
|||||||
vpnFileBrowserLoader.item.open();
|
vpnFileBrowserLoader.item.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
function normalizePinList(value) {
|
|
||||||
if (Array.isArray(value))
|
|
||||||
return value.filter(v => v)
|
|
||||||
if (typeof value === "string" && value.length > 0)
|
|
||||||
return [value]
|
|
||||||
return []
|
|
||||||
}
|
|
||||||
|
|
||||||
function getPinnedWifiNetworks() {
|
|
||||||
const pins = SettingsData.wifiNetworkPins || {}
|
|
||||||
return normalizePinList(pins["preferredWifi"])
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleWifiPin(ssid) {
|
|
||||||
const pins = JSON.parse(JSON.stringify(SettingsData.wifiNetworkPins || {}))
|
|
||||||
let pinnedList = normalizePinList(pins["preferredWifi"])
|
|
||||||
const pinIndex = pinnedList.indexOf(ssid)
|
|
||||||
|
|
||||||
if (pinIndex !== -1) {
|
|
||||||
pinnedList.splice(pinIndex, 1)
|
|
||||||
} else {
|
|
||||||
pinnedList.unshift(ssid)
|
|
||||||
if (pinnedList.length > maxPinnedWifiNetworks)
|
|
||||||
pinnedList = pinnedList.slice(0, maxPinnedWifiNetworks)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pinnedList.length > 0)
|
|
||||||
pins["preferredWifi"] = pinnedList
|
|
||||||
else
|
|
||||||
delete pins["preferredWifi"]
|
|
||||||
|
|
||||||
SettingsData.set("wifiNetworkPins", pins)
|
|
||||||
}
|
|
||||||
|
|
||||||
LazyLoader {
|
LazyLoader {
|
||||||
id: vpnFileBrowserLoader
|
id: vpnFileBrowserLoader
|
||||||
active: false
|
active: false
|
||||||
@@ -1060,19 +1025,15 @@ Item {
|
|||||||
model: {
|
model: {
|
||||||
const ssid = NetworkService.currentWifiSSID;
|
const ssid = NetworkService.currentWifiSSID;
|
||||||
const networks = NetworkService.wifiNetworks || [];
|
const networks = NetworkService.wifiNetworks || [];
|
||||||
const pinnedList = networkTab.getPinnedWifiNetworks();
|
const pins = SettingsData.wifiNetworkPins || {};
|
||||||
|
const pinnedSSID = pins["preferredWifi"];
|
||||||
|
|
||||||
let sorted = [...networks];
|
let sorted = [...networks];
|
||||||
sorted.sort((a, b) => {
|
sorted.sort((a, b) => {
|
||||||
const aPinnedIndex = pinnedList.indexOf(a.ssid)
|
if (a.ssid === pinnedSSID && b.ssid !== pinnedSSID)
|
||||||
const bPinnedIndex = pinnedList.indexOf(b.ssid)
|
return -1;
|
||||||
if (aPinnedIndex !== -1 || bPinnedIndex !== -1) {
|
if (b.ssid === pinnedSSID && a.ssid !== pinnedSSID)
|
||||||
if (aPinnedIndex === -1)
|
return 1;
|
||||||
return 1
|
|
||||||
if (bPinnedIndex === -1)
|
|
||||||
return -1
|
|
||||||
return aPinnedIndex - bPinnedIndex
|
|
||||||
}
|
|
||||||
if (a.ssid === ssid)
|
if (a.ssid === ssid)
|
||||||
return -1;
|
return -1;
|
||||||
if (b.ssid === ssid)
|
if (b.ssid === ssid)
|
||||||
@@ -1088,7 +1049,7 @@ Item {
|
|||||||
required property int index
|
required property int index
|
||||||
|
|
||||||
readonly property bool isConnected: modelData.ssid === NetworkService.currentWifiSSID
|
readonly property bool isConnected: modelData.ssid === NetworkService.currentWifiSSID
|
||||||
readonly property bool isPinned: networkTab.getPinnedWifiNetworks().includes(modelData.ssid)
|
readonly property bool isPinned: (SettingsData.wifiNetworkPins || {})["preferredWifi"] === modelData.ssid
|
||||||
readonly property bool isExpanded: networkTab.expandedWifiSsid === modelData.ssid
|
readonly property bool isExpanded: networkTab.expandedWifiSsid === modelData.ssid
|
||||||
|
|
||||||
width: parent.width
|
width: parent.width
|
||||||
@@ -1263,7 +1224,13 @@ Item {
|
|||||||
buttonSize: 28
|
buttonSize: 28
|
||||||
iconColor: isPinned ? Theme.primary : Theme.surfaceVariantText
|
iconColor: isPinned ? Theme.primary : Theme.surfaceVariantText
|
||||||
onClicked: {
|
onClicked: {
|
||||||
networkTab.toggleWifiPin(modelData.ssid)
|
const pins = JSON.parse(JSON.stringify(SettingsData.wifiNetworkPins || {}));
|
||||||
|
if (isPinned) {
|
||||||
|
delete pins["preferredWifi"];
|
||||||
|
} else {
|
||||||
|
pins["preferredWifi"] = modelData.ssid;
|
||||||
|
}
|
||||||
|
SettingsData.set("wifiNetworkPins", pins);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -270,9 +270,7 @@ FloatingWindow {
|
|||||||
root.updateFilteredPlugins();
|
root.updateFilteredPlugins();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
thirdPartyConfirmLoader.active = true;
|
thirdPartyConfirmModal.visible = true;
|
||||||
if (thirdPartyConfirmLoader.item)
|
|
||||||
thirdPartyConfirmLoader.item.show();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -670,132 +668,119 @@ FloatingWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LazyLoader {
|
FloatingWindow {
|
||||||
id: thirdPartyConfirmLoader
|
id: thirdPartyConfirmModal
|
||||||
active: false
|
|
||||||
|
|
||||||
FloatingWindow {
|
objectName: "thirdPartyConfirm"
|
||||||
id: thirdPartyConfirmModal
|
title: I18n.tr("Third-Party Plugin Warning")
|
||||||
|
implicitWidth: 500
|
||||||
|
implicitHeight: 350
|
||||||
|
color: Theme.surfaceContainer
|
||||||
|
visible: false
|
||||||
|
|
||||||
function show() {
|
FocusScope {
|
||||||
visible = true;
|
anchors.fill: parent
|
||||||
}
|
focus: true
|
||||||
|
|
||||||
function hide() {
|
Keys.onPressed: event => {
|
||||||
visible = false;
|
if (event.key === Qt.Key_Escape) {
|
||||||
}
|
thirdPartyConfirmModal.visible = false;
|
||||||
|
event.accepted = true;
|
||||||
objectName: "thirdPartyConfirm"
|
|
||||||
title: I18n.tr("Third-Party Plugin Warning")
|
|
||||||
implicitWidth: 500
|
|
||||||
implicitHeight: 350
|
|
||||||
color: Theme.surfaceContainer
|
|
||||||
visible: false
|
|
||||||
|
|
||||||
FocusScope {
|
|
||||||
anchors.fill: parent
|
|
||||||
focus: true
|
|
||||||
|
|
||||||
Keys.onPressed: event => {
|
|
||||||
if (event.key === Qt.Key_Escape) {
|
|
||||||
thirdPartyConfirmModal.hide();
|
|
||||||
event.accepted = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: Theme.spacingL
|
anchors.margins: Theme.spacingL
|
||||||
spacing: Theme.spacingL
|
spacing: Theme.spacingL
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
spacing: Theme.spacingM
|
spacing: Theme.spacingM
|
||||||
|
|
||||||
DankIcon {
|
DankIcon {
|
||||||
name: "warning"
|
name: "warning"
|
||||||
size: Theme.iconSize
|
size: Theme.iconSize
|
||||||
color: Theme.warning
|
color: Theme.warning
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: I18n.tr("Third-Party Plugin Warning")
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: parent.width - parent.spacing * 2 - Theme.iconSize - parent.children[1].implicitWidth - closeConfirmBtn.width
|
|
||||||
height: 1
|
|
||||||
}
|
|
||||||
|
|
||||||
DankActionButton {
|
|
||||||
id: closeConfirmBtn
|
|
||||||
iconName: "close"
|
|
||||||
iconSize: Theme.iconSize - 2
|
|
||||||
iconColor: Theme.outline
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
onClicked: thirdPartyConfirmModal.hide()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
width: parent.width
|
text: I18n.tr("Third-Party Plugin Warning")
|
||||||
text: I18n.tr("Third-party plugins are created by the community and are not officially supported by DankMaterialShell.\n\nThese plugins may pose security and privacy risks - install at your own risk.")
|
font.pixelSize: Theme.fontSizeLarge
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
font.weight: Font.Medium
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
wrapMode: Text.WordWrap
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: I18n.tr("• Plugins may contain bugs or security issues")
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: I18n.tr("• Review code before installation when possible")
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: I18n.tr("• Install only from trusted sources")
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceVariantText
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
width: parent.width
|
width: parent.width - parent.spacing * 2 - Theme.iconSize - parent.children[1].implicitWidth - closeConfirmBtn.width
|
||||||
height: parent.height - parent.spacing * 3 - y
|
height: 1
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
DankActionButton {
|
||||||
anchors.right: parent.right
|
id: closeConfirmBtn
|
||||||
spacing: Theme.spacingM
|
iconName: "close"
|
||||||
|
iconSize: Theme.iconSize - 2
|
||||||
|
iconColor: Theme.outline
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
onClicked: thirdPartyConfirmModal.visible = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DankButton {
|
StyledText {
|
||||||
text: I18n.tr("Cancel")
|
width: parent.width
|
||||||
iconName: "close"
|
text: I18n.tr("Third-party plugins are created by the community and are not officially supported by DankMaterialShell.\n\nThese plugins may pose security and privacy risks - install at your own risk.")
|
||||||
onClicked: thirdPartyConfirmModal.hide()
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
}
|
color: Theme.surfaceText
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
}
|
||||||
|
|
||||||
DankButton {
|
Column {
|
||||||
text: I18n.tr("I Understand")
|
width: parent.width
|
||||||
iconName: "check"
|
spacing: Theme.spacingS
|
||||||
onClicked: {
|
|
||||||
SessionData.setShowThirdPartyPlugins(true);
|
StyledText {
|
||||||
root.updateFilteredPlugins();
|
text: I18n.tr("• Plugins may contain bugs or security issues")
|
||||||
thirdPartyConfirmModal.hide();
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
}
|
color: Theme.surfaceVariantText
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: I18n.tr("• Review code before installation when possible")
|
||||||
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
|
color: Theme.surfaceVariantText
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: I18n.tr("• Install only from trusted sources")
|
||||||
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
|
color: Theme.surfaceVariantText
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
width: parent.width
|
||||||
|
height: parent.height - parent.spacing * 3 - y
|
||||||
|
}
|
||||||
|
|
||||||
|
Row {
|
||||||
|
anchors.right: parent.right
|
||||||
|
spacing: Theme.spacingM
|
||||||
|
|
||||||
|
DankButton {
|
||||||
|
text: I18n.tr("Cancel")
|
||||||
|
iconName: "close"
|
||||||
|
onClicked: thirdPartyConfirmModal.visible = false
|
||||||
|
}
|
||||||
|
|
||||||
|
DankButton {
|
||||||
|
text: I18n.tr("I Understand")
|
||||||
|
iconName: "check"
|
||||||
|
onClicked: {
|
||||||
|
SessionData.setShowThirdPartyPlugins(true);
|
||||||
|
root.updateFilteredPlugins();
|
||||||
|
thirdPartyConfirmModal.visible = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user