1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-27 23:12:49 -05:00

clipboard: fix file transfer & export functionality

- grants read to all installed flatpak apps
This commit is contained in:
bbedward
2026-01-26 17:58:06 -05:00
parent 705d5b04dd
commit 8499033221
30 changed files with 3940 additions and 838 deletions

View File

@@ -274,39 +274,39 @@ Column {
case "wifi":
{
if (NetworkService.wifiToggling)
return NetworkService.wifiEnabled ? "Disabling WiFi..." : "Enabling WiFi...";
return NetworkService.wifiEnabled ? I18n.tr("Disabling WiFi...", "network status") : I18n.tr("Enabling WiFi...", "network status");
const status = NetworkService.networkStatus;
if (status === "ethernet")
return "Ethernet";
return I18n.tr("Ethernet", "network status");
if (status === "vpn") {
if (NetworkService.ethernetConnected)
return "Ethernet";
return I18n.tr("Ethernet", "network status");
if (NetworkService.wifiConnected && NetworkService.currentWifiSSID)
return NetworkService.currentWifiSSID;
}
if (status === "wifi" && NetworkService.currentWifiSSID)
return NetworkService.currentWifiSSID;
if (NetworkService.wifiEnabled)
return "Not connected";
return "WiFi off";
return I18n.tr("Not connected", "network status");
return I18n.tr("WiFi off", "network status");
}
case "bluetooth":
{
if (!BluetoothService.available)
return "Bluetooth";
return I18n.tr("Bluetooth", "bluetooth status");
if (!BluetoothService.adapter)
return "No adapter";
return I18n.tr("No adapter", "bluetooth status");
if (!BluetoothService.adapter.enabled)
return "Disabled";
return "Enabled";
return I18n.tr("Disabled", "bluetooth status");
return I18n.tr("Enabled", "bluetooth status");
}
case "audioOutput":
return AudioService.sink?.description || "No output device";
return AudioService.sink?.description || I18n.tr("No output device", "audio status");
case "audioInput":
return AudioService.source?.description || "No input device";
return AudioService.source?.description || I18n.tr("No input device", "audio status");
default:
return widgetDef?.text || "Unknown";
return widgetDef?.text || I18n.tr("Unknown", "widget status");
}
}
secondaryText: {
@@ -314,29 +314,29 @@ Column {
case "wifi":
{
if (NetworkService.wifiToggling)
return "Please wait...";
return I18n.tr("Please wait...", "network status");
const status = NetworkService.networkStatus;
if (status === "ethernet")
return "Connected";
return I18n.tr("Connected", "network status");
if (status === "vpn") {
if (NetworkService.ethernetConnected)
return "Connected";
return I18n.tr("Connected", "network status");
if (NetworkService.wifiConnected)
return NetworkService.wifiSignalStrength > 0 ? NetworkService.wifiSignalStrength + "%" : "Connected";
return NetworkService.wifiSignalStrength > 0 ? NetworkService.wifiSignalStrength + "%" : I18n.tr("Connected", "network status");
}
if (status === "wifi")
return NetworkService.wifiSignalStrength > 0 ? NetworkService.wifiSignalStrength + "%" : "Connected";
return NetworkService.wifiSignalStrength > 0 ? NetworkService.wifiSignalStrength + "%" : I18n.tr("Connected", "network status");
if (NetworkService.wifiEnabled)
return "Select network";
return I18n.tr("Select network", "network status");
return "";
}
case "bluetooth":
{
if (!BluetoothService.available)
return "No adapters";
return I18n.tr("No adapters", "bluetooth status");
if (!BluetoothService.adapter || !BluetoothService.adapter.enabled)
return "Off";
return I18n.tr("Off", "bluetooth status");
const primaryDevice = (() => {
if (!BluetoothService.adapter || !BluetoothService.adapter.devices)
return null;
@@ -348,15 +348,15 @@ Column {
return null;
})();
if (primaryDevice)
return primaryDevice.name || primaryDevice.alias || primaryDevice.deviceName || "Connected Device";
return "No devices";
return primaryDevice.name || primaryDevice.alias || primaryDevice.deviceName || I18n.tr("Connected Device", "bluetooth status");
return I18n.tr("No devices", "bluetooth status");
}
case "audioOutput":
{
if (!AudioService.sink)
return "Select device";
return I18n.tr("Select device", "audio status");
if (AudioService.sink.audio.muted)
return "Muted";
return I18n.tr("Muted", "audio status");
const volume = AudioService.sink.audio.volume;
if (typeof volume !== "number" || isNaN(volume))
return "0%";
@@ -365,9 +365,9 @@ Column {
case "audioInput":
{
if (!AudioService.source)
return "Select device";
return I18n.tr("Select device", "audio status");
if (AudioService.source.audio.muted)
return "Muted";
return I18n.tr("Muted", "audio status");
const volume = AudioService.source.audio.volume;
if (typeof volume !== "number" || isNaN(volume))
return "0%";
@@ -606,7 +606,7 @@ Column {
case "idleInhibitor":
return SessionService.idleInhibited ? I18n.tr("Keeping Awake") : I18n.tr("Keep Awake");
default:
return "Unknown";
return I18n.tr("Unknown", "widget status");
}
}

View File

@@ -28,7 +28,7 @@ Item {
SettingsButtonGroupRow {
text: I18n.tr("Position")
model: ["Top", "Bottom", "Left", "Right"]
model: [I18n.tr("Top", "dock position option"), I18n.tr("Bottom", "dock position option"), I18n.tr("Left", "dock position option"), I18n.tr("Right", "dock position option")]
buttonPadding: Theme.spacingS
minButtonWidth: 44
textSize: Theme.fontSizeSmall
@@ -151,7 +151,7 @@ Item {
settingKey: "dockIndicatorStyle"
tags: ["dock", "indicator", "style", "circle", "line"]
text: I18n.tr("Indicator Style")
model: ["Circle", "Line"]
model: [I18n.tr("Circle", "dock indicator style option"), I18n.tr("Line", "dock indicator style option")]
buttonPadding: Theme.spacingS
minButtonWidth: 44
textSize: Theme.fontSizeSmall
@@ -500,7 +500,7 @@ Item {
text: I18n.tr("Border Color")
description: I18n.tr("Choose the border accent color")
visible: SettingsData.dockBorderEnabled
model: ["Surface", "Secondary", "Primary"]
model: [I18n.tr("Surface", "color option"), I18n.tr("Secondary", "color option"), I18n.tr("Primary", "color option")]
buttonPadding: Theme.spacingS
minButtonWidth: 44
textSize: Theme.fontSizeSmall

View File

@@ -47,22 +47,22 @@ Item {
}
SettingsDropdownRow {
property var scrollOpts: {
"Change Volume": "volume",
"Change Song": "song",
"Nothing": "nothing"
}
property var scrollOptsInternal: ["volume", "song", "nothing"]
property var scrollOptsDisplay: [I18n.tr("Change Volume", "media scroll wheel option"), I18n.tr("Change Song", "media scroll wheel option"), I18n.tr("Nothing", "media scroll wheel option")]
text: I18n.tr("Scroll Wheel")
description: I18n.tr("Scroll wheel behavior on media widget")
settingKey: "audioScrollMode"
tags: ["media", "music", "scroll"]
options: Object.keys(scrollOpts).sort()
options: scrollOptsDisplay
currentValue: {
Object.keys(scrollOpts).find(key => scrollOpts[key] === SettingsData.audioScrollMode) ?? "volume"
const idx = scrollOptsInternal.indexOf(SettingsData.audioScrollMode);
return idx >= 0 ? scrollOptsDisplay[idx] : scrollOptsDisplay[0];
}
onValueChanged: value => {
SettingsData.set("audioScrollMode", scrollOpts[value])
const idx = scrollOptsDisplay.indexOf(value);
if (idx >= 0)
SettingsData.set("audioScrollMode", scrollOptsInternal[idx]);
}
}
}

View File

@@ -99,38 +99,32 @@ Item {
description: I18n.tr("Choose where notification popups appear on screen")
currentValue: {
if (SettingsData.notificationPopupPosition === -1)
return "Top Center";
return I18n.tr("Top Center", "screen position option");
switch (SettingsData.notificationPopupPosition) {
case SettingsData.Position.Top:
return "Top Right";
return I18n.tr("Top Right", "screen position option");
case SettingsData.Position.Bottom:
return "Bottom Left";
return I18n.tr("Bottom Left", "screen position option");
case SettingsData.Position.Left:
return "Top Left";
return I18n.tr("Top Left", "screen position option");
case SettingsData.Position.Right:
return "Bottom Right";
return I18n.tr("Bottom Right", "screen position option");
default:
return "Top Right";
return I18n.tr("Top Right", "screen position option");
}
}
options: ["Top Right", "Top Left", "Top Center", "Bottom Right", "Bottom Left"]
options: [I18n.tr("Top Right", "screen position option"), I18n.tr("Top Left", "screen position option"), I18n.tr("Top Center", "screen position option"), I18n.tr("Bottom Right", "screen position option"), I18n.tr("Bottom Left", "screen position option")]
onValueChanged: value => {
switch (value) {
case "Top Right":
if (value === I18n.tr("Top Right", "screen position option")) {
SettingsData.set("notificationPopupPosition", SettingsData.Position.Top);
break;
case "Top Left":
} else if (value === I18n.tr("Top Left", "screen position option")) {
SettingsData.set("notificationPopupPosition", SettingsData.Position.Left);
break;
case "Top Center":
} else if (value === I18n.tr("Top Center", "screen position option")) {
SettingsData.set("notificationPopupPosition", -1);
break;
case "Bottom Right":
} else if (value === I18n.tr("Bottom Right", "screen position option")) {
SettingsData.set("notificationPopupPosition", SettingsData.Position.Right);
break;
case "Bottom Left":
} else if (value === I18n.tr("Bottom Left", "screen position option")) {
SettingsData.set("notificationPopupPosition", SettingsData.Position.Bottom);
break;
}
SettingsData.sendTestNotifications();
}

View File

@@ -31,52 +31,43 @@ Item {
currentValue: {
switch (SettingsData.osdPosition) {
case SettingsData.Position.Top:
return "Top Right";
return I18n.tr("Top Right", "screen position option");
case SettingsData.Position.Left:
return "Top Left";
return I18n.tr("Top Left", "screen position option");
case SettingsData.Position.TopCenter:
return "Top Center";
return I18n.tr("Top Center", "screen position option");
case SettingsData.Position.Right:
return "Bottom Right";
return I18n.tr("Bottom Right", "screen position option");
case SettingsData.Position.Bottom:
return "Bottom Left";
return I18n.tr("Bottom Left", "screen position option");
case SettingsData.Position.BottomCenter:
return "Bottom Center";
return I18n.tr("Bottom Center", "screen position option");
case SettingsData.Position.LeftCenter:
return "Left Center";
return I18n.tr("Left Center", "screen position option");
case SettingsData.Position.RightCenter:
return "Right Center";
return I18n.tr("Right Center", "screen position option");
default:
return "Bottom Center";
return I18n.tr("Bottom Center", "screen position option");
}
}
options: ["Top Right", "Top Left", "Top Center", "Bottom Right", "Bottom Left", "Bottom Center", "Left Center", "Right Center"]
options: [I18n.tr("Top Right", "screen position option"), I18n.tr("Top Left", "screen position option"), I18n.tr("Top Center", "screen position option"), I18n.tr("Bottom Right", "screen position option"), I18n.tr("Bottom Left", "screen position option"), I18n.tr("Bottom Center", "screen position option"), I18n.tr("Left Center", "screen position option"), I18n.tr("Right Center", "screen position option")]
onValueChanged: value => {
switch (value) {
case "Top Right":
if (value === I18n.tr("Top Right", "screen position option")) {
SettingsData.set("osdPosition", SettingsData.Position.Top);
break;
case "Top Left":
} else if (value === I18n.tr("Top Left", "screen position option")) {
SettingsData.set("osdPosition", SettingsData.Position.Left);
break;
case "Top Center":
} else if (value === I18n.tr("Top Center", "screen position option")) {
SettingsData.set("osdPosition", SettingsData.Position.TopCenter);
break;
case "Bottom Right":
} else if (value === I18n.tr("Bottom Right", "screen position option")) {
SettingsData.set("osdPosition", SettingsData.Position.Right);
break;
case "Bottom Left":
} else if (value === I18n.tr("Bottom Left", "screen position option")) {
SettingsData.set("osdPosition", SettingsData.Position.Bottom);
break;
case "Bottom Center":
} else if (value === I18n.tr("Bottom Center", "screen position option")) {
SettingsData.set("osdPosition", SettingsData.Position.BottomCenter);
break;
case "Left Center":
} else if (value === I18n.tr("Left Center", "screen position option")) {
SettingsData.set("osdPosition", SettingsData.Position.LeftCenter);
break;
case "Right Center":
} else if (value === I18n.tr("Right Center", "screen position option")) {
SettingsData.set("osdPosition", SettingsData.Position.RightCenter);
break;
}
}
}

View File

@@ -281,7 +281,7 @@ Item {
return 0;
}
model: DMSService.dmsAvailable ? ["Generic", "Auto", "Custom", "Browse"] : ["Generic", "Auto", "Custom"]
model: DMSService.dmsAvailable ? [I18n.tr("Generic", "theme category option"), I18n.tr("Auto", "theme category option"), I18n.tr("Custom", "theme category option"), I18n.tr("Browse", "theme category option")] : [I18n.tr("Generic", "theme category option"), I18n.tr("Auto", "theme category option"), I18n.tr("Custom", "theme category option")]
currentIndex: pendingIndex >= 0 ? pendingIndex : computedIndex
selectionMode: "single"
onSelectionChanged: (index, selected) => {
@@ -1440,7 +1440,7 @@ Item {
settingKey: "widgetColorMode"
text: I18n.tr("Widget Style")
description: I18n.tr("Change bar appearance")
model: ["default", "colorful"]
model: [I18n.tr("Default", "widget style option"), I18n.tr("Colorful", "widget style option")]
currentIndex: SettingsData.widgetColorMode === "colorful" ? 1 : 0
onSelectionChanged: (index, selected) => {
if (!selected)
@@ -1489,32 +1489,28 @@ Item {
tags: ["control", "center", "tile", "button", "color", "active"]
settingKey: "controlCenterTileColorMode"
text: I18n.tr("Control Center Tile Color")
description: I18n.tr("Active tile background and icon color")
options: ["Primary", "Primary Container", "Secondary", "Surface Variant"]
description: I18n.tr("Active tile background and icon color", "control center tile color setting description")
options: [I18n.tr("Primary", "tile color option"), I18n.tr("Primary Container", "tile color option"), I18n.tr("Secondary", "tile color option"), I18n.tr("Surface Variant", "tile color option")]
currentValue: {
switch (SettingsData.controlCenterTileColorMode) {
case "primaryContainer":
return "Primary Container";
return I18n.tr("Primary Container", "tile color option");
case "secondary":
return "Secondary";
return I18n.tr("Secondary", "tile color option");
case "surfaceVariant":
return "Surface Variant";
return I18n.tr("Surface Variant", "tile color option");
default:
return "Primary";
return I18n.tr("Primary", "tile color option");
}
}
onValueChanged: value => {
switch (value) {
case "Primary Container":
if (value === I18n.tr("Primary Container", "tile color option")) {
SettingsData.set("controlCenterTileColorMode", "primaryContainer");
return;
case "Secondary":
} else if (value === I18n.tr("Secondary", "tile color option")) {
SettingsData.set("controlCenterTileColorMode", "secondary");
return;
case "Surface Variant":
} else if (value === I18n.tr("Surface Variant", "tile color option")) {
SettingsData.set("controlCenterTileColorMode", "surfaceVariant");
return;
default:
} else {
SettingsData.set("controlCenterTileColorMode", "primary");
}
}

View File

@@ -75,60 +75,59 @@ Item {
settingKey: "clockDateFormat"
text: I18n.tr("Top Bar Format")
description: "Preview: " + (SettingsData.clockDateFormat ? new Date().toLocaleDateString(Qt.locale(), SettingsData.clockDateFormat) : new Date().toLocaleDateString(Qt.locale(), "ddd d"))
options: ["System Default", "Day Date", "Day Month Date", "Month Date", "Numeric (M/D)", "Numeric (D/M)", "Full with Year", "ISO Date", "Full Day & Month", "Custom..."]
options: [I18n.tr("System Default", "date format option"), I18n.tr("Day Date", "date format option"), I18n.tr("Day Month Date", "date format option"), I18n.tr("Month Date", "date format option"), I18n.tr("Numeric (M/D)", "date format option"), I18n.tr("Numeric (D/M)", "date format option"), I18n.tr("Full with Year", "date format option"), I18n.tr("ISO Date", "date format option"), I18n.tr("Full Day & Month", "date format option"), I18n.tr("Custom...", "date format option")]
currentValue: {
if (!SettingsData.clockDateFormat || SettingsData.clockDateFormat.length === 0)
return "System Default";
return I18n.tr("System Default", "date format option");
const presets = [
{
"format": "ddd d",
"label": "Day Date"
"label": I18n.tr("Day Date", "date format option")
},
{
"format": "ddd MMM d",
"label": "Day Month Date"
"label": I18n.tr("Day Month Date", "date format option")
},
{
"format": "MMM d",
"label": "Month Date"
"label": I18n.tr("Month Date", "date format option")
},
{
"format": "M/d",
"label": "Numeric (M/D)"
"label": I18n.tr("Numeric (M/D)", "date format option")
},
{
"format": "d/M",
"label": "Numeric (D/M)"
"label": I18n.tr("Numeric (D/M)", "date format option")
},
{
"format": "ddd d MMM yyyy",
"label": "Full with Year"
"label": I18n.tr("Full with Year", "date format option")
},
{
"format": "yyyy-MM-dd",
"label": "ISO Date"
"label": I18n.tr("ISO Date", "date format option")
},
{
"format": "dddd, MMMM d",
"label": "Full Day & Month"
"label": I18n.tr("Full Day & Month", "date format option")
}
];
const match = presets.find(p => p.format === SettingsData.clockDateFormat);
return match ? match.label : I18n.tr("Custom: ") + SettingsData.clockDateFormat;
}
onValueChanged: value => {
const formatMap = {
"System Default": "",
"Day Date": "ddd d",
"Day Month Date": "ddd MMM d",
"Month Date": "MMM d",
"Numeric (M/D)": "M/d",
"Numeric (D/M)": "d/M",
"Full with Year": "ddd d MMM yyyy",
"ISO Date": "yyyy-MM-dd",
"Full Day & Month": "dddd, MMMM d"
};
if (value === "Custom...") {
const formatMap = {};
formatMap[I18n.tr("System Default", "date format option")] = "";
formatMap[I18n.tr("Day Date", "date format option")] = "ddd d";
formatMap[I18n.tr("Day Month Date", "date format option")] = "ddd MMM d";
formatMap[I18n.tr("Month Date", "date format option")] = "MMM d";
formatMap[I18n.tr("Numeric (M/D)", "date format option")] = "M/d";
formatMap[I18n.tr("Numeric (D/M)", "date format option")] = "d/M";
formatMap[I18n.tr("Full with Year", "date format option")] = "ddd d MMM yyyy";
formatMap[I18n.tr("ISO Date", "date format option")] = "yyyy-MM-dd";
formatMap[I18n.tr("Full Day & Month", "date format option")] = "dddd, MMMM d";
if (value === I18n.tr("Custom...", "date format option")) {
customFormatInput.visible = true;
} else {
customFormatInput.visible = false;
@@ -163,60 +162,59 @@ Item {
settingKey: "lockDateFormat"
text: I18n.tr("Lock Screen Format")
description: "Preview: " + (SettingsData.lockDateFormat ? new Date().toLocaleDateString(Qt.locale(), SettingsData.lockDateFormat) : new Date().toLocaleDateString(Qt.locale(), Locale.LongFormat))
options: ["System Default", "Day Date", "Day Month Date", "Month Date", "Numeric (M/D)", "Numeric (D/M)", "Full with Year", "ISO Date", "Full Day & Month", "Custom..."]
options: [I18n.tr("System Default", "date format option"), I18n.tr("Day Date", "date format option"), I18n.tr("Day Month Date", "date format option"), I18n.tr("Month Date", "date format option"), I18n.tr("Numeric (M/D)", "date format option"), I18n.tr("Numeric (D/M)", "date format option"), I18n.tr("Full with Year", "date format option"), I18n.tr("ISO Date", "date format option"), I18n.tr("Full Day & Month", "date format option"), I18n.tr("Custom...", "date format option")]
currentValue: {
if (!SettingsData.lockDateFormat || SettingsData.lockDateFormat.length === 0)
return "System Default";
return I18n.tr("System Default", "date format option");
const presets = [
{
"format": "ddd d",
"label": "Day Date"
"label": I18n.tr("Day Date", "date format option")
},
{
"format": "ddd MMM d",
"label": "Day Month Date"
"label": I18n.tr("Day Month Date", "date format option")
},
{
"format": "MMM d",
"label": "Month Date"
"label": I18n.tr("Month Date", "date format option")
},
{
"format": "M/d",
"label": "Numeric (M/D)"
"label": I18n.tr("Numeric (M/D)", "date format option")
},
{
"format": "d/M",
"label": "Numeric (D/M)"
"label": I18n.tr("Numeric (D/M)", "date format option")
},
{
"format": "ddd d MMM yyyy",
"label": "Full with Year"
"label": I18n.tr("Full with Year", "date format option")
},
{
"format": "yyyy-MM-dd",
"label": "ISO Date"
"label": I18n.tr("ISO Date", "date format option")
},
{
"format": "dddd, MMMM d",
"label": "Full Day & Month"
"label": I18n.tr("Full Day & Month", "date format option")
}
];
const match = presets.find(p => p.format === SettingsData.lockDateFormat);
return match ? match.label : I18n.tr("Custom: ") + SettingsData.lockDateFormat;
}
onValueChanged: value => {
const formatMap = {
"System Default": "",
"Day Date": "ddd d",
"Day Month Date": "ddd MMM d",
"Month Date": "MMM d",
"Numeric (M/D)": "M/d",
"Numeric (D/M)": "d/M",
"Full with Year": "ddd d MMM yyyy",
"ISO Date": "yyyy-MM-dd",
"Full Day & Month": "dddd, MMMM d"
};
if (value === "Custom...") {
const formatMap = {};
formatMap[I18n.tr("System Default", "date format option")] = "";
formatMap[I18n.tr("Day Date", "date format option")] = "ddd d";
formatMap[I18n.tr("Day Month Date", "date format option")] = "ddd MMM d";
formatMap[I18n.tr("Month Date", "date format option")] = "MMM d";
formatMap[I18n.tr("Numeric (M/D)", "date format option")] = "M/d";
formatMap[I18n.tr("Numeric (D/M)", "date format option")] = "d/M";
formatMap[I18n.tr("Full with Year", "date format option")] = "ddd d MMM yyyy";
formatMap[I18n.tr("ISO Date", "date format option")] = "yyyy-MM-dd";
formatMap[I18n.tr("Full Day & Month", "date format option")] = "dddd, MMMM d";
if (value === I18n.tr("Custom...", "date format option")) {
customLockFormatInput.visible = true;
} else {
customLockFormatInput.visible = false;

View File

@@ -318,8 +318,9 @@ Item {
DankButtonGroup {
id: fillModeGroup
property var internalModes: ["Stretch", "Fit", "Fill", "Tile", "TileVertically", "TileHorizontally", "Pad"]
anchors.horizontalCenter: parent.horizontalCenter
model: ["Stretch", "Fit", "Fill", "Tile", "Tile V", "Tile H", "Pad"]
model: [I18n.tr("Stretch", "wallpaper fill mode"), I18n.tr("Fit", "wallpaper fill mode"), I18n.tr("Fill", "wallpaper fill mode"), I18n.tr("Tile", "wallpaper fill mode"), I18n.tr("Tile V", "wallpaper fill mode"), I18n.tr("Tile H", "wallpaper fill mode"), I18n.tr("Pad", "wallpaper fill mode")]
selectionMode: "single"
buttonHeight: 28
minButtonWidth: 48
@@ -328,21 +329,18 @@ Item {
textSize: Theme.fontSizeSmall
checkEnabled: false
currentIndex: {
const modes = ["Stretch", "Fit", "Fill", "Tile", "TileVertically", "TileHorizontally", "Pad"];
return modes.indexOf(SettingsData.wallpaperFillMode);
return internalModes.indexOf(SettingsData.wallpaperFillMode);
}
onSelectionChanged: (index, selected) => {
if (!selected)
return;
const modes = ["Stretch", "Fit", "Fill", "Tile", "TileVertically", "TileHorizontally", "Pad"];
SettingsData.set("wallpaperFillMode", modes[index]);
SettingsData.set("wallpaperFillMode", internalModes[index]);
}
Connections {
target: SettingsData
function onWallpaperFillModeChanged() {
const modes = ["Stretch", "Fit", "Fill", "Tile", "TileVertically", "TileHorizontally", "Pad"];
fillModeGroup.currentIndex = modes.indexOf(SettingsData.wallpaperFillMode);
fillModeGroup.currentIndex = fillModeGroup.internalModes.indexOf(SettingsData.wallpaperFillMode);
}
}
}
@@ -1134,15 +1132,41 @@ Item {
settingKey: "wallpaperTransition"
text: I18n.tr("Transition Effect")
description: I18n.tr("Visual effect used when wallpaper changes")
currentValue: {
if (SessionData.wallpaperTransition === "random")
return "Random";
return SessionData.wallpaperTransition.charAt(0).toUpperCase() + SessionData.wallpaperTransition.slice(1);
function getTransitionLabel(t) {
switch (t) {
case "random":
return I18n.tr("Random", "wallpaper transition option");
case "none":
return I18n.tr("None", "wallpaper transition option");
case "fade":
return I18n.tr("Fade", "wallpaper transition option");
case "wipe":
return I18n.tr("Wipe", "wallpaper transition option");
case "disc":
return I18n.tr("Disc", "wallpaper transition option");
case "stripes":
return I18n.tr("Stripes", "wallpaper transition option");
case "iris bloom":
return I18n.tr("Iris Bloom", "wallpaper transition option");
case "pixelate":
return I18n.tr("Pixelate", "wallpaper transition option");
case "portal":
return I18n.tr("Portal", "wallpaper transition option");
default:
return t.charAt(0).toUpperCase() + t.slice(1);
}
}
options: ["Random"].concat(SessionData.availableWallpaperTransitions.map(t => t.charAt(0).toUpperCase() + t.slice(1)))
currentValue: getTransitionLabel(SessionData.wallpaperTransition)
options: [I18n.tr("Random", "wallpaper transition option")].concat(SessionData.availableWallpaperTransitions.map(t => getTransitionLabel(t)))
onValueChanged: value => {
var transition = value.toLowerCase();
SessionData.setWallpaperTransition(transition);
const transitionMap = {};
transitionMap[I18n.tr("Random", "wallpaper transition option")] = "random";
SessionData.availableWallpaperTransitions.forEach(t => {
transitionMap[getTransitionLabel(t)] = t;
});
SessionData.setWallpaperTransition(transitionMap[value] || value.toLowerCase());
}
}