mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-06 05:25:41 -05:00
Compare commits
149 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3963c98689 | ||
|
|
02c59636fc | ||
|
|
989f196894 | ||
|
|
9314de4772 | ||
|
|
44a6cd88cd | ||
|
|
d8774c4787 | ||
|
|
a56066bac1 | ||
|
|
8a96f71d10 | ||
|
|
20a684e8f5 | ||
|
|
c8fcf50095 | ||
|
|
58b637bcca | ||
|
|
86caf92c90 | ||
|
|
35ead280d5 | ||
|
|
5d6c3e364d | ||
|
|
f006175829 | ||
|
|
3e0f325734 | ||
|
|
f8d383cff0 | ||
|
|
f2ec3ae755 | ||
|
|
f95e4e016b | ||
|
|
898e9e67d0 | ||
|
|
15983921b0 | ||
|
|
65c2077e30 | ||
|
|
946a28d3be | ||
|
|
69accb5319 | ||
|
|
4ddcf4391a | ||
|
|
a0d886009a | ||
|
|
91c37aaa96 | ||
|
|
7602247558 | ||
|
|
d5a4035bef | ||
|
|
d9652c7334 | ||
|
|
9b4fd7449b | ||
|
|
bc6b568f7e | ||
|
|
c9ee856f91 | ||
|
|
2355c898f8 | ||
|
|
87d0aed4ad | ||
|
|
3cbc547e0f | ||
|
|
e883ebe307 | ||
|
|
20d797320a | ||
|
|
bc3e043192 | ||
|
|
c0555aa608 | ||
|
|
e75b47c21a | ||
|
|
3702f493f6 | ||
|
|
80d88d4d8f | ||
|
|
95c711ce7e | ||
|
|
0ee89920fd | ||
|
|
fd49a171c0 | ||
|
|
16ad5221eb | ||
|
|
8167c432b8 | ||
|
|
ae5d6c1ba4 | ||
|
|
1e6c80bd03 | ||
|
|
d48cd1acdd | ||
|
|
a5f92165fb | ||
|
|
d834124a71 | ||
|
|
ce6f3afb39 | ||
|
|
f5462fa1bf | ||
|
|
f75e23158a | ||
|
|
253ff71a0a | ||
|
|
8d7db49cb0 | ||
|
|
315509f7a4 | ||
|
|
a7bd8b810b | ||
|
|
a7c8ba332b | ||
|
|
40cadb6a00 | ||
|
|
cbf409dffc | ||
|
|
60a791442e | ||
|
|
528e8bf92e | ||
|
|
8a4243e7f8 | ||
|
|
1ac95f0d14 | ||
|
|
cd51eb25ce | ||
|
|
4e64a2b2b2 | ||
|
|
672c660c41 | ||
|
|
2a56e57490 | ||
|
|
f6efd2363a | ||
|
|
fa08b39bb0 | ||
|
|
81c3110d0d | ||
|
|
c01e636421 | ||
|
|
fd8d2961bf | ||
|
|
9e4b53e20b | ||
|
|
20116b3933 | ||
|
|
bca5ee0c0d | ||
|
|
331bd69021 | ||
|
|
57b11b7699 | ||
|
|
3e9b11c281 | ||
|
|
bbfd618626 | ||
|
|
00abb839f9 | ||
|
|
1d639d5f5a | ||
|
|
c565fc08c3 | ||
|
|
026c71f9fc | ||
|
|
1eed499151 | ||
|
|
21f2aabd58 | ||
|
|
e1f06b7139 | ||
|
|
c4be74bce5 | ||
|
|
7c9e9e1cd9 | ||
|
|
797aabc637 | ||
|
|
630a3d4845 | ||
|
|
3b0bb4ea74 | ||
|
|
e36347a4c3 | ||
|
|
4f59dfc49c | ||
|
|
fc0082a470 | ||
|
|
712449674f | ||
|
|
a64b4527f2 | ||
|
|
71a7ebbfe2 | ||
|
|
d6d701c722 | ||
|
|
43fbbc07f5 | ||
|
|
8504144c32 | ||
|
|
1d3e59b5dd | ||
|
|
3f70ca3506 | ||
|
|
3640d8bd24 | ||
|
|
706a99817f | ||
|
|
4645b2dcab | ||
|
|
13f1673371 | ||
|
|
7d374c4c2a | ||
|
|
5ed449773c | ||
|
|
aef9c2269a | ||
|
|
daa5a3e821 | ||
|
|
5cd1167b28 | ||
|
|
21e7ae3dfd | ||
|
|
5d40138585 | ||
|
|
893fd820a3 | ||
|
|
2d536d99e5 | ||
|
|
a0ee4792b9 | ||
|
|
a8f6880840 | ||
|
|
51296d1d44 | ||
|
|
0f29149014 | ||
|
|
b9f0c277ec | ||
|
|
69964c9704 | ||
|
|
ff1d38e34f | ||
|
|
3abee7f2f5 | ||
|
|
ed0b80008f | ||
|
|
976ff108b3 | ||
|
|
66e3cc77c5 | ||
|
|
229abba1e4 | ||
|
|
8dacaf84cc | ||
|
|
102b185572 | ||
|
|
52ac474f7d | ||
|
|
c0064cfcfa | ||
|
|
414ce5610d | ||
|
|
113ac42814 | ||
|
|
a2f2eef326 | ||
|
|
54a69a6101 | ||
|
|
5e2d3c8d7d | ||
|
|
5a9950a7c3 | ||
|
|
2aadbc1a61 | ||
|
|
749414ab65 | ||
|
|
baaebcd413 | ||
|
|
5a8a60b15d | ||
|
|
f0ddb8db49 | ||
|
|
baa12c0161 | ||
|
|
ca226e98c2 | ||
|
|
453079ef1f |
24
.githooks/pre-commit
Executable file
24
.githooks/pre-commit
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
HOOK_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
REPO_ROOT="$(cd "$HOOK_DIR/.." && pwd)"
|
||||
|
||||
cd "$REPO_ROOT"
|
||||
|
||||
if [[ -z "${POEDITOR_API_TOKEN:-}" ]] || [[ -z "${POEDITOR_PROJECT_ID:-}" ]]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if ! command -v python3 &>/dev/null; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if ! python3 scripts/i18nsync.py check &>/dev/null; then
|
||||
echo "Translations out of sync"
|
||||
echo "run python3 scripts/i18nsync.py sync"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
exit 0
|
||||
15
.github/FUNDING.yml
vendored
Normal file
15
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: [avengemedia]
|
||||
patreon: # Replace with a single Patreon username
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: danklinux
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
||||
polar: # Replace with a single Polar username
|
||||
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
|
||||
thanks_dev: # Replace with a single thanks.dev username
|
||||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||
31
.github/workflows/copr-release.yml
vendored
31
.github/workflows/copr-release.yml
vendored
@@ -93,9 +93,9 @@ jobs:
|
||||
Requires: dms-cli
|
||||
Requires: dgop
|
||||
|
||||
Recommends: brightnessctl
|
||||
Recommends: cava
|
||||
Recommends: cliphist
|
||||
Recommends: danksearch
|
||||
Recommends: hyprpicker
|
||||
Recommends: matugen
|
||||
Recommends: wl-clipboard
|
||||
@@ -193,34 +193,7 @@ jobs:
|
||||
|
||||
# Restart DMS for active users after upgrade
|
||||
if [ "$1" -ge 2 ]; then
|
||||
# Find all quickshell DMS processes (PID and username)
|
||||
while read pid cmd; do
|
||||
username=$(ps -o user= -p "$pid" 2>/dev/null)
|
||||
|
||||
[ "$username" = "root" ] && continue
|
||||
[ -z "$username" ] && continue
|
||||
|
||||
# Get user's UID and validate session
|
||||
user_uid=$(id -u "$username" 2>/dev/null)
|
||||
[ -z "$user_uid" ] && continue
|
||||
[ ! -d "/run/user/$user_uid" ] && continue
|
||||
|
||||
wayland_display=$(tr '\0' '\n' < /proc/$pid/environ 2>/dev/null | grep '^WAYLAND_DISPLAY=' | cut -d= -f2)
|
||||
[ -z "$wayland_display" ] && continue
|
||||
|
||||
echo "Restarting DMS for user: $username"
|
||||
|
||||
# Run as user with full Wayland session environment
|
||||
runuser -u "$username" -- /bin/sh -c "
|
||||
export XDG_RUNTIME_DIR=/run/user/$user_uid
|
||||
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$user_uid/bus
|
||||
export WAYLAND_DISPLAY=$wayland_display
|
||||
export PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:\$PATH
|
||||
dms restart >/dev/null 2>&1
|
||||
" 2>/dev/null || true
|
||||
|
||||
break
|
||||
done < <(pgrep -a -f 'quickshell.*dms' 2>/dev/null)
|
||||
pkill -USR1 -x dms >/dev/null 2>&1 || true
|
||||
fi
|
||||
|
||||
%files
|
||||
|
||||
192
.github/workflows/poeditor-export.yml
vendored
192
.github/workflows/poeditor-export.yml
vendored
@@ -1,192 +0,0 @@
|
||||
name: POEditor Diff & Sync
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
workflow_dispatch: {}
|
||||
|
||||
concurrency:
|
||||
group: poeditor-sync
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
sync-translations:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.x'
|
||||
|
||||
- name: Install jq
|
||||
run: sudo apt-get update && sudo apt-get install -y jq
|
||||
|
||||
- name: Extract source strings from codebase
|
||||
env:
|
||||
API_TOKEN: ${{ secrets.POEDITOR_API_TOKEN }}
|
||||
PROJECT_ID: ${{ secrets.POEDITOR_PROJECT_ID }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
echo "::group::Extracting strings from QML files"
|
||||
python3 translations/extract_translations.py
|
||||
echo "::endgroup::"
|
||||
|
||||
echo "::group::Checking for changes in en.json"
|
||||
if [[ -f "translations/en.json" ]]; then
|
||||
jq -S . "translations/en.json" > /tmp/en_new.json
|
||||
if [[ -f "translations/en.json.orig" ]]; then
|
||||
jq -S . "translations/en.json.orig" > /tmp/en_old.json
|
||||
else
|
||||
git show HEAD:translations/en.json > /tmp/en_old.json 2>/dev/null || echo "[]" > /tmp/en_old.json
|
||||
jq -S . /tmp/en_old.json > /tmp/en_old.json.tmp && mv /tmp/en_old.json.tmp /tmp/en_old.json
|
||||
fi
|
||||
|
||||
if diff -q /tmp/en_new.json /tmp/en_old.json >/dev/null 2>&1; then
|
||||
echo "No changes in source strings"
|
||||
echo "source_changed=false" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "Detected changes in source strings"
|
||||
echo "source_changed=true" >> "$GITHUB_OUTPUT"
|
||||
|
||||
echo "::group::Uploading source strings to POEditor"
|
||||
RESP=$(curl -sS -X POST https://api.poeditor.com/v2/projects/upload \
|
||||
-F api_token="$API_TOKEN" \
|
||||
-F id="$PROJECT_ID" \
|
||||
-F updating="terms" \
|
||||
-F file=@"translations/en.json")
|
||||
|
||||
STATUS=$(echo "$RESP" | jq -r '.response.status')
|
||||
if [[ "$STATUS" != "success" ]]; then
|
||||
echo "::warning::POEditor upload failed: $RESP"
|
||||
else
|
||||
TERMS_ADDED=$(echo "$RESP" | jq -r '.result.terms.added // 0')
|
||||
TERMS_UPDATED=$(echo "$RESP" | jq -r '.result.terms.updated // 0')
|
||||
TERMS_DELETED=$(echo "$RESP" | jq -r '.result.terms.deleted // 0')
|
||||
echo "Terms added: $TERMS_ADDED, updated: $TERMS_UPDATED, deleted: $TERMS_DELETED"
|
||||
fi
|
||||
echo "::endgroup::"
|
||||
fi
|
||||
else
|
||||
echo "::warning::translations/en.json not found"
|
||||
echo "source_changed=false" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
echo "::endgroup::"
|
||||
id: extract
|
||||
|
||||
- name: Commit and push source strings
|
||||
if: steps.extract.outputs.source_changed == 'true'
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
git add translations/en.json translations/template.json
|
||||
git commit -m "i18n: update source strings from codebase"
|
||||
|
||||
for attempt in 1 2 3; do
|
||||
if git push; then
|
||||
echo "Successfully pushed source string updates"
|
||||
exit 0
|
||||
fi
|
||||
echo "Push attempt $attempt failed, pulling and retrying..."
|
||||
git pull --rebase
|
||||
sleep $((attempt*2))
|
||||
done
|
||||
|
||||
echo "Failed to push after retries" >&2
|
||||
exit 1
|
||||
|
||||
- name: Export and update translations from POEditor
|
||||
env:
|
||||
API_TOKEN: ${{ secrets.POEDITOR_API_TOKEN }}
|
||||
PROJECT_ID: ${{ secrets.POEDITOR_PROJECT_ID }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
LANGUAGES=(
|
||||
"ja:translations/poexports/ja.json"
|
||||
"zh-Hans:translations/poexports/zh_CN.json"
|
||||
"zh-Hant:translations/poexports/zh_TW.json"
|
||||
"pt-br:translations/poexports/pt.json"
|
||||
"tr:translations/poexports/tr.json"
|
||||
"it:translations/poexports/it.json"
|
||||
)
|
||||
|
||||
ANY_CHANGED=false
|
||||
|
||||
for lang_pair in "${LANGUAGES[@]}"; do
|
||||
IFS=':' read -r PO_LANG REPO_FILE <<< "$lang_pair"
|
||||
|
||||
echo "::group::Processing $PO_LANG"
|
||||
|
||||
RESP=$(curl -sS -X POST https://api.poeditor.com/v2/projects/export \
|
||||
-d api_token="$API_TOKEN" \
|
||||
-d id="$PROJECT_ID" \
|
||||
-d language="$PO_LANG" \
|
||||
-d type="key_value_json")
|
||||
|
||||
STATUS=$(echo "$RESP" | jq -r '.response.status')
|
||||
if [[ "$STATUS" != "success" ]]; then
|
||||
echo "POEditor export request failed for $PO_LANG: $RESP" >&2
|
||||
continue
|
||||
fi
|
||||
|
||||
URL=$(echo "$RESP" | jq -r '.result.url')
|
||||
if [[ -z "$URL" || "$URL" == "null" ]]; then
|
||||
echo "No export URL returned for $PO_LANG" >&2
|
||||
continue
|
||||
fi
|
||||
|
||||
curl -sS -L "$URL" -o "/tmp/po_export_${PO_LANG}.json"
|
||||
jq -S . "/tmp/po_export_${PO_LANG}.json" > "/tmp/po_export_${PO_LANG}.norm.json"
|
||||
|
||||
if [[ -f "$REPO_FILE" ]]; then
|
||||
jq -S . "$REPO_FILE" > "/tmp/repo_${PO_LANG}.norm.json" || echo "{}" > "/tmp/repo_${PO_LANG}.norm.json"
|
||||
else
|
||||
echo "{}" > "/tmp/repo_${PO_LANG}.norm.json"
|
||||
fi
|
||||
|
||||
if diff -q "/tmp/po_export_${PO_LANG}.norm.json" "/tmp/repo_${PO_LANG}.norm.json" >/dev/null; then
|
||||
echo "No changes for $PO_LANG"
|
||||
else
|
||||
echo "Detected changes for $PO_LANG"
|
||||
mkdir -p "$(dirname "$REPO_FILE")"
|
||||
cp "/tmp/po_export_${PO_LANG}.norm.json" "$REPO_FILE"
|
||||
ANY_CHANGED=true
|
||||
fi
|
||||
|
||||
echo "::endgroup::"
|
||||
done
|
||||
|
||||
echo "any_changed=$ANY_CHANGED" >> "$GITHUB_OUTPUT"
|
||||
id: export
|
||||
|
||||
- name: Commit and push translation updates
|
||||
if: steps.export.outputs.any_changed == 'true'
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
git add translations/poexports/*.json
|
||||
git commit -m "i18n: update translations"
|
||||
|
||||
for attempt in 1 2 3; do
|
||||
if git push; then
|
||||
echo "Successfully pushed translation updates"
|
||||
exit 0
|
||||
fi
|
||||
echo "Push attempt $attempt failed, pulling and retrying..."
|
||||
git pull --rebase
|
||||
sleep $((attempt*2))
|
||||
done
|
||||
|
||||
echo "Failed to push after retries" >&2
|
||||
exit 1
|
||||
@@ -21,6 +21,7 @@ Singleton {
|
||||
|
||||
property bool isLightMode: false
|
||||
property bool doNotDisturb: false
|
||||
property bool isSwitchingMode: false
|
||||
|
||||
property string wallpaperPath: ""
|
||||
property bool perMonitorWallpaper: false
|
||||
@@ -42,6 +43,7 @@ Singleton {
|
||||
|
||||
property bool nightModeEnabled: false
|
||||
property int nightModeTemperature: 4500
|
||||
property int nightModeHighTemperature: 6500
|
||||
property bool nightModeAutoEnabled: false
|
||||
property string nightModeAutoMode: "time"
|
||||
property int nightModeStartHour: 18
|
||||
@@ -58,6 +60,9 @@ Singleton {
|
||||
property bool showThirdPartyPlugins: false
|
||||
property string launchPrefix: ""
|
||||
property string lastBrightnessDevice: ""
|
||||
property var brightnessExponentialDevices: ({})
|
||||
property var brightnessUserSetValues: ({})
|
||||
property var brightnessExponentValues: ({})
|
||||
|
||||
property int selectedGpuIndex: 0
|
||||
property bool nvidiaGpuTempEnabled: false
|
||||
@@ -83,7 +88,21 @@ Singleton {
|
||||
if (content && content.trim()) {
|
||||
var settings = JSON.parse(content)
|
||||
isLightMode = settings.isLightMode !== undefined ? settings.isLightMode : false
|
||||
wallpaperPath = settings.wallpaperPath !== undefined ? settings.wallpaperPath : ""
|
||||
|
||||
if (settings.wallpaperPath && settings.wallpaperPath.startsWith("we:")) {
|
||||
console.warn("WallpaperEngine wallpaper detected, resetting wallpaper")
|
||||
wallpaperPath = ""
|
||||
Quickshell.execDetached([
|
||||
"notify-send",
|
||||
"-u", "critical",
|
||||
"-a", "DMS",
|
||||
"-i", "dialog-warning",
|
||||
"WallpaperEngine Support Moved",
|
||||
"WallpaperEngine support has been moved to a plugin. Please enable the Linux Wallpaper Engine plugin in Settings → Plugins to continue using WallpaperEngine."
|
||||
])
|
||||
} else {
|
||||
wallpaperPath = settings.wallpaperPath !== undefined ? settings.wallpaperPath : ""
|
||||
}
|
||||
perMonitorWallpaper = settings.perMonitorWallpaper !== undefined ? settings.perMonitorWallpaper : false
|
||||
monitorWallpapers = settings.monitorWallpapers !== undefined ? settings.monitorWallpapers : {}
|
||||
perModeWallpaper = settings.perModeWallpaper !== undefined ? settings.perModeWallpaper : false
|
||||
@@ -91,9 +110,13 @@ Singleton {
|
||||
wallpaperPathDark = settings.wallpaperPathDark !== undefined ? settings.wallpaperPathDark : ""
|
||||
monitorWallpapersLight = settings.monitorWallpapersLight !== undefined ? settings.monitorWallpapersLight : {}
|
||||
monitorWallpapersDark = settings.monitorWallpapersDark !== undefined ? settings.monitorWallpapersDark : {}
|
||||
brightnessExponentialDevices = settings.brightnessExponentialDevices !== undefined ? settings.brightnessExponentialDevices : (settings.brightnessLogarithmicDevices || {})
|
||||
brightnessUserSetValues = settings.brightnessUserSetValues !== undefined ? settings.brightnessUserSetValues : {}
|
||||
brightnessExponentValues = settings.brightnessExponentValues !== undefined ? settings.brightnessExponentValues : {}
|
||||
doNotDisturb = settings.doNotDisturb !== undefined ? settings.doNotDisturb : false
|
||||
nightModeEnabled = settings.nightModeEnabled !== undefined ? settings.nightModeEnabled : false
|
||||
nightModeTemperature = settings.nightModeTemperature !== undefined ? settings.nightModeTemperature : 4500
|
||||
nightModeHighTemperature = settings.nightModeHighTemperature !== undefined ? settings.nightModeHighTemperature : 6500
|
||||
nightModeAutoEnabled = settings.nightModeAutoEnabled !== undefined ? settings.nightModeAutoEnabled : false
|
||||
nightModeAutoMode = settings.nightModeAutoMode !== undefined ? settings.nightModeAutoMode : "time"
|
||||
if (settings.nightModeStartTime !== undefined) {
|
||||
@@ -168,9 +191,13 @@ Singleton {
|
||||
"wallpaperPathDark": wallpaperPathDark,
|
||||
"monitorWallpapersLight": monitorWallpapersLight,
|
||||
"monitorWallpapersDark": monitorWallpapersDark,
|
||||
"brightnessExponentialDevices": brightnessExponentialDevices,
|
||||
"brightnessUserSetValues": brightnessUserSetValues,
|
||||
"brightnessExponentValues": brightnessExponentValues,
|
||||
"doNotDisturb": doNotDisturb,
|
||||
"nightModeEnabled": nightModeEnabled,
|
||||
"nightModeTemperature": nightModeTemperature,
|
||||
"nightModeHighTemperature": nightModeHighTemperature,
|
||||
"nightModeAutoEnabled": nightModeAutoEnabled,
|
||||
"nightModeAutoMode": nightModeAutoMode,
|
||||
"nightModeStartHour": nightModeStartHour,
|
||||
@@ -205,37 +232,37 @@ Singleton {
|
||||
console.info("SessionData: Migrating configuration from undefined to version 1")
|
||||
if (typeof SettingsData !== "undefined") {
|
||||
if (settings.acMonitorTimeout !== undefined) {
|
||||
SettingsData.setAcMonitorTimeout(settings.acMonitorTimeout)
|
||||
SettingsData.set("acMonitorTimeout", settings.acMonitorTimeout)
|
||||
}
|
||||
if (settings.acLockTimeout !== undefined) {
|
||||
SettingsData.setAcLockTimeout(settings.acLockTimeout)
|
||||
SettingsData.set("acLockTimeout", settings.acLockTimeout)
|
||||
}
|
||||
if (settings.acSuspendTimeout !== undefined) {
|
||||
SettingsData.setAcSuspendTimeout(settings.acSuspendTimeout)
|
||||
SettingsData.set("acSuspendTimeout", settings.acSuspendTimeout)
|
||||
}
|
||||
if (settings.acHibernateTimeout !== undefined) {
|
||||
SettingsData.setAcHibernateTimeout(settings.acHibernateTimeout)
|
||||
SettingsData.set("acHibernateTimeout", settings.acHibernateTimeout)
|
||||
}
|
||||
if (settings.batteryMonitorTimeout !== undefined) {
|
||||
SettingsData.setBatteryMonitorTimeout(settings.batteryMonitorTimeout)
|
||||
SettingsData.set("batteryMonitorTimeout", settings.batteryMonitorTimeout)
|
||||
}
|
||||
if (settings.batteryLockTimeout !== undefined) {
|
||||
SettingsData.setBatteryLockTimeout(settings.batteryLockTimeout)
|
||||
SettingsData.set("batteryLockTimeout", settings.batteryLockTimeout)
|
||||
}
|
||||
if (settings.batterySuspendTimeout !== undefined) {
|
||||
SettingsData.setBatterySuspendTimeout(settings.batterySuspendTimeout)
|
||||
SettingsData.set("batterySuspendTimeout", settings.batterySuspendTimeout)
|
||||
}
|
||||
if (settings.batteryHibernateTimeout !== undefined) {
|
||||
SettingsData.setBatteryHibernateTimeout(settings.batteryHibernateTimeout)
|
||||
SettingsData.set("batteryHibernateTimeout", settings.batteryHibernateTimeout)
|
||||
}
|
||||
if (settings.lockBeforeSuspend !== undefined) {
|
||||
SettingsData.setLockBeforeSuspend(settings.lockBeforeSuspend)
|
||||
SettingsData.set("lockBeforeSuspend", settings.lockBeforeSuspend)
|
||||
}
|
||||
if (settings.loginctlLockIntegration !== undefined) {
|
||||
SettingsData.setLoginctlLockIntegration(settings.loginctlLockIntegration)
|
||||
SettingsData.set("loginctlLockIntegration", settings.loginctlLockIntegration)
|
||||
}
|
||||
if (settings.launchPrefix !== undefined) {
|
||||
SettingsData.setLaunchPrefix(settings.launchPrefix)
|
||||
SettingsData.set("launchPrefix", settings.launchPrefix)
|
||||
}
|
||||
}
|
||||
if (typeof CacheData !== "undefined") {
|
||||
@@ -250,7 +277,7 @@ Singleton {
|
||||
}
|
||||
|
||||
function cleanupUnusedKeys() {
|
||||
const validKeys = ["isLightMode", "wallpaperPath", "perMonitorWallpaper", "monitorWallpapers", "perModeWallpaper", "wallpaperPathLight", "wallpaperPathDark", "monitorWallpapersLight", "monitorWallpapersDark", "doNotDisturb", "nightModeEnabled", "nightModeTemperature", "nightModeAutoEnabled", "nightModeAutoMode", "nightModeStartHour", "nightModeStartMinute", "nightModeEndHour", "nightModeEndMinute", "latitude", "longitude", "nightModeUseIPLocation", "nightModeLocationProvider", "pinnedApps", "selectedGpuIndex", "nvidiaGpuTempEnabled", "nonNvidiaGpuTempEnabled", "enabledGpuPciIds", "wallpaperCyclingEnabled", "wallpaperCyclingMode", "wallpaperCyclingInterval", "wallpaperCyclingTime", "monitorCyclingSettings", "lastBrightnessDevice", "launchPrefix", "wallpaperTransition", "includedTransitions", "recentColors", "showThirdPartyPlugins", "configVersion"]
|
||||
const validKeys = ["isLightMode", "wallpaperPath", "perMonitorWallpaper", "monitorWallpapers", "perModeWallpaper", "wallpaperPathLight", "wallpaperPathDark", "monitorWallpapersLight", "monitorWallpapersDark", "doNotDisturb", "nightModeEnabled", "nightModeTemperature", "nightModeHighTemperature", "nightModeAutoEnabled", "nightModeAutoMode", "nightModeStartHour", "nightModeStartMinute", "nightModeEndHour", "nightModeEndMinute", "latitude", "longitude", "nightModeUseIPLocation", "nightModeLocationProvider", "pinnedApps", "selectedGpuIndex", "nvidiaGpuTempEnabled", "nonNvidiaGpuTempEnabled", "enabledGpuPciIds", "wallpaperCyclingEnabled", "wallpaperCyclingMode", "wallpaperCyclingInterval", "wallpaperCyclingTime", "monitorCyclingSettings", "lastBrightnessDevice", "brightnessExponentialDevices", "brightnessUserSetValues", "launchPrefix", "wallpaperTransition", "includedTransitions", "recentColors", "showThirdPartyPlugins", "configVersion"]
|
||||
|
||||
try {
|
||||
const content = settingsFile.text()
|
||||
@@ -277,9 +304,11 @@ Singleton {
|
||||
}
|
||||
|
||||
function setLightMode(lightMode) {
|
||||
isSwitchingMode = true
|
||||
isLightMode = lightMode
|
||||
syncWallpaperForCurrentMode()
|
||||
saveSettings()
|
||||
Qt.callLater(() => { isSwitchingMode = false })
|
||||
}
|
||||
|
||||
function setDoNotDisturb(enabled) {
|
||||
@@ -526,6 +555,11 @@ Singleton {
|
||||
saveSettings()
|
||||
}
|
||||
|
||||
function setNightModeHighTemperature(temperature) {
|
||||
nightModeHighTemperature = temperature
|
||||
saveSettings()
|
||||
}
|
||||
|
||||
function setNightModeAutoEnabled(enabled) {
|
||||
console.log("SessionData: Setting nightModeAutoEnabled to", enabled)
|
||||
nightModeAutoEnabled = enabled
|
||||
@@ -631,6 +665,52 @@ Singleton {
|
||||
saveSettings()
|
||||
}
|
||||
|
||||
function setBrightnessExponential(deviceName, enabled) {
|
||||
var newSettings = Object.assign({}, brightnessExponentialDevices)
|
||||
if (enabled) {
|
||||
newSettings[deviceName] = true
|
||||
} else {
|
||||
delete newSettings[deviceName]
|
||||
}
|
||||
brightnessExponentialDevices = newSettings
|
||||
saveSettings()
|
||||
|
||||
if (typeof DisplayService !== "undefined") {
|
||||
DisplayService.updateDeviceBrightnessDisplay(deviceName)
|
||||
}
|
||||
}
|
||||
|
||||
function getBrightnessExponential(deviceName) {
|
||||
return brightnessExponentialDevices[deviceName] === true
|
||||
}
|
||||
|
||||
function setBrightnessUserSetValue(deviceName, value) {
|
||||
var newValues = Object.assign({}, brightnessUserSetValues)
|
||||
newValues[deviceName] = value
|
||||
brightnessUserSetValues = newValues
|
||||
saveSettings()
|
||||
}
|
||||
|
||||
function getBrightnessUserSetValue(deviceName) {
|
||||
return brightnessUserSetValues[deviceName]
|
||||
}
|
||||
|
||||
function setBrightnessExponent(deviceName, exponent) {
|
||||
var newValues = Object.assign({}, brightnessExponentValues)
|
||||
if (exponent !== undefined && exponent !== null) {
|
||||
newValues[deviceName] = exponent
|
||||
} else {
|
||||
delete newValues[deviceName]
|
||||
}
|
||||
brightnessExponentValues = newValues
|
||||
saveSettings()
|
||||
}
|
||||
|
||||
function getBrightnessExponent(deviceName) {
|
||||
const value = brightnessExponentValues[deviceName]
|
||||
return value !== undefined ? value : 1.2
|
||||
}
|
||||
|
||||
function setSelectedGpuIndex(index) {
|
||||
selectedGpuIndex = index
|
||||
saveSettings()
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
182
Common/Theme.qml
182
Common/Theme.qml
@@ -9,6 +9,7 @@ import Quickshell.Io
|
||||
import Quickshell.Services.UPower
|
||||
import qs.Common
|
||||
import qs.Services
|
||||
import qs.Modules.Greetd
|
||||
import "StockThemes.js" as StockThemes
|
||||
|
||||
Singleton {
|
||||
@@ -43,23 +44,11 @@ Singleton {
|
||||
var screens = Quickshell.screens
|
||||
if (screens.length > 0) {
|
||||
var firstMonitorWallpaper = SessionData.getMonitorWallpaper(screens[0].name)
|
||||
var wallpaperPath = firstMonitorWallpaper || SessionData.wallpaperPath
|
||||
|
||||
if (wallpaperPath && wallpaperPath.startsWith("we:")) {
|
||||
return stateDir + "/we_screenshots/" + wallpaperPath.substring(3) + ".jpg"
|
||||
}
|
||||
|
||||
return wallpaperPath
|
||||
return firstMonitorWallpaper || SessionData.wallpaperPath
|
||||
}
|
||||
}
|
||||
|
||||
var wallpaperPath = SessionData.wallpaperPath
|
||||
var screens = Quickshell.screens
|
||||
if (screens.length > 0 && wallpaperPath && wallpaperPath.startsWith("we:")) {
|
||||
return stateDir + "/we_screenshots/" + wallpaperPath.substring(3) + ".jpg"
|
||||
}
|
||||
|
||||
return wallpaperPath
|
||||
return SessionData.wallpaperPath
|
||||
}
|
||||
readonly property string rawWallpaperPath: {
|
||||
if (typeof SessionData === "undefined")
|
||||
@@ -112,11 +101,10 @@ Singleton {
|
||||
const isLight = (typeof SessionData !== "undefined" && SessionData.isLightMode)
|
||||
const iconTheme = (typeof SettingsData !== "undefined" && SettingsData.iconTheme) ? SettingsData.iconTheme : "System Default"
|
||||
const selectedMatugenType = (typeof SettingsData !== "undefined" && SettingsData.matugenScheme) ? SettingsData.matugenScheme : "scheme-tonal-spot"
|
||||
const effectivePath = rawWallpaperPath.startsWith("we:") ? (stateDir + "/we_screenshots/" + rawWallpaperPath.substring(3) + ".jpg") : rawWallpaperPath
|
||||
if (effectivePath.startsWith("#")) {
|
||||
setDesiredTheme("hex", effectivePath, isLight, iconTheme, selectedMatugenType)
|
||||
if (rawWallpaperPath.startsWith("#")) {
|
||||
setDesiredTheme("hex", rawWallpaperPath, isLight, iconTheme, selectedMatugenType)
|
||||
} else {
|
||||
setDesiredTheme("image", effectivePath, isLight, iconTheme, selectedMatugenType)
|
||||
setDesiredTheme("image", rawWallpaperPath, isLight, iconTheme, selectedMatugenType)
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -127,11 +115,10 @@ Singleton {
|
||||
if (currentTheme === dynamic) {
|
||||
if (rawWallpaperPath) {
|
||||
const selectedMatugenType = (typeof SettingsData !== "undefined" && SettingsData.matugenScheme) ? SettingsData.matugenScheme : "scheme-tonal-spot"
|
||||
const effectivePath = rawWallpaperPath.startsWith("we:") ? (stateDir + "/we_screenshots/" + rawWallpaperPath.substring(3) + ".jpg") : rawWallpaperPath
|
||||
if (effectivePath.startsWith("#")) {
|
||||
setDesiredTheme("hex", effectivePath, isLight, iconTheme, selectedMatugenType)
|
||||
if (rawWallpaperPath.startsWith("#")) {
|
||||
setDesiredTheme("hex", rawWallpaperPath, isLight, iconTheme, selectedMatugenType)
|
||||
} else {
|
||||
setDesiredTheme("image", effectivePath, isLight, iconTheme, selectedMatugenType)
|
||||
setDesiredTheme("image", rawWallpaperPath, isLight, iconTheme, selectedMatugenType)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -213,43 +200,52 @@ Singleton {
|
||||
"value": "scheme-tonal-spot",
|
||||
"label": "Tonal Spot",
|
||||
"description": I18n.tr("Balanced palette with focused accents (default).")
|
||||
}), ({
|
||||
"value": "scheme-vibrant-spot",
|
||||
"label": "Vibrant Spot",
|
||||
"description": I18n.tr("Lively palette with saturated accents.")
|
||||
}), ({
|
||||
"value": "scheme-dynamic-contrast",
|
||||
"label": "Dynamic Contrast",
|
||||
"description": I18n.tr("High-contrast palette for strong visual distinction.")
|
||||
}), ({
|
||||
"value": "scheme-content",
|
||||
"label": "Content",
|
||||
"description": I18n.tr("Derives colors that closely match the underlying image.")
|
||||
}), ({
|
||||
"value": "scheme-expressive",
|
||||
"label": "Expressive",
|
||||
"description": I18n.tr("Vibrant palette with playful saturation.")
|
||||
}), ({
|
||||
"value": "scheme-fidelity",
|
||||
"label": "Fidelity",
|
||||
"description": I18n.tr("High-fidelity palette that preserves source hues.")
|
||||
}), ({
|
||||
"value": "scheme-fruit-salad",
|
||||
"label": "Fruit Salad",
|
||||
"description": I18n.tr("Colorful mix of bright contrasting accents.")
|
||||
}), ({
|
||||
"value": "scheme-monochrome",
|
||||
"label": "Monochrome",
|
||||
"description": I18n.tr("Minimal palette built around a single hue.")
|
||||
}), ({
|
||||
"value": "scheme-neutral",
|
||||
"label": "Neutral",
|
||||
"description": I18n.tr("Muted palette with subdued, calming tones.")
|
||||
}), ({
|
||||
"value": "scheme-rainbow",
|
||||
"label": "Rainbow",
|
||||
"description": I18n.tr("Diverse palette spanning the full spectrum.")
|
||||
})]
|
||||
}),
|
||||
({
|
||||
"value": "scheme-vibrant",
|
||||
"label": "Vibrant",
|
||||
"description": I18n.tr("Lively palette with saturated accents.")
|
||||
}),
|
||||
({
|
||||
"value": "scheme-dynamic-contrast",
|
||||
"label": "Dynamic Contrast",
|
||||
"description": I18n.tr("High-contrast palette for strong visual distinction.")
|
||||
}),
|
||||
({
|
||||
"value": "scheme-content",
|
||||
"label": "Content",
|
||||
"description": I18n.tr("Derives colors that closely match the underlying image.")
|
||||
}),
|
||||
({
|
||||
"value": "scheme-expressive",
|
||||
"label": "Expressive",
|
||||
"description": I18n.tr("Vibrant palette with playful saturation.")
|
||||
}),
|
||||
({
|
||||
"value": "scheme-fidelity",
|
||||
"label": "Fidelity",
|
||||
"description": I18n.tr("High-fidelity palette that preserves source hues.")
|
||||
}),
|
||||
({
|
||||
"value": "scheme-fruit-salad",
|
||||
"label": "Fruit Salad",
|
||||
"description": I18n.tr("Colorful mix of bright contrasting accents.")
|
||||
}),
|
||||
({
|
||||
"value": "scheme-monochrome",
|
||||
"label": "Monochrome",
|
||||
"description": I18n.tr("Minimal palette built around a single hue.")
|
||||
}),
|
||||
({
|
||||
"value": "scheme-neutral",
|
||||
"label": "Neutral",
|
||||
"description": I18n.tr("Muted palette with subdued, calming tones.")
|
||||
}),
|
||||
({
|
||||
"value": "scheme-rainbow",
|
||||
"label": "Rainbow",
|
||||
"description": I18n.tr("Diverse palette spanning the full spectrum.")
|
||||
})]
|
||||
|
||||
function getMatugenScheme(value) {
|
||||
const schemes = availableMatugenSchemes
|
||||
@@ -264,12 +260,7 @@ Singleton {
|
||||
property color primaryText: currentThemeData.primaryText
|
||||
property color primaryContainer: currentThemeData.primaryContainer
|
||||
property color secondary: currentThemeData.secondary
|
||||
property color surface: {
|
||||
if (typeof SettingsData !== "undefined" && SettingsData.surfaceBase === "s") {
|
||||
return currentThemeData.background
|
||||
}
|
||||
return currentThemeData.surface
|
||||
}
|
||||
property color surface: currentThemeData.surface
|
||||
property color surfaceText: currentThemeData.surfaceText
|
||||
property color surfaceVariant: currentThemeData.surfaceVariant
|
||||
property color surfaceVariantText: currentThemeData.surfaceVariantText
|
||||
@@ -278,24 +269,9 @@ Singleton {
|
||||
property color backgroundText: currentThemeData.backgroundText
|
||||
property color outline: currentThemeData.outline
|
||||
property color outlineVariant: currentThemeData.outlineVariant || Qt.rgba(outline.r, outline.g, outline.b, 0.6)
|
||||
property color surfaceContainer: {
|
||||
if (typeof SettingsData !== "undefined" && SettingsData.surfaceBase === "s") {
|
||||
return currentThemeData.surface
|
||||
}
|
||||
return currentThemeData.surfaceContainer
|
||||
}
|
||||
property color surfaceContainerHigh: {
|
||||
if (typeof SettingsData !== "undefined" && SettingsData.surfaceBase === "s") {
|
||||
return currentThemeData.surfaceContainer
|
||||
}
|
||||
return currentThemeData.surfaceContainerHigh
|
||||
}
|
||||
property color surfaceContainerHighest: {
|
||||
if (typeof SettingsData !== "undefined" && SettingsData.surfaceBase === "s") {
|
||||
return currentThemeData.surfaceContainerHigh
|
||||
}
|
||||
return currentThemeData.surfaceContainerHighest
|
||||
}
|
||||
property color surfaceContainer: currentThemeData.surfaceContainer
|
||||
property color surfaceContainerHigh: currentThemeData.surfaceContainerHigh
|
||||
property color surfaceContainerHighest: currentThemeData.surfaceContainerHighest
|
||||
|
||||
property color onSurface: surfaceText
|
||||
property color onSurfaceVariant: surfaceVariantText
|
||||
@@ -439,7 +415,12 @@ Singleton {
|
||||
}
|
||||
}
|
||||
|
||||
property real cornerRadius: typeof SettingsData !== "undefined" ? SettingsData.cornerRadius : 12
|
||||
property real cornerRadius: {
|
||||
if (typeof SessionData !== "undefined" && SessionData.isGreeterMode && typeof GreetdSettings !== "undefined") {
|
||||
return GreetdSettings.cornerRadius
|
||||
}
|
||||
return typeof SettingsData !== "undefined" ? SettingsData.cornerRadius : 12
|
||||
}
|
||||
property real spacingXS: 4
|
||||
property real spacingS: 8
|
||||
property real spacingM: 12
|
||||
@@ -490,7 +471,7 @@ Singleton {
|
||||
}
|
||||
const isGreeterMode = (typeof SessionData !== "undefined" && SessionData.isGreeterMode)
|
||||
if (savePrefs && typeof SettingsData !== "undefined" && !isGreeterMode)
|
||||
SettingsData.setTheme(currentTheme)
|
||||
SettingsData.set("currentThemeName", currentTheme)
|
||||
|
||||
if (!isGreeterMode) {
|
||||
generateSystemThemesFromCurrentTheme()
|
||||
@@ -612,13 +593,6 @@ Singleton {
|
||||
readonly property var _availableThemeNames: StockThemes.getAllThemeNames()
|
||||
property string currentThemeName: currentTheme
|
||||
|
||||
function popupBackground() {
|
||||
return Qt.rgba(surfaceContainer.r, surfaceContainer.g, surfaceContainer.b, popupTransparency)
|
||||
}
|
||||
|
||||
function contentBackground() {
|
||||
return Qt.rgba(surfaceContainer.r, surfaceContainer.g, surfaceContainer.b, popupTransparency)
|
||||
}
|
||||
|
||||
function panelBackground() {
|
||||
return Qt.rgba(surfaceContainer.r, surfaceContainer.g, surfaceContainer.b, panelTransparency)
|
||||
@@ -662,13 +636,6 @@ Singleton {
|
||||
}
|
||||
}
|
||||
|
||||
function getPopupBackgroundAlpha() {
|
||||
return popupTransparency
|
||||
}
|
||||
|
||||
function getContentBackgroundAlpha() {
|
||||
return popupTransparency
|
||||
}
|
||||
|
||||
function isColorDark(c) {
|
||||
return (0.299 * c.r + 0.587 * c.g + 0.114 * c.b) < 0.5
|
||||
@@ -803,7 +770,6 @@ Singleton {
|
||||
"mode": isLight ? "light" : "dark",
|
||||
"iconTheme": iconTheme || "System Default",
|
||||
"matugenType": matugenType || "scheme-tonal-spot",
|
||||
"surfaceBase": (typeof SettingsData !== "undefined" && SettingsData.surfaceBase) ? SettingsData.surfaceBase : "sc",
|
||||
"runUserTemplates": (typeof SettingsData !== "undefined") ? SettingsData.runUserMatugenTemplates : true
|
||||
}
|
||||
|
||||
@@ -813,13 +779,8 @@ Singleton {
|
||||
Quickshell.execDetached(["sh", "-c", `mkdir -p '${stateDir}' && cat > '${desiredPath}' << 'EOF'\n${json}\nEOF`])
|
||||
workerRunning = true
|
||||
const syncModeWithPortal = (typeof SettingsData !== "undefined" && SettingsData.syncModeWithPortal) ? "true" : "false"
|
||||
if (rawWallpaperPath.startsWith("we:")) {
|
||||
console.log("Theme: Starting matugen worker (WE wallpaper, waiting for screenshot)")
|
||||
systemThemeGenerator.command = ["sh", "-c", `sleep 3 && ${shellDir}/scripts/matugen-worker.sh '${stateDir}' '${shellDir}' '${configDir}' '${syncModeWithPortal}' --run`]
|
||||
} else {
|
||||
console.log("Theme: Starting matugen worker")
|
||||
systemThemeGenerator.command = [shellDir + "/scripts/matugen-worker.sh", stateDir, shellDir, configDir, syncModeWithPortal, "--run"]
|
||||
}
|
||||
console.log("Theme: Starting matugen worker")
|
||||
systemThemeGenerator.command = [shellDir + "/scripts/matugen-worker.sh", stateDir, shellDir, configDir, syncModeWithPortal, "--run"]
|
||||
systemThemeGenerator.running = true
|
||||
}
|
||||
|
||||
@@ -836,11 +797,10 @@ Singleton {
|
||||
return
|
||||
}
|
||||
const selectedMatugenType = (typeof SettingsData !== "undefined" && SettingsData.matugenScheme) ? SettingsData.matugenScheme : "scheme-tonal-spot"
|
||||
const effectivePath = rawWallpaperPath.startsWith("we:") ? (stateDir + "/we_screenshots/" + rawWallpaperPath.substring(3) + ".jpg") : rawWallpaperPath
|
||||
if (effectivePath.startsWith("#")) {
|
||||
setDesiredTheme("hex", effectivePath, isLight, iconTheme, selectedMatugenType)
|
||||
if (rawWallpaperPath.startsWith("#")) {
|
||||
setDesiredTheme("hex", rawWallpaperPath, isLight, iconTheme, selectedMatugenType)
|
||||
} else {
|
||||
setDesiredTheme("image", effectivePath, isLight, iconTheme, selectedMatugenType)
|
||||
setDesiredTheme("image", rawWallpaperPath, isLight, iconTheme, selectedMatugenType)
|
||||
}
|
||||
} else {
|
||||
let primaryColor
|
||||
|
||||
56
Common/settings/Lists.qml
Normal file
56
Common/settings/Lists.qml
Normal file
@@ -0,0 +1,56 @@
|
||||
pragma Singleton
|
||||
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
function init(leftModel, centerModel, rightModel, left, center, right) {
|
||||
const dummy = {
|
||||
widgetId: "dummy",
|
||||
enabled: true,
|
||||
size: 20,
|
||||
selectedGpuIndex: 0,
|
||||
pciId: "",
|
||||
mountPath: "/",
|
||||
minimumWidth: true,
|
||||
showSwap: false
|
||||
}
|
||||
leftModel.append(dummy)
|
||||
centerModel.append(dummy)
|
||||
rightModel.append(dummy)
|
||||
|
||||
update(leftModel, left)
|
||||
update(centerModel, center)
|
||||
update(rightModel, right)
|
||||
}
|
||||
|
||||
function update(model, order) {
|
||||
model.clear()
|
||||
for (var i = 0; i < order.length; i++) {
|
||||
var widgetId = typeof order[i] === "string" ? order[i] : order[i].id
|
||||
var enabled = typeof order[i] === "string" ? true : order[i].enabled
|
||||
var size = typeof order[i] === "string" ? undefined : order[i].size
|
||||
var selectedGpuIndex = typeof order[i] === "string" ? undefined : order[i].selectedGpuIndex
|
||||
var pciId = typeof order[i] === "string" ? undefined : order[i].pciId
|
||||
var mountPath = typeof order[i] === "string" ? undefined : order[i].mountPath
|
||||
var minimumWidth = typeof order[i] === "string" ? undefined : order[i].minimumWidth
|
||||
var showSwap = typeof order[i] === "string" ? undefined : order[i].showSwap
|
||||
var item = {
|
||||
widgetId: widgetId,
|
||||
enabled: enabled
|
||||
}
|
||||
if (size !== undefined) item.size = size
|
||||
if (selectedGpuIndex !== undefined) item.selectedGpuIndex = selectedGpuIndex
|
||||
if (pciId !== undefined) item.pciId = pciId
|
||||
if (mountPath !== undefined) item.mountPath = mountPath
|
||||
if (minimumWidth !== undefined) item.minimumWidth = minimumWidth
|
||||
if (showSwap !== undefined) item.showSwap = showSwap
|
||||
|
||||
model.append(item)
|
||||
}
|
||||
}
|
||||
}
|
||||
131
Common/settings/Processes.qml
Normal file
131
Common/settings/Processes.qml
Normal file
@@ -0,0 +1,131 @@
|
||||
pragma Singleton
|
||||
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
property var settingsRoot: null
|
||||
|
||||
function detectIcons() {
|
||||
systemDefaultDetectionProcess.running = true
|
||||
}
|
||||
|
||||
function detectQtTools() {
|
||||
qtToolsDetectionProcess.running = true
|
||||
}
|
||||
|
||||
function detectFprintd() {
|
||||
fprintdDetectionProcess.running = true
|
||||
}
|
||||
|
||||
function checkPluginSettings() {
|
||||
pluginSettingsCheckProcess.running = true
|
||||
}
|
||||
|
||||
function checkDefaultSettings() {
|
||||
defaultSettingsCheckProcess.running = true
|
||||
}
|
||||
|
||||
property var systemDefaultDetectionProcess: Process {
|
||||
command: ["sh", "-c", "gsettings get org.gnome.desktop.interface icon-theme 2>/dev/null | sed \"s/'//g\" || echo ''"]
|
||||
running: false
|
||||
onExited: function(exitCode) {
|
||||
if (!settingsRoot) return;
|
||||
if (exitCode === 0 && stdout && stdout.length > 0) {
|
||||
settingsRoot.systemDefaultIconTheme = stdout.trim();
|
||||
} else {
|
||||
settingsRoot.systemDefaultIconTheme = "";
|
||||
}
|
||||
iconThemeDetectionProcess.running = true;
|
||||
}
|
||||
}
|
||||
|
||||
property var iconThemeDetectionProcess: Process {
|
||||
|
||||
command: ["sh", "-c", "find /usr/share/icons ~/.local/share/icons ~/.icons -maxdepth 1 -type d 2>/dev/null | sed 's|.*/||' | grep -v '^icons$' | sort -u"]
|
||||
running: false
|
||||
|
||||
stdout: StdioCollector {
|
||||
onStreamFinished: {
|
||||
if (!settingsRoot) return
|
||||
var detectedThemes = ["System Default"]
|
||||
if (text && text.trim()) {
|
||||
var themes = text.trim().split('\n')
|
||||
for (var i = 0; i < themes.length; i++) {
|
||||
var theme = themes[i].trim()
|
||||
if (theme && theme !== "" && theme !== "default" && theme !== "hicolor" && theme !== "locolor") {
|
||||
detectedThemes.push(theme)
|
||||
}
|
||||
}
|
||||
}
|
||||
settingsRoot.availableIconThemes = detectedThemes
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
property var qtToolsDetectionProcess: Process {
|
||||
command: ["sh", "-c", "echo -n 'qt5ct:'; command -v qt5ct >/dev/null && echo 'true' || echo 'false'; echo -n 'qt6ct:'; command -v qt6ct >/dev/null && echo 'true' || echo 'false'; echo -n 'gtk:'; (command -v gsettings >/dev/null || command -v dconf >/dev/null) && echo 'true' || echo 'false'"]
|
||||
running: false
|
||||
|
||||
stdout: StdioCollector {
|
||||
onStreamFinished: {
|
||||
if (!settingsRoot) return;
|
||||
if (text && text.trim()) {
|
||||
var lines = text.trim().split('\n');
|
||||
for (var i = 0; i < lines.length; i++) {
|
||||
var line = lines[i];
|
||||
if (line.startsWith('qt5ct:')) {
|
||||
settingsRoot.qt5ctAvailable = line.split(':')[1] === 'true';
|
||||
} else if (line.startsWith('qt6ct:')) {
|
||||
settingsRoot.qt6ctAvailable = line.split(':')[1] === 'true';
|
||||
} else if (line.startsWith('gtk:')) {
|
||||
settingsRoot.gtkAvailable = line.split(':')[1] === 'true';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
property var defaultSettingsCheckProcess: Process {
|
||||
command: ["sh", "-c", "CONFIG_DIR=\"" + (settingsRoot?._configDir || "") + "/DankMaterialShell\"; if [ -f \"$CONFIG_DIR/default-settings.json\" ] && [ ! -f \"$CONFIG_DIR/settings.json\" ]; then cp --no-preserve=mode \"$CONFIG_DIR/default-settings.json\" \"$CONFIG_DIR/settings.json\" && echo 'copied'; else echo 'not_found'; fi"]
|
||||
running: false
|
||||
onExited: function(exitCode) {
|
||||
if (!settingsRoot) return;
|
||||
if (exitCode === 0) {
|
||||
console.info("Copied default-settings.json to settings.json");
|
||||
if (settingsRoot.settingsFile) {
|
||||
settingsRoot.settingsFile.reload();
|
||||
}
|
||||
} else {
|
||||
if (typeof ThemeApplier !== "undefined") {
|
||||
ThemeApplier.applyStoredTheme(settingsRoot);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
property var fprintdDetectionProcess: Process {
|
||||
command: ["sh", "-c", "command -v fprintd-list >/dev/null 2>&1"]
|
||||
running: false
|
||||
onExited: function(exitCode) {
|
||||
if (!settingsRoot) return;
|
||||
settingsRoot.fprintdAvailable = (exitCode === 0);
|
||||
}
|
||||
}
|
||||
|
||||
property var pluginSettingsCheckProcess: Process {
|
||||
command: ["test", "-f", settingsRoot?.pluginSettingsPath || ""]
|
||||
running: false
|
||||
|
||||
onExited: function(exitCode) {
|
||||
if (!settingsRoot) return;
|
||||
settingsRoot.pluginSettingsFileExists = (exitCode === 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
232
Common/settings/SettingsSpec.js
Normal file
232
Common/settings/SettingsSpec.js
Normal file
@@ -0,0 +1,232 @@
|
||||
.pragma library
|
||||
|
||||
function percentToUnit(v) {
|
||||
if (v === undefined || v === null) return undefined;
|
||||
return v > 1 ? v / 100 : v;
|
||||
}
|
||||
|
||||
var SPEC = {
|
||||
currentThemeName: { def: "blue", onChange: "applyStoredTheme" },
|
||||
customThemeFile: { def: "" },
|
||||
matugenScheme: { def: "scheme-tonal-spot", onChange: "regenSystemThemes" },
|
||||
runUserMatugenTemplates: { def: true, onChange: "regenSystemThemes" },
|
||||
matugenTargetMonitor: { def: "", onChange: "regenSystemThemes" },
|
||||
|
||||
dankBarTransparency: { def: 1.0, coerce: percentToUnit, migrate: ["topBarTransparency"] },
|
||||
dankBarWidgetTransparency: { def: 1.0, coerce: percentToUnit, migrate: ["topBarWidgetTransparency"] },
|
||||
popupTransparency: { def: 1.0, coerce: percentToUnit },
|
||||
dockTransparency: { def: 1.0, coerce: percentToUnit },
|
||||
|
||||
widgetBackgroundColor: { def: "sch" },
|
||||
cornerRadius: { def: 12, onChange: "updateNiriLayout" },
|
||||
|
||||
use24HourClock: { def: true },
|
||||
showSeconds: { def: false },
|
||||
useFahrenheit: { def: false },
|
||||
nightModeEnabled: { def: false },
|
||||
animationSpeed: { def: 1 },
|
||||
customAnimationDuration: { def: 500 },
|
||||
wallpaperFillMode: { def: "Fill" },
|
||||
blurredWallpaperLayer: { def: false },
|
||||
blurWallpaperOnOverview: { def: false },
|
||||
|
||||
showLauncherButton: { def: true },
|
||||
showWorkspaceSwitcher: { def: true },
|
||||
showFocusedWindow: { def: true },
|
||||
showWeather: { def: true },
|
||||
showMusic: { def: true },
|
||||
showClipboard: { def: true },
|
||||
showCpuUsage: { def: true },
|
||||
showMemUsage: { def: true },
|
||||
showCpuTemp: { def: true },
|
||||
showGpuTemp: { def: true },
|
||||
selectedGpuIndex: { def: 0 },
|
||||
enabledGpuPciIds: { def: [] },
|
||||
showSystemTray: { def: true },
|
||||
showClock: { def: true },
|
||||
showNotificationButton: { def: true },
|
||||
showBattery: { def: true },
|
||||
showControlCenterButton: { def: true },
|
||||
|
||||
controlCenterShowNetworkIcon: { def: true },
|
||||
controlCenterShowBluetoothIcon: { def: true },
|
||||
controlCenterShowAudioIcon: { def: true },
|
||||
controlCenterWidgets: { def: [
|
||||
{ id: "volumeSlider", enabled: true, width: 50 },
|
||||
{ id: "brightnessSlider", enabled: true, width: 50 },
|
||||
{ id: "wifi", enabled: true, width: 50 },
|
||||
{ id: "bluetooth", enabled: true, width: 50 },
|
||||
{ id: "audioOutput", enabled: true, width: 50 },
|
||||
{ id: "audioInput", enabled: true, width: 50 },
|
||||
{ id: "nightMode", enabled: true, width: 50 },
|
||||
{ id: "darkMode", enabled: true, width: 50 }
|
||||
]},
|
||||
|
||||
showWorkspaceIndex: { def: false },
|
||||
showWorkspacePadding: { def: false },
|
||||
workspaceScrolling: { def: false },
|
||||
showWorkspaceApps: { def: false },
|
||||
maxWorkspaceIcons: { def: 3 },
|
||||
workspacesPerMonitor: { def: true },
|
||||
dwlShowAllTags: { def: false },
|
||||
workspaceNameIcons: { def: {} },
|
||||
waveProgressEnabled: { def: true },
|
||||
clockCompactMode: { def: false },
|
||||
focusedWindowCompactMode: { def: false },
|
||||
runningAppsCompactMode: { def: true },
|
||||
keyboardLayoutNameCompactMode: { def: false },
|
||||
runningAppsCurrentWorkspace: { def: false },
|
||||
runningAppsGroupByApp: { def: false },
|
||||
clockDateFormat: { def: "" },
|
||||
lockDateFormat: { def: "" },
|
||||
mediaSize: { def: 1 },
|
||||
|
||||
dankBarLeftWidgets: { def: ["launcherButton", "workspaceSwitcher", "focusedWindow"], migrate: ["topBarLeftWidgets"] },
|
||||
dankBarCenterWidgets: { def: ["music", "clock", "weather"], migrate: ["topBarCenterWidgets"] },
|
||||
dankBarRightWidgets: { def: ["systemTray", "clipboard", "cpuUsage", "memUsage", "notificationButton", "battery", "controlCenterButton"], migrate: ["topBarRightWidgets"] },
|
||||
dankBarWidgetOrder: { def: [] },
|
||||
|
||||
appLauncherViewMode: { def: "list" },
|
||||
spotlightModalViewMode: { def: "list" },
|
||||
sortAppsAlphabetically: { def: false },
|
||||
|
||||
weatherLocation: { def: "New York, NY" },
|
||||
weatherCoordinates: { def: "40.7128,-74.0060" },
|
||||
useAutoLocation: { def: false },
|
||||
weatherEnabled: { def: true },
|
||||
|
||||
networkPreference: { def: "auto" },
|
||||
vpnLastConnected: { def: "" },
|
||||
|
||||
iconTheme: { def: "System Default", onChange: "applyStoredIconTheme" },
|
||||
availableIconThemes: { def: ["System Default"], persist: false },
|
||||
systemDefaultIconTheme: { def: "", persist: false },
|
||||
qt5ctAvailable: { def: false, persist: false },
|
||||
qt6ctAvailable: { def: false, persist: false },
|
||||
gtkAvailable: { def: false, persist: false },
|
||||
|
||||
launcherLogoMode: { def: "apps" },
|
||||
launcherLogoCustomPath: { def: "" },
|
||||
launcherLogoColorOverride: { def: "" },
|
||||
launcherLogoColorInvertOnMode: { def: false },
|
||||
launcherLogoBrightness: { def: 0.5 },
|
||||
launcherLogoContrast: { def: 1 },
|
||||
launcherLogoSizeOffset: { def: 0 },
|
||||
|
||||
fontFamily: { def: "Inter Variable" },
|
||||
monoFontFamily: { def: "Fira Code" },
|
||||
fontWeight: { def: 400 },
|
||||
fontScale: { def: 1.0 },
|
||||
dankBarFontScale: { def: 1.0 },
|
||||
|
||||
notepadUseMonospace: { def: true },
|
||||
notepadFontFamily: { def: "" },
|
||||
notepadFontSize: { def: 14 },
|
||||
notepadShowLineNumbers: { def: false },
|
||||
notepadTransparencyOverride: { def: -1 },
|
||||
notepadLastCustomTransparency: { def: 0.7 },
|
||||
|
||||
soundsEnabled: { def: true },
|
||||
useSystemSoundTheme: { def: false },
|
||||
soundNewNotification: { def: true },
|
||||
soundVolumeChanged: { def: true },
|
||||
soundPluggedIn: { def: true },
|
||||
|
||||
acMonitorTimeout: { def: 0 },
|
||||
acLockTimeout: { def: 0 },
|
||||
acSuspendTimeout: { def: 0 },
|
||||
acSuspendBehavior: { def: 0 },
|
||||
batteryMonitorTimeout: { def: 0 },
|
||||
batteryLockTimeout: { def: 0 },
|
||||
batterySuspendTimeout: { def: 0 },
|
||||
batterySuspendBehavior: { def: 0 },
|
||||
lockBeforeSuspend: { def: false },
|
||||
loginctlLockIntegration: { def: true },
|
||||
launchPrefix: { def: "" },
|
||||
brightnessDevicePins: { def: {} },
|
||||
|
||||
gtkThemingEnabled: { def: false, onChange: "regenSystemThemes" },
|
||||
qtThemingEnabled: { def: false, onChange: "regenSystemThemes" },
|
||||
syncModeWithPortal: { def: true },
|
||||
|
||||
showDock: { def: false },
|
||||
dockAutoHide: { def: false },
|
||||
dockGroupByApp: { def: false },
|
||||
dockOpenOnOverview: { def: false },
|
||||
dockPosition: { def: 1 },
|
||||
dockSpacing: { def: 4 },
|
||||
dockBottomGap: { def: 0 },
|
||||
dockMargin: { def: 0 },
|
||||
dockIconSize: { def: 40 },
|
||||
dockIndicatorStyle: { def: "circle" },
|
||||
|
||||
notificationOverlayEnabled: { def: false },
|
||||
dankBarAutoHide: { def: false, migrate: ["topBarAutoHide"] },
|
||||
dankBarOpenOnOverview: { def: false, migrate: ["topBarOpenOnOverview"] },
|
||||
dankBarVisible: { def: true, migrate: ["topBarVisible"] },
|
||||
overviewRows: { def: 2, persist: false },
|
||||
overviewColumns: { def: 5, persist: false },
|
||||
overviewScale: { def: 0.16, persist: false },
|
||||
dankBarSpacing: { def: 4, migrate: ["topBarSpacing"], onChange: "updateNiriLayout" },
|
||||
dankBarBottomGap: { def: 0, migrate: ["topBarBottomGap"] },
|
||||
dankBarInnerPadding: { def: 4, migrate: ["topBarInnerPadding"] },
|
||||
dankBarPosition: { def: 0, migrate: ["dankBarAtBottom", "topBarAtBottom"] },
|
||||
dankBarIsVertical: { def: false, persist: false },
|
||||
|
||||
dankBarSquareCorners: { def: false, migrate: ["topBarSquareCorners"] },
|
||||
dankBarNoBackground: { def: false, migrate: ["topBarNoBackground"] },
|
||||
dankBarGothCornersEnabled: { def: false, migrate: ["topBarGothCornersEnabled"] },
|
||||
dankBarGothCornerRadiusOverride: { def: false },
|
||||
dankBarGothCornerRadiusValue: { def: 12 },
|
||||
dankBarBorderEnabled: { def: false },
|
||||
dankBarBorderColor: { def: "surfaceText" },
|
||||
dankBarBorderOpacity: { def: 1.0 },
|
||||
dankBarBorderThickness: { def: 1 },
|
||||
|
||||
popupGapsAuto: { def: true },
|
||||
popupGapsManual: { def: 4 },
|
||||
|
||||
modalDarkenBackground: { def: true },
|
||||
|
||||
lockScreenShowPowerActions: { def: true },
|
||||
enableFprint: { def: false },
|
||||
maxFprintTries: { def: 3 },
|
||||
fprintdAvailable: { def: false, persist: false },
|
||||
hideBrightnessSlider: { def: false },
|
||||
|
||||
notificationTimeoutLow: { def: 5000 },
|
||||
notificationTimeoutNormal: { def: 5000 },
|
||||
notificationTimeoutCritical: { def: 0 },
|
||||
notificationPopupPosition: { def: 0 },
|
||||
|
||||
osdAlwaysShowValue: { def: false },
|
||||
|
||||
powerActionConfirm: { def: true },
|
||||
customPowerActionLock: { def: "" },
|
||||
customPowerActionLogout: { def: "" },
|
||||
customPowerActionSuspend: { def: "" },
|
||||
customPowerActionHibernate: { def: "" },
|
||||
customPowerActionReboot: { def: "" },
|
||||
customPowerActionPowerOff: { def: "" },
|
||||
|
||||
updaterUseCustomCommand: { def: false },
|
||||
updaterCustomCommand: { def: "" },
|
||||
updaterTerminalAdditionalParams: { def: "" },
|
||||
|
||||
screenPreferences: { def: {} },
|
||||
showOnLastDisplay: { def: {} }
|
||||
};
|
||||
|
||||
function getValidKeys() {
|
||||
return Object.keys(SPEC).filter(function(k) { return SPEC[k].persist !== false; }).concat(["configVersion"]);
|
||||
}
|
||||
|
||||
function set(root, key, value, saveFn, hooks) {
|
||||
if (!(key in SPEC)) return;
|
||||
root[key] = value;
|
||||
var hookName = SPEC[key].onChange;
|
||||
if (hookName && hooks && hooks[hookName]) {
|
||||
hooks[hookName](root);
|
||||
}
|
||||
saveFn();
|
||||
}
|
||||
118
Common/settings/SettingsStore.js
Normal file
118
Common/settings/SettingsStore.js
Normal file
@@ -0,0 +1,118 @@
|
||||
.pragma library
|
||||
|
||||
.import "./SettingsSpec.js" as SpecModule
|
||||
|
||||
function parse(root, jsonObj) {
|
||||
var SPEC = SpecModule.SPEC;
|
||||
for (var k in SPEC) {
|
||||
var spec = SPEC[k];
|
||||
root[k] = spec.def;
|
||||
}
|
||||
|
||||
if (!jsonObj) return;
|
||||
|
||||
for (var k in jsonObj) {
|
||||
if (!SPEC[k]) continue;
|
||||
var raw = jsonObj[k];
|
||||
var spec = SPEC[k];
|
||||
var coerce = spec.coerce;
|
||||
root[k] = coerce ? (coerce(raw) !== undefined ? coerce(raw) : root[k]) : raw;
|
||||
}
|
||||
}
|
||||
|
||||
function toJson(root) {
|
||||
var SPEC = SpecModule.SPEC;
|
||||
var out = {};
|
||||
for (var k in SPEC) {
|
||||
if (SPEC[k].persist === false) continue;
|
||||
out[k] = root[k];
|
||||
}
|
||||
out.configVersion = root.settingsConfigVersion;
|
||||
return out;
|
||||
}
|
||||
|
||||
function migrate(root, jsonObj) {
|
||||
var SPEC = SpecModule.SPEC;
|
||||
if (!jsonObj) return;
|
||||
|
||||
if (jsonObj.themeIndex !== undefined || jsonObj.themeIsDynamic !== undefined) {
|
||||
var themeNames = ["blue", "deepBlue", "purple", "green", "orange", "red", "cyan", "pink", "amber", "coral"];
|
||||
if (jsonObj.themeIsDynamic) {
|
||||
root.currentThemeName = "dynamic";
|
||||
} else if (jsonObj.themeIndex >= 0 && jsonObj.themeIndex < themeNames.length) {
|
||||
root.currentThemeName = themeNames[jsonObj.themeIndex];
|
||||
}
|
||||
console.info("Auto-migrated theme from index", jsonObj.themeIndex, "to", root.currentThemeName);
|
||||
}
|
||||
|
||||
if ((jsonObj.dankBarWidgetOrder && jsonObj.dankBarWidgetOrder.length > 0) ||
|
||||
(jsonObj.topBarWidgetOrder && jsonObj.topBarWidgetOrder.length > 0)) {
|
||||
if (jsonObj.dankBarLeftWidgets === undefined && jsonObj.dankBarCenterWidgets === undefined && jsonObj.dankBarRightWidgets === undefined) {
|
||||
var widgetOrder = jsonObj.dankBarWidgetOrder || jsonObj.topBarWidgetOrder;
|
||||
root.dankBarLeftWidgets = widgetOrder.filter(function(w) { return ["launcherButton", "workspaceSwitcher", "focusedWindow"].indexOf(w) >= 0; });
|
||||
root.dankBarCenterWidgets = widgetOrder.filter(function(w) { return ["clock", "music", "weather"].indexOf(w) >= 0; });
|
||||
root.dankBarRightWidgets = widgetOrder.filter(function(w) { return ["systemTray", "clipboard", "systemResources", "notificationButton", "battery", "controlCenterButton"].indexOf(w) >= 0; });
|
||||
}
|
||||
}
|
||||
|
||||
if (jsonObj.useOSLogo !== undefined) {
|
||||
root.launcherLogoMode = jsonObj.useOSLogo ? "os" : "apps";
|
||||
root.launcherLogoColorOverride = jsonObj.osLogoColorOverride !== undefined ? jsonObj.osLogoColorOverride : "";
|
||||
root.launcherLogoBrightness = jsonObj.osLogoBrightness !== undefined ? jsonObj.osLogoBrightness : 0.5;
|
||||
root.launcherLogoContrast = jsonObj.osLogoContrast !== undefined ? jsonObj.osLogoContrast : 1;
|
||||
}
|
||||
|
||||
if (jsonObj.mediaCompactMode !== undefined && jsonObj.mediaSize === undefined) {
|
||||
root.mediaSize = jsonObj.mediaCompactMode ? 0 : 1;
|
||||
}
|
||||
|
||||
for (var k in SPEC) {
|
||||
var spec = SPEC[k];
|
||||
if (!spec.migrate) continue;
|
||||
for (var i = 0; i < spec.migrate.length; i++) {
|
||||
var oldKey = spec.migrate[i];
|
||||
if (jsonObj[oldKey] !== undefined && jsonObj[k] === undefined) {
|
||||
var raw = jsonObj[oldKey];
|
||||
var coerce = spec.coerce;
|
||||
root[k] = coerce ? (coerce(raw) !== undefined ? coerce(raw) : root[k]) : raw;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (jsonObj.dankBarAtBottom !== undefined || jsonObj.topBarAtBottom !== undefined) {
|
||||
var atBottom = jsonObj.dankBarAtBottom !== undefined ? jsonObj.dankBarAtBottom : jsonObj.topBarAtBottom;
|
||||
root.dankBarPosition = atBottom ? 1 : 0;
|
||||
}
|
||||
|
||||
if (jsonObj.pluginSettings !== undefined) {
|
||||
root.pluginSettings = jsonObj.pluginSettings;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function cleanup(fileText) {
|
||||
var getValidKeys = SpecModule.getValidKeys;
|
||||
if (!fileText || !fileText.trim()) return;
|
||||
|
||||
try {
|
||||
var settings = JSON.parse(fileText);
|
||||
var validKeys = getValidKeys();
|
||||
var needsSave = false;
|
||||
|
||||
for (var key in settings) {
|
||||
if (validKeys.indexOf(key) < 0) {
|
||||
console.log("SettingsData: Removing unused key:", key);
|
||||
delete settings[key];
|
||||
needsSave = true;
|
||||
}
|
||||
}
|
||||
|
||||
return needsSave ? JSON.stringify(settings, null, 2) : null;
|
||||
} catch (e) {
|
||||
console.warn("SettingsData: Failed to cleanup unused keys:", e.message);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,8 @@ import qs.Widgets
|
||||
DankModal {
|
||||
id: root
|
||||
|
||||
layerNamespace: "dms:bluetooth-pairing"
|
||||
|
||||
property string deviceName: ""
|
||||
property string deviceAddress: ""
|
||||
property string requestType: ""
|
||||
@@ -201,7 +203,7 @@ DankModal {
|
||||
width: parent.width
|
||||
height: 56
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainerHighest
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency)
|
||||
visible: requestType === "confirm"
|
||||
|
||||
Column {
|
||||
|
||||
@@ -26,7 +26,7 @@ Rectangle {
|
||||
if (isSelected) {
|
||||
return Theme.primaryPressed
|
||||
}
|
||||
return mouseArea.containsMouse ? Theme.primaryHoverLight : Theme.surfaceContainerHigh
|
||||
return mouseArea.containsMouse ? Theme.primaryHoverLight : Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
}
|
||||
|
||||
Row {
|
||||
|
||||
@@ -12,6 +12,8 @@ import qs.Widgets
|
||||
DankModal {
|
||||
id: clipboardHistoryModal
|
||||
|
||||
layerNamespace: "dms:clipboard"
|
||||
|
||||
property int totalCount: 0
|
||||
property var clipboardEntries: []
|
||||
property string searchText: ""
|
||||
@@ -136,7 +138,7 @@ DankModal {
|
||||
visible: false
|
||||
width: ClipboardConstants.modalWidth
|
||||
height: ClipboardConstants.modalHeight
|
||||
backgroundColor: Theme.popupBackground()
|
||||
backgroundColor: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
||||
cornerRadius: Theme.cornerRadius
|
||||
borderColor: Theme.outlineMedium
|
||||
borderWidth: 1
|
||||
|
||||
@@ -8,7 +8,8 @@ import qs.Services
|
||||
PanelWindow {
|
||||
id: root
|
||||
|
||||
WlrLayershell.namespace: "quickshell:modal"
|
||||
property string layerNamespace: "dms:modal"
|
||||
WlrLayershell.namespace: layerNamespace
|
||||
|
||||
property alias content: contentLoader.sourceComponent
|
||||
property alias contentLoader: contentLoader
|
||||
@@ -110,24 +111,24 @@ PanelWindow {
|
||||
bottom: true
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
enabled: root.closeOnBackgroundClick && root.shouldBeVisible
|
||||
onClicked: mouse => {
|
||||
const localPos = mapToItem(contentContainer, mouse.x, mouse.y)
|
||||
if (localPos.x < 0 || localPos.x > contentContainer.width || localPos.y < 0 || localPos.y > contentContainer.height) {
|
||||
root.backgroundClicked()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: background
|
||||
|
||||
anchors.fill: parent
|
||||
color: "black"
|
||||
opacity: root.showBackground ? (root.shouldBeVisible ? root.backgroundOpacity : 0) : 0
|
||||
visible: root.showBackground
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
enabled: root.closeOnBackgroundClick
|
||||
onClicked: mouse => {
|
||||
const localPos = mapToItem(contentContainer, mouse.x, mouse.y)
|
||||
if (localPos.x < 0 || localPos.x > contentContainer.width || localPos.y < 0 || localPos.y > contentContainer.height) {
|
||||
root.backgroundClicked()
|
||||
}
|
||||
}
|
||||
}
|
||||
opacity: root.showBackground && SettingsData.modalDarkenBackground ? (root.shouldBeVisible ? root.backgroundOpacity : 0) : 0
|
||||
visible: root.showBackground && SettingsData.modalDarkenBackground
|
||||
|
||||
Behavior on opacity {
|
||||
NumberAnimation {
|
||||
@@ -138,12 +139,11 @@ PanelWindow {
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: contentContainer
|
||||
Item {
|
||||
id: modalContainer
|
||||
|
||||
width: Theme.px(root.width, dpr)
|
||||
height: Theme.px(root.height, dpr)
|
||||
anchors.centerIn: undefined
|
||||
x: {
|
||||
if (positioning === "center") {
|
||||
return Theme.snap((root.screenWidth - width) / 2, dpr)
|
||||
@@ -164,101 +164,93 @@ PanelWindow {
|
||||
}
|
||||
return 0
|
||||
}
|
||||
color: root.backgroundColor
|
||||
radius: root.cornerRadius
|
||||
border.color: root.borderColor
|
||||
border.width: root.borderWidth
|
||||
clip: false
|
||||
layer.enabled: true
|
||||
layer.smooth: true
|
||||
layer.textureSize: Qt.size(width * Math.max(2, root.screen?.devicePixelRatio || 1), height * Math.max(2, root.screen?.devicePixelRatio || 1))
|
||||
layer.samples: 4
|
||||
opacity: root.shouldBeVisible ? 1 : 0
|
||||
transform: [scaleTransform, motionTransform]
|
||||
|
||||
Scale {
|
||||
id: scaleTransform
|
||||
readonly property bool slide: root.animationType === "slide"
|
||||
readonly property real offsetX: slide ? 15 : 0
|
||||
readonly property real offsetY: slide ? -30 : root.animationOffset
|
||||
|
||||
origin.x: contentContainer.width / 2
|
||||
origin.y: contentContainer.height / 2
|
||||
xScale: root.shouldBeVisible ? 1 : root.animationScaleCollapsed
|
||||
yScale: root.shouldBeVisible ? 1 : root.animationScaleCollapsed
|
||||
property real animX: 0
|
||||
property real animY: 0
|
||||
property real scaleValue: root.animationScaleCollapsed
|
||||
|
||||
Behavior on xScale {
|
||||
NumberAnimation {
|
||||
duration: root.animationDuration
|
||||
easing.type: Easing.BezierSpline
|
||||
easing.bezierCurve: root.shouldBeVisible ? root.animationEnterCurve : root.animationExitCurve
|
||||
}
|
||||
}
|
||||
onOffsetXChanged: animX = Theme.snap(root.shouldBeVisible ? 0 : offsetX, root.dpr)
|
||||
onOffsetYChanged: animY = Theme.snap(root.shouldBeVisible ? 0 : offsetY, root.dpr)
|
||||
|
||||
Behavior on yScale {
|
||||
NumberAnimation {
|
||||
duration: root.animationDuration
|
||||
easing.type: Easing.BezierSpline
|
||||
easing.bezierCurve: root.shouldBeVisible ? root.animationEnterCurve : root.animationExitCurve
|
||||
}
|
||||
Connections {
|
||||
target: root
|
||||
function onShouldBeVisibleChanged() {
|
||||
modalContainer.animX = Theme.snap(root.shouldBeVisible ? 0 : modalContainer.offsetX, root.dpr)
|
||||
modalContainer.animY = Theme.snap(root.shouldBeVisible ? 0 : modalContainer.offsetY, root.dpr)
|
||||
modalContainer.scaleValue = root.shouldBeVisible ? 1.0 : root.animationScaleCollapsed
|
||||
}
|
||||
}
|
||||
|
||||
Translate {
|
||||
id: motionTransform
|
||||
|
||||
readonly property bool slide: root.animationType === "slide"
|
||||
readonly property real hiddenX: slide ? 15 : 0
|
||||
readonly property real hiddenY: slide ? -30 : root.animationOffset
|
||||
|
||||
x: Theme.snap(root.shouldBeVisible ? 0 : hiddenX, root.dpr)
|
||||
y: Theme.snap(root.shouldBeVisible ? 0 : hiddenY, root.dpr)
|
||||
|
||||
Behavior on x {
|
||||
NumberAnimation {
|
||||
duration: root.animationDuration
|
||||
easing.type: Easing.BezierSpline
|
||||
easing.bezierCurve: root.shouldBeVisible ? root.animationEnterCurve : root.animationExitCurve
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on y {
|
||||
NumberAnimation {
|
||||
duration: root.animationDuration
|
||||
easing.type: Easing.BezierSpline
|
||||
easing.bezierCurve: root.shouldBeVisible ? root.animationEnterCurve : root.animationExitCurve
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on opacity {
|
||||
Behavior on animX {
|
||||
NumberAnimation {
|
||||
duration: animationDuration
|
||||
duration: root.animationDuration
|
||||
easing.type: Easing.BezierSpline
|
||||
easing.bezierCurve: root.shouldBeVisible ? root.animationEnterCurve : root.animationExitCurve
|
||||
}
|
||||
}
|
||||
|
||||
FocusScope {
|
||||
anchors.fill: parent
|
||||
focus: root.shouldBeVisible
|
||||
Behavior on animY {
|
||||
NumberAnimation {
|
||||
duration: root.animationDuration
|
||||
easing.type: Easing.BezierSpline
|
||||
easing.bezierCurve: root.shouldBeVisible ? root.animationEnterCurve : root.animationExitCurve
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on scaleValue {
|
||||
NumberAnimation {
|
||||
duration: root.animationDuration
|
||||
easing.type: Easing.BezierSpline
|
||||
easing.bezierCurve: root.shouldBeVisible ? root.animationEnterCurve : root.animationExitCurve
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: contentContainer
|
||||
|
||||
anchors.centerIn: parent
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
color: root.backgroundColor
|
||||
radius: root.cornerRadius
|
||||
border.color: root.borderColor
|
||||
border.width: root.borderWidth
|
||||
clip: false
|
||||
layer.enabled: true
|
||||
layer.smooth: false
|
||||
layer.textureSize: Qt.size(width * root.dpr, height * root.dpr)
|
||||
layer.textureMirroring: ShaderEffectSource.NoMirroring
|
||||
opacity: root.shouldBeVisible ? 1 : 0
|
||||
scale: modalContainer.scaleValue
|
||||
x: Theme.snap(modalContainer.animX + (parent.width - width) * (1 - modalContainer.scaleValue) * 0.5, root.dpr)
|
||||
y: Theme.snap(modalContainer.animY + (parent.height - height) * (1 - modalContainer.scaleValue) * 0.5, root.dpr)
|
||||
|
||||
Item {
|
||||
id: directContentWrapper
|
||||
Behavior on opacity {
|
||||
NumberAnimation {
|
||||
duration: animationDuration
|
||||
easing.type: Easing.BezierSpline
|
||||
easing.bezierCurve: root.shouldBeVisible ? root.animationEnterCurve : root.animationExitCurve
|
||||
}
|
||||
}
|
||||
|
||||
FocusScope {
|
||||
anchors.fill: parent
|
||||
visible: root.directContent !== null
|
||||
focus: true
|
||||
focus: root.shouldBeVisible
|
||||
clip: false
|
||||
|
||||
Component.onCompleted: {
|
||||
if (root.directContent) {
|
||||
root.directContent.parent = directContentWrapper
|
||||
root.directContent.anchors.fill = directContentWrapper
|
||||
Qt.callLater(() => root.directContent.forceActiveFocus())
|
||||
}
|
||||
}
|
||||
Item {
|
||||
id: directContentWrapper
|
||||
|
||||
Connections {
|
||||
function onDirectContentChanged() {
|
||||
anchors.fill: parent
|
||||
visible: root.directContent !== null
|
||||
focus: true
|
||||
clip: false
|
||||
|
||||
Component.onCompleted: {
|
||||
if (root.directContent) {
|
||||
root.directContent.parent = directContentWrapper
|
||||
root.directContent.anchors.fill = directContentWrapper
|
||||
@@ -266,23 +258,33 @@ PanelWindow {
|
||||
}
|
||||
}
|
||||
|
||||
target: root
|
||||
Connections {
|
||||
function onDirectContentChanged() {
|
||||
if (root.directContent) {
|
||||
root.directContent.parent = directContentWrapper
|
||||
root.directContent.anchors.fill = directContentWrapper
|
||||
Qt.callLater(() => root.directContent.forceActiveFocus())
|
||||
}
|
||||
}
|
||||
|
||||
target: root
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: contentLoader
|
||||
Loader {
|
||||
id: contentLoader
|
||||
|
||||
anchors.fill: parent
|
||||
active: root.directContent === null && (root.keepContentLoaded || root.shouldBeVisible || root.visible)
|
||||
asynchronous: false
|
||||
focus: true
|
||||
clip: false
|
||||
visible: root.directContent === null
|
||||
anchors.fill: parent
|
||||
active: root.directContent === null && (root.keepContentLoaded || root.shouldBeVisible || root.visible)
|
||||
asynchronous: false
|
||||
focus: true
|
||||
clip: false
|
||||
visible: root.directContent === null
|
||||
|
||||
onLoaded: {
|
||||
if (item) {
|
||||
Qt.callLater(() => item.forceActiveFocus())
|
||||
onLoaded: {
|
||||
if (item) {
|
||||
Qt.callLater(() => item.forceActiveFocus())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ import qs.Widgets
|
||||
DankModal {
|
||||
id: root
|
||||
|
||||
layerNamespace: "dms:color-picker"
|
||||
|
||||
property string pickerTitle: "Choose Color"
|
||||
property color selectedColor: SessionData.recentColors.length > 0 ? SessionData.recentColors[0] : Theme.primary
|
||||
property var onColorSelectedCallback: null
|
||||
@@ -382,7 +384,7 @@ DankModal {
|
||||
if (index < SessionData.recentColors.length) {
|
||||
return SessionData.recentColors[index]
|
||||
}
|
||||
return Theme.surfaceContainerHigh
|
||||
return Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
}
|
||||
|
||||
opacity: index < SessionData.recentColors.length ? 1.0 : 0.3
|
||||
|
||||
@@ -91,7 +91,7 @@ StyledRect {
|
||||
if (keyboardNavigationActive && delegateRoot.index === selectedIndex)
|
||||
return Theme.surfacePressed
|
||||
|
||||
return mouseArea.containsMouse ? Theme.surfaceContainerHigh : "transparent"
|
||||
return mouseArea.containsMouse ? Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) : "transparent"
|
||||
}
|
||||
border.color: keyboardNavigationActive && delegateRoot.index === selectedIndex ? Theme.primary : "transparent"
|
||||
border.width: (keyboardNavigationActive && delegateRoot.index === selectedIndex) ? 2 : 0
|
||||
|
||||
@@ -98,7 +98,7 @@ StyledRect {
|
||||
color: {
|
||||
if (keyboardNavigationActive && listDelegateRoot.index === selectedIndex)
|
||||
return Theme.surfacePressed
|
||||
return listMouseArea.containsMouse ? Theme.surfaceContainerHigh : "transparent"
|
||||
return listMouseArea.containsMouse ? Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) : "transparent"
|
||||
}
|
||||
border.color: keyboardNavigationActive && listDelegateRoot.index === selectedIndex ? Theme.primary : "transparent"
|
||||
border.width: (keyboardNavigationActive && listDelegateRoot.index === selectedIndex) ? 2 : 0
|
||||
|
||||
@@ -11,6 +11,8 @@ import qs.Widgets
|
||||
DankModal {
|
||||
id: fileBrowserModal
|
||||
|
||||
layerNamespace: "dms:file-browser"
|
||||
|
||||
property string homeDir: StandardPaths.writableLocation(StandardPaths.HomeLocation)
|
||||
property string docsDir: StandardPaths.writableLocation(StandardPaths.DocumentsLocation)
|
||||
property string musicDir: StandardPaths.writableLocation(StandardPaths.MusicLocation)
|
||||
@@ -39,9 +41,6 @@ DankModal {
|
||||
property bool selectedFileIsDir: false
|
||||
property bool showOverwriteConfirmation: false
|
||||
property string pendingFilePath: ""
|
||||
property bool weAvailable: false
|
||||
property string wePath: ""
|
||||
property bool weMode: false
|
||||
property var parentModal: null
|
||||
property bool showSidebar: true
|
||||
property string viewMode: "grid"
|
||||
@@ -220,22 +219,6 @@ DankModal {
|
||||
StandardPaths.HomeLocation) + "/snap/steam/common/.local/share/Steam/steamapps/workshop/content/431960"]
|
||||
property int currentPathIndex: 0
|
||||
|
||||
function discoverWallpaperEngine() {
|
||||
currentPathIndex = 0
|
||||
checkNextPath()
|
||||
}
|
||||
|
||||
function checkNextPath() {
|
||||
if (currentPathIndex >= steamPaths.length) {
|
||||
return
|
||||
}
|
||||
|
||||
const wePath = steamPaths[currentPathIndex]
|
||||
const cleanPath = wePath.replace(/^file:\/\//, '')
|
||||
weDiscoveryProcess.command = ["test", "-d", cleanPath]
|
||||
weDiscoveryProcess.wePath = wePath
|
||||
weDiscoveryProcess.running = true
|
||||
}
|
||||
width: 800
|
||||
height: 600
|
||||
enableShadow: true
|
||||
@@ -266,9 +249,6 @@ DankModal {
|
||||
selectedIndex = -1
|
||||
keyboardNavigationActive = false
|
||||
backButtonFocused = false
|
||||
if (browserType === "wallpaper" && !weAvailable) {
|
||||
discoverWallpaperEngine()
|
||||
}
|
||||
}
|
||||
}
|
||||
onCurrentPathChanged: {
|
||||
@@ -572,23 +552,6 @@ DankModal {
|
||||
}
|
||||
}
|
||||
|
||||
Process {
|
||||
id: weDiscoveryProcess
|
||||
|
||||
property string wePath: ""
|
||||
running: false
|
||||
|
||||
onExited: exitCode => {
|
||||
if (exitCode === 0) {
|
||||
fileBrowserModal.weAvailable = true
|
||||
fileBrowserModal.wePath = wePath
|
||||
} else {
|
||||
currentPathIndex++
|
||||
checkNextPath()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
content: Component {
|
||||
Item {
|
||||
anchors.fill: parent
|
||||
@@ -644,7 +607,6 @@ DankModal {
|
||||
iconName: showHiddenFiles ? "visibility_off" : "visibility"
|
||||
iconSize: Theme.iconSize - 4
|
||||
iconColor: showHiddenFiles ? Theme.primary : Theme.surfaceText
|
||||
visible: !weMode
|
||||
onClicked: showHiddenFiles = !showHiddenFiles
|
||||
}
|
||||
|
||||
@@ -653,7 +615,6 @@ DankModal {
|
||||
iconName: viewMode === "grid" ? "view_list" : "grid_view"
|
||||
iconSize: Theme.iconSize - 4
|
||||
iconColor: Theme.surfaceText
|
||||
visible: !weMode
|
||||
onClicked: viewMode = viewMode === "grid" ? "list" : "grid"
|
||||
}
|
||||
|
||||
@@ -662,26 +623,10 @@ DankModal {
|
||||
iconName: iconSizeIndex === 0 ? "photo_size_select_small" : iconSizeIndex === 1 ? "photo_size_select_large" : iconSizeIndex === 2 ? "photo_size_select_actual" : "zoom_in"
|
||||
iconSize: Theme.iconSize - 4
|
||||
iconColor: Theme.surfaceText
|
||||
visible: !weMode && viewMode === "grid"
|
||||
visible: viewMode === "grid"
|
||||
onClicked: iconSizeIndex = (iconSizeIndex + 1) % iconSizes.length
|
||||
}
|
||||
|
||||
DankActionButton {
|
||||
circular: false
|
||||
iconName: "movie"
|
||||
iconSize: Theme.iconSize - 4
|
||||
iconColor: weMode ? Theme.primary : Theme.surfaceText
|
||||
visible: weAvailable && browserType === "wallpaper"
|
||||
onClicked: {
|
||||
weMode = !weMode
|
||||
if (weMode) {
|
||||
navigateTo(wePath)
|
||||
} else {
|
||||
navigateTo(getLastPath())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DankActionButton {
|
||||
circular: false
|
||||
iconName: "info"
|
||||
@@ -769,8 +714,8 @@ DankModal {
|
||||
height: parent.height - 41
|
||||
clip: true
|
||||
|
||||
property real gridCellWidth: weMode ? 255 : iconSizes[iconSizeIndex] + 24
|
||||
property real gridCellHeight: weMode ? 215 : iconSizes[iconSizeIndex] + 56
|
||||
property real gridCellWidth: iconSizes[iconSizeIndex] + 24
|
||||
property real gridCellHeight: iconSizes[iconSizeIndex] + 56
|
||||
property real availableGridWidth: width - Theme.spacingM * 2
|
||||
property int gridColumns: Math.max(1, Math.floor(availableGridWidth / gridCellWidth))
|
||||
property real gridLeftMargin: Theme.spacingM + Math.max(0, (availableGridWidth - (gridColumns * gridCellWidth)) / 2)
|
||||
@@ -809,7 +754,6 @@ DankModal {
|
||||
}
|
||||
|
||||
delegate: FileBrowserGridDelegate {
|
||||
weMode: fileBrowserModal.weMode
|
||||
iconSizes: fileBrowserModal.iconSizes
|
||||
iconSizeIndex: fileBrowserModal.iconSizeIndex
|
||||
selectedIndex: fileBrowserModal.selectedIndex
|
||||
@@ -817,11 +761,7 @@ DankModal {
|
||||
onItemClicked: (index, path, name, isDir) => {
|
||||
selectedIndex = index
|
||||
setSelectedFileData(path, name, isDir)
|
||||
if (weMode && isDir) {
|
||||
var sceneId = path.split("/").pop()
|
||||
fileSelected("we:" + sceneId)
|
||||
fileBrowserModal.close()
|
||||
} else if (isDir) {
|
||||
if (isDir) {
|
||||
navigateTo(path)
|
||||
} else {
|
||||
fileSelected(path)
|
||||
@@ -838,11 +778,7 @@ DankModal {
|
||||
fileBrowserModal.keyboardSelectionRequested = false
|
||||
selectedIndex = index
|
||||
setSelectedFileData(filePath, fileName, fileIsDir)
|
||||
if (weMode && fileIsDir) {
|
||||
var sceneId = filePath.split("/").pop()
|
||||
fileSelected("we:" + sceneId)
|
||||
fileBrowserModal.close()
|
||||
} else if (fileIsDir) {
|
||||
if (fileIsDir) {
|
||||
navigateTo(filePath)
|
||||
} else {
|
||||
fileSelected(filePath)
|
||||
|
||||
@@ -56,7 +56,7 @@ Row {
|
||||
StyledRect {
|
||||
anchors.fill: parent
|
||||
radius: Theme.cornerRadius
|
||||
color: pathEditMode ? Theme.surfaceContainer : "transparent"
|
||||
color: pathEditMode ? Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency) : "transparent"
|
||||
border.color: pathEditMode ? Theme.primary : "transparent"
|
||||
border.width: pathEditMode ? 1 : 0
|
||||
visible: !pathEditMode
|
||||
|
||||
@@ -34,7 +34,7 @@ StyledRect {
|
||||
width: parent?.width ?? 0
|
||||
height: 38
|
||||
radius: Theme.cornerRadius
|
||||
color: quickAccessMouseArea.containsMouse ? Theme.surfaceContainerHigh : (currentPath === modelData?.path ? Theme.surfacePressed : "transparent")
|
||||
color: quickAccessMouseArea.containsMouse ? Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) : (currentPath === modelData?.path ? Theme.surfacePressed : "transparent")
|
||||
|
||||
Row {
|
||||
anchors.fill: parent
|
||||
|
||||
@@ -9,10 +9,16 @@ import qs.Widgets
|
||||
DankModal {
|
||||
id: root
|
||||
|
||||
width: 1400
|
||||
height: 900
|
||||
layerNamespace: "dms:hyprkeybinds"
|
||||
|
||||
property real _maxW: Math.min(Screen.width * 0.92, 1200)
|
||||
property real _maxH: Math.min(Screen.height * 0.92, 900)
|
||||
width: _maxW
|
||||
height: _maxH
|
||||
onBackgroundClicked: close()
|
||||
|
||||
Shortcut { sequence: "Esc"; onActivated: root.close() }
|
||||
|
||||
function categorizeKeybinds() {
|
||||
const categories = {
|
||||
"Workspace": [],
|
||||
|
||||
@@ -8,6 +8,8 @@ import qs.Widgets
|
||||
DankModal {
|
||||
id: root
|
||||
|
||||
layerNamespace: "dms:network-info"
|
||||
|
||||
property bool networkInfoModalVisible: false
|
||||
property string networkSSID: ""
|
||||
property var networkData: null
|
||||
|
||||
@@ -8,6 +8,8 @@ import qs.Widgets
|
||||
DankModal {
|
||||
id: root
|
||||
|
||||
layerNamespace: "dms:network-info-wired"
|
||||
|
||||
property bool networkWiredInfoModalVisible: false
|
||||
property string networkID: ""
|
||||
property var networkData: null
|
||||
|
||||
@@ -9,6 +9,8 @@ import qs.Widgets
|
||||
DankModal {
|
||||
id: notificationModal
|
||||
|
||||
layerNamespace: "dms:notification-modal"
|
||||
|
||||
property bool notificationModalOpen: false
|
||||
property var notificationListRef: null
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@ import qs.Widgets
|
||||
DankModal {
|
||||
id: root
|
||||
|
||||
layerNamespace: "dms:polkit"
|
||||
|
||||
property string passwordInput: ""
|
||||
property var currentFlow: PolkitService.agent?.flow
|
||||
property bool isLoading: false
|
||||
|
||||
@@ -7,6 +7,8 @@ import qs.Widgets
|
||||
DankModal {
|
||||
id: root
|
||||
|
||||
layerNamespace: "dms:power-menu"
|
||||
|
||||
property int selectedIndex: 0
|
||||
property int optionCount: SessionService.hibernateSupported ? 5 : 4
|
||||
property rect parentBounds: Qt.rect(0, 0, 0, 0)
|
||||
|
||||
@@ -9,6 +9,8 @@ import qs.Widgets
|
||||
DankModal {
|
||||
id: processListModal
|
||||
|
||||
layerNamespace: "dms:process-list-modal"
|
||||
|
||||
property int currentTab: 0
|
||||
property var tabNames: ["Processes", "Performance", "System"]
|
||||
|
||||
@@ -44,7 +46,7 @@ DankModal {
|
||||
width: 900
|
||||
height: 680
|
||||
visible: false
|
||||
backgroundColor: Theme.popupBackground()
|
||||
backgroundColor: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
||||
cornerRadius: Theme.cornerRadius
|
||||
enableShadow: true
|
||||
onBackgroundClicked: () => {
|
||||
@@ -181,7 +183,7 @@ DankModal {
|
||||
Rectangle {
|
||||
Layout.fillWidth: true
|
||||
height: 52
|
||||
color: Theme.surfaceContainerHigh
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
radius: Theme.cornerRadius
|
||||
border.color: Theme.outlineLight
|
||||
border.width: 1
|
||||
@@ -281,7 +283,7 @@ DankModal {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainerHigh
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
border.color: Theme.outlineLight
|
||||
border.width: 1
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ Item {
|
||||
text: I18n.tr("Show Power Actions")
|
||||
description: I18n.tr("Show power, restart, and logout buttons on the lock screen")
|
||||
checked: SettingsData.lockScreenShowPowerActions
|
||||
onToggled: checked => SettingsData.setLockScreenShowPowerActions(checked)
|
||||
onToggled: checked => SettingsData.set("lockScreenShowPowerActions", checked)
|
||||
}
|
||||
|
||||
StyledText {
|
||||
@@ -84,7 +84,7 @@ Item {
|
||||
enabled: SessionService.loginctlAvailable
|
||||
onToggled: checked => {
|
||||
if (SessionService.loginctlAvailable) {
|
||||
SettingsData.setLoginctlLockIntegration(checked)
|
||||
SettingsData.set("loginctlLockIntegration", checked)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -95,7 +95,7 @@ Item {
|
||||
description: I18n.tr("Automatically lock the screen when the system prepares to suspend")
|
||||
checked: SettingsData.lockBeforeSuspend
|
||||
visible: SessionService.loginctlAvailable && SettingsData.loginctlLockIntegration
|
||||
onToggled: checked => SettingsData.setLockBeforeSuspend(checked)
|
||||
onToggled: checked => SettingsData.set("lockBeforeSuspend", checked)
|
||||
}
|
||||
|
||||
DankToggle {
|
||||
@@ -104,7 +104,7 @@ Item {
|
||||
description: I18n.tr("Use fingerprint reader for lock screen authentication (requires enrolled fingerprints)")
|
||||
checked: SettingsData.enableFprint
|
||||
visible: SettingsData.fprintdAvailable
|
||||
onToggled: checked => SettingsData.setEnableFprint(checked)
|
||||
onToggled: checked => SettingsData.set("enableFprint", checked)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -186,9 +186,9 @@ Item {
|
||||
if (index >= 0) {
|
||||
const timeout = timeoutValues[index]
|
||||
if (powerCategory.currentIndex === 0) {
|
||||
SettingsData.setAcLockTimeout(timeout)
|
||||
SettingsData.set("acLockTimeout", timeout)
|
||||
} else {
|
||||
SettingsData.setBatteryLockTimeout(timeout)
|
||||
SettingsData.set("batteryLockTimeout", timeout)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -222,9 +222,9 @@ Item {
|
||||
if (index >= 0) {
|
||||
const timeout = timeoutValues[index]
|
||||
if (powerCategory.currentIndex === 0) {
|
||||
SettingsData.setAcMonitorTimeout(timeout)
|
||||
SettingsData.set("acMonitorTimeout", timeout)
|
||||
} else {
|
||||
SettingsData.setBatteryMonitorTimeout(timeout)
|
||||
SettingsData.set("batteryMonitorTimeout", timeout)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -258,46 +258,52 @@ Item {
|
||||
if (index >= 0) {
|
||||
const timeout = timeoutValues[index]
|
||||
if (powerCategory.currentIndex === 0) {
|
||||
SettingsData.setAcSuspendTimeout(timeout)
|
||||
SettingsData.set("acSuspendTimeout", timeout)
|
||||
} else {
|
||||
SettingsData.setBatterySuspendTimeout(timeout)
|
||||
SettingsData.set("batterySuspendTimeout", timeout)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DankDropdown {
|
||||
id: hibernateDropdown
|
||||
property var timeoutOptions: ["Never", "1 minute", "2 minutes", "3 minutes", "5 minutes", "10 minutes", "15 minutes", "20 minutes", "30 minutes", "1 hour", "1 hour 30 minutes", "2 hours", "3 hours"]
|
||||
property var timeoutValues: [0, 60, 120, 180, 300, 600, 900, 1200, 1800, 3600, 5400, 7200, 10800]
|
||||
|
||||
text: I18n.tr("Hibernate system after")
|
||||
options: timeoutOptions
|
||||
Column {
|
||||
width: parent.width
|
||||
spacing: Theme.spacingS
|
||||
visible: SessionService.hibernateSupported
|
||||
|
||||
Connections {
|
||||
target: powerCategory
|
||||
function onCurrentIndexChanged() {
|
||||
const currentTimeout = powerCategory.currentIndex === 0 ? SettingsData.acHibernateTimeout : SettingsData.batteryHibernateTimeout
|
||||
const index = hibernateDropdown.timeoutValues.indexOf(currentTimeout)
|
||||
hibernateDropdown.currentValue = index >= 0 ? hibernateDropdown.timeoutOptions[index] : "Never"
|
||||
StyledText {
|
||||
text: I18n.tr("Suspend behavior")
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
color: Theme.surfaceText
|
||||
}
|
||||
|
||||
DankButtonGroup {
|
||||
id: suspendBehaviorSelector
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
model: ["Suspend", "Hibernate", "Suspend then Hibernate"]
|
||||
selectionMode: "single"
|
||||
checkEnabled: false
|
||||
|
||||
Connections {
|
||||
target: powerCategory
|
||||
function onCurrentIndexChanged() {
|
||||
const behavior = powerCategory.currentIndex === 0 ? SettingsData.acSuspendBehavior : SettingsData.batterySuspendBehavior
|
||||
suspendBehaviorSelector.currentIndex = behavior
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
const currentTimeout = powerCategory.currentIndex === 0 ? SettingsData.acHibernateTimeout : SettingsData.batteryHibernateTimeout
|
||||
const index = timeoutValues.indexOf(currentTimeout)
|
||||
currentValue = index >= 0 ? timeoutOptions[index] : "Never"
|
||||
}
|
||||
Component.onCompleted: {
|
||||
const behavior = powerCategory.currentIndex === 0 ? SettingsData.acSuspendBehavior : SettingsData.batterySuspendBehavior
|
||||
currentIndex = behavior
|
||||
}
|
||||
|
||||
onValueChanged: value => {
|
||||
const index = timeoutOptions.indexOf(value)
|
||||
if (index >= 0) {
|
||||
const timeout = timeoutValues[index]
|
||||
if (powerCategory.currentIndex === 0) {
|
||||
SettingsData.setAcHibernateTimeout(timeout)
|
||||
} else {
|
||||
SettingsData.setBatteryHibernateTimeout(timeout)
|
||||
onSelectionChanged: (index, selected) => {
|
||||
if (selected) {
|
||||
if (powerCategory.currentIndex === 0) {
|
||||
SettingsData.set("acSuspendBehavior", index)
|
||||
} else {
|
||||
SettingsData.set("batterySuspendBehavior", index)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -352,7 +358,7 @@ Item {
|
||||
text: I18n.tr("Show Confirmation on Power Actions")
|
||||
description: I18n.tr("Request confirmation on power off, restart, suspend, hibernate and logout actions")
|
||||
checked: SettingsData.powerActionConfirm
|
||||
onToggled: checked => SettingsData.setPowerActionConfirm(checked)
|
||||
onToggled: checked => SettingsData.set("powerActionConfirm", checked)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -418,7 +424,7 @@ Item {
|
||||
}
|
||||
|
||||
onTextEdited: {
|
||||
SettingsData.setCustomPowerActionLock(text.trim());
|
||||
SettingsData.set("customPowerActionLock", text.trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -450,7 +456,7 @@ Item {
|
||||
}
|
||||
|
||||
onTextEdited: {
|
||||
SettingsData.setCustomPowerActionLogout(text.trim());
|
||||
SettingsData.set("customPowerActionLogout", text.trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -482,7 +488,7 @@ Item {
|
||||
}
|
||||
|
||||
onTextEdited: {
|
||||
SettingsData.setCustomPowerActionSuspend(text.trim());
|
||||
SettingsData.set("customPowerActionSuspend", text.trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -514,7 +520,7 @@ Item {
|
||||
}
|
||||
|
||||
onTextEdited: {
|
||||
SettingsData.setCustomPowerActionHibernate(text.trim());
|
||||
SettingsData.set("customPowerActionHibernate", text.trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -546,7 +552,7 @@ Item {
|
||||
}
|
||||
|
||||
onTextEdited: {
|
||||
SettingsData.setCustomPowerActionReboot(text.trim());
|
||||
SettingsData.set("customPowerActionReboot", text.trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -578,7 +584,7 @@ Item {
|
||||
}
|
||||
|
||||
onTextEdited: {
|
||||
SettingsData.setCustomPowerActionPowerOff(text.trim());
|
||||
SettingsData.set("customPowerActionPowerOff", text.trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ import qs.Widgets
|
||||
DankModal {
|
||||
id: settingsModal
|
||||
|
||||
layerNamespace: "dms:settings"
|
||||
|
||||
property Component settingsContent
|
||||
property alias profileBrowser: profileBrowser
|
||||
property int currentTabIndex: 0
|
||||
@@ -36,6 +38,7 @@ DankModal {
|
||||
objectName: "settingsModal"
|
||||
width: Math.min(800, screenWidth * 0.9)
|
||||
height: Math.min(800, screenHeight * 0.85)
|
||||
backgroundColor: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
||||
visible: false
|
||||
onBackgroundClicked: () => {
|
||||
return hide();
|
||||
|
||||
@@ -55,7 +55,7 @@ Rectangle {
|
||||
|
||||
width: 270
|
||||
height: parent.height
|
||||
color: Theme.surfaceContainer
|
||||
color: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
||||
radius: Theme.cornerRadius
|
||||
|
||||
DankFlickable {
|
||||
|
||||
@@ -20,7 +20,7 @@ Rectangle {
|
||||
readonly property int iconSize: 40
|
||||
|
||||
radius: Theme.cornerRadius
|
||||
color: isSelected ? Theme.primaryPressed : mouseArea.containsMouse ? Theme.primaryHoverLight : Theme.surfaceContainerHigh
|
||||
color: isSelected ? Theme.primaryPressed : mouseArea.containsMouse ? Theme.primaryHoverLight : Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
|
||||
Row {
|
||||
anchors.fill: parent
|
||||
|
||||
@@ -86,7 +86,7 @@ Rectangle {
|
||||
width: ListView.view.width
|
||||
height: filesList.itemHeight
|
||||
radius: Theme.cornerRadius
|
||||
color: ListView.isCurrentItem ? Theme.primaryPressed : fileMouseArea.containsMouse ? Theme.primaryHoverLight : Theme.surfaceContainerHigh
|
||||
color: ListView.isCurrentItem ? Theme.primaryPressed : fileMouseArea.containsMouse ? Theme.primaryHoverLight : Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
|
||||
Row {
|
||||
anchors.fill: parent
|
||||
|
||||
@@ -160,7 +160,7 @@ Item {
|
||||
parentModal.hide()
|
||||
}
|
||||
onViewModeSelected: mode => {
|
||||
SettingsData.setSpotlightModalViewMode(mode)
|
||||
SettingsData.set("spotlightModalViewMode", mode)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ Item {
|
||||
width: parent.width - 80 - Theme.spacingL
|
||||
height: 56
|
||||
cornerRadius: Theme.cornerRadius
|
||||
backgroundColor: Theme.surfaceContainerHigh
|
||||
backgroundColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
normalBorderColor: Theme.outlineMedium
|
||||
focusedBorderColor: Theme.primary
|
||||
leftIconName: searchMode === "files" ? "folder" : "search"
|
||||
@@ -201,7 +201,7 @@ Item {
|
||||
textColor: Theme.surfaceText
|
||||
font.pixelSize: Theme.fontSizeLarge
|
||||
enabled: parentModal ? parentModal.spotlightOpen : true
|
||||
placeholderText: searchMode === "files" ? "Search files..." : "Search apps..."
|
||||
placeholderText: ""
|
||||
ignoreLeftRightKeys: appLauncher.viewMode !== "list"
|
||||
ignoreTabKeys: true
|
||||
keyForwardTargets: [spotlightKeyHandler]
|
||||
|
||||
@@ -34,7 +34,7 @@ Popup {
|
||||
|
||||
background: Rectangle {
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.popupBackground()
|
||||
color: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
||||
border.width: 1
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ import qs.Widgets
|
||||
DankModal {
|
||||
id: spotlightModal
|
||||
|
||||
layerNamespace: "dms:spotlight"
|
||||
|
||||
property bool spotlightOpen: false
|
||||
property alias spotlightContent: spotlightContentInstance
|
||||
|
||||
@@ -79,9 +81,9 @@ DankModal {
|
||||
}
|
||||
|
||||
shouldBeVisible: spotlightOpen
|
||||
width: 550
|
||||
height: 700
|
||||
backgroundColor: Theme.popupBackground()
|
||||
width: 500
|
||||
height: 600
|
||||
backgroundColor: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
||||
cornerRadius: Theme.cornerRadius
|
||||
borderColor: Theme.outlineMedium
|
||||
borderWidth: 1
|
||||
|
||||
@@ -73,125 +73,22 @@ Rectangle {
|
||||
appLauncher.keyboardNavigationActive = false
|
||||
}
|
||||
|
||||
delegate: Rectangle {
|
||||
width: ListView.view.width
|
||||
height: resultsList.itemHeight
|
||||
radius: Theme.cornerRadius
|
||||
color: ListView.isCurrentItem ? Theme.primaryPressed : listMouseArea.containsMouse ? Theme.primaryHoverLight : Theme.surfaceContainerHigh
|
||||
|
||||
Row {
|
||||
anchors.fill: parent
|
||||
anchors.margins: Theme.spacingM
|
||||
spacing: Theme.spacingL
|
||||
|
||||
Item {
|
||||
width: resultsList.iconSize
|
||||
height: resultsList.iconSize
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: model.icon !== undefined && model.icon !== ""
|
||||
|
||||
property string iconValue: model.icon || ""
|
||||
property bool isMaterial: iconValue.indexOf("material:") === 0
|
||||
property bool isUnicode: iconValue.indexOf("unicode:") === 0
|
||||
property string materialName: isMaterial ? iconValue.substring(9) : ""
|
||||
property string unicodeChar: isUnicode ? iconValue.substring(8) : ""
|
||||
|
||||
DankIcon {
|
||||
anchors.centerIn: parent
|
||||
name: parent.materialName
|
||||
size: resultsList.iconSize
|
||||
color: Theme.surfaceText
|
||||
visible: parent.isMaterial
|
||||
}
|
||||
|
||||
StyledText {
|
||||
anchors.centerIn: parent
|
||||
text: parent.unicodeChar
|
||||
font.pixelSize: resultsList.iconSize * 0.8
|
||||
color: Theme.surfaceText
|
||||
visible: parent.isUnicode
|
||||
}
|
||||
|
||||
IconImage {
|
||||
id: listIconImg
|
||||
|
||||
anchors.fill: parent
|
||||
source: parent.isMaterial || parent.isUnicode ? "" : Quickshell.iconPath(parent.iconValue, true)
|
||||
asynchronous: true
|
||||
visible: !parent.isMaterial && !parent.isUnicode && status === Image.Ready
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
visible: !parent.isMaterial && !parent.isUnicode && !listIconImg.visible
|
||||
color: Theme.surfaceLight
|
||||
radius: Theme.cornerRadius
|
||||
border.width: 1
|
||||
border.color: Theme.primarySelected
|
||||
|
||||
StyledText {
|
||||
anchors.centerIn: parent
|
||||
text: (model.name && model.name.length > 0) ? model.name.charAt(0).toUpperCase() : "A"
|
||||
font.pixelSize: resultsList.iconSize * 0.4
|
||||
color: Theme.primary
|
||||
font.weight: Font.Bold
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: (model.icon !== undefined && model.icon !== "") ? (parent.width - resultsList.iconSize - Theme.spacingL) : parent.width
|
||||
spacing: Theme.spacingXS
|
||||
|
||||
StyledText {
|
||||
width: parent.width
|
||||
text: model.name || ""
|
||||
font.pixelSize: Theme.fontSizeLarge
|
||||
color: Theme.surfaceText
|
||||
font.weight: Font.Medium
|
||||
elide: Text.ElideRight
|
||||
wrapMode: Text.NoWrap
|
||||
maximumLineCount: 1
|
||||
}
|
||||
|
||||
StyledText {
|
||||
width: parent.width
|
||||
text: model.comment || "Application"
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
color: Theme.surfaceVariantText
|
||||
elide: Text.ElideRight
|
||||
maximumLineCount: 1
|
||||
visible: resultsList.showDescription && model.comment && model.comment.length > 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: listMouseArea
|
||||
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
z: 10
|
||||
onEntered: () => {
|
||||
if (resultsList.hoverUpdatesSelection && !resultsList.keyboardNavigationActive)
|
||||
resultsList.currentIndex = index
|
||||
}
|
||||
onPositionChanged: () => {
|
||||
resultsList.keyboardNavigationReset()
|
||||
}
|
||||
onClicked: mouse => {
|
||||
if (mouse.button === Qt.LeftButton) {
|
||||
resultsList.itemClicked(index, model)
|
||||
} else if (mouse.button === Qt.RightButton && !model.isPlugin) {
|
||||
const globalPos = mapToItem(null, mouse.x, mouse.y)
|
||||
const modalPos = resultsContainer.parent.mapFromItem(null, globalPos.x, globalPos.y)
|
||||
resultsList.itemRightClicked(index, model, modalPos.x, modalPos.y)
|
||||
}
|
||||
}
|
||||
delegate: AppLauncherListDelegate {
|
||||
listView: resultsList
|
||||
itemHeight: resultsList.itemHeight
|
||||
iconSize: resultsList.iconSize
|
||||
showDescription: resultsList.showDescription
|
||||
hoverUpdatesSelection: resultsList.hoverUpdatesSelection
|
||||
keyboardNavigationActive: resultsList.keyboardNavigationActive
|
||||
isCurrentItem: ListView.isCurrentItem
|
||||
iconMaterialSizeAdjustment: 0
|
||||
iconUnicodeScale: 0.8
|
||||
onItemClicked: (idx, modelData) => resultsList.itemClicked(idx, modelData)
|
||||
onItemRightClicked: (idx, modelData, mouseX, mouseY) => {
|
||||
const modalPos = resultsContainer.parent.mapFromItem(null, mouseX, mouseY)
|
||||
resultsList.itemRightClicked(idx, modelData, modalPos.x, modalPos.y)
|
||||
}
|
||||
onKeyboardNavigationReset: resultsList.keyboardNavigationReset
|
||||
}
|
||||
}
|
||||
|
||||
@@ -260,113 +157,23 @@ Rectangle {
|
||||
appLauncher.keyboardNavigationActive = false
|
||||
}
|
||||
|
||||
delegate: Rectangle {
|
||||
width: resultsGrid.cellWidth - resultsGrid.cellPadding
|
||||
height: resultsGrid.cellHeight - resultsGrid.cellPadding
|
||||
radius: Theme.cornerRadius
|
||||
color: resultsGrid.currentIndex === index ? Theme.primaryPressed : gridMouseArea.containsMouse ? Theme.primaryHoverLight : Theme.surfaceContainerHigh
|
||||
|
||||
Column {
|
||||
anchors.centerIn: parent
|
||||
spacing: Theme.spacingS
|
||||
|
||||
Item {
|
||||
property int iconSize: Math.min(resultsGrid.maxIconSize, Math.max(resultsGrid.minIconSize, resultsGrid.cellWidth * resultsGrid.iconSizeRatio))
|
||||
|
||||
width: iconSize
|
||||
height: iconSize
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
visible: model.icon !== undefined && model.icon !== ""
|
||||
|
||||
property string iconValue: model.icon || ""
|
||||
property bool isMaterial: iconValue.indexOf("material:") === 0
|
||||
property bool isUnicode: iconValue.indexOf("unicode:") === 0
|
||||
property string materialName: isMaterial ? iconValue.substring(9) : ""
|
||||
property string unicodeChar: isUnicode ? iconValue.substring(8) : ""
|
||||
|
||||
DankIcon {
|
||||
anchors.centerIn: parent
|
||||
name: parent.materialName
|
||||
size: parent.iconSize
|
||||
color: Theme.surfaceText
|
||||
visible: parent.isMaterial
|
||||
}
|
||||
|
||||
StyledText {
|
||||
anchors.centerIn: parent
|
||||
text: parent.unicodeChar
|
||||
font.pixelSize: parent.iconSize * 0.8
|
||||
color: Theme.surfaceText
|
||||
visible: parent.isUnicode
|
||||
}
|
||||
|
||||
IconImage {
|
||||
id: gridIconImg
|
||||
|
||||
anchors.fill: parent
|
||||
source: parent.isMaterial || parent.isUnicode ? "" : Quickshell.iconPath(parent.iconValue, true)
|
||||
smooth: true
|
||||
asynchronous: true
|
||||
visible: !parent.isMaterial && !parent.isUnicode && status === Image.Ready
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
visible: !parent.isMaterial && !parent.isUnicode && !gridIconImg.visible
|
||||
color: Theme.surfaceLight
|
||||
radius: Theme.cornerRadius
|
||||
border.width: 1
|
||||
border.color: Theme.primarySelected
|
||||
|
||||
StyledText {
|
||||
anchors.centerIn: parent
|
||||
text: (model.name && model.name.length > 0) ? model.name.charAt(0).toUpperCase() : "A"
|
||||
font.pixelSize: Math.min(28, parent.width * 0.5)
|
||||
color: Theme.primary
|
||||
font.weight: Font.Bold
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StyledText {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: resultsGrid.cellWidth - 12
|
||||
text: model.name || ""
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceText
|
||||
font.weight: Font.Medium
|
||||
elide: Text.ElideRight
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
maximumLineCount: 1
|
||||
wrapMode: Text.NoWrap
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: gridMouseArea
|
||||
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
z: 10
|
||||
onEntered: () => {
|
||||
if (resultsGrid.hoverUpdatesSelection && !resultsGrid.keyboardNavigationActive)
|
||||
resultsGrid.currentIndex = index
|
||||
}
|
||||
onPositionChanged: () => {
|
||||
resultsGrid.keyboardNavigationReset()
|
||||
}
|
||||
onClicked: mouse => {
|
||||
if (mouse.button === Qt.LeftButton) {
|
||||
resultsGrid.itemClicked(index, model)
|
||||
} else if (mouse.button === Qt.RightButton && !model.isPlugin) {
|
||||
const globalPos = mapToItem(null, mouse.x, mouse.y)
|
||||
const modalPos = resultsContainer.parent.mapFromItem(null, globalPos.x, globalPos.y)
|
||||
resultsGrid.itemRightClicked(index, model, modalPos.x, modalPos.y)
|
||||
}
|
||||
}
|
||||
delegate: AppLauncherGridDelegate {
|
||||
gridView: resultsGrid
|
||||
cellWidth: resultsGrid.cellWidth
|
||||
cellHeight: resultsGrid.cellHeight
|
||||
cellPadding: resultsGrid.cellPadding
|
||||
minIconSize: resultsGrid.minIconSize
|
||||
maxIconSize: resultsGrid.maxIconSize
|
||||
iconSizeRatio: resultsGrid.iconSizeRatio
|
||||
hoverUpdatesSelection: resultsGrid.hoverUpdatesSelection
|
||||
keyboardNavigationActive: resultsGrid.keyboardNavigationActive
|
||||
currentIndex: resultsGrid.currentIndex
|
||||
onItemClicked: (idx, modelData) => resultsGrid.itemClicked(idx, modelData)
|
||||
onItemRightClicked: (idx, modelData, mouseX, mouseY) => {
|
||||
const modalPos = resultsContainer.parent.mapFromItem(null, mouseX, mouseY)
|
||||
resultsGrid.itemRightClicked(idx, modelData, modalPos.x, modalPos.y)
|
||||
}
|
||||
onKeyboardNavigationReset: resultsGrid.keyboardNavigationReset
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ import qs.Widgets
|
||||
DankModal {
|
||||
id: root
|
||||
|
||||
layerNamespace: "dms:wifi-password"
|
||||
|
||||
property string wifiPasswordSSID: ""
|
||||
property string wifiPasswordInput: ""
|
||||
property string wifiUsernameInput: ""
|
||||
|
||||
@@ -13,6 +13,8 @@ import qs.Widgets
|
||||
DankPopout {
|
||||
id: appDrawerPopout
|
||||
|
||||
layerNamespace: "dms:app-launcher"
|
||||
|
||||
property var triggerScreen: null
|
||||
|
||||
// Setting to Exclusive, so virtual keyboards can send input to app drawer
|
||||
@@ -59,7 +61,7 @@ DankPopout {
|
||||
gridColumns: 4
|
||||
onAppLaunched: appDrawerPopout.close()
|
||||
onViewModeSelected: function (mode) {
|
||||
SettingsData.setAppLauncherViewMode(mode)
|
||||
SettingsData.set("appLauncherViewMode", mode)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +71,7 @@ DankPopout {
|
||||
|
||||
property alias searchField: searchField
|
||||
|
||||
color: Theme.popupBackground()
|
||||
color: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
||||
radius: Theme.cornerRadius
|
||||
antialiasing: true
|
||||
smooth: true
|
||||
@@ -208,7 +210,7 @@ DankPopout {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
height: 52
|
||||
cornerRadius: Theme.cornerRadius
|
||||
backgroundColor: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, Theme.getContentBackgroundAlpha() * 0.7)
|
||||
backgroundColor: Theme.withAlpha(Theme.surfaceVariant, Theme.popupTransparency)
|
||||
normalBorderColor: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.3)
|
||||
focusedBorderColor: Theme.primary
|
||||
leftIconName: "search"
|
||||
@@ -389,134 +391,27 @@ DankPopout {
|
||||
appLauncher.keyboardNavigationActive = false
|
||||
}
|
||||
|
||||
delegate: Rectangle {
|
||||
width: ListView.view.width
|
||||
height: appList.itemHeight
|
||||
radius: Theme.cornerRadius
|
||||
color: ListView.isCurrentItem ? Theme.primaryPressed : listMouseArea.containsMouse ? Theme.primaryHoverLight : Theme.surfaceContainerHigh
|
||||
|
||||
Row {
|
||||
anchors.fill: parent
|
||||
anchors.margins: Theme.spacingM
|
||||
spacing: Theme.spacingL
|
||||
|
||||
Item {
|
||||
width: appList.iconSize
|
||||
height: appList.iconSize
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
visible: model.icon !== undefined && model.icon !== ""
|
||||
|
||||
property string iconValue: model.icon || ""
|
||||
property bool isMaterial: iconValue.indexOf("material:") === 0
|
||||
property bool isUnicode: iconValue.indexOf("unicode:") === 0
|
||||
property string materialName: isMaterial ? iconValue.substring(9) : ""
|
||||
property string unicodeChar: isUnicode ? iconValue.substring(8) : ""
|
||||
|
||||
DankIcon {
|
||||
anchors.centerIn: parent
|
||||
name: parent.materialName
|
||||
size: appList.iconSize - Theme.spacingM
|
||||
color: Theme.surfaceText
|
||||
visible: parent.isMaterial
|
||||
}
|
||||
|
||||
StyledText {
|
||||
anchors.centerIn: parent
|
||||
text: parent.unicodeChar
|
||||
font.pixelSize: appList.iconSize * 0.7
|
||||
color: Theme.surfaceText
|
||||
visible: parent.isUnicode
|
||||
}
|
||||
|
||||
IconImage {
|
||||
id: listIconImg
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.margins: Theme.spacingXS
|
||||
source: parent.isMaterial || parent.isUnicode ? "" : Quickshell.iconPath(parent.iconValue, true)
|
||||
smooth: true
|
||||
asynchronous: true
|
||||
visible: !parent.isMaterial && !parent.isUnicode && status === Image.Ready
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: Theme.spacingS
|
||||
anchors.rightMargin: Theme.spacingS
|
||||
anchors.bottomMargin: Theme.spacingM
|
||||
visible: !parent.isMaterial && !parent.isUnicode && listIconImg.status !== Image.Ready
|
||||
color: Theme.surfaceLight
|
||||
radius: Theme.cornerRadius
|
||||
border.width: 0
|
||||
border.color: Theme.primarySelected
|
||||
|
||||
StyledText {
|
||||
anchors.centerIn: parent
|
||||
text: (model.name && model.name.length > 0) ? model.name.charAt(0).toUpperCase() : "A"
|
||||
font.pixelSize: appList.iconSize * 0.4
|
||||
color: Theme.primary
|
||||
font.weight: Font.Bold
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Column {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: (model.icon !== undefined && model.icon !== "") ? (parent.width - appList.iconSize - Theme.spacingL) : parent.width
|
||||
spacing: Theme.spacingXS
|
||||
|
||||
StyledText {
|
||||
width: parent.width
|
||||
text: model.name || ""
|
||||
font.pixelSize: Theme.fontSizeLarge
|
||||
color: Theme.surfaceText
|
||||
font.weight: Font.Medium
|
||||
elide: Text.ElideRight
|
||||
wrapMode: Text.NoWrap
|
||||
maximumLineCount: 1
|
||||
}
|
||||
|
||||
StyledText {
|
||||
width: parent.width
|
||||
text: model.comment || "Application"
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
color: Theme.surfaceVariantText
|
||||
elide: Text.ElideRight
|
||||
maximumLineCount: 1
|
||||
visible: appList.showDescription && model.comment && model.comment.length > 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: listMouseArea
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: Theme.spacingS
|
||||
anchors.rightMargin: Theme.spacingS
|
||||
anchors.bottomMargin: Theme.spacingM
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
z: 10
|
||||
onEntered: {
|
||||
if (appList.hoverUpdatesSelection && !appList.keyboardNavigationActive)
|
||||
appList.currentIndex = index
|
||||
}
|
||||
onPositionChanged: {
|
||||
appList.keyboardNavigationReset()
|
||||
}
|
||||
onClicked: mouse => {
|
||||
if (mouse.button === Qt.LeftButton) {
|
||||
appList.itemClicked(index, model)
|
||||
} else if (mouse.button === Qt.RightButton) {
|
||||
var globalPos = mapToItem(null, mouse.x, mouse.y)
|
||||
var panelPos = contextMenu.parent.mapFromItem(null, globalPos.x, globalPos.y)
|
||||
appList.itemRightClicked(index, model, panelPos.x, panelPos.y)
|
||||
}
|
||||
}
|
||||
delegate: AppLauncherListDelegate {
|
||||
listView: appList
|
||||
itemHeight: appList.itemHeight
|
||||
iconSize: appList.iconSize
|
||||
showDescription: appList.showDescription
|
||||
hoverUpdatesSelection: appList.hoverUpdatesSelection
|
||||
keyboardNavigationActive: appList.keyboardNavigationActive
|
||||
isCurrentItem: ListView.isCurrentItem
|
||||
mouseAreaLeftMargin: Theme.spacingS
|
||||
mouseAreaRightMargin: Theme.spacingS
|
||||
mouseAreaBottomMargin: Theme.spacingM
|
||||
iconMargins: Theme.spacingXS
|
||||
iconFallbackLeftMargin: Theme.spacingS
|
||||
iconFallbackRightMargin: Theme.spacingS
|
||||
iconFallbackBottomMargin: Theme.spacingM
|
||||
onItemClicked: (idx, modelData) => appList.itemClicked(idx, modelData)
|
||||
onItemRightClicked: (idx, modelData, mouseX, mouseY) => {
|
||||
const panelPos = contextMenu.parent.mapFromItem(null, mouseX, mouseY)
|
||||
appList.itemRightClicked(idx, modelData, panelPos.x, panelPos.y)
|
||||
}
|
||||
onKeyboardNavigationReset: appList.keyboardNavigationReset
|
||||
}
|
||||
}
|
||||
|
||||
@@ -587,122 +482,30 @@ DankPopout {
|
||||
appLauncher.keyboardNavigationActive = false
|
||||
}
|
||||
|
||||
delegate: Rectangle {
|
||||
width: appGrid.cellWidth - appGrid.cellPadding
|
||||
height: appGrid.cellHeight - appGrid.cellPadding
|
||||
radius: Theme.cornerRadius
|
||||
color: appGrid.currentIndex === index ? Theme.primaryPressed : gridMouseArea.containsMouse ? Theme.primaryHoverLight : Theme.surfaceContainerHigh
|
||||
|
||||
Column {
|
||||
anchors.centerIn: parent
|
||||
spacing: Theme.spacingS
|
||||
|
||||
Item {
|
||||
property int iconSize: Math.min(appGrid.maxIconSize, Math.max(appGrid.minIconSize, appGrid.cellWidth * appGrid.iconSizeRatio))
|
||||
|
||||
width: iconSize
|
||||
height: iconSize
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
visible: model.icon !== undefined && model.icon !== ""
|
||||
|
||||
property string iconValue: model.icon || ""
|
||||
property bool isMaterial: iconValue.indexOf("material:") === 0
|
||||
property bool isUnicode: iconValue.indexOf("unicode:") === 0
|
||||
property string materialName: isMaterial ? iconValue.substring(9) : ""
|
||||
property string unicodeChar: isUnicode ? iconValue.substring(8) : ""
|
||||
|
||||
DankIcon {
|
||||
anchors.centerIn: parent
|
||||
name: parent.materialName
|
||||
size: parent.iconSize - Theme.spacingL
|
||||
color: Theme.surfaceText
|
||||
visible: parent.isMaterial
|
||||
}
|
||||
|
||||
StyledText {
|
||||
anchors.centerIn: parent
|
||||
text: parent.unicodeChar
|
||||
font.pixelSize: parent.iconSize * 0.8
|
||||
color: Theme.surfaceText
|
||||
visible: parent.isUnicode
|
||||
}
|
||||
|
||||
IconImage {
|
||||
id: gridIconImg
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: Theme.spacingS
|
||||
anchors.rightMargin: Theme.spacingS
|
||||
anchors.bottomMargin: Theme.spacingS
|
||||
source: parent.isMaterial || parent.isUnicode ? "" : Quickshell.iconPath(parent.iconValue, true)
|
||||
smooth: true
|
||||
asynchronous: true
|
||||
visible: !parent.isMaterial && !parent.isUnicode && status === Image.Ready
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: Theme.spacingS
|
||||
anchors.rightMargin: Theme.spacingS
|
||||
anchors.bottomMargin: Theme.spacingS
|
||||
visible: !parent.isMaterial && !parent.isUnicode && gridIconImg.status !== Image.Ready
|
||||
color: Theme.surfaceLight
|
||||
radius: Theme.cornerRadius
|
||||
border.width: 0
|
||||
border.color: Theme.primarySelected
|
||||
|
||||
StyledText {
|
||||
anchors.centerIn: parent
|
||||
text: (model.name && model.name.length > 0) ? model.name.charAt(0).toUpperCase() : "A"
|
||||
font.pixelSize: Math.min(28, parent.width * 0.5)
|
||||
color: Theme.primary
|
||||
font.weight: Font.Bold
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StyledText {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
width: appGrid.cellWidth - 12
|
||||
text: model.name || ""
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceText
|
||||
font.weight: Font.Medium
|
||||
elide: Text.ElideRight
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
maximumLineCount: 1
|
||||
wrapMode: Text.NoWrap
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: gridMouseArea
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: Theme.spacingS
|
||||
anchors.rightMargin: Theme.spacingS
|
||||
anchors.bottomMargin: Theme.spacingS
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
z: 10
|
||||
onEntered: {
|
||||
if (appGrid.hoverUpdatesSelection && !appGrid.keyboardNavigationActive)
|
||||
appGrid.currentIndex = index
|
||||
}
|
||||
onPositionChanged: {
|
||||
appGrid.keyboardNavigationReset()
|
||||
}
|
||||
onClicked: mouse => {
|
||||
if (mouse.button === Qt.LeftButton) {
|
||||
appGrid.itemClicked(index, model)
|
||||
} else if (mouse.button === Qt.RightButton) {
|
||||
var globalPos = mapToItem(null, mouse.x, mouse.y)
|
||||
var panelPos = contextMenu.parent.mapFromItem(null, globalPos.x, globalPos.y)
|
||||
appGrid.itemRightClicked(index, model, panelPos.x, panelPos.y)
|
||||
}
|
||||
}
|
||||
delegate: AppLauncherGridDelegate {
|
||||
gridView: appGrid
|
||||
cellWidth: appGrid.cellWidth
|
||||
cellHeight: appGrid.cellHeight
|
||||
cellPadding: appGrid.cellPadding
|
||||
minIconSize: appGrid.minIconSize
|
||||
maxIconSize: appGrid.maxIconSize
|
||||
iconSizeRatio: appGrid.iconSizeRatio
|
||||
hoverUpdatesSelection: appGrid.hoverUpdatesSelection
|
||||
keyboardNavigationActive: appGrid.keyboardNavigationActive
|
||||
currentIndex: appGrid.currentIndex
|
||||
mouseAreaLeftMargin: Theme.spacingS
|
||||
mouseAreaRightMargin: Theme.spacingS
|
||||
mouseAreaBottomMargin: Theme.spacingS
|
||||
iconFallbackLeftMargin: Theme.spacingS
|
||||
iconFallbackRightMargin: Theme.spacingS
|
||||
iconFallbackBottomMargin: Theme.spacingS
|
||||
iconMaterialSizeAdjustment: Theme.spacingL
|
||||
onItemClicked: (idx, modelData) => appGrid.itemClicked(idx, modelData)
|
||||
onItemRightClicked: (idx, modelData, mouseX, mouseY) => {
|
||||
const panelPos = contextMenu.parent.mapFromItem(null, mouseX, mouseY)
|
||||
appGrid.itemRightClicked(idx, modelData, panelPos.x, panelPos.y)
|
||||
}
|
||||
onKeyboardNavigationReset: appGrid.keyboardNavigationReset
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -739,7 +542,7 @@ DankPopout {
|
||||
|
||||
background: Rectangle {
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.popupBackground()
|
||||
color: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
||||
border.width: 1
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ Item {
|
||||
height: root.itemHeight
|
||||
width: root.getButtonWidth(itemCount, parent.width)
|
||||
radius: Theme.cornerRadius
|
||||
color: selectedCategory === modelData ? Theme.primary : Theme.surfaceContainerHigh
|
||||
color: selectedCategory === modelData ? Theme.primary : Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
|
||||
StyledText {
|
||||
anchors.centerIn: parent
|
||||
@@ -81,7 +81,7 @@ Item {
|
||||
height: root.itemHeight
|
||||
width: root.getButtonWidth(itemCount, parent.width)
|
||||
radius: Theme.cornerRadius
|
||||
color: selectedCategory === modelData ? Theme.primary : Theme.surfaceContainerHigh
|
||||
color: selectedCategory === modelData ? Theme.primary : Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
border.color: selectedCategory === modelData ? selectedBorderColor : unselectedBorderColor
|
||||
|
||||
StyledText {
|
||||
@@ -117,7 +117,7 @@ Item {
|
||||
height: root.itemHeight
|
||||
width: root.getButtonWidth(itemCount, parent.width)
|
||||
radius: Theme.cornerRadius
|
||||
color: selectedCategory === modelData ? Theme.primary : Theme.surfaceContainerHigh
|
||||
color: selectedCategory === modelData ? Theme.primary : Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
border.color: selectedCategory === modelData ? selectedBorderColor : unselectedBorderColor
|
||||
|
||||
StyledText {
|
||||
|
||||
@@ -7,6 +7,7 @@ import Quickshell.Io
|
||||
import qs.Common
|
||||
import qs.Widgets
|
||||
import qs.Modules
|
||||
import qs.Services
|
||||
|
||||
Variants {
|
||||
model: {
|
||||
@@ -76,11 +77,6 @@ Variants {
|
||||
}
|
||||
}
|
||||
|
||||
WallpaperEngineProc {
|
||||
id: weProc
|
||||
monitor: modelData.name
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
if (source) {
|
||||
const formattedSource = source.startsWith("file://") ? source : "file://" + source
|
||||
@@ -89,34 +85,25 @@ Variants {
|
||||
isInitialized = true
|
||||
}
|
||||
|
||||
Component.onDestruction: {
|
||||
weProc.stop()
|
||||
}
|
||||
|
||||
property bool isInitialized: false
|
||||
property real transitionProgress: 0
|
||||
readonly property bool transitioning: transitionAnimation.running
|
||||
|
||||
onSourceChanged: {
|
||||
const isWE = source.startsWith("we:")
|
||||
const isColor = source.startsWith("#")
|
||||
|
||||
if (isWE) {
|
||||
if (!source) {
|
||||
setWallpaperImmediate("")
|
||||
} else if (isColor) {
|
||||
setWallpaperImmediate("")
|
||||
weProc.start(source.substring(3))
|
||||
} else {
|
||||
weProc.stop()
|
||||
if (!source) {
|
||||
setWallpaperImmediate("")
|
||||
} else if (isColor) {
|
||||
setWallpaperImmediate("")
|
||||
if (!isInitialized || !currentWallpaper.source) {
|
||||
setWallpaperImmediate(source.startsWith("file://") ? source : "file://" + source)
|
||||
isInitialized = true
|
||||
} else if (CompositorService.isNiri && SessionData.isSwitchingMode) {
|
||||
setWallpaperImmediate(source.startsWith("file://") ? source : "file://" + source)
|
||||
} else {
|
||||
if (!isInitialized || !currentWallpaper.source) {
|
||||
setWallpaperImmediate(source.startsWith("file://") ? source : "file://" + source)
|
||||
isInitialized = true
|
||||
} else {
|
||||
changeWallpaper(source.startsWith("file://") ? source : "file://" + source)
|
||||
}
|
||||
changeWallpaper(source.startsWith("file://") ? source : "file://" + source)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -173,7 +160,7 @@ Variants {
|
||||
asynchronous: true
|
||||
smooth: true
|
||||
cache: true
|
||||
fillMode: root.getFillMode(SettingsData.wallpaperFillMode)
|
||||
fillMode: root.getFillMode(SessionData.isGreeterMode ? GreetdSettings.wallpaperFillMode : SettingsData.wallpaperFillMode)
|
||||
}
|
||||
|
||||
Image {
|
||||
@@ -184,7 +171,7 @@ Variants {
|
||||
asynchronous: true
|
||||
smooth: true
|
||||
cache: true
|
||||
fillMode: root.getFillMode(SettingsData.wallpaperFillMode)
|
||||
fillMode: root.getFillMode(SessionData.isGreeterMode ? GreetdSettings.wallpaperFillMode : SettingsData.wallpaperFillMode)
|
||||
|
||||
onStatusChanged: {
|
||||
if (status !== Image.Ready)
|
||||
@@ -207,6 +194,7 @@ Variants {
|
||||
blur: 0.8
|
||||
blurMax: 75
|
||||
opacity: 1 - root.transitionProgress
|
||||
autoPaddingEnabled: false
|
||||
}
|
||||
|
||||
MultiEffect {
|
||||
@@ -216,6 +204,7 @@ Variants {
|
||||
blur: 0.8
|
||||
blurMax: 75
|
||||
opacity: root.transitionProgress
|
||||
autoPaddingEnabled: false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
309
Modules/ControlCenter/BuiltinPlugins/CupsWidget.qml
Normal file
309
Modules/ControlCenter/BuiltinPlugins/CupsWidget.qml
Normal file
@@ -0,0 +1,309 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import qs.Common
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
import qs.Modules.Plugins
|
||||
|
||||
PluginComponent {
|
||||
id: root
|
||||
|
||||
Ref {
|
||||
service: CupsService
|
||||
}
|
||||
|
||||
ccWidgetIcon: CupsService.cupsAvailable && CupsService.getPrintersNum() > 0 ? "print" : "print_disabled"
|
||||
ccWidgetPrimaryText: I18n.tr("Printers")
|
||||
ccWidgetSecondaryText: {
|
||||
if (CupsService.cupsAvailable && CupsService.getPrintersNum() > 0) {
|
||||
return I18n.tr("Printers: ") + CupsService.getPrintersNum() + " - " + I18n.tr("Jobs: ") + CupsService.getTotalJobsNum()
|
||||
} else {
|
||||
if (!CupsService.cupsAvailable) {
|
||||
return I18n.tr("Print Server not available")
|
||||
} else {
|
||||
return I18n.tr("No printer found")
|
||||
}
|
||||
}
|
||||
}
|
||||
ccWidgetIsActive: CupsService.cupsAvailable && CupsService.getTotalJobsNum() > 0
|
||||
|
||||
onCcWidgetToggled: {
|
||||
|
||||
}
|
||||
|
||||
ccDetailContent: Component {
|
||||
Rectangle {
|
||||
id: detailRoot
|
||||
implicitHeight: detailColumn.implicitHeight + Theme.spacingM * 2
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainerHigh
|
||||
|
||||
Column {
|
||||
visible: !CupsService.cupsAvailable || CupsService.getPrintersNum() == 0
|
||||
anchors.centerIn: parent
|
||||
spacing: Theme.spacingS
|
||||
|
||||
DankIcon {
|
||||
name: "print_disabled"
|
||||
size: 36
|
||||
color: Theme.surfaceVariantText
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: !CupsService.cupsAvailable ? I18n.tr("Print Server not available") : I18n.tr("No printer found")
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
color: Theme.surfaceVariantText
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
id: detailColumn
|
||||
anchors.fill: parent
|
||||
anchors.margins: Theme.spacingM
|
||||
spacing: Theme.spacingS
|
||||
visible: CupsService.cupsAvailable && CupsService.getPrintersNum() > 0
|
||||
height: visible ? 120 : 0
|
||||
|
||||
RowLayout {
|
||||
spacing: Theme.spacingS
|
||||
width: parent.width
|
||||
|
||||
DankDropdown {
|
||||
id: printerDropdown
|
||||
text: ""
|
||||
Layout.fillWidth: true
|
||||
Layout.maximumWidth: parent.width - 180
|
||||
description: ""
|
||||
currentValue: {
|
||||
CupsService.getSelectedPrinter()
|
||||
}
|
||||
options: CupsService.getPrintersNames()
|
||||
onValueChanged: value => {
|
||||
CupsService.setSelectedPrinter(value)
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
spacing: Theme.spacingS
|
||||
|
||||
StyledText {
|
||||
text: CupsService.getCurrentPrinterStatePrettyShort()
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceText
|
||||
font.weight: Font.Medium
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
|
||||
Row {
|
||||
spacing: Theme.spacingM
|
||||
|
||||
Rectangle {
|
||||
height: 24
|
||||
width: 80
|
||||
radius: 14
|
||||
color: printerStatusToggle.containsMouse ? Theme.errorHover : Theme.surfaceLight
|
||||
visible: true
|
||||
opacity: 1.0
|
||||
|
||||
Row {
|
||||
anchors.centerIn: parent
|
||||
spacing: Theme.spacingXS
|
||||
|
||||
DankIcon {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
name: CupsService.getCurrentPrinterState() === "stopped" ? "play_arrow" : "pause"
|
||||
size: Theme.fontSizeSmall + 4
|
||||
color: Theme.surfaceText
|
||||
}
|
||||
|
||||
StyledText {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: CupsService.getCurrentPrinterState() === "stopped" ? I18n.tr("Resume") : I18n.tr("Pause")
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceText
|
||||
font.weight: Font.Medium
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: printerStatusToggle
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
enabled: true
|
||||
onClicked: {
|
||||
const selected = CupsService.getSelectedPrinter()
|
||||
if (CupsService.getCurrentPrinterState() === "stopped") {
|
||||
CupsService.resumePrinter(selected)
|
||||
} else {
|
||||
CupsService.pausePrinter(selected)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
height: 24
|
||||
width: 80
|
||||
radius: 14
|
||||
color: clearJobsToggle.containsMouse ? Theme.errorHover : Theme.surfaceLight
|
||||
visible: true
|
||||
opacity: 1.0
|
||||
|
||||
Row {
|
||||
anchors.centerIn: parent
|
||||
spacing: Theme.spacingXS
|
||||
|
||||
DankIcon {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
name: "delete_forever"
|
||||
size: Theme.fontSizeSmall + 4
|
||||
color: Theme.surfaceText
|
||||
}
|
||||
|
||||
StyledText {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: I18n.tr("Jobs")
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceText
|
||||
font.weight: Font.Medium
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: clearJobsToggle
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
enabled: true
|
||||
onClicked: {
|
||||
const selected = CupsService.getSelectedPrinter()
|
||||
CupsService.purgeJobs(selected)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
height: 1
|
||||
width: parent.width
|
||||
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12)
|
||||
}
|
||||
|
||||
DankFlickable {
|
||||
width: parent.width
|
||||
height: 160
|
||||
contentHeight: listCol.height
|
||||
clip: true
|
||||
|
||||
Column {
|
||||
id: listCol
|
||||
width: parent.width
|
||||
spacing: Theme.spacingXS
|
||||
|
||||
Item {
|
||||
width: parent.width
|
||||
height: 120
|
||||
visible: CupsService.getCurrentPrinterJobs().length === 0
|
||||
|
||||
Column {
|
||||
anchors.centerIn: parent
|
||||
spacing: Theme.spacingS
|
||||
|
||||
DankIcon {
|
||||
name: "work"
|
||||
size: 36
|
||||
color: Theme.surfaceVariantText
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: I18n.tr("The job queue of this printer is empty")
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
color: Theme.surfaceVariantText
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Repeater {
|
||||
model: CupsService.getCurrentPrinterJobs()
|
||||
|
||||
delegate: Rectangle {
|
||||
required property var modelData
|
||||
|
||||
width: parent ? parent.width : 300
|
||||
height: 50
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainerHighest
|
||||
border.width: 1
|
||||
border.color: Theme.outlineLight
|
||||
opacity: 1.0
|
||||
|
||||
RowLayout {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.margins: Theme.spacingM
|
||||
spacing: Theme.spacingM
|
||||
|
||||
DankIcon {
|
||||
name: "docs"
|
||||
size: Theme.iconSize + 2
|
||||
color: Theme.surfaceText
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
|
||||
Column {
|
||||
spacing: 2
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
Layout.fillWidth: true
|
||||
|
||||
StyledText {
|
||||
text: "[" + modelData.id + "] " + modelData.state + " (" + (modelData.size / 1024) + "kb)"
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
color: Theme.surfaceText
|
||||
elide: Text.ElideRight
|
||||
wrapMode: Text.NoWrap
|
||||
width: parent.width
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: {
|
||||
var date = new Date(modelData.timeCreated)
|
||||
return date.toLocaleString(Qt.locale(), Locale.ShortFormat)
|
||||
}
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceTextMedium
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
|
||||
DankActionButton {
|
||||
id: cancelJobButton
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: Theme.spacingM
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
iconName: "delete"
|
||||
buttonSize: 36
|
||||
onClicked: {
|
||||
CupsService.cancelJob(CupsService.getSelectedPrinter(), modelData.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,7 @@ PluginComponent {
|
||||
id: detailRoot
|
||||
implicitHeight: detailColumn.implicitHeight + Theme.spacingM * 2
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainerHigh
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
|
||||
Column {
|
||||
id: detailColumn
|
||||
|
||||
@@ -25,7 +25,7 @@ Rectangle {
|
||||
|
||||
readonly property color _tileBgActive: Theme.primary
|
||||
readonly property color _tileBgInactive:
|
||||
Theme.surfaceContainerHigh
|
||||
Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
readonly property color _tileRingActive:
|
||||
Qt.rgba(Theme.primaryText.r, Theme.primaryText.g, Theme.primaryText.b, 0.22)
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ Item {
|
||||
}
|
||||
return w
|
||||
})
|
||||
SettingsData.setControlCenterWidgets(newWidgets)
|
||||
SettingsData.set("controlCenterWidgets", newWidgets)
|
||||
if (root.collapseCallback) {
|
||||
root.collapseCallback()
|
||||
}
|
||||
@@ -74,7 +74,7 @@ Item {
|
||||
}
|
||||
return w
|
||||
})
|
||||
SettingsData.setControlCenterWidgets(newWidgets)
|
||||
SettingsData.set("controlCenterWidgets", newWidgets)
|
||||
if (root.collapseCallback) {
|
||||
root.collapseCallback()
|
||||
}
|
||||
@@ -104,6 +104,12 @@ Item {
|
||||
}
|
||||
builtinInstance = widgetModel.vpnBuiltinInstance
|
||||
}
|
||||
if (builtinId === "builtin_cups") {
|
||||
if (widgetModel?.cupsLoader) {
|
||||
widgetModel.cupsLoader.active = true
|
||||
}
|
||||
builtinInstance = widgetModel.cupsBuiltinInstance
|
||||
}
|
||||
|
||||
if (!builtinInstance || !builtinInstance.ccDetailContent) {
|
||||
return
|
||||
|
||||
@@ -83,7 +83,7 @@ Item {
|
||||
}
|
||||
return w
|
||||
})
|
||||
SettingsData.setControlCenterWidgets(newWidgets)
|
||||
SettingsData.set("controlCenterWidgets", newWidgets)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -485,7 +485,7 @@ Column {
|
||||
anchors.centerIn: parent
|
||||
width: parent.width
|
||||
height: 14
|
||||
property color sliderTrackColor: Theme.surfaceContainerHigh
|
||||
property color sliderTrackColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -507,7 +507,7 @@ Column {
|
||||
instanceId: widgetData.instanceId || ""
|
||||
screenName: root.screenName
|
||||
parentScreen: root.parentScreen
|
||||
property color sliderTrackColor: Theme.surfaceContainerHigh
|
||||
property color sliderTrackColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
|
||||
onIconClicked: {
|
||||
if (!root.editMode && DisplayService.devices && DisplayService.devices.length > 1) {
|
||||
@@ -530,7 +530,7 @@ Column {
|
||||
anchors.centerIn: parent
|
||||
width: parent.width
|
||||
height: 14
|
||||
property color sliderTrackColor: Theme.surfaceContainerHigh
|
||||
property color sliderTrackColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -794,6 +794,12 @@ Column {
|
||||
}
|
||||
builtinInstance = Qt.binding(() => root.model?.vpnBuiltinInstance)
|
||||
}
|
||||
if (id === "builtin_cups") {
|
||||
if (root.model?.cupsLoader) {
|
||||
root.model.cupsLoader.active = true
|
||||
}
|
||||
builtinInstance = Qt.binding(() => root.model?.cupsBuiltinInstance)
|
||||
}
|
||||
}
|
||||
|
||||
sourceComponent: {
|
||||
@@ -836,6 +842,9 @@ Column {
|
||||
onExpandClicked: {
|
||||
if (root.editMode)
|
||||
return
|
||||
if (builtinInstance) {
|
||||
builtinInstance.ccWidgetExpanded()
|
||||
}
|
||||
root.expandClicked(widgetData, widgetIndex)
|
||||
}
|
||||
}
|
||||
@@ -969,6 +978,9 @@ Column {
|
||||
onExpandClicked: {
|
||||
if (root.editMode)
|
||||
return
|
||||
if (pluginInstance) {
|
||||
pluginInstance.ccWidgetExpanded()
|
||||
}
|
||||
root.expandClicked(widgetData, widgetIndex)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ Item {
|
||||
copy[i] = copy[j];
|
||||
copy[j] = tmp;
|
||||
|
||||
SettingsData.setControlCenterWidgets(copy);
|
||||
SettingsData.set("controlCenterWidgets", copy);
|
||||
}
|
||||
|
||||
function snapToGrid() {
|
||||
@@ -244,7 +244,7 @@ Item {
|
||||
var widgets = SettingsData.controlCenterWidgets.slice()
|
||||
if (widgetIndex >= 0 && widgetIndex < widgets.length) {
|
||||
widgets[widgetIndex].width = newSize
|
||||
SettingsData.setControlCenterWidgets(widgets)
|
||||
SettingsData.set("controlCenterWidgets", widgets)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ Row {
|
||||
width: 400 - Theme.spacingL * 2
|
||||
height: 50
|
||||
radius: Theme.cornerRadius
|
||||
color: widgetMouseArea.containsMouse ? Theme.primaryHover : Theme.surfaceContainerHigh
|
||||
color: widgetMouseArea.containsMouse ? Theme.primaryHover : Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
|
||||
border.width: 0
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ Rectangle {
|
||||
|
||||
implicitHeight: 70
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainerHigh
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
|
||||
Theme.outline.b, 0.08)
|
||||
border.width: 0
|
||||
|
||||
@@ -20,6 +20,8 @@ import "./utils/state.js" as StateUtils
|
||||
DankPopout {
|
||||
id: root
|
||||
|
||||
layerNamespace: "dms:control-center"
|
||||
|
||||
property string expandedSection: ""
|
||||
property var triggerScreen: null
|
||||
property bool editMode: false
|
||||
@@ -46,7 +48,7 @@ DankPopout {
|
||||
}
|
||||
}
|
||||
|
||||
readonly property color _containerBg: Theme.surfaceContainerHigh
|
||||
readonly property color _containerBg: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
|
||||
function setTriggerPosition(x, y, width, section, screen) {
|
||||
StateUtils.setTriggerPosition(root, x, y, width, section, screen)
|
||||
|
||||
@@ -14,7 +14,7 @@ Rectangle {
|
||||
|
||||
implicitHeight: headerRow.height + (hasInputVolumeSliderInCC ? 0 : volumeSlider.height) + audioContent.height + Theme.spacingM
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainerHigh
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
||||
border.width: 0
|
||||
|
||||
@@ -134,7 +134,7 @@ Rectangle {
|
||||
width: parent.width
|
||||
height: 50
|
||||
radius: Theme.cornerRadius
|
||||
color: deviceMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) : Theme.surfaceContainerHighest
|
||||
color: deviceMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) : Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency)
|
||||
border.color: modelData === AudioService.source ? Theme.primary : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12)
|
||||
border.width: 0
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ Rectangle {
|
||||
|
||||
implicitHeight: headerRow.height + (!hasVolumeSliderInCC ? volumeSlider.height : 0) + audioContent.height + Theme.spacingM
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainerHigh
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
||||
border.width: 0
|
||||
|
||||
@@ -139,7 +139,7 @@ Rectangle {
|
||||
width: parent.width
|
||||
height: 50
|
||||
radius: Theme.cornerRadius
|
||||
color: deviceMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) : Theme.surfaceContainerHighest
|
||||
color: deviceMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) : Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency)
|
||||
border.color: modelData === AudioService.sink ? Theme.primary : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12)
|
||||
border.width: 0
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import qs.Widgets
|
||||
Rectangle {
|
||||
implicitHeight: contentColumn.implicitHeight + Theme.spacingL * 2
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainerHigh
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
||||
border.width: 0
|
||||
|
||||
@@ -125,7 +125,7 @@ Rectangle {
|
||||
width: (parent.width - Theme.spacingM) / 2
|
||||
height: 64
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainerHighest
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency)
|
||||
border.width: 0
|
||||
|
||||
Column {
|
||||
@@ -160,7 +160,7 @@ Rectangle {
|
||||
width: (parent.width - Theme.spacingM) / 2
|
||||
height: 64
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainerHighest
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency)
|
||||
border.width: 0
|
||||
|
||||
Column {
|
||||
|
||||
@@ -206,7 +206,7 @@ Item {
|
||||
radius: Theme.cornerRadius
|
||||
color: {
|
||||
if (modelData.name === currentCodec)
|
||||
return Theme.surfaceContainerHighest;
|
||||
return Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency);
|
||||
else if (codecMouseArea.containsMouse)
|
||||
return Theme.surfaceHover;
|
||||
else
|
||||
|
||||
@@ -12,7 +12,7 @@ Rectangle {
|
||||
|
||||
implicitHeight: BluetoothService.adapter && BluetoothService.adapter.enabled ? headerRow.height + bluetoothContent.height + Theme.spacingM : headerRow.height
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainerHigh
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
||||
border.width: 0
|
||||
|
||||
@@ -85,8 +85,8 @@ Rectangle {
|
||||
radius: 18
|
||||
color: {
|
||||
if (!BluetoothService.adapter || !BluetoothService.adapter.enabled)
|
||||
return Theme.surfaceContainerHigh
|
||||
return scanMouseArea.containsMouse ? Theme.surfaceContainerHigh : "transparent"
|
||||
return Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
return scanMouseArea.containsMouse ? Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) : "transparent"
|
||||
}
|
||||
border.color: BluetoothService.adapter && BluetoothService.adapter.enabled ? Theme.primary : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12)
|
||||
border.width: 0
|
||||
@@ -179,7 +179,7 @@ Rectangle {
|
||||
return Qt.rgba(Theme.warning.r, Theme.warning.g, Theme.warning.b, 0.12)
|
||||
if (deviceMouseArea.containsMouse)
|
||||
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08)
|
||||
return Theme.surfaceContainerHighest
|
||||
return Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency)
|
||||
}
|
||||
border.color: {
|
||||
if (modelData.state === BluetoothDeviceState.Connecting)
|
||||
@@ -359,7 +359,7 @@ Rectangle {
|
||||
width: parent.width
|
||||
height: 50
|
||||
radius: Theme.cornerRadius
|
||||
color: availableMouseArea.containsMouse && !isBusy ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) : Theme.surfaceContainerHighest
|
||||
color: availableMouseArea.containsMouse && !isBusy ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) : Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency)
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12)
|
||||
border.width: 0
|
||||
opacity: (canConnect && !isBusy) ? 1 : 0.6
|
||||
@@ -463,7 +463,7 @@ Rectangle {
|
||||
property var currentDevice: null
|
||||
|
||||
background: Rectangle {
|
||||
color: Theme.popupBackground()
|
||||
color: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
||||
radius: Theme.cornerRadius
|
||||
border.width: 0
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12)
|
||||
|
||||
@@ -47,6 +47,16 @@ Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
const backlight = DisplayService.devices.find(d => d.class === "backlight")
|
||||
if (backlight) {
|
||||
return backlight.name
|
||||
}
|
||||
|
||||
const ddc = DisplayService.devices.find(d => d.class === "ddc")
|
||||
if (ddc) {
|
||||
return ddc.name
|
||||
}
|
||||
|
||||
return DisplayService.devices.length > 0 ? DisplayService.devices[0].name : ""
|
||||
}
|
||||
|
||||
@@ -75,12 +85,12 @@ Rectangle {
|
||||
pins[screenName] = currentDeviceName
|
||||
}
|
||||
|
||||
SettingsData.setBrightnessDevicePins(pins)
|
||||
SettingsData.set("brightnessDevicePins", pins)
|
||||
}
|
||||
|
||||
implicitHeight: brightnessContent.height + Theme.spacingM
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainerHigh
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
||||
border.width: 0
|
||||
|
||||
@@ -131,7 +141,7 @@ Rectangle {
|
||||
height: 40
|
||||
visible: screenName && screenName.length > 0 && DisplayService.devices && DisplayService.devices.length > 1
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainerHighest
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency)
|
||||
|
||||
Item {
|
||||
anchors.fill: parent
|
||||
@@ -200,106 +210,249 @@ Rectangle {
|
||||
required property var modelData
|
||||
required property int index
|
||||
|
||||
property real deviceBrightness: {
|
||||
DisplayService.brightnessVersion
|
||||
return DisplayService.getDeviceBrightness(modelData.name)
|
||||
}
|
||||
|
||||
width: parent.width
|
||||
height: 80
|
||||
height: 100
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainerHighest
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency)
|
||||
border.color: modelData.name === currentDeviceName ? Theme.primary : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12)
|
||||
border.width: modelData.name === currentDeviceName ? 2 : 0
|
||||
|
||||
Row {
|
||||
anchors.left: parent.left
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.leftMargin: Theme.spacingM
|
||||
spacing: Theme.spacingM
|
||||
Column {
|
||||
anchors.fill: parent
|
||||
anchors.margins: Theme.spacingM
|
||||
spacing: Theme.spacingS
|
||||
|
||||
Column {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: 2
|
||||
Item {
|
||||
width: parent.width
|
||||
height: Math.max(deviceIconColumn.height, deviceInfoColumn.height, exponentControls.height)
|
||||
|
||||
DankIcon {
|
||||
name: {
|
||||
const deviceClass = modelData.class || ""
|
||||
const deviceName = modelData.name || ""
|
||||
Row {
|
||||
anchors.left: parent.left
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: Theme.spacingM
|
||||
|
||||
if (deviceClass === "backlight" || deviceClass === "ddc") {
|
||||
const brightness = DisplayService.getDeviceBrightness(modelData.name)
|
||||
if (brightness <= 33) return "brightness_low"
|
||||
if (brightness <= 66) return "brightness_medium"
|
||||
return "brightness_high"
|
||||
} else if (deviceName.includes("kbd")) {
|
||||
return "keyboard"
|
||||
} else {
|
||||
return "lightbulb"
|
||||
Column {
|
||||
id: deviceIconColumn
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: 2
|
||||
|
||||
DankIcon {
|
||||
name: {
|
||||
const deviceClass = modelData.class || ""
|
||||
const deviceName = modelData.name || ""
|
||||
|
||||
if (deviceClass === "backlight" || deviceClass === "ddc") {
|
||||
if (deviceBrightness <= 33)
|
||||
return "brightness_low"
|
||||
if (deviceBrightness <= 66)
|
||||
return "brightness_medium"
|
||||
return "brightness_high"
|
||||
} else if (deviceName.includes("kbd")) {
|
||||
return "keyboard"
|
||||
} else {
|
||||
return "lightbulb"
|
||||
}
|
||||
}
|
||||
size: Theme.iconSize
|
||||
color: modelData.name === currentDeviceName ? Theme.primary : Theme.surfaceText
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: Math.round(deviceBrightness) + "%"
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceText
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
id: deviceInfoColumn
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: parent.parent.width - deviceIconColumn.width - exponentControls.width - Theme.spacingM * 3
|
||||
|
||||
StyledText {
|
||||
text: {
|
||||
const name = modelData.name || ""
|
||||
const deviceClass = modelData.class || ""
|
||||
if (deviceClass === "backlight") {
|
||||
return name.replace("_", " ").replace(/\b\w/g, c => c.toUpperCase())
|
||||
}
|
||||
return name
|
||||
}
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
color: Theme.surfaceText
|
||||
font.weight: modelData.name === currentDeviceName ? Font.Medium : Font.Normal
|
||||
elide: Text.ElideRight
|
||||
width: parent.width
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: modelData.name
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceVariantText
|
||||
elide: Text.ElideRight
|
||||
width: parent.width
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: {
|
||||
const deviceClass = modelData.class || ""
|
||||
if (deviceClass === "backlight")
|
||||
return "Backlight device"
|
||||
if (deviceClass === "ddc")
|
||||
return "DDC/CI monitor"
|
||||
if (deviceClass === "leds")
|
||||
return "LED device"
|
||||
return deviceClass
|
||||
}
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceVariantText
|
||||
elide: Text.ElideRight
|
||||
width: parent.width
|
||||
}
|
||||
}
|
||||
size: Theme.iconSize
|
||||
color: modelData.name === currentDeviceName ? Theme.primary : Theme.surfaceText
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: Math.round(DisplayService.getDeviceBrightness(modelData.name)) + "%"
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceText
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
Row {
|
||||
id: exponentControls
|
||||
width: 140
|
||||
height: 28
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: Theme.spacingXS
|
||||
visible: SessionData.getBrightnessExponential(modelData.name)
|
||||
z: 1
|
||||
|
||||
StyledRect {
|
||||
width: 28
|
||||
height: 28
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency)
|
||||
opacity: SessionData.getBrightnessExponent(modelData.name) > 1.0 ? 1.0 : 0.4
|
||||
|
||||
DankIcon {
|
||||
anchors.centerIn: parent
|
||||
name: "remove"
|
||||
size: 14
|
||||
color: Theme.surfaceText
|
||||
}
|
||||
|
||||
StateLayer {
|
||||
stateColor: Theme.primary
|
||||
cornerRadius: parent.radius
|
||||
enabled: SessionData.getBrightnessExponent(modelData.name) > 1.0
|
||||
onClicked: {
|
||||
const current = SessionData.getBrightnessExponent(modelData.name)
|
||||
const newValue = Math.max(1.0, Math.round((current - 0.1) * 10) / 10)
|
||||
SessionData.setBrightnessExponent(modelData.name, newValue)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StyledRect {
|
||||
width: 50
|
||||
height: 28
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency)
|
||||
border.width: 0
|
||||
|
||||
StyledText {
|
||||
anchors.centerIn: parent
|
||||
text: SessionData.getBrightnessExponent(modelData.name).toFixed(1)
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
font.weight: Font.Medium
|
||||
color: Theme.primary
|
||||
}
|
||||
}
|
||||
|
||||
StyledRect {
|
||||
width: 28
|
||||
height: 28
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency)
|
||||
opacity: SessionData.getBrightnessExponent(modelData.name) < 2.5 ? 1.0 : 0.4
|
||||
|
||||
DankIcon {
|
||||
anchors.centerIn: parent
|
||||
name: "add"
|
||||
size: 14
|
||||
color: Theme.surfaceText
|
||||
}
|
||||
|
||||
StateLayer {
|
||||
stateColor: Theme.primary
|
||||
cornerRadius: parent.radius
|
||||
enabled: SessionData.getBrightnessExponent(modelData.name) < 2.5
|
||||
onClicked: {
|
||||
const current = SessionData.getBrightnessExponent(modelData.name)
|
||||
const newValue = Math.min(2.5, Math.round((current + 0.1) * 10) / 10)
|
||||
SessionData.setBrightnessExponent(modelData.name, newValue)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: parent.parent.width - parent.parent.anchors.leftMargin - parent.spacing - 50 - Theme.spacingM
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
height: 24
|
||||
radius: height / 2
|
||||
color: SessionData.getBrightnessExponential(modelData.name) ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : Theme.withAlpha(Theme.surfaceText, 0.05)
|
||||
|
||||
StyledText {
|
||||
text: {
|
||||
const name = modelData.name || ""
|
||||
const deviceClass = modelData.class || ""
|
||||
if (deviceClass === "backlight") {
|
||||
return name.replace("_", " ").replace(/\b\w/g, c => c.toUpperCase())
|
||||
}
|
||||
return name
|
||||
Row {
|
||||
anchors.centerIn: parent
|
||||
spacing: 4
|
||||
|
||||
DankIcon {
|
||||
name: "show_chart"
|
||||
size: 14
|
||||
color: SessionData.getBrightnessExponential(modelData.name) ? Theme.primary : Theme.surfaceText
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: SessionData.getBrightnessExponential(modelData.name) ? "Exponential" : "Linear"
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: SessionData.getBrightnessExponential(modelData.name) ? Theme.primary : Theme.surfaceText
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
color: Theme.surfaceText
|
||||
font.weight: modelData.name === currentDeviceName ? Font.Medium : Font.Normal
|
||||
elide: Text.ElideRight
|
||||
width: parent.width
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: modelData.name
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceVariantText
|
||||
elide: Text.ElideRight
|
||||
width: parent.width
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: {
|
||||
const deviceClass = modelData.class || ""
|
||||
if (deviceClass === "backlight") return "Backlight device"
|
||||
if (deviceClass === "ddc") return "DDC/CI monitor"
|
||||
if (deviceClass === "leds") return "LED device"
|
||||
return deviceClass
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
const currentState = SessionData.getBrightnessExponential(modelData.name)
|
||||
SessionData.setBrightnessExponential(modelData.name, !currentState)
|
||||
}
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceVariantText
|
||||
elide: Text.ElideRight
|
||||
width: parent.width
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
anchors.bottomMargin: 28
|
||||
anchors.rightMargin: SessionData.getBrightnessExponential(modelData.name) ? 145 : 0
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
if (screenName && screenName.length > 0 && modelData.name !== currentDeviceName) {
|
||||
const pins = JSON.parse(JSON.stringify(SettingsData.brightnessDevicePins || {}))
|
||||
if (pins[screenName]) {
|
||||
delete pins[screenName]
|
||||
SettingsData.set("brightnessDevicePins", pins)
|
||||
}
|
||||
}
|
||||
currentDeviceName = modelData.name
|
||||
deviceNameChanged(modelData.name)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ Rectangle {
|
||||
|
||||
implicitHeight: diskContent.height + Theme.spacingM
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainerHigh
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
||||
border.width: 0
|
||||
|
||||
@@ -78,7 +78,7 @@ Rectangle {
|
||||
width: parent.width
|
||||
height: 80
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainerHighest
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency)
|
||||
border.color: modelData.mount === currentMountPath ? Theme.primary : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12)
|
||||
border.width: modelData.mount === currentMountPath ? 2 : 0
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ Rectangle {
|
||||
return headerRow.height + wifiOffContent.height + Theme.spacingM
|
||||
}
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainerHigh
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
||||
border.width: 0
|
||||
|
||||
@@ -230,7 +230,7 @@ Rectangle {
|
||||
width: parent.width
|
||||
height: 50
|
||||
radius: Theme.cornerRadius
|
||||
color: wiredNetworkMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) : Theme.surfaceContainerHighest
|
||||
color: wiredNetworkMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) : Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency)
|
||||
border.color: Theme.primary
|
||||
border.width: 0
|
||||
|
||||
@@ -310,7 +310,7 @@ Rectangle {
|
||||
property bool currentConnected: false
|
||||
|
||||
background: Rectangle {
|
||||
color: Theme.popupBackground()
|
||||
color: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
||||
radius: Theme.cornerRadius
|
||||
border.width: 0
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12)
|
||||
@@ -376,6 +376,9 @@ Rectangle {
|
||||
contentHeight: wifiColumn.height
|
||||
clip: true
|
||||
|
||||
property var frozenNetworks: []
|
||||
property bool menuOpen: false
|
||||
|
||||
Column {
|
||||
id: wifiColumn
|
||||
width: parent.width
|
||||
@@ -403,7 +406,7 @@ Rectangle {
|
||||
}
|
||||
|
||||
Repeater {
|
||||
model: sortedNetworks
|
||||
model: wifiContent.menuOpen ? wifiContent.frozenNetworks : sortedNetworks
|
||||
|
||||
property var sortedNetworks: {
|
||||
const ssid = NetworkService.currentWifiSSID
|
||||
@@ -414,6 +417,9 @@ Rectangle {
|
||||
if (b.ssid === ssid) return 1
|
||||
return b.signal - a.signal
|
||||
})
|
||||
if (!wifiContent.menuOpen) {
|
||||
wifiContent.frozenNetworks = sorted
|
||||
}
|
||||
return sorted
|
||||
}
|
||||
delegate: Rectangle {
|
||||
@@ -423,7 +429,7 @@ Rectangle {
|
||||
width: parent.width
|
||||
height: 50
|
||||
radius: Theme.cornerRadius
|
||||
color: networkMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) : Theme.surfaceContainerHighest
|
||||
color: networkMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) : Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency)
|
||||
border.color: modelData.ssid === NetworkService.currentWifiSSID ? Theme.primary : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12)
|
||||
border.width: 0
|
||||
|
||||
@@ -494,11 +500,13 @@ Rectangle {
|
||||
if (networkContextMenu.visible) {
|
||||
networkContextMenu.close()
|
||||
} else {
|
||||
wifiContent.menuOpen = true
|
||||
networkContextMenu.currentSSID = modelData.ssid
|
||||
networkContextMenu.currentSecured = modelData.secured
|
||||
networkContextMenu.currentConnected = modelData.ssid === NetworkService.currentWifiSSID
|
||||
networkContextMenu.currentSaved = modelData.saved
|
||||
networkContextMenu.currentSignal = modelData.signal
|
||||
networkContextMenu.currentAutoconnect = modelData.autoconnect || false
|
||||
networkContextMenu.popup(optionsButton, -networkContextMenu.width + optionsButton.width, optionsButton.height + Theme.spacingXS)
|
||||
}
|
||||
}
|
||||
@@ -541,9 +549,14 @@ Rectangle {
|
||||
property bool currentConnected: false
|
||||
property bool currentSaved: false
|
||||
property int currentSignal: 0
|
||||
property bool currentAutoconnect: false
|
||||
|
||||
onClosed: {
|
||||
wifiContent.menuOpen = false
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
color: Theme.popupBackground()
|
||||
color: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
||||
radius: Theme.cornerRadius
|
||||
border.width: 0
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12)
|
||||
@@ -606,6 +619,29 @@ Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
MenuItem {
|
||||
text: networkContextMenu.currentAutoconnect ? I18n.tr("Disable Autoconnect") : I18n.tr("Enable Autoconnect")
|
||||
height: (networkContextMenu.currentSaved || networkContextMenu.currentConnected) && DMSService.apiVersion > 13 ? 32 : 0
|
||||
visible: (networkContextMenu.currentSaved || networkContextMenu.currentConnected) && DMSService.apiVersion > 13
|
||||
|
||||
contentItem: StyledText {
|
||||
text: parent.text
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
color: Theme.surfaceText
|
||||
leftPadding: Theme.spacingS
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
color: parent.hovered ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) : "transparent"
|
||||
radius: Theme.cornerRadius / 2
|
||||
}
|
||||
|
||||
onTriggered: {
|
||||
NetworkService.setWifiAutoconnect(networkContextMenu.currentSSID, !networkContextMenu.currentAutoconnect)
|
||||
}
|
||||
}
|
||||
|
||||
MenuItem {
|
||||
text: I18n.tr("Forget Network")
|
||||
height: networkContextMenu.currentSaved || networkContextMenu.currentConnected ? 32 : 0
|
||||
|
||||
@@ -8,6 +8,7 @@ QtObject {
|
||||
id: root
|
||||
|
||||
property var vpnBuiltinInstance: null
|
||||
property var cupsBuiltinInstance: null
|
||||
|
||||
property var vpnLoader: Loader {
|
||||
active: false
|
||||
@@ -32,6 +33,41 @@ QtObject {
|
||||
}
|
||||
}
|
||||
|
||||
property var cupsLoader: Loader {
|
||||
active: false
|
||||
sourceComponent: Component {
|
||||
CupsWidget {}
|
||||
}
|
||||
|
||||
onItemChanged: {
|
||||
root.cupsBuiltinInstance = item
|
||||
if (item && !DMSService.activeSubscriptions.includes("cups") && !DMSService.activeSubscriptions.includes("all")) {
|
||||
DMSService.addSubscription("cups")
|
||||
}
|
||||
}
|
||||
|
||||
onActiveChanged: {
|
||||
if (!active) {
|
||||
if (DMSService.activeSubscriptions.includes("cups")) {
|
||||
DMSService.removeSubscription("cups")
|
||||
}
|
||||
root.cupsBuiltinInstance = null
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: SettingsData
|
||||
function onControlCenterWidgetsChanged() {
|
||||
const widgets = SettingsData.controlCenterWidgets || []
|
||||
const hasCupsWidget = widgets.some(w => w.id === "builtin_cups")
|
||||
if (!hasCupsWidget && cupsLoader.active) {
|
||||
console.log("CupsWidget: No CUPS widget in control center, deactivating loader")
|
||||
cupsLoader.active = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
readonly property var coreWidgetDefinitions: [{
|
||||
"id": "nightMode",
|
||||
"text": "Night Mode",
|
||||
@@ -146,6 +182,15 @@ QtObject {
|
||||
"enabled": DMSNetworkService.available,
|
||||
"warning": !DMSNetworkService.available ? "VPN not available" : undefined,
|
||||
"isBuiltinPlugin": true
|
||||
}, {
|
||||
"id": "builtin_cups",
|
||||
"text": "Printers",
|
||||
"description": "Print Server Management",
|
||||
"icon": "Print",
|
||||
"type": "builtin_plugin",
|
||||
"enabled": CupsService.available,
|
||||
"warning": !CupsService.available ? "CUPS not available" : undefined,
|
||||
"isBuiltinPlugin": true
|
||||
}]
|
||||
|
||||
function getPluginWidgets() {
|
||||
|
||||
@@ -46,7 +46,7 @@ PanelWindow {
|
||||
height: 320 // Fixed height to prevent cropping
|
||||
x: Math.max(Theme.spacingL, parent.width - width - Theme.spacingL)
|
||||
y: Theme.barHeight + Theme.spacingXS
|
||||
color: Theme.popupBackground()
|
||||
color: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
||||
radius: Theme.cornerRadius
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
|
||||
Theme.outline.b, 0.08)
|
||||
|
||||
@@ -68,7 +68,7 @@ Row {
|
||||
unit: "%"
|
||||
valueOverride: actualVolumePercent
|
||||
thumbOutlineColor: Theme.surfaceContainer
|
||||
trackColor: root.sliderTrackColor.a > 0 ? root.sliderTrackColor : Theme.surfaceContainerHigh
|
||||
trackColor: root.sliderTrackColor.a > 0 ? root.sliderTrackColor : Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
onSliderValueChanged: function(newValue) {
|
||||
if (defaultSink) {
|
||||
defaultSink.audio.volume = newValue / 100.0
|
||||
|
||||
@@ -13,7 +13,7 @@ Row {
|
||||
property string screenName: ""
|
||||
property var parentScreen: null
|
||||
|
||||
signal iconClicked()
|
||||
signal iconClicked
|
||||
|
||||
height: 40
|
||||
spacing: 0
|
||||
@@ -36,13 +36,27 @@ Row {
|
||||
|
||||
if (deviceName && deviceName.length > 0) {
|
||||
const found = DisplayService.devices.find(dev => dev.name === deviceName)
|
||||
return found ? found.name : ""
|
||||
if (found) {
|
||||
return found.name
|
||||
}
|
||||
}
|
||||
|
||||
const currentDeviceName = DisplayService.currentDevice
|
||||
if (currentDeviceName) {
|
||||
const found = DisplayService.devices.find(dev => dev.name === currentDeviceName)
|
||||
return found ? found.name : ""
|
||||
if (found) {
|
||||
return found.name
|
||||
}
|
||||
}
|
||||
|
||||
const backlight = DisplayService.devices.find(d => d.class === "backlight")
|
||||
if (backlight) {
|
||||
return backlight.name
|
||||
}
|
||||
|
||||
const ddc = DisplayService.devices.find(d => d.class === "ddc")
|
||||
if (ddc) {
|
||||
return ddc.name
|
||||
}
|
||||
|
||||
return DisplayService.devices.length > 0 ? DisplayService.devices[0].name : ""
|
||||
@@ -57,6 +71,7 @@ Row {
|
||||
}
|
||||
|
||||
property real targetBrightness: {
|
||||
DisplayService.brightnessVersion
|
||||
if (!targetDeviceName) {
|
||||
return 0
|
||||
}
|
||||
@@ -69,9 +84,7 @@ Row {
|
||||
height: Theme.iconSize + Theme.spacingS * 2
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
radius: (Theme.iconSize + Theme.spacingS * 2) / 2
|
||||
color: iconArea.containsMouse
|
||||
? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12)
|
||||
: Theme.withAlpha(Theme.primary, 0)
|
||||
color: iconArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : Theme.withAlpha(Theme.primary, 0)
|
||||
|
||||
MouseArea {
|
||||
id: iconArea
|
||||
@@ -112,8 +125,10 @@ Row {
|
||||
|
||||
if (targetDevice.class === "backlight" || targetDevice.class === "ddc") {
|
||||
const brightness = targetBrightness
|
||||
if (brightness <= 33) return "brightness_low"
|
||||
if (brightness <= 66) return "brightness_medium"
|
||||
if (brightness <= 33)
|
||||
return "brightness_low"
|
||||
if (brightness <= 66)
|
||||
return "brightness_medium"
|
||||
return "brightness_high"
|
||||
} else if (targetDevice.name.includes("kbd")) {
|
||||
return "keyboard"
|
||||
@@ -131,16 +146,39 @@ Row {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: parent.width - (Theme.iconSize + Theme.spacingS * 2)
|
||||
enabled: DisplayService.brightnessAvailable && targetDeviceName.length > 0
|
||||
minimum: 1
|
||||
maximum: 100
|
||||
minimum: {
|
||||
if (!targetDevice) return 1
|
||||
const isExponential = SessionData.getBrightnessExponential(targetDevice.id)
|
||||
if (isExponential) {
|
||||
return 1
|
||||
}
|
||||
return (targetDevice.class === "backlight" || targetDevice.class === "ddc") ? 1 : 0
|
||||
}
|
||||
maximum: {
|
||||
if (!targetDevice) return 100
|
||||
const isExponential = SessionData.getBrightnessExponential(targetDevice.id)
|
||||
if (isExponential) {
|
||||
return 100
|
||||
}
|
||||
return targetDevice.displayMax || 100
|
||||
}
|
||||
value: targetBrightness
|
||||
onSliderValueChanged: function(newValue) {
|
||||
showValue: true
|
||||
unit: {
|
||||
if (!targetDevice) return "%"
|
||||
const isExponential = SessionData.getBrightnessExponential(targetDevice.id)
|
||||
if (isExponential) {
|
||||
return "%"
|
||||
}
|
||||
return targetDevice.class === "ddc" ? "" : "%"
|
||||
}
|
||||
onSliderValueChanged: function (newValue) {
|
||||
if (DisplayService.brightnessAvailable && targetDeviceName) {
|
||||
DisplayService.setBrightness(newValue, targetDeviceName, true)
|
||||
}
|
||||
}
|
||||
thumbOutlineColor: Theme.surfaceContainer
|
||||
trackColor: Theme.surfaceContainerHigh
|
||||
trackColor: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
}
|
||||
|
||||
Loader {
|
||||
@@ -148,4 +186,4 @@ Row {
|
||||
active: false
|
||||
sourceComponent: DankTooltip {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ Rectangle {
|
||||
width: parent ? parent.width : 200
|
||||
height: 60
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainerHigh
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
||||
border.width: 0
|
||||
opacity: enabled ? 1.0 : 0.6
|
||||
|
||||
@@ -27,7 +27,7 @@ Rectangle {
|
||||
return Theme.isLightMode ? Qt.darker(base, factor) : Qt.lighter(base, factor)
|
||||
}
|
||||
|
||||
readonly property color _containerBg: Theme.surfaceContainerHigh
|
||||
readonly property color _containerBg: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
|
||||
color: {
|
||||
const baseColor = bodyMouse.containsMouse ? Theme.widgetBaseHoverColor : _containerBg
|
||||
|
||||
@@ -66,7 +66,7 @@ Row {
|
||||
unit: "%"
|
||||
valueOverride: actualVolumePercent
|
||||
thumbOutlineColor: Theme.surfaceContainer
|
||||
trackColor: root.sliderTrackColor.a > 0 ? root.sliderTrackColor : Theme.surfaceContainerHigh
|
||||
trackColor: root.sliderTrackColor.a > 0 ? root.sliderTrackColor : Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
onIsDraggingChanged: {
|
||||
AudioService.suppressOSD = isDragging
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ Rectangle {
|
||||
}
|
||||
|
||||
readonly property color _tileBgActive: Theme.primary
|
||||
readonly property color _tileBgInactive: Theme.surfaceContainerHigh
|
||||
readonly property color _tileBgInactive: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
readonly property color _tileRingActive:
|
||||
Qt.rgba(Theme.primaryText.r, Theme.primaryText.g, Theme.primaryText.b, 0.22)
|
||||
readonly property color _tileIconActive: Theme.primaryText
|
||||
|
||||
@@ -27,7 +27,7 @@ Rectangle {
|
||||
}
|
||||
|
||||
readonly property color _tileBgActive: Theme.primary
|
||||
readonly property color _tileBgInactive: Theme.surfaceContainerHigh
|
||||
readonly property color _tileBgInactive: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
readonly property color _tileRingActive:
|
||||
Qt.rgba(Theme.primaryText.r, Theme.primaryText.g, Theme.primaryText.b, 0.22)
|
||||
readonly property color _tileIconActive: Theme.primaryText
|
||||
|
||||
@@ -24,7 +24,7 @@ Rectangle {
|
||||
}
|
||||
|
||||
readonly property color _tileBgActive: Theme.primary
|
||||
readonly property color _tileBgInactive: Theme.surfaceContainerHigh
|
||||
readonly property color _tileBgInactive: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
readonly property color _tileRingActive:
|
||||
Qt.rgba(Theme.primaryText.r, Theme.primaryText.g, Theme.primaryText.b, 0.22)
|
||||
|
||||
@@ -42,7 +42,7 @@ Rectangle {
|
||||
return Theme.isLightMode ? Qt.darker(base, factor) : Qt.lighter(base, factor)
|
||||
}
|
||||
|
||||
readonly property color _containerBg: Theme.surfaceContainerHigh
|
||||
readonly property color _containerBg: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
|
||||
@@ -21,7 +21,7 @@ function addWidget(widgetId) {
|
||||
}
|
||||
|
||||
widgets.push(widget)
|
||||
SettingsData.setControlCenterWidgets(widgets)
|
||||
SettingsData.set("controlCenterWidgets", widgets)
|
||||
}
|
||||
|
||||
function generateUniqueId() {
|
||||
@@ -32,7 +32,7 @@ function removeWidget(index) {
|
||||
var widgets = SettingsData.controlCenterWidgets.slice()
|
||||
if (index >= 0 && index < widgets.length) {
|
||||
widgets.splice(index, 1)
|
||||
SettingsData.setControlCenterWidgets(widgets)
|
||||
SettingsData.set("controlCenterWidgets", widgets)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,12 +54,12 @@ function toggleWidgetSize(index) {
|
||||
}
|
||||
}
|
||||
|
||||
SettingsData.setControlCenterWidgets(widgets)
|
||||
SettingsData.set("controlCenterWidgets", widgets)
|
||||
}
|
||||
}
|
||||
|
||||
function reorderWidgets(newOrder) {
|
||||
SettingsData.setControlCenterWidgets(newOrder)
|
||||
SettingsData.set("controlCenterWidgets", newOrder)
|
||||
}
|
||||
|
||||
function moveWidget(fromIndex, toIndex) {
|
||||
@@ -67,7 +67,7 @@ function moveWidget(fromIndex, toIndex) {
|
||||
if (fromIndex >= 0 && fromIndex < widgets.length && toIndex >= 0 && toIndex < widgets.length) {
|
||||
const movedWidget = widgets.splice(fromIndex, 1)[0]
|
||||
widgets.splice(toIndex, 0, movedWidget)
|
||||
SettingsData.setControlCenterWidgets(widgets)
|
||||
SettingsData.set("controlCenterWidgets", widgets)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,9 +82,9 @@ function resetToDefault() {
|
||||
{"id": "nightMode", "enabled": true, "width": 50},
|
||||
{"id": "darkMode", "enabled": true, "width": 50}
|
||||
]
|
||||
SettingsData.setControlCenterWidgets(defaultWidgets)
|
||||
SettingsData.set("controlCenterWidgets", defaultWidgets)
|
||||
}
|
||||
|
||||
function clearAll() {
|
||||
SettingsData.setControlCenterWidgets([])
|
||||
SettingsData.set("controlCenterWidgets", [])
|
||||
}
|
||||
@@ -72,6 +72,12 @@ Item {
|
||||
function onSurfaceContainerChanged() { root.requestRepaint() }
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: SettingsData
|
||||
function onDankBarGothCornerRadiusOverrideChanged() { root.requestRepaint() }
|
||||
function onDankBarGothCornerRadiusValueChanged() { root.requestRepaint() }
|
||||
}
|
||||
|
||||
onPaint: {
|
||||
const ctx = getContext("2d")
|
||||
const W = barWindow.isVertical ? correctHeight : correctWidth
|
||||
@@ -171,6 +177,12 @@ Item {
|
||||
function onSurfaceChanged() { root.requestRepaint() }
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: SettingsData
|
||||
function onDankBarGothCornerRadiusOverrideChanged() { root.requestRepaint() }
|
||||
function onDankBarGothCornerRadiusValueChanged() { root.requestRepaint() }
|
||||
}
|
||||
|
||||
onPaint: {
|
||||
const ctx = getContext("2d")
|
||||
const W = barWindow.isVertical ? correctHeight : correctWidth
|
||||
@@ -278,6 +290,8 @@ Item {
|
||||
function onDankBarSpacingChanged() { root.requestRepaint() }
|
||||
function onDankBarSquareCornersChanged() { root.requestRepaint() }
|
||||
function onDankBarTransparencyChanged() { root.requestRepaint() }
|
||||
function onDankBarGothCornerRadiusOverrideChanged() { root.requestRepaint() }
|
||||
function onDankBarGothCornerRadiusValueChanged() { root.requestRepaint() }
|
||||
}
|
||||
|
||||
onPaint: {
|
||||
|
||||
@@ -146,7 +146,7 @@ Item {
|
||||
}
|
||||
|
||||
WlrLayershell.layer: dBarLayer
|
||||
WlrLayershell.namespace: "quickshell:bar"
|
||||
WlrLayershell.namespace: "dms:bar"
|
||||
|
||||
property var modelData: item
|
||||
|
||||
@@ -175,7 +175,7 @@ Item {
|
||||
readonly property bool isVertical: axis.isVertical
|
||||
|
||||
property bool gothCornersEnabled: SettingsData.dankBarGothCornersEnabled
|
||||
property real wingtipsRadius: Theme.cornerRadius
|
||||
property real wingtipsRadius: SettingsData.dankBarGothCornerRadiusOverride ? SettingsData.dankBarGothCornerRadiusValue : Theme.cornerRadius
|
||||
readonly property real _wingR: Math.max(0, wingtipsRadius)
|
||||
readonly property color _surfaceContainer: Theme.surfaceContainer
|
||||
readonly property real _backgroundAlpha: topBarCore?.backgroundTransparency ?? SettingsData.dankBarTransparency
|
||||
@@ -531,6 +531,61 @@ Item {
|
||||
axis: axis
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: scrollArea
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.NoButton
|
||||
propagateComposedEvents: true
|
||||
z: -1
|
||||
|
||||
property real scrollAccumulator: 0
|
||||
property real touchpadThreshold: 500
|
||||
property bool actionInProgress: false
|
||||
|
||||
Timer {
|
||||
id: cooldownTimer
|
||||
interval: 100
|
||||
onTriggered: parent.actionInProgress = false
|
||||
}
|
||||
|
||||
onWheel: wheel => {
|
||||
if (actionInProgress) {
|
||||
wheel.accepted = false
|
||||
return
|
||||
}
|
||||
|
||||
const deltaY = wheel.angleDelta.y
|
||||
const deltaX = wheel.angleDelta.x
|
||||
|
||||
if (CompositorService.isNiri && Math.abs(deltaX) > Math.abs(deltaY)) {
|
||||
topBarContent.switchApp(deltaX)
|
||||
wheel.accepted = false
|
||||
return
|
||||
}
|
||||
|
||||
const isMouseWheel = Math.abs(deltaY) >= 120 && (Math.abs(deltaY) % 120) === 0
|
||||
const direction = deltaY < 0 ? 1 : -1
|
||||
|
||||
if (isMouseWheel) {
|
||||
topBarContent.switchWorkspace(direction)
|
||||
actionInProgress = true
|
||||
cooldownTimer.restart()
|
||||
} else {
|
||||
scrollAccumulator += deltaY
|
||||
|
||||
if (Math.abs(scrollAccumulator) >= touchpadThreshold) {
|
||||
const touchDirection = scrollAccumulator < 0 ? 1 : -1
|
||||
topBarContent.switchWorkspace(touchDirection)
|
||||
scrollAccumulator = 0
|
||||
actionInProgress = true
|
||||
cooldownTimer.restart()
|
||||
}
|
||||
}
|
||||
|
||||
wheel.accepted = false
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
id: topBarContent
|
||||
anchors.fill: parent
|
||||
@@ -835,60 +890,6 @@ Item {
|
||||
id: stackContainer
|
||||
anchors.fill: parent
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.NoButton
|
||||
propagateComposedEvents: true
|
||||
z: -1
|
||||
|
||||
property real scrollAccumulator: 0
|
||||
property real touchpadThreshold: 500
|
||||
property bool actionInProgress: false
|
||||
|
||||
Timer {
|
||||
id: cooldownTimer
|
||||
interval: 100
|
||||
onTriggered: parent.actionInProgress = false
|
||||
}
|
||||
|
||||
onWheel: wheel => {
|
||||
if (actionInProgress) {
|
||||
wheel.accepted = false
|
||||
return
|
||||
}
|
||||
|
||||
const deltaY = wheel.angleDelta.y
|
||||
const deltaX = wheel.angleDelta.x
|
||||
|
||||
if (CompositorService.isNiri && Math.abs(deltaX) > Math.abs(deltaY)) {
|
||||
topBarContent.switchApp(deltaX)
|
||||
wheel.accepted = false
|
||||
return
|
||||
}
|
||||
|
||||
const isMouseWheel = Math.abs(deltaY) >= 120 && (Math.abs(deltaY) % 120) === 0
|
||||
const direction = deltaY < 0 ? 1 : -1
|
||||
|
||||
if (isMouseWheel) {
|
||||
topBarContent.switchWorkspace(direction)
|
||||
actionInProgress = true
|
||||
cooldownTimer.restart()
|
||||
} else {
|
||||
scrollAccumulator += deltaY
|
||||
|
||||
if (Math.abs(scrollAccumulator) >= touchpadThreshold) {
|
||||
const touchDirection = scrollAccumulator < 0 ? 1 : -1
|
||||
topBarContent.switchWorkspace(touchDirection)
|
||||
scrollAccumulator = 0
|
||||
actionInProgress = true
|
||||
cooldownTimer.restart()
|
||||
}
|
||||
}
|
||||
|
||||
wheel.accepted = false
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
id: horizontalStack
|
||||
anchors.fill: parent
|
||||
|
||||
@@ -11,6 +11,8 @@ import qs.Widgets
|
||||
DankPopout {
|
||||
id: root
|
||||
|
||||
layerNamespace: "dms:battery"
|
||||
|
||||
property var triggerScreen: null
|
||||
|
||||
function setTriggerPosition(x, y, width, section, screen) {
|
||||
@@ -56,7 +58,7 @@ DankPopout {
|
||||
id: batteryContent
|
||||
|
||||
implicitHeight: contentColumn.implicitHeight + Theme.spacingL * 2
|
||||
color: Theme.popupBackground()
|
||||
color: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
||||
radius: Theme.cornerRadius
|
||||
border.color: Theme.outlineMedium
|
||||
border.width: 0
|
||||
@@ -304,7 +306,7 @@ DankPopout {
|
||||
width: (parent.width - Theme.spacingM) / 2
|
||||
height: 64
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainerHigh
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
border.width: 0
|
||||
|
||||
Column {
|
||||
@@ -339,7 +341,7 @@ DankPopout {
|
||||
width: (parent.width - Theme.spacingM) / 2
|
||||
height: 64
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainerHigh
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
border.width: 0
|
||||
|
||||
Column {
|
||||
@@ -388,7 +390,7 @@ DankPopout {
|
||||
width: parent.width
|
||||
height: batteryColumn.implicitHeight + Theme.spacingM * 2
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainer
|
||||
color: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
||||
border.width: 0
|
||||
|
||||
Column {
|
||||
@@ -458,7 +460,7 @@ DankPopout {
|
||||
width: (parent.width - Theme.spacingS * 2) / 3
|
||||
height: 48
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainerHigh
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
border.width: 0
|
||||
|
||||
Column {
|
||||
@@ -495,7 +497,7 @@ DankPopout {
|
||||
width: (parent.width - Theme.spacingS * 2) / 3
|
||||
height: 48
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainerHigh
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
border.width: 0
|
||||
|
||||
Column {
|
||||
@@ -524,7 +526,7 @@ DankPopout {
|
||||
width: (parent.width - Theme.spacingS * 2) / 3
|
||||
height: 48
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainerHigh
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
border.width: 0
|
||||
|
||||
Column {
|
||||
|
||||
@@ -13,6 +13,8 @@ import qs.Widgets
|
||||
DankPopout {
|
||||
id: root
|
||||
|
||||
layerNamespace: "dms:vpn"
|
||||
|
||||
Ref {
|
||||
service: DMSNetworkService
|
||||
}
|
||||
@@ -51,7 +53,7 @@ DankPopout {
|
||||
id: content
|
||||
|
||||
implicitHeight: contentColumn.height + Theme.spacingL * 2
|
||||
color: Theme.popupBackground()
|
||||
color: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
||||
radius: Theme.cornerRadius
|
||||
border.color: Theme.outlineMedium
|
||||
border.width: 0
|
||||
@@ -152,7 +154,7 @@ DankPopout {
|
||||
width: parent.width
|
||||
implicitHeight: detailsColumn.implicitHeight + Theme.spacingM * 2
|
||||
radius: Theme.cornerRadius
|
||||
color: Qt.rgba(Theme.surfaceContainerHigh.r, Theme.surfaceContainerHigh.g, Theme.surfaceContainerHigh.b, Theme.getContentBackgroundAlpha() * 0.6)
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
border.color: Theme.outlineStrong
|
||||
border.width: 0
|
||||
clip: true
|
||||
|
||||
@@ -193,7 +193,7 @@ Item {
|
||||
width: tooltipText.contentWidth + Theme.spacingM * 2
|
||||
height: tooltipText.contentHeight + Theme.spacingS * 2
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.popupBackground()
|
||||
color: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
||||
border.color: Theme.outlineMedium
|
||||
border.width: 1
|
||||
visible: false
|
||||
|
||||
@@ -14,6 +14,8 @@ BasePill {
|
||||
property var popoutTarget: null
|
||||
property var widgetData: null
|
||||
property bool minimumWidth: (widgetData && widgetData.minimumWidth !== undefined) ? widgetData.minimumWidth : true
|
||||
property bool showSwap: (widgetData && widgetData.showSwap !== undefined) ? widgetData.showSwap : false
|
||||
readonly property real swapUsage: DgopService.totalSwapKB > 0 ? (DgopService.usedSwapKB / DgopService.totalSwapKB) * 100 : 0
|
||||
|
||||
Component.onCompleted: {
|
||||
DgopService.addRef(["memory"]);
|
||||
@@ -62,6 +64,14 @@ BasePill {
|
||||
color: Theme.surfaceText
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
|
||||
StyledText {
|
||||
visible: root.showSwap && DgopService.totalSwapKB > 0
|
||||
text: root.swapUsage.toFixed(0)
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness)
|
||||
color: Theme.surfaceVariantText
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
@@ -93,18 +103,31 @@ BasePill {
|
||||
return "--%";
|
||||
}
|
||||
|
||||
return DgopService.memoryUsage.toFixed(0) + "%";
|
||||
let ramText = DgopService.memoryUsage.toFixed(0) + "%";
|
||||
if (root.showSwap && DgopService.totalSwapKB > 0) {
|
||||
return ramText + " · " + root.swapUsage.toFixed(0) + "%";
|
||||
}
|
||||
return ramText;
|
||||
}
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness)
|
||||
color: Theme.surfaceText
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
elide: Text.ElideNone
|
||||
wrapMode: Text.NoWrap
|
||||
|
||||
StyledTextMetrics {
|
||||
id: ramBaseline
|
||||
font.pixelSize: Theme.barTextSize(root.barThickness)
|
||||
text: "100%"
|
||||
text: {
|
||||
if (!root.showSwap) {
|
||||
return "100%";
|
||||
}
|
||||
if (root.swapUsage < 10) {
|
||||
return "100% · 0%";
|
||||
}
|
||||
return "100% · 100%";
|
||||
}
|
||||
}
|
||||
|
||||
width: root.minimumWidth ? Math.max(ramBaseline.width, paintedWidth) : paintedWidth
|
||||
|
||||
@@ -772,7 +772,7 @@ Item {
|
||||
}
|
||||
width: 100
|
||||
height: 32
|
||||
color: Theme.popupBackground()
|
||||
color: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
||||
radius: Theme.cornerRadius
|
||||
border.width: 1
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12)
|
||||
|
||||
@@ -440,7 +440,7 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
color: Theme.popupBackground()
|
||||
color: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
||||
radius: Theme.cornerRadius
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
||||
border.width: 1
|
||||
|
||||
@@ -162,13 +162,13 @@ Item {
|
||||
return
|
||||
}
|
||||
|
||||
const keyBase = (w.app_id || w.appId || w.class || w.windowClass || "unknown").toLowerCase()
|
||||
const keyBase = (w.app_id || w.appId || w.class || w.windowClass || "unknown")
|
||||
const key = isActiveWs ? `${keyBase}_${i}` : keyBase
|
||||
|
||||
if (!byApp[key]) {
|
||||
const moddedId = Paths.moddedAppId(keyBase)
|
||||
const isSteamApp = moddedId.toLowerCase().includes("steam_app")
|
||||
const icon = isSteamApp ? "" : Quickshell.iconPath(DesktopEntries.heuristicLookup(moddedId)?.icon, true)
|
||||
const icon = isSteamApp ? "" : DesktopService.resolveIconPath(moddedId)
|
||||
byApp[key] = {
|
||||
"type": "icon",
|
||||
"icon": icon,
|
||||
@@ -417,8 +417,12 @@ Item {
|
||||
acceptedButtons: Qt.RightButton
|
||||
|
||||
onClicked: mouse => {
|
||||
if (mouse.button === Qt.RightButton && CompositorService.isHyprland && root.hyprlandOverviewLoader?.item) {
|
||||
root.hyprlandOverviewLoader.item.overviewOpen = !root.hyprlandOverviewLoader.item.overviewOpen
|
||||
if (mouse.button === Qt.RightButton) {
|
||||
if (CompositorService.isNiri) {
|
||||
NiriService.toggleOverview()
|
||||
} else if (CompositorService.isHyprland && root.hyprlandOverviewLoader?.item) {
|
||||
root.hyprlandOverviewLoader.item.overviewOpen = !root.hyprlandOverviewLoader.item.overviewOpen
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -476,34 +480,27 @@ Item {
|
||||
property bool loadedHasIcon: false
|
||||
property var loadedIcons: []
|
||||
|
||||
readonly property real visualWidth: {
|
||||
if (root.isVertical) {
|
||||
return SettingsData.showWorkspaceApps ? widgetHeight * 0.7 : widgetHeight * 0.5
|
||||
} else {
|
||||
if (SettingsData.showWorkspaceApps && loadedIcons.length > 0) {
|
||||
const numIcons = Math.min(loadedIcons.length, SettingsData.maxWorkspaceIcons)
|
||||
const iconsWidth = numIcons * 18 + (numIcons > 0 ? (numIcons - 1) * Theme.spacingXS : 0)
|
||||
const baseWidth = isActive ? root.widgetHeight * 0.9 + Theme.spacingXS : root.widgetHeight * 0.7
|
||||
return baseWidth + iconsWidth
|
||||
}
|
||||
return isActive ? root.widgetHeight * 1.05 : root.widgetHeight * 0.7
|
||||
readonly property real baseWidth: root.isVertical ? (SettingsData.showWorkspaceApps ? widgetHeight * 0.7 : widgetHeight * 0.5) : (isActive ? root.widgetHeight * 1.05 : root.widgetHeight * 0.7)
|
||||
readonly property real baseHeight: root.isVertical ? (isActive ? root.widgetHeight * 1.05 : root.widgetHeight * 0.7) : (SettingsData.showWorkspaceApps ? widgetHeight * 0.7 : widgetHeight * 0.5)
|
||||
|
||||
readonly property real iconsExtraWidth: {
|
||||
if (!root.isVertical && SettingsData.showWorkspaceApps && loadedIcons.length > 0) {
|
||||
const numIcons = Math.min(loadedIcons.length, SettingsData.maxWorkspaceIcons)
|
||||
return numIcons * 18 + (numIcons > 0 ? (numIcons - 1) * Theme.spacingXS : 0) + (isActive ? Theme.spacingXS : 0)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
readonly property real visualHeight: {
|
||||
if (root.isVertical) {
|
||||
if (SettingsData.showWorkspaceApps && loadedIcons.length > 0) {
|
||||
const numIcons = Math.min(loadedIcons.length, SettingsData.maxWorkspaceIcons)
|
||||
const iconsHeight = numIcons * 18 + (numIcons > 0 ? (numIcons - 1) * Theme.spacingXS : 0)
|
||||
const baseHeight = isActive ? root.widgetHeight * 0.9 + Theme.spacingXS : root.widgetHeight * 0.7
|
||||
return baseHeight + iconsHeight
|
||||
}
|
||||
return isActive ? root.widgetHeight * 1.05 : root.widgetHeight * 0.7
|
||||
} else {
|
||||
return SettingsData.showWorkspaceApps ? widgetHeight * 0.7 : widgetHeight * 0.5
|
||||
readonly property real iconsExtraHeight: {
|
||||
if (root.isVertical && SettingsData.showWorkspaceApps && loadedIcons.length > 0) {
|
||||
const numIcons = Math.min(loadedIcons.length, SettingsData.maxWorkspaceIcons)
|
||||
return numIcons * 18 + (numIcons > 0 ? (numIcons - 1) * Theme.spacingXS : 0) + (isActive ? Theme.spacingXS : 0)
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
//DO NOT move this MouseArea. It should be on this level in order for the appMouseArea to work
|
||||
|
||||
readonly property real visualWidth: baseWidth + iconsExtraWidth
|
||||
readonly property real visualHeight: baseHeight + iconsExtraHeight
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
anchors.fill: parent
|
||||
@@ -519,9 +516,17 @@ Item {
|
||||
const isRightClick = mouse.button === Qt.RightButton
|
||||
|
||||
if (CompositorService.isNiri) {
|
||||
NiriService.switchToWorkspace(modelData - 1)
|
||||
if (isRightClick) {
|
||||
NiriService.toggleOverview()
|
||||
} else {
|
||||
NiriService.switchToWorkspace(modelData - 1)
|
||||
}
|
||||
} else if (CompositorService.isHyprland && modelData?.id) {
|
||||
Hyprland.dispatch(`workspace ${modelData.id}`)
|
||||
if (isRightClick && root.hyprlandOverviewLoader?.item) {
|
||||
root.hyprlandOverviewLoader.item.overviewOpen = !root.hyprlandOverviewLoader.item.overviewOpen
|
||||
} else {
|
||||
Hyprland.dispatch(`workspace ${modelData.id}`)
|
||||
}
|
||||
} else if (CompositorService.isDwl && modelData?.tag !== undefined) {
|
||||
console.log("DWL click - tag:", modelData.tag, "rightClick:", isRightClick)
|
||||
if (isRightClick) {
|
||||
@@ -597,17 +602,10 @@ Item {
|
||||
radius: Theme.cornerRadius
|
||||
color: isActive ? Theme.primary : isUrgent ? Theme.error : isPlaceholder ? Theme.surfaceTextLight : isHovered ? Theme.outlineButton : Theme.surfaceTextAlpha
|
||||
|
||||
border.width: {
|
||||
if (isUrgent && !isActive) return 2
|
||||
return 0
|
||||
}
|
||||
border.color: {
|
||||
if (isUrgent && !isActive) return Theme.error
|
||||
return Theme.withAlpha(Theme.error, 0)
|
||||
}
|
||||
border.width: isUrgent && !isActive ? 2 : 0
|
||||
border.color: isUrgent && !isActive ? Theme.error : Theme.withAlpha(Theme.error, 0)
|
||||
|
||||
Behavior on width {
|
||||
enabled: (!SettingsData.showWorkspaceApps || SettingsData.maxWorkspaceIcons <= 3)
|
||||
NumberAnimation {
|
||||
duration: Theme.mediumDuration
|
||||
easing.type: Theme.emphasizedEasing
|
||||
@@ -615,7 +613,6 @@ Item {
|
||||
}
|
||||
|
||||
Behavior on height {
|
||||
enabled: root.isVertical && (!SettingsData.showWorkspaceApps || SettingsData.maxWorkspaceIcons <= 3)
|
||||
NumberAnimation {
|
||||
duration: Theme.mediumDuration
|
||||
easing.type: Theme.emphasizedEasing
|
||||
@@ -631,14 +628,14 @@ Item {
|
||||
|
||||
Behavior on border.width {
|
||||
NumberAnimation {
|
||||
duration: Theme.shortDuration
|
||||
duration: Theme.mediumDuration
|
||||
easing.type: Theme.emphasizedEasing
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on border.color {
|
||||
ColorAnimation {
|
||||
duration: Theme.shortDuration
|
||||
duration: Theme.mediumDuration
|
||||
easing.type: Theme.emphasizedEasing
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@ import qs.Modules.DankDash
|
||||
DankPopout {
|
||||
id: root
|
||||
|
||||
layerNamespace: "dms:dash"
|
||||
|
||||
property bool dashVisible: false
|
||||
property var triggerScreen: null
|
||||
property int currentTabIndex: 0
|
||||
@@ -105,7 +107,7 @@ DankPopout {
|
||||
id: mainContainer
|
||||
|
||||
implicitHeight: contentColumn.height + Theme.spacingM * 2
|
||||
color: Theme.surfaceContainer
|
||||
color: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
||||
radius: Theme.cornerRadius
|
||||
focus: true
|
||||
|
||||
|
||||
@@ -435,7 +435,7 @@ Item {
|
||||
width: parent.width
|
||||
height: 48
|
||||
radius: Theme.cornerRadius
|
||||
color: deviceMouseAreaLeft.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : Theme.surfaceContainerHigh
|
||||
color: deviceMouseAreaLeft.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
border.color: modelData === AudioService.sink ? Theme.primary : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
|
||||
border.width: modelData === AudioService.sink ? 2 : 1
|
||||
|
||||
@@ -592,7 +592,7 @@ Item {
|
||||
width: parent.width
|
||||
height: 48
|
||||
radius: Theme.cornerRadius
|
||||
color: playerMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : Theme.surfaceContainerHigh
|
||||
color: playerMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
border.color: modelData === activePlayer ? Theme.primary : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
|
||||
border.width: modelData === activePlayer ? 2 : 1
|
||||
|
||||
@@ -862,7 +862,7 @@ Item {
|
||||
height: 40
|
||||
radius: 20
|
||||
anchors.centerIn: parent
|
||||
color: prevBtnArea.containsMouse ? Theme.surfaceContainerHigh : "transparent"
|
||||
color: prevBtnArea.containsMouse ? Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) : "transparent"
|
||||
|
||||
DankIcon {
|
||||
anchors.centerIn: parent
|
||||
@@ -940,7 +940,7 @@ Item {
|
||||
height: 40
|
||||
radius: 20
|
||||
anchors.centerIn: parent
|
||||
color: nextBtnArea.containsMouse ? Theme.surfaceContainerHigh : "transparent"
|
||||
color: nextBtnArea.containsMouse ? Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) : "transparent"
|
||||
|
||||
DankIcon {
|
||||
anchors.centerIn: parent
|
||||
@@ -1249,7 +1249,7 @@ Item {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
anchors.centerIn: parent
|
||||
color: Theme.surfaceContainerHigh
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
radius: Theme.cornerRadius
|
||||
}
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ Rectangle {
|
||||
}
|
||||
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainerHigh
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.05)
|
||||
border.width: 1
|
||||
|
||||
@@ -354,7 +354,7 @@ Rectangle {
|
||||
} else if (eventMouseArea.containsMouse) {
|
||||
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.06)
|
||||
}
|
||||
return Theme.surfaceContainerHigh
|
||||
return Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
}
|
||||
border.color: {
|
||||
if (modelData.url && eventMouseArea.containsMouse) {
|
||||
|
||||
@@ -8,7 +8,7 @@ Rectangle {
|
||||
property int pad: Theme.spacingM
|
||||
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainerHigh
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
||||
border.width: 1
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ Card {
|
||||
height: 28
|
||||
radius: 14
|
||||
anchors.verticalCenter: playPauseButton.verticalCenter
|
||||
color: prevArea.containsMouse ? Theme.surfaceContainerHigh : "transparent"
|
||||
color: prevArea.containsMouse ? Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) : "transparent"
|
||||
|
||||
DankIcon {
|
||||
anchors.centerIn: parent
|
||||
@@ -183,7 +183,7 @@ Card {
|
||||
height: 28
|
||||
radius: 14
|
||||
anchors.verticalCenter: playPauseButton.verticalCenter
|
||||
color: nextArea.containsMouse ? Theme.surfaceContainerHigh : "transparent"
|
||||
color: nextArea.containsMouse ? Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) : "transparent"
|
||||
|
||||
DankIcon {
|
||||
anchors.centerIn: parent
|
||||
|
||||
@@ -202,7 +202,7 @@ Item {
|
||||
function loadWallpaperDirectory() {
|
||||
const currentWallpaper = getCurrentWallpaper()
|
||||
|
||||
if (!currentWallpaper || currentWallpaper.startsWith("#") || currentWallpaper.startsWith("we:")) {
|
||||
if (!currentWallpaper || currentWallpaper.startsWith("#")) {
|
||||
if (CacheData.wallpaperLastPath && CacheData.wallpaperLastPath !== "") {
|
||||
wallpaperDir = CacheData.wallpaperLastPath
|
||||
} else {
|
||||
@@ -412,7 +412,7 @@ Item {
|
||||
id: wallpaperCard
|
||||
anchors.fill: parent
|
||||
anchors.margins: Theme.spacingXS
|
||||
color: Theme.surfaceContainerHighest
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency)
|
||||
radius: Theme.cornerRadius
|
||||
clip: true
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ Item {
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
if (WeatherService.weather.available) {
|
||||
SettingsData.setTemperatureUnit(!SettingsData.useFahrenheit)
|
||||
SettingsData.set("temperatureUnit", !SettingsData.useFahrenheit)
|
||||
}
|
||||
}
|
||||
enabled: WeatherService.weather.available
|
||||
@@ -231,7 +231,7 @@ Item {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainerHigh
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
|
||||
Column {
|
||||
anchors.centerIn: parent
|
||||
@@ -278,7 +278,7 @@ Item {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainerHigh
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
|
||||
Column {
|
||||
anchors.centerIn: parent
|
||||
@@ -325,7 +325,7 @@ Item {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainerHigh
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
|
||||
Column {
|
||||
anchors.centerIn: parent
|
||||
@@ -372,7 +372,7 @@ Item {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainerHigh
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
|
||||
Column {
|
||||
anchors.centerIn: parent
|
||||
@@ -419,7 +419,7 @@ Item {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainerHigh
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
|
||||
Column {
|
||||
anchors.centerIn: parent
|
||||
@@ -466,7 +466,7 @@ Item {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.surfaceContainerHigh
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
|
||||
Column {
|
||||
anchors.centerIn: parent
|
||||
@@ -554,7 +554,7 @@ Item {
|
||||
return null
|
||||
}
|
||||
|
||||
color: isToday ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.1) : Theme.surfaceContainerHigh
|
||||
color: isToday ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.1) : Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
border.color: isToday ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.3) : "transparent"
|
||||
border.width: isToday ? 1 : 0
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ Variants {
|
||||
delegate: PanelWindow {
|
||||
id: dock
|
||||
|
||||
WlrLayershell.namespace: "quickshell:dock"
|
||||
WlrLayershell.namespace: "dms:dock"
|
||||
|
||||
readonly property bool isVertical: SettingsData.dockPosition === SettingsData.Position.Left || SettingsData.dockPosition === SettingsData.Position.Right
|
||||
|
||||
@@ -54,7 +54,7 @@ Variants {
|
||||
}
|
||||
|
||||
readonly property real dockMargin: SettingsData.dockSpacing
|
||||
readonly property real positionSpacing: barSpacing + SettingsData.dockBottomGap
|
||||
readonly property real positionSpacing: barSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin
|
||||
readonly property real _dpr: (dock.screen && dock.screen.devicePixelRatio) ? dock.screen.devicePixelRatio : 1
|
||||
function px(v) { return Math.round(v * _dpr) / _dpr }
|
||||
|
||||
@@ -103,13 +103,13 @@ Variants {
|
||||
exclusiveZone: {
|
||||
if (!SettingsData.showDock || autoHide) return -1
|
||||
if (barSpacing > 0) return -1
|
||||
return px(effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap)
|
||||
return px(effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin)
|
||||
}
|
||||
|
||||
property real animationHeadroom: Math.ceil(SettingsData.dockIconSize * 0.35)
|
||||
|
||||
implicitWidth: isVertical ? (px(effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockIconSize * 0.3) + animationHeadroom) : 0
|
||||
implicitHeight: !isVertical ? (px(effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockIconSize * 0.3) + animationHeadroom) : 0
|
||||
implicitWidth: isVertical ? (px(effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin + SettingsData.dockIconSize * 0.3) + animationHeadroom) : 0
|
||||
implicitHeight: !isVertical ? (px(effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin + SettingsData.dockIconSize * 0.3) + animationHeadroom) : 0
|
||||
|
||||
Item {
|
||||
id: maskItem
|
||||
@@ -188,7 +188,7 @@ Variants {
|
||||
const isBottom = SettingsData.dockPosition === SettingsData.Position.Bottom
|
||||
const globalX = buttonGlobalPos.x + dock.hoveredButton.width / 2
|
||||
const screenRelativeY = isBottom
|
||||
? (screenHeight - dock.effectiveBarHeight - SettingsData.dockSpacing - SettingsData.dockBottomGap - 35)
|
||||
? (screenHeight - dock.effectiveBarHeight - SettingsData.dockSpacing - SettingsData.dockBottomGap - SettingsData.dockMargin - 35)
|
||||
: (buttonGlobalPos.y - screenY + dock.hoveredButton.height + Theme.spacingS)
|
||||
dockTooltip.show(tooltipText,
|
||||
globalX,
|
||||
@@ -197,7 +197,7 @@ Variants {
|
||||
false, false)
|
||||
} else {
|
||||
const isLeft = SettingsData.dockPosition === SettingsData.Position.Left
|
||||
const tooltipOffset = dock.effectiveBarHeight + SettingsData.dockSpacing + Theme.spacingXS
|
||||
const tooltipOffset = dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockMargin + Theme.spacingXS
|
||||
const tooltipX = isLeft ? tooltipOffset : (dock.screen.width - tooltipOffset)
|
||||
const screenRelativeY = buttonGlobalPos.y - screenY + dock.hoveredButton.height / 2
|
||||
dockTooltip.show(tooltipText,
|
||||
@@ -259,12 +259,12 @@ Variants {
|
||||
if (dock.isVertical) {
|
||||
return dock.reveal ? Math.min(dockBackground.implicitHeight + 4, maxDockHeight) : Math.min(Math.max(dockBackground.implicitHeight + 64, 200), screenHeight * 0.5)
|
||||
} else {
|
||||
return dock.reveal ? px(dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap) : 1
|
||||
return dock.reveal ? px(dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin) : 1
|
||||
}
|
||||
}
|
||||
width: {
|
||||
if (dock.isVertical) {
|
||||
return dock.reveal ? px(dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap) : 1
|
||||
return dock.reveal ? px(dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin) : 1
|
||||
} else {
|
||||
return dock.reveal ? Math.min(dockBackground.implicitWidth + 4, maxDockWidth) : Math.min(Math.max(dockBackground.implicitWidth + 64, 200), screenWidth * 0.5)
|
||||
}
|
||||
@@ -304,7 +304,7 @@ Variants {
|
||||
x: {
|
||||
if (!dock.isVertical) return 0
|
||||
if (dock.reveal) return 0
|
||||
const hideDistance = dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + 10
|
||||
const hideDistance = dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin + 10
|
||||
if (SettingsData.dockPosition === SettingsData.Position.Right) {
|
||||
return hideDistance
|
||||
} else {
|
||||
@@ -314,7 +314,7 @@ Variants {
|
||||
y: {
|
||||
if (dock.isVertical) return 0
|
||||
if (dock.reveal) return 0
|
||||
const hideDistance = dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + 10
|
||||
const hideDistance = dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin + 10
|
||||
if (SettingsData.dockPosition === SettingsData.Position.Bottom) {
|
||||
return hideDistance
|
||||
} else {
|
||||
@@ -350,10 +350,10 @@ Variants {
|
||||
right: dock.isVertical ? (SettingsData.dockPosition === SettingsData.Position.Right ? parent.right : undefined) : undefined
|
||||
verticalCenter: dock.isVertical ? parent.verticalCenter : undefined
|
||||
}
|
||||
anchors.topMargin: !dock.isVertical && SettingsData.dockPosition === SettingsData.Position.Top ? barSpacing + 1 : 0
|
||||
anchors.bottomMargin: !dock.isVertical && SettingsData.dockPosition === SettingsData.Position.Bottom ? barSpacing + 1 : 0
|
||||
anchors.leftMargin: dock.isVertical && SettingsData.dockPosition === SettingsData.Position.Left ? barSpacing + 1 : 0
|
||||
anchors.rightMargin: dock.isVertical && SettingsData.dockPosition === SettingsData.Position.Right ? barSpacing + 1 : 0
|
||||
anchors.topMargin: !dock.isVertical && SettingsData.dockPosition === SettingsData.Position.Top ? barSpacing + SettingsData.dockMargin + 1 : 0
|
||||
anchors.bottomMargin: !dock.isVertical && SettingsData.dockPosition === SettingsData.Position.Bottom ? barSpacing + SettingsData.dockMargin + 1 : 0
|
||||
anchors.leftMargin: dock.isVertical && SettingsData.dockPosition === SettingsData.Position.Left ? barSpacing + SettingsData.dockMargin + 1 : 0
|
||||
anchors.rightMargin: dock.isVertical && SettingsData.dockPosition === SettingsData.Position.Right ? barSpacing + SettingsData.dockMargin + 1 : 0
|
||||
|
||||
implicitWidth: dock.isVertical ? (dockApps.implicitHeight + SettingsData.dockSpacing * 2) : (dockApps.implicitWidth + SettingsData.dockSpacing * 2)
|
||||
implicitHeight: dock.isVertical ? (dockApps.implicitWidth + SettingsData.dockSpacing * 2) : (dockApps.implicitHeight + SettingsData.dockSpacing * 2)
|
||||
|
||||
@@ -219,6 +219,8 @@ Item {
|
||||
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
enabled: true
|
||||
preventStealing: true
|
||||
cursorShape: longPressing ? Qt.DragMoveCursor : Qt.PointingHandCursor
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
|
||||
onPressed: mouse => {
|
||||
|
||||
@@ -91,7 +91,7 @@ PanelWindow {
|
||||
}
|
||||
|
||||
const isVertical = SettingsData.dockPosition === SettingsData.Position.Left || SettingsData.dockPosition === SettingsData.Position.Right
|
||||
const dockMargin = 16
|
||||
const dockMargin = SettingsData.dockMargin + 16
|
||||
let buttonScreenX, buttonScreenY
|
||||
|
||||
if (isVertical) {
|
||||
@@ -161,7 +161,7 @@ PanelWindow {
|
||||
|
||||
width: Math.min(400, Math.max(180, menuColumn.implicitWidth + Theme.spacingS * 2))
|
||||
height: Math.max(60, menuColumn.implicitHeight + Theme.spacingS * 2)
|
||||
color: Theme.popupBackground()
|
||||
color: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
||||
radius: Theme.cornerRadius
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
||||
border.width: 1
|
||||
|
||||
@@ -38,11 +38,11 @@ Singleton {
|
||||
property real fontScale: 1.0
|
||||
property real cornerRadius: 12
|
||||
property string widgetBackgroundColor: "sch"
|
||||
property string surfaceBase: "s"
|
||||
property string lockDateFormat: ""
|
||||
property bool lockScreenShowPowerActions: true
|
||||
property var screenPreferences: ({})
|
||||
property int animationSpeed: 2
|
||||
property string wallpaperFillMode: "Fill"
|
||||
|
||||
readonly property string defaultFontFamily: "Inter Variable"
|
||||
readonly property string defaultMonoFontFamily: "Fira Code"
|
||||
@@ -73,11 +73,11 @@ Singleton {
|
||||
fontScale = settings.fontScale !== undefined ? settings.fontScale : 1.0
|
||||
cornerRadius = settings.cornerRadius !== undefined ? settings.cornerRadius : 12
|
||||
widgetBackgroundColor = settings.widgetBackgroundColor !== undefined ? settings.widgetBackgroundColor : "sch"
|
||||
surfaceBase = settings.surfaceBase !== undefined ? settings.surfaceBase : "s"
|
||||
lockDateFormat = settings.lockDateFormat !== undefined ? settings.lockDateFormat : ""
|
||||
lockScreenShowPowerActions = settings.lockScreenShowPowerActions !== undefined ? settings.lockScreenShowPowerActions : true
|
||||
screenPreferences = settings.screenPreferences !== undefined ? settings.screenPreferences : ({})
|
||||
animationSpeed = settings.animationSpeed !== undefined ? settings.animationSpeed : 2
|
||||
wallpaperFillMode = settings.wallpaperFillMode !== undefined ? settings.wallpaperFillMode : "Fill"
|
||||
settingsLoaded = true
|
||||
|
||||
if (typeof Theme !== "undefined") {
|
||||
|
||||
@@ -147,15 +147,9 @@ Item {
|
||||
anchors.fill: parent
|
||||
source: {
|
||||
var currentWallpaper = SessionData.getMonitorWallpaper(screenName)
|
||||
if (screenName && currentWallpaper && currentWallpaper.startsWith("we:")) {
|
||||
const cacheHome = StandardPaths.writableLocation(StandardPaths.GenericCacheLocation).toString()
|
||||
const baseDir = Paths.strip(cacheHome)
|
||||
const screenshotPath = baseDir + "/DankMaterialShell/we_screenshots" + "/" + currentWallpaper.substring(3) + ".jpg"
|
||||
return screenshotPath
|
||||
}
|
||||
return (currentWallpaper && !currentWallpaper.startsWith("#")) ? currentWallpaper : ""
|
||||
}
|
||||
fillMode: Theme.getFillMode(SettingsData.wallpaperFillMode)
|
||||
fillMode: Theme.getFillMode(GreetdSettings.wallpaperFillMode)
|
||||
smooth: true
|
||||
asynchronous: false
|
||||
cache: true
|
||||
|
||||
@@ -32,7 +32,7 @@ Scope {
|
||||
visible: overviewScope.overviewOpen
|
||||
color: "transparent"
|
||||
|
||||
WlrLayershell.namespace: "quickshell:overview"
|
||||
WlrLayershell.namespace: "dms:workspace-overview"
|
||||
WlrLayershell.layer: WlrLayer.Overlay
|
||||
WlrLayershell.exclusiveZone: -1
|
||||
WlrLayershell.keyboardFocus: WlrKeyboardFocus.Exclusive
|
||||
|
||||
@@ -62,6 +62,7 @@ Item {
|
||||
|
||||
function sendLockerReadyOnce() {
|
||||
if (lockerReadySent) return;
|
||||
if (root.unlocking) return;
|
||||
lockerReadySent = true;
|
||||
if (SessionService.loginctlAvailable && DMSService.apiVersion >= 2) {
|
||||
DMSService.sendRequest("loginctl.lockerReady", null, resp => {
|
||||
@@ -73,9 +74,10 @@ Item {
|
||||
|
||||
function maybeSend() {
|
||||
if (!lockerReadyArmed) return;
|
||||
if (root.unlocking) return;
|
||||
if (!root.visible || root.opacity <= 0) return;
|
||||
Qt.callLater(() => {
|
||||
if (root.visible && root.opacity > 0)
|
||||
if (root.visible && root.opacity > 0 && !root.unlocking)
|
||||
sendLockerReadyOnce();
|
||||
});
|
||||
}
|
||||
@@ -157,12 +159,6 @@ Item {
|
||||
anchors.fill: parent
|
||||
source: {
|
||||
var currentWallpaper = SessionData.getMonitorWallpaper(screenName)
|
||||
if (screenName && currentWallpaper && currentWallpaper.startsWith("we:")) {
|
||||
const cacheHome = StandardPaths.writableLocation(StandardPaths.GenericCacheLocation).toString()
|
||||
const baseDir = Paths.strip(cacheHome)
|
||||
const screenshotPath = baseDir + "/DankMaterialShell/we_screenshots" + "/" + currentWallpaper.substring(3) + ".jpg"
|
||||
return screenshotPath
|
||||
}
|
||||
return (currentWallpaper && !currentWallpaper.startsWith("#")) ? currentWallpaper : ""
|
||||
}
|
||||
fillMode: Theme.getFillMode(SettingsData.wallpaperFillMode)
|
||||
@@ -1247,6 +1243,7 @@ Item {
|
||||
lockSecured: !demoMode
|
||||
onUnlockRequested: {
|
||||
root.unlocking = true
|
||||
lockerReadyArmed = false
|
||||
passwordField.text = ""
|
||||
root.passwordBuffer = ""
|
||||
root.unlockRequested()
|
||||
|
||||
@@ -182,7 +182,7 @@ Column {
|
||||
height: 48
|
||||
visible: searchVisible
|
||||
opacity: searchVisible ? 1 : 0
|
||||
color: Qt.rgba(Theme.surfaceContainerHigh.r, Theme.surfaceContainerHigh.g, Theme.surfaceContainerHigh.b, 0.95)
|
||||
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
border.color: searchField.activeFocus ? Theme.primary : Theme.outlineMedium
|
||||
border.width: searchField.activeFocus ? 2 : 1
|
||||
radius: Theme.cornerRadius
|
||||
|
||||
@@ -49,7 +49,7 @@ Rectangle {
|
||||
if (keyboardNavigationActive && expanded && selectedNotificationIndex >= 0) {
|
||||
return Theme.primaryHoverLight
|
||||
}
|
||||
return Theme.surfaceContainerHigh
|
||||
return Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
}
|
||||
border.color: {
|
||||
if (isGroupSelected && keyboardNavigationActive) {
|
||||
@@ -342,7 +342,7 @@ Rectangle {
|
||||
return baseHeight
|
||||
}
|
||||
radius: Theme.cornerRadius
|
||||
color: isSelected ? Theme.primaryPressed : Theme.surfaceContainerHigh
|
||||
color: isSelected ? Theme.primaryPressed : Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
border.color: isSelected ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.4) : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.05)
|
||||
border.width: isSelected ? 1 : 1
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ import qs.Modules.Notifications.Center
|
||||
DankPopout {
|
||||
id: root
|
||||
|
||||
layerNamespace: "dms:notification-center"
|
||||
|
||||
property bool notificationHistoryVisible: false
|
||||
property var triggerScreen: null
|
||||
|
||||
@@ -113,7 +115,7 @@ DankPopout {
|
||||
return Math.max(300, Math.min(baseHeight, maxHeight))
|
||||
}
|
||||
|
||||
color: Theme.popupBackground()
|
||||
color: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
||||
radius: Theme.cornerRadius
|
||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
||||
border.width: 0
|
||||
|
||||
@@ -85,7 +85,7 @@ Item {
|
||||
height: 28
|
||||
radius: Theme.cornerRadius
|
||||
visible: NotificationService.notifications.length > 0
|
||||
color: clearArea.containsMouse ? Theme.primaryHoverLight : Theme.surfaceContainerHigh
|
||||
color: clearArea.containsMouse ? Theme.primaryHoverLight : Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||
|
||||
Row {
|
||||
anchors.centerIn: parent
|
||||
|
||||
@@ -164,7 +164,7 @@ Rectangle {
|
||||
onValueChanged: value => {
|
||||
for (let i = 0; i < timeoutOptions.length; i++) {
|
||||
if (timeoutOptions[i].text === value) {
|
||||
SettingsData.setNotificationTimeoutLow(timeoutOptions[i].value)
|
||||
SettingsData.set("notificationTimeoutLow", timeoutOptions[i].value)
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -179,7 +179,7 @@ Rectangle {
|
||||
onValueChanged: value => {
|
||||
for (let i = 0; i < timeoutOptions.length; i++) {
|
||||
if (timeoutOptions[i].text === value) {
|
||||
SettingsData.setNotificationTimeoutNormal(timeoutOptions[i].value)
|
||||
SettingsData.set("notificationTimeoutNormal", timeoutOptions[i].value)
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -194,7 +194,7 @@ Rectangle {
|
||||
onValueChanged: value => {
|
||||
for (let i = 0; i < timeoutOptions.length; i++) {
|
||||
if (timeoutOptions[i].text === value) {
|
||||
SettingsData.setNotificationTimeoutCritical(timeoutOptions[i].value)
|
||||
SettingsData.set("notificationTimeoutCritical", timeoutOptions[i].value)
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -245,7 +245,7 @@ Rectangle {
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
checked: SettingsData.notificationOverlayEnabled
|
||||
onToggled: toggled => SettingsData.setNotificationOverlayEnabled(toggled)
|
||||
onToggled: toggled => SettingsData.set("notificationOverlayEnabled", toggled)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import qs.Widgets
|
||||
PanelWindow {
|
||||
id: win
|
||||
|
||||
WlrLayershell.namespace: "quickshell:notification"
|
||||
WlrLayershell.namespace: "dms:notification-popup"
|
||||
|
||||
required property var notificationData
|
||||
required property string notificationId
|
||||
@@ -212,7 +212,7 @@ PanelWindow {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 4
|
||||
radius: Theme.cornerRadius
|
||||
color: Theme.popupBackground()
|
||||
color: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
||||
border.color: notificationData && notificationData.urgency === NotificationUrgency.Critical ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.3) : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
||||
border.width: notificationData && notificationData.urgency === NotificationUrgency.Critical ? 2 : 0
|
||||
clip: true
|
||||
|
||||
@@ -11,23 +11,12 @@ DankOSD {
|
||||
autoHideInterval: 3000
|
||||
enableMouseInteraction: true
|
||||
|
||||
property var brightnessDebounceTimer: Timer {
|
||||
property int pendingValue: 0
|
||||
|
||||
interval: {
|
||||
const deviceInfo = DisplayService.getCurrentDeviceInfo()
|
||||
return (deviceInfo && deviceInfo.class === "ddc") ? 200 : 50
|
||||
}
|
||||
repeat: false
|
||||
onTriggered: {
|
||||
DisplayService.setBrightnessInternal(pendingValue, DisplayService.lastIpcDevice)
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: DisplayService
|
||||
function onBrightnessChanged() {
|
||||
root.show()
|
||||
function onBrightnessChanged(showOsd) {
|
||||
if (showOsd) {
|
||||
root.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,11 +62,35 @@ DankOSD {
|
||||
height: 40
|
||||
x: parent.gap * 2 + Theme.iconSize
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
minimum: 1
|
||||
maximum: 100
|
||||
minimum: {
|
||||
const deviceInfo = DisplayService.getCurrentDeviceInfo()
|
||||
if (!deviceInfo) return 1
|
||||
const isExponential = SessionData.getBrightnessExponential(deviceInfo.id)
|
||||
if (isExponential) {
|
||||
return 1
|
||||
}
|
||||
return (deviceInfo.class === "backlight" || deviceInfo.class === "ddc") ? 1 : 0
|
||||
}
|
||||
maximum: {
|
||||
const deviceInfo = DisplayService.getCurrentDeviceInfo()
|
||||
if (!deviceInfo) return 100
|
||||
const isExponential = SessionData.getBrightnessExponential(deviceInfo.id)
|
||||
if (isExponential) {
|
||||
return 100
|
||||
}
|
||||
return deviceInfo.displayMax || 100
|
||||
}
|
||||
enabled: DisplayService.brightnessAvailable
|
||||
showValue: true
|
||||
unit: "%"
|
||||
unit: {
|
||||
const deviceInfo = DisplayService.getCurrentDeviceInfo()
|
||||
if (!deviceInfo) return "%"
|
||||
const isExponential = SessionData.getBrightnessExponential(deviceInfo.id)
|
||||
if (isExponential) {
|
||||
return "%"
|
||||
}
|
||||
return deviceInfo.class === "ddc" ? "" : "%"
|
||||
}
|
||||
thumbOutlineColor: Theme.surfaceContainer
|
||||
alwaysShowValue: SettingsData.osdAlwaysShowValue
|
||||
|
||||
@@ -89,8 +102,7 @@ DankOSD {
|
||||
|
||||
onSliderValueChanged: newValue => {
|
||||
if (DisplayService.brightnessAvailable) {
|
||||
root.brightnessDebounceTimer.pendingValue = newValue
|
||||
root.brightnessDebounceTimer.restart()
|
||||
DisplayService.setBrightness(newValue, DisplayService.lastIpcDevice, true)
|
||||
resetHideTimer()
|
||||
}
|
||||
}
|
||||
@@ -101,22 +113,21 @@ DankOSD {
|
||||
|
||||
onSliderDragFinished: finalValue => {
|
||||
if (DisplayService.brightnessAvailable) {
|
||||
root.brightnessDebounceTimer.stop()
|
||||
DisplayService.setBrightnessInternal(finalValue, DisplayService.lastIpcDevice)
|
||||
DisplayService.setBrightness(finalValue, DisplayService.lastIpcDevice, true)
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: DisplayService
|
||||
|
||||
function onBrightnessChanged() {
|
||||
if (!brightnessSlider.pressed) {
|
||||
function onBrightnessChanged(showOsd) {
|
||||
if (!brightnessSlider.pressed && brightnessSlider.value !== DisplayService.brightnessLevel) {
|
||||
brightnessSlider.value = DisplayService.brightnessLevel
|
||||
}
|
||||
}
|
||||
|
||||
function onDeviceSwitched() {
|
||||
if (!brightnessSlider.pressed) {
|
||||
if (!brightnessSlider.pressed && brightnessSlider.value !== DisplayService.brightnessLevel) {
|
||||
brightnessSlider.value = DisplayService.brightnessLevel
|
||||
}
|
||||
}
|
||||
@@ -124,13 +135,4 @@ DankOSD {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onOsdShown: {
|
||||
if (DisplayService.brightnessAvailable && contentLoader.item) {
|
||||
const slider = contentLoader.item.children[0].children[1]
|
||||
if (slider) {
|
||||
slider.value = DisplayService.brightnessLevel
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user