mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-06 13:38:28 -04:00
Compare commits
129 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 990d86d481 | |||
| 526cb157fd | |||
| 92ba96d9f9 | |||
| 5dfd875b9e | |||
| 00b22df802 | |||
| b22b1bef9b | |||
| 5cae48a85d | |||
| 4200270b55 | |||
| c2c180d304 | |||
| 3938e60ce4 | |||
| 2986e354e8 | |||
| bf12665adb | |||
| f8fe16738e | |||
| 3c688cfbd3 | |||
| 92ba2bb57d | |||
| 504c132f78 | |||
| bdaa6bcc9d | |||
| a50bb2cab3 | |||
| b17a90a412 | |||
| 0ffec5011b | |||
| adbbd9b112 | |||
| 95e1d6b72e | |||
| 4cb09dcc1b | |||
| ed44d02202 | |||
| 4352f49ae3 | |||
| 9ddea82063 | |||
| 3c0f2cbc48 | |||
| 6c45413d7a | |||
| 149e1e64b1 | |||
| 5589cfb783 | |||
| ff71502083 | |||
| 1ef5371c3b | |||
| 3951cd6b18 | |||
| 9686f29246 | |||
| 6d206c9521 | |||
| 48e36ae146 | |||
| 7c24e85c19 | |||
| fe1a783ec2 | |||
| 358496134c | |||
| dc924618fb | |||
| fb2dbced08 | |||
| cdaedad969 | |||
| bf408f8d00 | |||
| b169fe0d77 | |||
| 9b67cedaa1 | |||
| 2edf70a144 | |||
| 72a71cacba | |||
| 0440e40a82 | |||
| ec27d4643c | |||
| f18d36f6c2 | |||
| 3254cc6a1e | |||
| 4af3225f21 | |||
| 3c5245914f | |||
| 89814a2c65 | |||
| 5d2093e54a | |||
| 3cd52ca327 | |||
| 5b41d699fa | |||
| 544599bf1c | |||
| 296b3a3d7e | |||
| 729a990fa7 | |||
| c3fa7b2e1d | |||
| 2c5a1a2804 | |||
| 1973526c4e | |||
| bba5502960 | |||
| 52740290b2 | |||
| 27703575bc | |||
| e6504add7b | |||
| f1e9121295 | |||
| 9ff751b82a | |||
| 21eaaef056 | |||
| bb0be2b215 | |||
| 25847c3f03 | |||
| 7b5c25c50f | |||
| 7535b70fa6 | |||
| e3034e4e94 | |||
| 3da19e5c15 | |||
| ca89e12963 | |||
| 4fb6995796 | |||
| 3f5a54aa88 | |||
| d379d251b9 | |||
| 7ab0e01573 | |||
| 2cb48aaf6b | |||
| e4657aa5f9 | |||
| 197d17ac4e | |||
| 31ea83584b | |||
| ea66b136ba | |||
| 06c0ea2afb | |||
| f4f47c0bc5 | |||
| 8a0ed8a50f | |||
| 63eea01243 | |||
| f590a2965a | |||
| 4ab03deded | |||
| 846d07d86a | |||
| 55d88d8dfb | |||
| a803f96f41 | |||
| da7cc5648b | |||
| 75443758f9 | |||
| eaecff93a4 | |||
| 6e7c20c59c | |||
| 406dcfe110 | |||
| e2b3a2e3ca | |||
| 71ab752e1b | |||
| 204ecd0461 | |||
| 0fdfac366e | |||
| 52123458c7 | |||
| 26b2955cf3 | |||
| d82d86df5c | |||
| c445597f83 | |||
| 6a58adfb29 | |||
| 05feb211ba | |||
| a3b2167e58 | |||
| 0b69feaa1a | |||
| 494144a7c7 | |||
| 2a2c1ca9e6 | |||
| 56b7ecb008 | |||
| 867102b82c | |||
| 4bdb7d17b2 | |||
| c44ffae751 | |||
| ce1595d62d | |||
| 45f6232e32 | |||
| 9cf2ca7196 | |||
| c0eeed4e89 | |||
| d0a4c1c56e | |||
| cb0dc9c68d | |||
| 0439d017b9 | |||
| 8008238ca0 | |||
| a095d0ed90 | |||
| a48cce59d4 | |||
| 4c806f83f1 |
@@ -0,0 +1,56 @@
|
|||||||
|
name: Sync flake.lock to dank-qml-common
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- "dank-qml-common"
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
sync:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Create GitHub App token
|
||||||
|
id: app_token
|
||||||
|
uses: actions/create-github-app-token@v1
|
||||||
|
with:
|
||||||
|
app-id: ${{ secrets.APP_ID }}
|
||||||
|
private-key: ${{ secrets.APP_PRIVATE_KEY }}
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
token: ${{ steps.app_token.outputs.token }}
|
||||||
|
|
||||||
|
- name: Install Nix
|
||||||
|
uses: cachix/install-nix-action@v31
|
||||||
|
|
||||||
|
- name: Point flake input at the submodule commit
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
submodule_rev=$(git ls-tree HEAD dank-qml-common --object-only)
|
||||||
|
flake_rev=$(python3 -c "import json; print(json.load(open('flake.lock'))['nodes']['dank-qml-common']['locked']['rev'])")
|
||||||
|
[ "$submodule_rev" = "$flake_rev" ] && { echo "flake.lock already matches $submodule_rev"; exit 0; }
|
||||||
|
nix flake lock --override-input dank-qml-common "github:AvengeMedia/dank-qml-common/$submodule_rev"
|
||||||
|
|
||||||
|
- name: Commit and push flake.lock update
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ steps.app_token.outputs.token }}
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
if git diff --quiet flake.lock; then
|
||||||
|
echo "No changes to flake.lock"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
git config user.name "dms-ci[bot]"
|
||||||
|
git config user.email "dms-ci[bot]@users.noreply.github.com"
|
||||||
|
git add flake.lock
|
||||||
|
git commit -m "nix: sync flake.lock to dank-qml-common submodule"
|
||||||
|
git pull --rebase origin ${{ github.ref_name }}
|
||||||
|
git push https://x-access-token:${GH_TOKEN}@github.com/${{ github.repository }}.git HEAD:${{ github.ref_name }}
|
||||||
@@ -27,6 +27,8 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
- name: Install flatpak
|
- name: Install flatpak
|
||||||
run: sudo apt update && sudo apt install -y flatpak
|
run: sudo apt update && sudo apt install -y flatpak
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
- name: Install flatpak
|
- name: Install flatpak
|
||||||
run: sudo apt update && sudo apt install -y flatpak
|
run: sudo apt update && sudo apt install -y flatpak
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
ref: ${{ inputs.tag }}
|
ref: ${{ inputs.tag }}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v6
|
uses: actions/setup-go@v6
|
||||||
@@ -191,11 +192,13 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
ref: ${{ inputs.tag }}
|
ref: ${{ inputs.tag }}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
- name: Fetch updated tag after version bump
|
- name: Fetch updated tag after version bump
|
||||||
run: |
|
run: |
|
||||||
git fetch origin --force tag ${TAG}
|
git fetch origin --force tag ${TAG}
|
||||||
git checkout ${TAG}
|
git checkout ${TAG}
|
||||||
|
git submodule update --init --recursive
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v6
|
uses: actions/setup-go@v6
|
||||||
@@ -252,6 +255,7 @@ jobs:
|
|||||||
- **`dankinstall-arm64.gz`** - Installer binary for ARM64 systems
|
- **`dankinstall-arm64.gz`** - Installer binary for ARM64 systems
|
||||||
- **`dms-cli-<version>.tar.gz`** - Go source code with vendored modules (for distro packaging)
|
- **`dms-cli-<version>.tar.gz`** - Go source code with vendored modules (for distro packaging)
|
||||||
- **`dms-qml.tar.gz`** - QML source code only
|
- **`dms-qml.tar.gz`** - QML source code only
|
||||||
|
- **`dms-source.tar.gz`** - Full repository source with bundled DankCommon (for distro packaging)
|
||||||
|
|
||||||
### Checksums
|
### Checksums
|
||||||
- **`*.sha256`** - SHA256 checksums for verifying download integrity
|
- **`*.sha256`** - SHA256 checksums for verifying download integrity
|
||||||
@@ -299,6 +303,22 @@ jobs:
|
|||||||
# Copy completions
|
# Copy completions
|
||||||
cp _core_assets/completion.* _release_assets/ 2>/dev/null || true
|
cp _core_assets/completion.* _release_assets/ 2>/dev/null || true
|
||||||
|
|
||||||
|
# Replace the DankCommon symlink with real submodule content for packaging
|
||||||
|
rm quickshell/DankCommon
|
||||||
|
cp -r dank-qml-common/DankCommon quickshell/DankCommon
|
||||||
|
|
||||||
|
# Create full source tarball (GitHub tag archives never contain submodule content)
|
||||||
|
VERSION_NUM=${TAG#v}
|
||||||
|
tar --exclude='.git' \
|
||||||
|
--exclude='.github' \
|
||||||
|
--exclude='dank-qml-common' \
|
||||||
|
--exclude='_release_assets' \
|
||||||
|
--exclude='_core_assets' \
|
||||||
|
--exclude='RELEASE_BODY.md' \
|
||||||
|
--transform "s,^\.,DankMaterialShell-${VERSION_NUM},S" \
|
||||||
|
-czf _release_assets/dms-source.tar.gz .
|
||||||
|
(cd _release_assets && sha256sum dms-source.tar.gz > dms-source.tar.gz.sha256)
|
||||||
|
|
||||||
# Create QML source package (exclude build artifacts and git files)
|
# Create QML source package (exclude build artifacts and git files)
|
||||||
# Copy root LICENSE and CONTRIBUTING.md to quickshell/ for packaging
|
# Copy root LICENSE and CONTRIBUTING.md to quickshell/ for packaging
|
||||||
cp LICENSE CONTRIBUTING.md quickshell/
|
cp LICENSE CONTRIBUTING.md quickshell/
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ jobs:
|
|||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
- name: Check for updates
|
- name: Check for updates
|
||||||
id: check
|
id: check
|
||||||
@@ -199,6 +200,7 @@ jobs:
|
|||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
- name: Wait before OBS upload
|
- name: Wait before OBS upload
|
||||||
run: sleep 3
|
run: sleep 3
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ jobs:
|
|||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
@@ -94,6 +95,7 @@ jobs:
|
|||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v6
|
uses: actions/setup-go@v6
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
ref: ${{ github.event.release.tag_name || (github.event.inputs.version && (startsWith(github.event.inputs.version, 'v') && github.event.inputs.version || format('v{0}', github.event.inputs.version))) || github.ref }}
|
ref: ${{ github.event.release.tag_name || (github.event.inputs.version && (startsWith(github.event.inputs.version, 'v') && github.event.inputs.version || format('v{0}', github.event.inputs.version))) || github.ref }}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
- name: Record checked-out source commit
|
- name: Record checked-out source commit
|
||||||
run: echo "SOURCE_COMMIT=$(git rev-parse HEAD)" >> "$GITHUB_ENV"
|
run: echo "SOURCE_COMMIT=$(git rev-parse HEAD)" >> "$GITHUB_ENV"
|
||||||
@@ -225,7 +226,7 @@ jobs:
|
|||||||
if [ -n "$RELEASE_VER" ] && { [ "$BUILD_DMS" = "true" ] || [ "$BUILD_GREETER" = "true" ]; }; then
|
if [ -n "$RELEASE_VER" ] && { [ "$BUILD_DMS" = "true" ] || [ "$BUILD_GREETER" = "true" ]; }; then
|
||||||
echo "🔧 Updating stable templates for $ARCHIVE_TAG"
|
echo "🔧 Updating stable templates for $ARCHIVE_TAG"
|
||||||
TARBALL="$(mktemp)"
|
TARBALL="$(mktemp)"
|
||||||
curl -fsSL -o "$TARBALL" "https://github.com/${{ github.repository }}/archive/refs/tags/${ARCHIVE_TAG}.tar.gz"
|
curl -fsSL -o "$TARBALL" "https://github.com/${{ github.repository }}/releases/download/${ARCHIVE_TAG}/dms-source.tar.gz"
|
||||||
RELEASE_CHECKSUM="$(sha256sum "$TARBALL" | cut -d' ' -f1)"
|
RELEASE_CHECKSUM="$(sha256sum "$TARBALL" | cut -d' ' -f1)"
|
||||||
rm -f "$TARBALL"
|
rm -f "$TARBALL"
|
||||||
|
|
||||||
@@ -246,7 +247,7 @@ jobs:
|
|||||||
# into $wrksrc (create_wrksrc=yes handles the rest).
|
# into $wrksrc (create_wrksrc=yes handles the rest).
|
||||||
SRC_CACHE="hostdir/sources/dms-git-${GIT_VER}"
|
SRC_CACHE="hostdir/sources/dms-git-${GIT_VER}"
|
||||||
mkdir -p "$SRC_CACHE"
|
mkdir -p "$SRC_CACHE"
|
||||||
tar -czf "${SRC_CACHE}/dms-git-${GIT_VER}.tar.gz" \
|
tar -czhf "${SRC_CACHE}/dms-git-${GIT_VER}.tar.gz" \
|
||||||
--exclude=void-packages \
|
--exclude=void-packages \
|
||||||
--exclude=r2-repo \
|
--exclude=r2-repo \
|
||||||
--exclude=.git \
|
--exclude=.git \
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
[submodule "dank-qml-common"]
|
||||||
|
path = dank-qml-common
|
||||||
|
url = https://github.com/AvengeMedia/dank-qml-common.git
|
||||||
@@ -36,6 +36,14 @@ repos:
|
|||||||
language: system
|
language: system
|
||||||
files: ^quickshell/(.*\.qml|translations/(term_freeze\.json|check_term_freeze\.py|extract_translations\.py))$
|
files: ^quickshell/(.*\.qml|translations/(term_freeze\.json|check_term_freeze\.py|extract_translations\.py))$
|
||||||
pass_filenames: false
|
pass_filenames: false
|
||||||
|
- repo: local
|
||||||
|
hooks:
|
||||||
|
- id: i18n-term-variants
|
||||||
|
name: i18n term variants (no case/punctuation duplicates)
|
||||||
|
entry: python3 quickshell/translations/check_term_variants.py
|
||||||
|
language: system
|
||||||
|
files: ^quickshell/(.*\.qml|translations/(check_term_variants\.py|extract_translations\.py))$
|
||||||
|
pass_filenames: false
|
||||||
- repo: local
|
- repo: local
|
||||||
hooks:
|
hooks:
|
||||||
- id: no-console-in-qml
|
- id: no-console-in-qml
|
||||||
|
|||||||
@@ -6,6 +6,14 @@ To contribute fork this repository, make your changes, and open a pull request.
|
|||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
|
Clone with submodules — the shared widget library ([dank-qml-common](https://github.com/AvengeMedia/dank-qml-common)) is vendored at `dank-qml-common/` and symlinked into `quickshell/DankCommon`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone --recurse-submodules https://github.com/AvengeMedia/DankMaterialShell.git
|
||||||
|
# or, in an existing clone:
|
||||||
|
git submodule update --init
|
||||||
|
```
|
||||||
|
|
||||||
Install [prek](https://prek.j178.dev/) then activate pre-commit hooks:
|
Install [prek](https://prek.j178.dev/) then activate pre-commit hooks:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -28,6 +36,24 @@ This will provide:
|
|||||||
|
|
||||||
The dev shell automatically creates the `.qmlls.ini` file in the `quickshell/` directory.
|
The dev shell automatically creates the `.qmlls.ini` file in the `quickshell/` directory.
|
||||||
|
|
||||||
|
## Shared widgets (dank-qml-common)
|
||||||
|
|
||||||
|
Everything under `quickshell/DankCommon/` (core widgets, the file browser, scroll physics, bundled fonts) is shared across the DMS suite and lives in the `dank-qml-common` submodule. It is a normal git worktree:
|
||||||
|
|
||||||
|
1. Edit files under `dank-qml-common/` (or through the `quickshell/DankCommon` symlink — same files) and test in the running shell; hot reload works as usual. For isolated widget work, the library is its own runnable config with a gallery: `qs -c dank-qml-common`.
|
||||||
|
2. Commit and PR those changes in the `dank-qml-common` repo: `cd dank-qml-common && git switch -c my-change`, push, open the PR there.
|
||||||
|
3. Once merged, bump the pointer here: `make update-common` (updates the submodule and the nix flake input together), then commit alongside any DMS-side changes. If you only bump the submodule, CI syncs `flake.lock` to it automatically on master.
|
||||||
|
|
||||||
|
The submodule URL in `.gitmodules` is HTTPS so CI and anonymous clones keep working. To push over SSH instead of being prompted for credentials, add a push rewrite to your git config — fetches stay HTTPS, pushes use SSH:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git config --global url."git@github.com:AvengeMedia/".pushInsteadOf "https://github.com/AvengeMedia/"
|
||||||
|
```
|
||||||
|
|
||||||
|
Shared widgets read app-provided singletons (`Theme`, `SettingsData`, ...) through a documented contract — see the dank-qml-common README. If your change needs a new contract property, add it to the library's stub singletons in the same PR, then to `quickshell/Common/` here when you bump.
|
||||||
|
|
||||||
|
Files in `quickshell/Widgets/`, `quickshell/Common/`, and `quickshell/Modals/FileBrowser/` that moved to the library remain in place as thin wrappers, so `import qs.Widgets`, `qs.Common`, and `qs.Modals.FileBrowser` keep working for the shell and for plugins.
|
||||||
|
|
||||||
## VSCode Setup
|
## VSCode Setup
|
||||||
|
|
||||||
This is a monorepo, the easiest thing to do is to open an editor in either `quickshell`, `core`, or both depending on which part of the project you are working on.
|
This is a monorepo, the easiest thing to do is to open an editor in either `quickshell`, `core`, or both depending on which part of the project you are working on.
|
||||||
@@ -104,6 +130,8 @@ Text {
|
|||||||
|
|
||||||
Preferably, try to keep new terms to a minimum and re-use existing terms where possible. See `quickshell/translations/en.json` for the list of existing terms. (This isn't always possible obviously, but instead of using `Auto-connect` you would use `Autoconnect` since it's already translated)
|
Preferably, try to keep new terms to a minimum and re-use existing terms where possible. See `quickshell/translations/en.json` for the list of existing terms. (This isn't always possible obviously, but instead of using `Auto-connect` you would use `Autoconnect` since it's already translated)
|
||||||
|
|
||||||
|
Strings inside `quickshell/DankCommon/` are owned by the dank-qml-common repo but stay in the DMS POEditor project — extraction here deliberately skips them, and `scripts/i18nsync.py sync` uploads the union of app terms and the submodule's terms instead (common terms carry the `dank-qml-common` tag). On download the sync splits the exports: app translations go to `quickshell/translations/poexports/`, common translations go to `dank-qml-common/DankCommon/translations/poexports/` for you to commit in that repo and bump. At runtime `I18n` merges both catalogs (app terms win). Other apps (dankcalendar) keep their own POEditor projects and merge the `dank-qml-common`-tagged terms from the DMS project.
|
||||||
|
|
||||||
### GO (`core` directory)
|
### GO (`core` directory)
|
||||||
|
|
||||||
1. Install the [Go Extension](https://code.visualstudio.com/docs/languages/go)
|
1. Install the [Go Extension](https://code.visualstudio.com/docs/languages/go)
|
||||||
|
|||||||
@@ -35,6 +35,12 @@ clean:
|
|||||||
lint-qml:
|
lint-qml:
|
||||||
@./quickshell/scripts/qmllint-entrypoints.sh
|
@./quickshell/scripts/qmllint-entrypoints.sh
|
||||||
|
|
||||||
|
# Pull the latest dank-qml-common and pin it everywhere it is consumed
|
||||||
|
# (submodule pointer + nix flake input). Commit both in one change.
|
||||||
|
update-common:
|
||||||
|
git submodule update --remote --merge dank-qml-common
|
||||||
|
nix --extra-experimental-features 'nix-command flakes' flake update dank-qml-common
|
||||||
|
|
||||||
# Installation targets
|
# Installation targets
|
||||||
install-bin:
|
install-bin:
|
||||||
@echo "Installing $(BINARY_NAME) to $(INSTALL_DIR)..."
|
@echo "Installing $(BINARY_NAME) to $(INSTALL_DIR)..."
|
||||||
@@ -43,8 +49,9 @@ install-bin:
|
|||||||
|
|
||||||
install-shell:
|
install-shell:
|
||||||
@echo "Installing shell files to $(SHELL_INSTALL_DIR)..."
|
@echo "Installing shell files to $(SHELL_INSTALL_DIR)..."
|
||||||
|
@test -e $(SHELL_DIR)/DankCommon/Widgets/DankIcon.qml || { echo "DankCommon missing: run git submodule update --init"; exit 1; }
|
||||||
@mkdir -p $(SHELL_INSTALL_DIR)
|
@mkdir -p $(SHELL_INSTALL_DIR)
|
||||||
@cp -r $(SHELL_DIR)/* $(SHELL_INSTALL_DIR)/
|
@cp -rL $(SHELL_DIR)/* $(SHELL_INSTALL_DIR)/
|
||||||
@rm -rf $(SHELL_INSTALL_DIR)/.git* $(SHELL_INSTALL_DIR)/.github
|
@rm -rf $(SHELL_INSTALL_DIR)/.git* $(SHELL_INSTALL_DIR)/.github
|
||||||
@echo "Shell files installed"
|
@echo "Shell files installed"
|
||||||
|
|
||||||
|
|||||||
@@ -250,6 +250,10 @@ func updateOtherDistros() error {
|
|||||||
return fmt.Errorf("failed to fetch changes: %w", err)
|
return fmt.Errorf("failed to fetch changes: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err := updateSubmodules(); err != nil {
|
||||||
|
return fmt.Errorf("failed to update submodules: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
if currentTag != "" {
|
if currentTag != "" {
|
||||||
latestTagCmd := exec.Command("git", "tag", "-l", "v*", "--sort=-version:refname")
|
latestTagCmd := exec.Command("git", "tag", "-l", "v*", "--sort=-version:refname")
|
||||||
latestTagOutput, err := latestTagCmd.Output()
|
latestTagOutput, err := latestTagCmd.Output()
|
||||||
@@ -291,6 +295,10 @@ func updateOtherDistros() error {
|
|||||||
return fmt.Errorf("update cancelled")
|
return fmt.Errorf("update cancelled")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err := updateSubmodules(); err != nil {
|
||||||
|
return fmt.Errorf("failed to update submodules: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
fmt.Printf("\nUpdate complete! Updated from %s to %s\n", currentTag, latestTag)
|
fmt.Printf("\nUpdate complete! Updated from %s to %s\n", currentTag, latestTag)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -320,10 +328,21 @@ func updateOtherDistros() error {
|
|||||||
return fmt.Errorf("update cancelled")
|
return fmt.Errorf("update cancelled")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err := updateSubmodules(); err != nil {
|
||||||
|
return fmt.Errorf("failed to update submodules: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
fmt.Println("\nUpdate complete!")
|
fmt.Println("\nUpdate complete!")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func updateSubmodules() error {
|
||||||
|
submoduleCmd := exec.Command("git", "submodule", "update", "--init", "--recursive")
|
||||||
|
submoduleCmd.Stdout = os.Stdout
|
||||||
|
submoduleCmd.Stderr = os.Stderr
|
||||||
|
return submoduleCmd.Run()
|
||||||
|
}
|
||||||
|
|
||||||
func offerReclone(dmsPath string) bool {
|
func offerReclone(dmsPath string) bool {
|
||||||
fmt.Println("\nWould you like to backup and re-clone the repository? (y/N): ")
|
fmt.Println("\nWould you like to backup and re-clone the repository? (y/N): ")
|
||||||
reader := bufio.NewReader(os.Stdin)
|
reader := bufio.NewReader(os.Stdin)
|
||||||
@@ -342,7 +361,7 @@ func offerReclone(dmsPath string) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println("Cloning fresh copy...")
|
fmt.Println("Cloning fresh copy...")
|
||||||
cloneCmd := exec.Command("git", "clone", "https://github.com/AvengeMedia/DankMaterialShell.git", dmsPath)
|
cloneCmd := exec.Command("git", "clone", "--recurse-submodules", "https://github.com/AvengeMedia/DankMaterialShell.git", dmsPath)
|
||||||
cloneCmd.Stdout = os.Stdout
|
cloneCmd.Stdout = os.Stdout
|
||||||
cloneCmd.Stderr = os.Stderr
|
cloneCmd.Stderr = os.Stderr
|
||||||
if err := cloneCmd.Run(); err != nil {
|
if err := cloneCmd.Run(); err != nil {
|
||||||
|
|||||||
@@ -520,7 +520,7 @@ func (m *ManualPackageInstaller) installDankMaterialShell(ctx context.Context, v
|
|||||||
Progress: 0.90,
|
Progress: 0.90,
|
||||||
Step: "Cloning DankMaterialShell...",
|
Step: "Cloning DankMaterialShell...",
|
||||||
IsComplete: false,
|
IsComplete: false,
|
||||||
CommandInfo: "git clone https://github.com/AvengeMedia/DankMaterialShell.git",
|
CommandInfo: "git clone --recurse-submodules https://github.com/AvengeMedia/DankMaterialShell.git",
|
||||||
}
|
}
|
||||||
|
|
||||||
configDir := filepath.Dir(dmsPath)
|
configDir := filepath.Dir(dmsPath)
|
||||||
@@ -528,7 +528,7 @@ func (m *ManualPackageInstaller) installDankMaterialShell(ctx context.Context, v
|
|||||||
return fmt.Errorf("failed to create quickshell config directory: %w", err)
|
return fmt.Errorf("failed to create quickshell config directory: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
cloneCmd := exec.CommandContext(ctx, "git", "clone",
|
cloneCmd := exec.CommandContext(ctx, "git", "clone", "--recurse-submodules",
|
||||||
"https://github.com/AvengeMedia/DankMaterialShell.git", dmsPath)
|
"https://github.com/AvengeMedia/DankMaterialShell.git", dmsPath)
|
||||||
if err := cloneCmd.Run(); err != nil {
|
if err := cloneCmd.Run(); err != nil {
|
||||||
return fmt.Errorf("failed to clone DankMaterialShell: %w", err)
|
return fmt.Errorf("failed to clone DankMaterialShell: %w", err)
|
||||||
@@ -553,6 +553,8 @@ func (m *ManualPackageInstaller) installDankMaterialShell(ctx context.Context, v
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m.syncDMSSubmodules(ctx, dmsPath)
|
||||||
|
|
||||||
m.log(fmt.Sprintf("Checked out latest tag: %s", latestTag))
|
m.log(fmt.Sprintf("Checked out latest tag: %s", latestTag))
|
||||||
m.log("DankMaterialShell cloned successfully")
|
m.log("DankMaterialShell cloned successfully")
|
||||||
return nil
|
return nil
|
||||||
@@ -591,6 +593,8 @@ func (m *ManualPackageInstaller) installDankMaterialShell(ctx context.Context, v
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m.syncDMSSubmodules(ctx, dmsPath)
|
||||||
|
|
||||||
m.log("DankMaterialShell updated successfully (git variant)")
|
m.log("DankMaterialShell updated successfully (git variant)")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -609,10 +613,19 @@ func (m *ManualPackageInstaller) installDankMaterialShell(ctx context.Context, v
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m.syncDMSSubmodules(ctx, dmsPath)
|
||||||
|
|
||||||
m.log(fmt.Sprintf("Updated to tag: %s", latestTag))
|
m.log(fmt.Sprintf("Updated to tag: %s", latestTag))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *ManualPackageInstaller) syncDMSSubmodules(ctx context.Context, dmsPath string) {
|
||||||
|
submoduleCmd := exec.CommandContext(ctx, "git", "-C", dmsPath, "submodule", "update", "--init", "--recursive")
|
||||||
|
if err := submoduleCmd.Run(); err != nil {
|
||||||
|
m.logError("Failed to update submodules", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (m *ManualPackageInstaller) installXwaylandSatellite(ctx context.Context, sudoPassword string, progressChan chan<- InstallProgressMsg) error {
|
func (m *ManualPackageInstaller) installXwaylandSatellite(ctx context.Context, sudoPassword string, progressChan chan<- InstallProgressMsg) error {
|
||||||
m.log("Installing xwayland-satellite from source...")
|
m.log("Installing xwayland-satellite from source...")
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ type minimalInstallGroup struct {
|
|||||||
|
|
||||||
func shouldPreferMinimalInstall(pkg string) bool {
|
func shouldPreferMinimalInstall(pkg string) bool {
|
||||||
switch pkg {
|
switch pkg {
|
||||||
case "niri", "niri-git":
|
case "niri", "niri-git", "hyprland", "hyprland-git":
|
||||||
return true
|
return true
|
||||||
default:
|
default:
|
||||||
return false
|
return false
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
package qmlchecks
|
|
||||||
|
|
||||||
import (
|
|
||||||
"os"
|
|
||||||
"strings"
|
|
||||||
"testing"
|
|
||||||
)
|
|
||||||
|
|
||||||
func TestGreeterRememberLastSessionFallsBackToDesktopID(t *testing.T) {
|
|
||||||
data, err := os.ReadFile("../../../quickshell/Modules/Greetd/GreeterContent.qml")
|
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("read greeter QML: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
content := string(data)
|
|
||||||
if !strings.Contains(content, "GreetdMemory.lastSessionDesktopId || desktopIdFromPath(GreetdMemory.lastSessionId)") {
|
|
||||||
t.Fatalf("remembered greeter sessions should derive a desktop id from legacy absolute session paths")
|
|
||||||
}
|
|
||||||
if !strings.Contains(content, "GreeterState.sessionDesktopIds[i] === savedDesktopId") {
|
|
||||||
t.Fatalf("remembered greeter sessions should match current sessions by desktop id")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -24,32 +24,6 @@ func TestLockScreenPasswordFieldBypassesTextInputIME(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestLockScreenAuthenticationCardOwnsFactorControls(t *testing.T) {
|
|
||||||
data, err := os.ReadFile("../../../quickshell/Modules/Settings/LockScreenTab.qml")
|
|
||||||
if err != nil {
|
|
||||||
t.Fatalf("read lock screen settings QML: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
content := string(data)
|
|
||||||
authCard := strings.Index(content, `title: I18n.tr("Authentication")`)
|
|
||||||
behaviorCard := strings.Index(content, `title: I18n.tr("Behavior")`)
|
|
||||||
fingerprintToggle := strings.Index(content, `settingKey: "enableFprint"`)
|
|
||||||
u2fToggle := strings.Index(content, `settingKey: "enableU2f"`)
|
|
||||||
u2fSource := strings.Index(content, `settingKey: "lockU2fPamPath"`)
|
|
||||||
if authCard < 0 || behaviorCard < 0 || fingerprintToggle < 0 || u2fToggle < 0 || u2fSource < 0 {
|
|
||||||
t.Fatalf("expected authentication card, factor toggles, and U2F source setting")
|
|
||||||
}
|
|
||||||
for name, position := range map[string]int{
|
|
||||||
"fingerprint toggle": fingerprintToggle,
|
|
||||||
"U2F toggle": u2fToggle,
|
|
||||||
"U2F source": u2fSource,
|
|
||||||
} {
|
|
||||||
if position < authCard || position > behaviorCard {
|
|
||||||
t.Fatalf("%s must remain in the authentication card", name)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestLockScreenPamSupportsManagedAndSystemPolicies(t *testing.T) {
|
func TestLockScreenPamSupportsManagedAndSystemPolicies(t *testing.T) {
|
||||||
data, err := os.ReadFile("../../../quickshell/Modules/Lock/Pam.qml")
|
data, err := os.ReadFile("../../../quickshell/Modules/Lock/Pam.qml")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Submodule
+1
Submodule dank-qml-common added at 5942bc1c60
@@ -70,7 +70,7 @@ override_dh_auto_install:
|
|||||||
|
|
||||||
mkdir -p debian/dms-git/usr/share/quickshell/dms debian/dms-git/usr/lib/systemd/user
|
mkdir -p debian/dms-git/usr/share/quickshell/dms debian/dms-git/usr/lib/systemd/user
|
||||||
if [ -d quickshell ]; then \
|
if [ -d quickshell ]; then \
|
||||||
cp -r quickshell/* debian/dms-git/usr/share/quickshell/dms/; \
|
cp -rL quickshell/* debian/dms-git/usr/share/quickshell/dms/; \
|
||||||
install -Dm644 assets/systemd/dms.service debian/dms-git/usr/lib/systemd/user/dms.service; \
|
install -Dm644 assets/systemd/dms.service debian/dms-git/usr/lib/systemd/user/dms.service; \
|
||||||
install -Dm644 assets/dms-open.desktop debian/dms-git/usr/share/applications/dms-open.desktop; \
|
install -Dm644 assets/dms-open.desktop debian/dms-git/usr/share/applications/dms-open.desktop; \
|
||||||
install -Dm644 assets/com.danklinux.dms.desktop debian/dms-git/usr/share/applications/com.danklinux.dms.desktop; \
|
install -Dm644 assets/com.danklinux.dms.desktop debian/dms-git/usr/share/applications/com.danklinux.dms.desktop; \
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ override_dh_auto_install:
|
|||||||
fi; \
|
fi; \
|
||||||
if [ -n "$$SOURCE_DIR" ]; then \
|
if [ -n "$$SOURCE_DIR" ]; then \
|
||||||
mkdir -p debian/dms-greeter/usr/share/quickshell/dms-greeter && \
|
mkdir -p debian/dms-greeter/usr/share/quickshell/dms-greeter && \
|
||||||
( cd $$SOURCE_DIR && tar cf - --exclude=debian . ) | \
|
( cd $$SOURCE_DIR && tar chf - --exclude=debian . ) | \
|
||||||
( cd debian/dms-greeter/usr/share/quickshell/dms-greeter && tar xf - ) && \
|
( cd debian/dms-greeter/usr/share/quickshell/dms-greeter && tar xf - ) && \
|
||||||
install -Dm755 $$SOURCE_DIR/Modules/Greetd/assets/dms-greeter \
|
install -Dm755 $$SOURCE_DIR/Modules/Greetd/assets/dms-greeter \
|
||||||
debian/dms-greeter/usr/bin/dms-greeter && \
|
debian/dms-greeter/usr/bin/dms-greeter && \
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<service name="download_url">
|
<service name="download_url">
|
||||||
<param name="protocol">https</param>
|
<param name="protocol">https</param>
|
||||||
<param name="host">github.com</param>
|
<param name="host">github.com</param>
|
||||||
<param name="path">/AvengeMedia/DankMaterialShell/archive/refs/tags/v1.2.3.tar.gz</param>
|
<param name="path">/AvengeMedia/DankMaterialShell/releases/download/v1.2.3/dms-source.tar.gz</param>
|
||||||
<param name="filename">dms-source.tar.gz</param>
|
<param name="filename">dms-source.tar.gz</param>
|
||||||
</service>
|
</service>
|
||||||
<!-- Download amd64 binary -->
|
<!-- Download amd64 binary -->
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ override_dh_auto_install:
|
|||||||
mv "$$SOURCE_DIR" DankMaterialShell-$(UPSTREAM_VERSION); \
|
mv "$$SOURCE_DIR" DankMaterialShell-$(UPSTREAM_VERSION); \
|
||||||
fi
|
fi
|
||||||
if [ -d DankMaterialShell-$(UPSTREAM_VERSION) ]; then \
|
if [ -d DankMaterialShell-$(UPSTREAM_VERSION) ]; then \
|
||||||
cp -r DankMaterialShell-$(UPSTREAM_VERSION)/quickshell/* debian/dms/usr/share/quickshell/dms/; \
|
cp -rL DankMaterialShell-$(UPSTREAM_VERSION)/quickshell/* debian/dms/usr/share/quickshell/dms/; \
|
||||||
install -Dm644 DankMaterialShell-$(UPSTREAM_VERSION)/assets/systemd/dms.service debian/dms/usr/lib/systemd/user/dms.service; \
|
install -Dm644 DankMaterialShell-$(UPSTREAM_VERSION)/assets/systemd/dms.service debian/dms/usr/lib/systemd/user/dms.service; \
|
||||||
install -Dm644 DankMaterialShell-$(UPSTREAM_VERSION)/assets/dms-open.desktop debian/dms/usr/share/applications/dms-open.desktop; \
|
install -Dm644 DankMaterialShell-$(UPSTREAM_VERSION)/assets/dms-open.desktop debian/dms/usr/share/applications/dms-open.desktop; \
|
||||||
install -Dm644 DankMaterialShell-$(UPSTREAM_VERSION)/assets/com.danklinux.dms.desktop debian/dms/usr/share/applications/com.danklinux.dms.desktop; \
|
install -Dm644 DankMaterialShell-$(UPSTREAM_VERSION)/assets/com.danklinux.dms.desktop debian/dms/usr/share/applications/com.danklinux.dms.desktop; \
|
||||||
|
|||||||
@@ -200,7 +200,9 @@ in
|
|||||||
];
|
];
|
||||||
# DMS currently relies on /etc/pam.d/login for lock screen password auth on NixOS.
|
# DMS currently relies on /etc/pam.d/login for lock screen password auth on NixOS.
|
||||||
# Declare security.pam.services.dankshell only if you want to override that runtime fallback.
|
# Declare security.pam.services.dankshell only if you want to override that runtime fallback.
|
||||||
# U2F and fingerprint are handled separately by DMS — do not add pam_u2f or pam_fprintd here.
|
# Do not add pam_u2f or pam_fprintd here for security-key unlock, enable
|
||||||
|
# programs.dank-material-shell.lockscreen.securityKey.enable, which declares the
|
||||||
|
# dedicated dankshell-u2f service DMS drives on its own.
|
||||||
# security.pam.services.dankshell = {
|
# security.pam.services.dankshell = {
|
||||||
# # Example: add faillock
|
# # Example: add faillock
|
||||||
# faillock.enable = true;
|
# faillock.enable = true;
|
||||||
|
|||||||
@@ -23,6 +23,15 @@ in
|
|||||||
description = "Systemd target to bind to.";
|
description = "Systemd target to bind to.";
|
||||||
default = "graphical-session.target";
|
default = "graphical-session.target";
|
||||||
};
|
};
|
||||||
|
options.programs.dank-material-shell.lockscreen.securityKey = {
|
||||||
|
enable = lib.mkEnableOption "FIDO2/U2F security key unlock for the DMS lock screen via a dedicated dankshell-u2f PAM service";
|
||||||
|
package = lib.mkPackageOption pkgs "pam_u2f" { };
|
||||||
|
moduleArgs = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.str;
|
||||||
|
default = [ "cue" ];
|
||||||
|
description = "Arguments passed to pam_u2f.so in the dankshell-u2f PAM service.";
|
||||||
|
};
|
||||||
|
};
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
systemd.user.services.dms = lib.mkIf cfg.systemd.enable {
|
systemd.user.services.dms = lib.mkIf cfg.systemd.enable {
|
||||||
description = "DankMaterialShell";
|
description = "DankMaterialShell";
|
||||||
@@ -46,6 +55,18 @@ in
|
|||||||
inherit value;
|
inherit value;
|
||||||
}) common.plugins;
|
}) common.plugins;
|
||||||
|
|
||||||
|
# DMS's bundled U2F fallback stack references pam_u2f.so by name, which NixOS's
|
||||||
|
# libpam cannot resolve; the dedicated service below uses the absolute store path
|
||||||
|
# and is picked up automatically by the lock screen when present.
|
||||||
|
security.pam.services."dankshell-u2f" = lib.mkIf cfg.lockscreen.securityKey.enable {
|
||||||
|
text = ''
|
||||||
|
auth required ${cfg.lockscreen.securityKey.package}/lib/security/pam_u2f.so ${lib.concatStringsSep " " cfg.lockscreen.securityKey.moduleArgs}
|
||||||
|
account required pam_permit.so
|
||||||
|
password required pam_deny.so
|
||||||
|
session required pam_permit.so
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
services.power-profiles-daemon.enable = lib.mkDefault true;
|
services.power-profiles-daemon.enable = lib.mkDefault true;
|
||||||
services.accounts-daemon.enable = lib.mkDefault true;
|
services.accounts-daemon.enable = lib.mkDefault true;
|
||||||
services.geoclue2.enable = lib.mkDefault true;
|
services.geoclue2.enable = lib.mkDefault true;
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ pkgs.testers.runNixOSTest {
|
|||||||
programs.dank-material-shell = {
|
programs.dank-material-shell = {
|
||||||
enable = true;
|
enable = true;
|
||||||
systemd.enable = true;
|
systemd.enable = true;
|
||||||
|
lockscreen.securityKey.enable = true;
|
||||||
plugins = {
|
plugins = {
|
||||||
TestPlugin = {
|
TestPlugin = {
|
||||||
src = pkgs.emptyDirectory;
|
src = pkgs.emptyDirectory;
|
||||||
@@ -39,6 +40,7 @@ pkgs.testers.runNixOSTest {
|
|||||||
machine.succeed("su -- danklinux -c 'dms --help >/dev/null'")
|
machine.succeed("su -- danklinux -c 'dms --help >/dev/null'")
|
||||||
machine.succeed("test -d /etc/xdg/quickshell/dms-plugins")
|
machine.succeed("test -d /etc/xdg/quickshell/dms-plugins")
|
||||||
machine.succeed("test -f /run/current-system/sw/lib/systemd/user/dms.service")
|
machine.succeed("test -f /run/current-system/sw/lib/systemd/user/dms.service")
|
||||||
|
machine.succeed("grep -q 'lib/security/pam_u2f.so cue' /etc/pam.d/dankshell-u2f")
|
||||||
|
|
||||||
payload = json.loads(machine.succeed("su -- danklinux -c 'dms doctor --json'"))
|
payload = json.loads(machine.succeed("su -- danklinux -c 'dms doctor --json'"))
|
||||||
t.assertIn("summary", payload)
|
t.assertIn("summary", payload)
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ update_debian_dms_service() {
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sed -i "s|/archive/refs/tags/v[0-9][^\"]*\.tar\.gz|/archive/refs/tags/v${base_version}.tar.gz|" "$service_path"
|
sed -i "s|/releases/download/v[0-9][^\"]*/dms-source\.tar\.gz|/releases/download/v${base_version}/dms-source.tar.gz|" "$service_path"
|
||||||
sed -i "s|/releases/download/v[0-9][^\"]*/dms-distropkg-amd64\.gz|/releases/download/v${base_version}/dms-distropkg-amd64.gz|" "$service_path"
|
sed -i "s|/releases/download/v[0-9][^\"]*/dms-distropkg-amd64\.gz|/releases/download/v${base_version}/dms-distropkg-amd64.gz|" "$service_path"
|
||||||
sed -i "s|/releases/download/v[0-9][^\"]*/dms-distropkg-arm64\.gz|/releases/download/v${base_version}/dms-distropkg-arm64.gz|" "$service_path"
|
sed -i "s|/releases/download/v[0-9][^\"]*/dms-distropkg-arm64\.gz|/releases/download/v${base_version}/dms-distropkg-arm64.gz|" "$service_path"
|
||||||
}
|
}
|
||||||
@@ -542,8 +542,8 @@ if [[ "$UPLOAD_OPENSUSE" == true ]] && [[ "$UPLOAD_DEBIAN" == false ]] && [[ -f
|
|||||||
if [[ -n "$GIT_URL" ]]; then
|
if [[ -n "$GIT_URL" ]]; then
|
||||||
echo " Cloning git source from: $GIT_URL (revision: ${GIT_REVISION:-master})"
|
echo " Cloning git source from: $GIT_URL (revision: ${GIT_REVISION:-master})"
|
||||||
SOURCE_DIR="$TEMP_DIR/dms-git-source"
|
SOURCE_DIR="$TEMP_DIR/dms-git-source"
|
||||||
if git clone --depth 1 --branch "${GIT_REVISION:-master}" "$GIT_URL" "$SOURCE_DIR" 2>/dev/null ||
|
if git clone --depth 1 --recurse-submodules --shallow-submodules --branch "${GIT_REVISION:-master}" "$GIT_URL" "$SOURCE_DIR" 2>/dev/null ||
|
||||||
git clone --depth 1 "$GIT_URL" "$SOURCE_DIR" 2>/dev/null; then
|
git clone --depth 1 --recurse-submodules --shallow-submodules "$GIT_URL" "$SOURCE_DIR" 2>/dev/null; then
|
||||||
cd "$SOURCE_DIR"
|
cd "$SOURCE_DIR"
|
||||||
if [[ -n "$GIT_REVISION" ]]; then
|
if [[ -n "$GIT_REVISION" ]]; then
|
||||||
git checkout "$GIT_REVISION" 2>/dev/null || true
|
git checkout "$GIT_REVISION" 2>/dev/null || true
|
||||||
@@ -586,7 +586,7 @@ if [[ "$UPLOAD_OPENSUSE" == true ]] && [[ "$UPLOAD_DEBIAN" == false ]] && [[ -f
|
|||||||
echo " Creating $SOURCE0 (directory: $EXPECTED_DIR)"
|
echo " Creating $SOURCE0 (directory: $EXPECTED_DIR)"
|
||||||
mkdir -p "$EXPECTED_DIR"
|
mkdir -p "$EXPECTED_DIR"
|
||||||
cp -a "$SOURCE_DIR"/. "$EXPECTED_DIR/"
|
cp -a "$SOURCE_DIR"/. "$EXPECTED_DIR/"
|
||||||
tar -czf "$WORK_DIR/$SOURCE0" "$EXPECTED_DIR"
|
tar -czhf "$WORK_DIR/$SOURCE0" "$EXPECTED_DIR"
|
||||||
rm -rf "$EXPECTED_DIR"
|
rm -rf "$EXPECTED_DIR"
|
||||||
echo " Created $SOURCE0 ($(stat -c%s "$WORK_DIR/$SOURCE0" 2>/dev/null || echo 0) bytes)"
|
echo " Created $SOURCE0 ($(stat -c%s "$WORK_DIR/$SOURCE0" 2>/dev/null || echo 0) bytes)"
|
||||||
;;
|
;;
|
||||||
@@ -604,7 +604,7 @@ if [[ "$UPLOAD_OPENSUSE" == true ]] && [[ "$UPLOAD_DEBIAN" == false ]] && [[ -f
|
|||||||
|
|
||||||
echo " Creating $SOURCE0 (directory: $EXPECTED_DIR)"
|
echo " Creating $SOURCE0 (directory: $EXPECTED_DIR)"
|
||||||
cp -r "$SOURCE_DIR" "$EXPECTED_DIR"
|
cp -r "$SOURCE_DIR" "$EXPECTED_DIR"
|
||||||
tar -czf "$WORK_DIR/$SOURCE0" "$EXPECTED_DIR"
|
tar -czhf "$WORK_DIR/$SOURCE0" "$EXPECTED_DIR"
|
||||||
rm -rf "$EXPECTED_DIR"
|
rm -rf "$EXPECTED_DIR"
|
||||||
echo " Created $SOURCE0 ($(stat -c%s "$WORK_DIR/$SOURCE0" 2>/dev/null || echo 0) bytes)"
|
echo " Created $SOURCE0 ($(stat -c%s "$WORK_DIR/$SOURCE0" 2>/dev/null || echo 0) bytes)"
|
||||||
|
|
||||||
@@ -656,8 +656,8 @@ if [[ "$UPLOAD_DEBIAN" == true ]] && [[ -d "distro/debian/$PACKAGE/debian" ]]; t
|
|||||||
if [[ -n "$GIT_URL" ]]; then
|
if [[ -n "$GIT_URL" ]]; then
|
||||||
echo " Cloning git source from: $GIT_URL (revision: ${GIT_REVISION:-master})"
|
echo " Cloning git source from: $GIT_URL (revision: ${GIT_REVISION:-master})"
|
||||||
SOURCE_DIR="$TEMP_DIR/dms-git-source"
|
SOURCE_DIR="$TEMP_DIR/dms-git-source"
|
||||||
if git clone --depth 1 --branch "${GIT_REVISION:-master}" "$GIT_URL" "$SOURCE_DIR" 2>/dev/null ||
|
if git clone --depth 1 --recurse-submodules --shallow-submodules --branch "${GIT_REVISION:-master}" "$GIT_URL" "$SOURCE_DIR" 2>/dev/null ||
|
||||||
git clone --depth 1 "$GIT_URL" "$SOURCE_DIR" 2>/dev/null; then
|
git clone --depth 1 --recurse-submodules --shallow-submodules "$GIT_URL" "$SOURCE_DIR" 2>/dev/null; then
|
||||||
cd "$SOURCE_DIR"
|
cd "$SOURCE_DIR"
|
||||||
if [[ -n "$GIT_REVISION" ]]; then
|
if [[ -n "$GIT_REVISION" ]]; then
|
||||||
git checkout "$GIT_REVISION" 2>/dev/null || true
|
git checkout "$GIT_REVISION" 2>/dev/null || true
|
||||||
@@ -820,11 +820,11 @@ if [[ "$UPLOAD_DEBIAN" == true ]] && [[ -d "distro/debian/$PACKAGE/debian" ]]; t
|
|||||||
mkdir -p "$EXPECTED_DIR"
|
mkdir -p "$EXPECTED_DIR"
|
||||||
cp -a "$SOURCE_DIR"/. "$EXPECTED_DIR/"
|
cp -a "$SOURCE_DIR"/. "$EXPECTED_DIR/"
|
||||||
if [[ "$SOURCE0" == *.tar.xz ]]; then
|
if [[ "$SOURCE0" == *.tar.xz ]]; then
|
||||||
tar --sort=name --mtime='2000-01-01 00:00:00' --owner=0 --group=0 -cJf "$WORK_DIR/$SOURCE0" "$EXPECTED_DIR"
|
tar --sort=name --mtime='2000-01-01 00:00:00' --owner=0 --group=0 -cJhf "$WORK_DIR/$SOURCE0" "$EXPECTED_DIR"
|
||||||
elif [[ "$SOURCE0" == *.tar.bz2 ]]; then
|
elif [[ "$SOURCE0" == *.tar.bz2 ]]; then
|
||||||
tar --sort=name --mtime='2000-01-01 00:00:00' --owner=0 --group=0 -cjf "$WORK_DIR/$SOURCE0" "$EXPECTED_DIR"
|
tar --sort=name --mtime='2000-01-01 00:00:00' --owner=0 --group=0 -cjhf "$WORK_DIR/$SOURCE0" "$EXPECTED_DIR"
|
||||||
else
|
else
|
||||||
tar --sort=name --mtime='2000-01-01 00:00:00' --owner=0 --group=0 -czf "$WORK_DIR/$SOURCE0" "$EXPECTED_DIR"
|
tar --sort=name --mtime='2000-01-01 00:00:00' --owner=0 --group=0 -czhf "$WORK_DIR/$SOURCE0" "$EXPECTED_DIR"
|
||||||
fi
|
fi
|
||||||
rm -rf "$EXPECTED_DIR"
|
rm -rf "$EXPECTED_DIR"
|
||||||
echo " Created $SOURCE0 ($(stat -c%s "$WORK_DIR/$SOURCE0" 2>/dev/null || echo 0) bytes)"
|
echo " Created $SOURCE0 ($(stat -c%s "$WORK_DIR/$SOURCE0" 2>/dev/null || echo 0) bytes)"
|
||||||
@@ -835,11 +835,11 @@ if [[ "$UPLOAD_DEBIAN" == true ]] && [[ -d "distro/debian/$PACKAGE/debian" ]]; t
|
|||||||
echo " Creating $SOURCE0 (directory: $EXPECTED_DIR)"
|
echo " Creating $SOURCE0 (directory: $EXPECTED_DIR)"
|
||||||
cp -r "$SOURCE_DIR" "$EXPECTED_DIR"
|
cp -r "$SOURCE_DIR" "$EXPECTED_DIR"
|
||||||
if [[ "$SOURCE0" == *.tar.xz ]]; then
|
if [[ "$SOURCE0" == *.tar.xz ]]; then
|
||||||
tar --sort=name --mtime='2000-01-01 00:00:00' --owner=0 --group=0 -cJf "$WORK_DIR/$SOURCE0" "$EXPECTED_DIR"
|
tar --sort=name --mtime='2000-01-01 00:00:00' --owner=0 --group=0 -cJhf "$WORK_DIR/$SOURCE0" "$EXPECTED_DIR"
|
||||||
elif [[ "$SOURCE0" == *.tar.bz2 ]]; then
|
elif [[ "$SOURCE0" == *.tar.bz2 ]]; then
|
||||||
tar --sort=name --mtime='2000-01-01 00:00:00' --owner=0 --group=0 -cjf "$WORK_DIR/$SOURCE0" "$EXPECTED_DIR"
|
tar --sort=name --mtime='2000-01-01 00:00:00' --owner=0 --group=0 -cjhf "$WORK_DIR/$SOURCE0" "$EXPECTED_DIR"
|
||||||
else
|
else
|
||||||
tar --sort=name --mtime='2000-01-01 00:00:00' --owner=0 --group=0 -czf "$WORK_DIR/$SOURCE0" "$EXPECTED_DIR"
|
tar --sort=name --mtime='2000-01-01 00:00:00' --owner=0 --group=0 -czhf "$WORK_DIR/$SOURCE0" "$EXPECTED_DIR"
|
||||||
fi
|
fi
|
||||||
rm -rf "$EXPECTED_DIR"
|
rm -rf "$EXPECTED_DIR"
|
||||||
echo " Created $SOURCE0 ($(stat -c%s "$WORK_DIR/$SOURCE0" 2>/dev/null || echo 0) bytes)"
|
echo " Created $SOURCE0 ($(stat -c%s "$WORK_DIR/$SOURCE0" 2>/dev/null || echo 0) bytes)"
|
||||||
@@ -849,11 +849,11 @@ if [[ "$UPLOAD_DEBIAN" == true ]] && [[ -d "distro/debian/$PACKAGE/debian" ]]; t
|
|||||||
echo " Creating $SOURCE0 (directory: $EXPECTED_DIR)"
|
echo " Creating $SOURCE0 (directory: $EXPECTED_DIR)"
|
||||||
cp -r "$SOURCE_DIR" "$EXPECTED_DIR"
|
cp -r "$SOURCE_DIR" "$EXPECTED_DIR"
|
||||||
if [[ "$SOURCE0" == *.tar.xz ]]; then
|
if [[ "$SOURCE0" == *.tar.xz ]]; then
|
||||||
tar --sort=name --mtime='2000-01-01 00:00:00' --owner=0 --group=0 -cJf "$WORK_DIR/$SOURCE0" "$EXPECTED_DIR"
|
tar --sort=name --mtime='2000-01-01 00:00:00' --owner=0 --group=0 -cJhf "$WORK_DIR/$SOURCE0" "$EXPECTED_DIR"
|
||||||
elif [[ "$SOURCE0" == *.tar.bz2 ]]; then
|
elif [[ "$SOURCE0" == *.tar.bz2 ]]; then
|
||||||
tar --sort=name --mtime='2000-01-01 00:00:00' --owner=0 --group=0 -cjf "$WORK_DIR/$SOURCE0" "$EXPECTED_DIR"
|
tar --sort=name --mtime='2000-01-01 00:00:00' --owner=0 --group=0 -cjhf "$WORK_DIR/$SOURCE0" "$EXPECTED_DIR"
|
||||||
else
|
else
|
||||||
tar --sort=name --mtime='2000-01-01 00:00:00' --owner=0 --group=0 -czf "$WORK_DIR/$SOURCE0" "$EXPECTED_DIR"
|
tar --sort=name --mtime='2000-01-01 00:00:00' --owner=0 --group=0 -czhf "$WORK_DIR/$SOURCE0" "$EXPECTED_DIR"
|
||||||
fi
|
fi
|
||||||
rm -rf "$EXPECTED_DIR"
|
rm -rf "$EXPECTED_DIR"
|
||||||
echo " Created $SOURCE0 ($(stat -c%s "$WORK_DIR/$SOURCE0" 2>/dev/null || echo 0) bytes)"
|
echo " Created $SOURCE0 ($(stat -c%s "$WORK_DIR/$SOURCE0" 2>/dev/null || echo 0) bytes)"
|
||||||
@@ -863,11 +863,11 @@ if [[ "$UPLOAD_DEBIAN" == true ]] && [[ -d "distro/debian/$PACKAGE/debian" ]]; t
|
|||||||
echo " Creating $SOURCE0 (directory: $DIR_NAME)"
|
echo " Creating $SOURCE0 (directory: $DIR_NAME)"
|
||||||
cp -r "$SOURCE_DIR" "$DIR_NAME"
|
cp -r "$SOURCE_DIR" "$DIR_NAME"
|
||||||
if [[ "$SOURCE0" == *.tar.xz ]]; then
|
if [[ "$SOURCE0" == *.tar.xz ]]; then
|
||||||
tar --sort=name --mtime='2000-01-01 00:00:00' --owner=0 --group=0 -cJf "$WORK_DIR/$SOURCE0" "$DIR_NAME"
|
tar --sort=name --mtime='2000-01-01 00:00:00' --owner=0 --group=0 -cJhf "$WORK_DIR/$SOURCE0" "$DIR_NAME"
|
||||||
elif [[ "$SOURCE0" == *.tar.bz2 ]]; then
|
elif [[ "$SOURCE0" == *.tar.bz2 ]]; then
|
||||||
tar --sort=name --mtime='2000-01-01 00:00:00' --owner=0 --group=0 -cjf "$WORK_DIR/$SOURCE0" "$DIR_NAME"
|
tar --sort=name --mtime='2000-01-01 00:00:00' --owner=0 --group=0 -cjhf "$WORK_DIR/$SOURCE0" "$DIR_NAME"
|
||||||
else
|
else
|
||||||
tar --sort=name --mtime='2000-01-01 00:00:00' --owner=0 --group=0 -czf "$WORK_DIR/$SOURCE0" "$DIR_NAME"
|
tar --sort=name --mtime='2000-01-01 00:00:00' --owner=0 --group=0 -czhf "$WORK_DIR/$SOURCE0" "$DIR_NAME"
|
||||||
fi
|
fi
|
||||||
rm -rf "$DIR_NAME"
|
rm -rf "$DIR_NAME"
|
||||||
echo " Created $SOURCE0 ($(stat -c%s "$WORK_DIR/$SOURCE0" 2>/dev/null || echo 0) bytes)"
|
echo " Created $SOURCE0 ($(stat -c%s "$WORK_DIR/$SOURCE0" 2>/dev/null || echo 0) bytes)"
|
||||||
|
|||||||
@@ -344,7 +344,7 @@ EOF
|
|||||||
|
|
||||||
if [ ! -f "dms-source.tar.gz" ]; then
|
if [ ! -f "dms-source.tar.gz" ]; then
|
||||||
info "Downloading dms source for QML files..."
|
info "Downloading dms source for QML files..."
|
||||||
if wget -O dms-source.tar.gz "https://github.com/AvengeMedia/DankMaterialShell/archive/refs/tags/v${VERSION}.tar.gz"; then
|
if wget -O dms-source.tar.gz "https://github.com/AvengeMedia/DankMaterialShell/releases/download/v${VERSION}/dms-source.tar.gz"; then
|
||||||
success "source tarball downloaded"
|
success "source tarball downloaded"
|
||||||
else
|
else
|
||||||
error "Failed to download dms-source.tar.gz"
|
error "Failed to download dms-source.tar.gz"
|
||||||
@@ -356,7 +356,7 @@ EOF
|
|||||||
info "Downloading source for dms-greeter..."
|
info "Downloading source for dms-greeter..."
|
||||||
if [ ! -f "dms-greeter-source.tar.gz" ]; then
|
if [ ! -f "dms-greeter-source.tar.gz" ]; then
|
||||||
info "Downloading dms-greeter source..."
|
info "Downloading dms-greeter source..."
|
||||||
if wget -O dms-greeter-source.tar.gz "https://github.com/AvengeMedia/DankMaterialShell/archive/refs/tags/v${VERSION}.tar.gz"; then
|
if wget -O dms-greeter-source.tar.gz "https://github.com/AvengeMedia/DankMaterialShell/releases/download/v${VERSION}/dms-source.tar.gz"; then
|
||||||
success "source tarball downloaded"
|
success "source tarball downloaded"
|
||||||
else
|
else
|
||||||
error "Failed to download dms-greeter-source.tar.gz"
|
error "Failed to download dms-greeter-source.tar.gz"
|
||||||
@@ -386,7 +386,7 @@ if [ "$IS_GIT_PACKAGE" = true ] && [ -n "$GIT_REPO" ]; then
|
|||||||
|
|
||||||
info "Cloning $GIT_REPO from GitHub (getting latest commit info)..."
|
info "Cloning $GIT_REPO from GitHub (getting latest commit info)..."
|
||||||
TEMP_CLONE=$(mktemp -d "$TEMP_BASE/ppa_clone_XXXXXX")
|
TEMP_CLONE=$(mktemp -d "$TEMP_BASE/ppa_clone_XXXXXX")
|
||||||
if git clone "https://github.com/$GIT_REPO.git" "$TEMP_CLONE"; then
|
if git clone --recurse-submodules --shallow-submodules "https://github.com/$GIT_REPO.git" "$TEMP_CLONE"; then
|
||||||
GIT_COMMIT_HASH=$(cd "$TEMP_CLONE" && git rev-parse --short HEAD)
|
GIT_COMMIT_HASH=$(cd "$TEMP_CLONE" && git rev-parse --short HEAD)
|
||||||
GIT_COMMIT_COUNT=$(cd "$TEMP_CLONE" && git rev-list --count HEAD)
|
GIT_COMMIT_COUNT=$(cd "$TEMP_CLONE" && git rev-list --count HEAD)
|
||||||
UPSTREAM_VERSION=$(cd "$TEMP_CLONE" && git tag -l "v*" | sed 's/^v//' | sort -V | tail -1)
|
UPSTREAM_VERSION=$(cd "$TEMP_CLONE" && git tag -l "v*" | sed 's/^v//' | sort -V | tail -1)
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ override_dh_auto_install:
|
|||||||
|
|
||||||
# Install QML files from git clone
|
# Install QML files from git clone
|
||||||
mkdir -p debian/dms-git/usr/share/quickshell/dms
|
mkdir -p debian/dms-git/usr/share/quickshell/dms
|
||||||
cp -r dms-git-repo/* debian/dms-git/usr/share/quickshell/dms/
|
cp -rL dms-git-repo/* debian/dms-git/usr/share/quickshell/dms/
|
||||||
|
|
||||||
# Remove unnecessary directories
|
# Remove unnecessary directories
|
||||||
rm -rf debian/dms-git/usr/share/quickshell/dms/core
|
rm -rf debian/dms-git/usr/share/quickshell/dms/core
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ override_dh_auto_build:
|
|||||||
override_dh_auto_install:
|
override_dh_auto_install:
|
||||||
# Install greeter files to shared data location
|
# Install greeter files to shared data location
|
||||||
mkdir -p debian/dms-greeter/usr/share/quickshell/dms-greeter
|
mkdir -p debian/dms-greeter/usr/share/quickshell/dms-greeter
|
||||||
cp -r DankMaterialShell-$(BASE_VERSION)/quickshell/* debian/dms-greeter/usr/share/quickshell/dms-greeter/
|
cp -rL DankMaterialShell-$(BASE_VERSION)/quickshell/* debian/dms-greeter/usr/share/quickshell/dms-greeter/
|
||||||
|
|
||||||
# Install launcher script
|
# Install launcher script
|
||||||
install -Dm755 DankMaterialShell-$(BASE_VERSION)/quickshell/Modules/Greetd/assets/dms-greeter \
|
install -Dm755 DankMaterialShell-$(BASE_VERSION)/quickshell/Modules/Greetd/assets/dms-greeter \
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ override_dh_auto_install:
|
|||||||
|
|
||||||
# Install QML files from source tarball
|
# Install QML files from source tarball
|
||||||
mkdir -p debian/dms/usr/share/quickshell/dms
|
mkdir -p debian/dms/usr/share/quickshell/dms
|
||||||
cp -r DankMaterialShell-$(BASE_VERSION)/* debian/dms/usr/share/quickshell/dms/
|
cp -rL DankMaterialShell-$(BASE_VERSION)/* debian/dms/usr/share/quickshell/dms/
|
||||||
|
|
||||||
# Remove unnecessary directories
|
# Remove unnecessary directories
|
||||||
rm -rf debian/dms/usr/share/quickshell/dms/core
|
rm -rf debian/dms/usr/share/quickshell/dms/core
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ short_desc="DankMaterialShell greeter for greetd"
|
|||||||
maintainer="AvengeMedia <AvengeMedia.US@gmail.com>"
|
maintainer="AvengeMedia <AvengeMedia.US@gmail.com>"
|
||||||
license="MIT"
|
license="MIT"
|
||||||
homepage="https://danklinux.com"
|
homepage="https://danklinux.com"
|
||||||
distfiles="https://github.com/AvengeMedia/DankMaterialShell/archive/refs/tags/v${version}.tar.gz"
|
distfiles="https://github.com/AvengeMedia/DankMaterialShell/releases/download/v${version}/dms-source.tar.gz"
|
||||||
checksum=14f2678d6a15223ba069d1b8c8a21a5564b735d190c231f62ed44fd8bf48677c
|
checksum=14f2678d6a15223ba069d1b8c8a21a5564b735d190c231f62ed44fd8bf48677c
|
||||||
|
|
||||||
depends="greetd quickshell acl-progs dbus elogind pam_rundir mesa-dri"
|
depends="greetd quickshell acl-progs dbus elogind pam_rundir mesa-dri"
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ maintainer="AvengeMedia <AvengeMedia.US@gmail.com>"
|
|||||||
license="MIT"
|
license="MIT"
|
||||||
homepage="https://danklinux.com"
|
homepage="https://danklinux.com"
|
||||||
changelog="https://github.com/AvengeMedia/DankMaterialShell/releases"
|
changelog="https://github.com/AvengeMedia/DankMaterialShell/releases"
|
||||||
distfiles="https://github.com/AvengeMedia/DankMaterialShell/archive/refs/tags/v${version}.tar.gz"
|
distfiles="https://github.com/AvengeMedia/DankMaterialShell/releases/download/v${version}/dms-source.tar.gz"
|
||||||
checksum=14f2678d6a15223ba069d1b8c8a21a5564b735d190c231f62ed44fd8bf48677c
|
checksum=14f2678d6a15223ba069d1b8c8a21a5564b735d190c231f62ed44fd8bf48677c
|
||||||
|
|
||||||
# Optional feature deps are listed in distro/void/README.md.
|
# Optional feature deps are listed in distro/void/README.md.
|
||||||
|
|||||||
Generated
+17
@@ -1,5 +1,21 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"dank-qml-common": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1784332064,
|
||||||
|
"narHash": "sha256-n0LKLirPnNSXYxElK1IpnybEwU0nnyso4kpsEFX88U0=",
|
||||||
|
"owner": "AvengeMedia",
|
||||||
|
"repo": "dank-qml-common",
|
||||||
|
"rev": "5942bc1c60b4538940922b58112c8ae125880891",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "AvengeMedia",
|
||||||
|
"repo": "dank-qml-common",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"flake-compat": {
|
"flake-compat": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
@@ -34,6 +50,7 @@
|
|||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"dank-qml-common": "dank-qml-common",
|
||||||
"flake-compat": "flake-compat",
|
"flake-compat": "flake-compat",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,12 +7,17 @@
|
|||||||
url = "github:NixOS/flake-compat";
|
url = "github:NixOS/flake-compat";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
dank-qml-common = {
|
||||||
|
url = "github:AvengeMedia/dank-qml-common";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
{
|
{
|
||||||
self,
|
self,
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
|
dank-qml-common,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
@@ -125,6 +130,10 @@
|
|||||||
mkdir -p $out/share/quickshell/dms
|
mkdir -p $out/share/quickshell/dms
|
||||||
cp -r ${rootSrc}/quickshell/. $out/share/quickshell/dms/
|
cp -r ${rootSrc}/quickshell/. $out/share/quickshell/dms/
|
||||||
|
|
||||||
|
rm -f $out/share/quickshell/dms/DankCommon
|
||||||
|
cp -r ${dank-qml-common}/DankCommon $out/share/quickshell/dms/DankCommon
|
||||||
|
chmod -R u+w $out/share/quickshell/dms/DankCommon
|
||||||
|
|
||||||
chmod u+w $out/share/quickshell/dms/VERSION
|
chmod u+w $out/share/quickshell/dms/VERSION
|
||||||
echo "${version}" > $out/share/quickshell/dms/VERSION
|
echo "${version}" > $out/share/quickshell/dms/VERSION
|
||||||
|
|
||||||
|
|||||||
@@ -141,13 +141,15 @@ DankMaterialShell/
|
|||||||
│ │ ├── ipp/ # Internet Printing Protocol
|
│ │ ├── ipp/ # Internet Printing Protocol
|
||||||
│ │ └── syncmap/ # Thread-safe map
|
│ │ └── syncmap/ # Thread-safe map
|
||||||
│ └── go.mod # Go module definition
|
│ └── go.mod # Go module definition
|
||||||
|
├── dank-qml-common/ # Shared widget library (git submodule)
|
||||||
├── quickshell/ # QML frontend (UI layer) - see "QML Frontend Architecture" below
|
├── quickshell/ # QML frontend (UI layer) - see "QML Frontend Architecture" below
|
||||||
│ ├── shell.qml # Main entry point
|
│ ├── shell.qml # Main entry point
|
||||||
│ ├── Services/ # IPC client wrappers
|
│ ├── Services/ # IPC client wrappers
|
||||||
│ ├── Modules/ # UI components
|
│ ├── Modules/ # UI components
|
||||||
│ ├── Widgets/ # Reusable controls
|
│ ├── Widgets/ # Reusable controls
|
||||||
│ ├── Modals/ # Full-screen overlays
|
│ ├── Modals/ # Full-screen overlays
|
||||||
│ └── Common/ # Shared resources
|
│ ├── Common/ # Shared resources
|
||||||
|
│ └── DankCommon/ # Symlink to ../dank-qml-common/DankCommon
|
||||||
├── distro/ # Distribution packaging
|
├── distro/ # Distribution packaging
|
||||||
│ ├── arch/ # AUR packages
|
│ ├── arch/ # AUR packages
|
||||||
│ ├── fedora/ # RPM specs
|
│ ├── fedora/ # RPM specs
|
||||||
@@ -490,6 +492,8 @@ import qs.Services // For service access
|
|||||||
import qs.Widgets // For reusable widgets (DankIcon, etc.)
|
import qs.Widgets // For reusable widgets (DankIcon, etc.)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Many widgets in `Widgets/`, `Common/`, and `Modals/FileBrowser/` are thin wrappers over the shared dank-qml-common library (`quickshell/DankCommon/`, a submodule symlink). Keep importing them through `qs.Widgets`, `qs.Common`, and `qs.Modals.FileBrowser` — the wrappers are the stable API for the shell and for plugins. Edit the implementations in `dank-qml-common/` (see CONTRIBUTING.md, "Shared widgets").
|
||||||
|
|
||||||
#### Go Import Order
|
#### Go Import Order
|
||||||
|
|
||||||
Follow standard Go conventions:
|
Follow standard Go conventions:
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
The Wolverine
|
Marble Tabby
|
||||||
|
|||||||
@@ -1,66 +1,11 @@
|
|||||||
pragma Singleton
|
pragma Singleton
|
||||||
pragma ComponentBehavior: Bound
|
|
||||||
|
|
||||||
import QtQuick
|
|
||||||
import Quickshell
|
import Quickshell
|
||||||
|
import qs.DankCommon.Common as DankCommon
|
||||||
|
|
||||||
Singleton {
|
Singleton {
|
||||||
id: root
|
readonly property var rounding: DankCommon.Appearance.rounding
|
||||||
|
readonly property var spacing: DankCommon.Appearance.spacing
|
||||||
readonly property Rounding rounding: Rounding {}
|
readonly property var fontSize: DankCommon.Appearance.fontSize
|
||||||
readonly property Spacing spacing: Spacing {}
|
readonly property var anim: DankCommon.Appearance.anim
|
||||||
readonly property FontSize fontSize: FontSize {}
|
|
||||||
readonly property Anim anim: Anim {}
|
|
||||||
|
|
||||||
component Rounding: QtObject {
|
|
||||||
readonly property int small: 8
|
|
||||||
readonly property int normal: 12
|
|
||||||
readonly property int large: 16
|
|
||||||
readonly property int extraLarge: 24
|
|
||||||
readonly property int full: 1000
|
|
||||||
}
|
|
||||||
|
|
||||||
component Spacing: QtObject {
|
|
||||||
readonly property int small: 4
|
|
||||||
readonly property int normal: 8
|
|
||||||
readonly property int large: 12
|
|
||||||
readonly property int extraLarge: 16
|
|
||||||
readonly property int huge: 24
|
|
||||||
}
|
|
||||||
|
|
||||||
component FontSize: QtObject {
|
|
||||||
readonly property int small: 12
|
|
||||||
readonly property int normal: 14
|
|
||||||
readonly property int large: 16
|
|
||||||
readonly property int extraLarge: 20
|
|
||||||
readonly property int huge: 24
|
|
||||||
}
|
|
||||||
|
|
||||||
component AnimCurves: QtObject {
|
|
||||||
readonly property list<real> standard: [0.2, 0, 0, 1, 1, 1]
|
|
||||||
readonly property list<real> standardAccel: [0.3, 0, 1, 1, 1, 1]
|
|
||||||
readonly property list<real> standardDecel: [0, 0, 0, 1, 1, 1]
|
|
||||||
readonly property list<real> emphasized: [0.05, 0, 2 / 15, 0.06, 1
|
|
||||||
/ 6, 0.4, 5 / 24, 0.82, 0.25, 1, 1, 1]
|
|
||||||
readonly property list<real> emphasizedAccel: [0.3, 0, 0.8, 0.15, 1, 1]
|
|
||||||
readonly property list<real> emphasizedDecel: [0.05, 0.7, 0.1, 1, 1, 1]
|
|
||||||
readonly property list<real> expressiveFastSpatial: [0.42, 1.67, 0.21, 0.9, 1, 1]
|
|
||||||
readonly property list<real> expressiveDefaultSpatial: [0.38, 1.21, 0.22, 1, 1, 1]
|
|
||||||
readonly property list<real> expressiveEffects: [0.34, 0.8, 0.34, 1, 1, 1]
|
|
||||||
}
|
|
||||||
|
|
||||||
component AnimDurations: QtObject {
|
|
||||||
readonly property int quick: 150
|
|
||||||
readonly property int normal: 300
|
|
||||||
readonly property int slow: 500
|
|
||||||
readonly property int extraSlow: 1000
|
|
||||||
readonly property int expressiveFastSpatial: 350
|
|
||||||
readonly property int expressiveDefaultSpatial: 500
|
|
||||||
readonly property int expressiveEffects: 200
|
|
||||||
}
|
|
||||||
|
|
||||||
component Anim: QtObject {
|
|
||||||
readonly property AnimCurves curves: AnimCurves {}
|
|
||||||
readonly property AnimDurations durations: AnimDurations {}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,3 @@
|
|||||||
import QtQuick
|
import qs.DankCommon.Common as DankCommon
|
||||||
import qs.Common
|
|
||||||
|
|
||||||
// Reusable NumberAnimation wrapper
|
DankCommon.DankAnim {}
|
||||||
NumberAnimation {
|
|
||||||
duration: Theme.expressiveDurations.normal
|
|
||||||
easing.type: Easing.BezierSpline
|
|
||||||
easing.bezierCurve: Theme.expressiveCurves.standard
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,9 +1,3 @@
|
|||||||
import QtQuick
|
import qs.DankCommon.Common as DankCommon
|
||||||
import qs.Common
|
|
||||||
|
|
||||||
// Reusable ColorAnimation wrapper
|
DankCommon.DankColorAnim {}
|
||||||
ColorAnimation {
|
|
||||||
duration: Theme.expressiveDurations.normal
|
|
||||||
easing.type: Easing.BezierSpline
|
|
||||||
easing.bezierCurve: Theme.expressiveCurves.standard
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,64 +1,3 @@
|
|||||||
import QtQuick
|
import qs.DankCommon.Common as DankCommon
|
||||||
import Quickshell.Io
|
|
||||||
|
|
||||||
Item {
|
DankCommon.DankSocket {}
|
||||||
id: root
|
|
||||||
|
|
||||||
property alias path: socket.path
|
|
||||||
property alias parser: socket.parser
|
|
||||||
property bool connected: false
|
|
||||||
property bool linkUp: false
|
|
||||||
|
|
||||||
property int reconnectBaseMs: 400
|
|
||||||
property int reconnectMaxMs: 15000
|
|
||||||
|
|
||||||
property int _reconnectAttempt: 0
|
|
||||||
|
|
||||||
signal connectionStateChanged
|
|
||||||
|
|
||||||
onConnectedChanged: {
|
|
||||||
socket.connected = connected;
|
|
||||||
}
|
|
||||||
|
|
||||||
Socket {
|
|
||||||
id: socket
|
|
||||||
|
|
||||||
onConnectionStateChanged: {
|
|
||||||
root.linkUp = connected;
|
|
||||||
root.connectionStateChanged();
|
|
||||||
if (connected) {
|
|
||||||
root._reconnectAttempt = 0;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (root.connected) {
|
|
||||||
root._scheduleReconnect();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Timer {
|
|
||||||
id: reconnectTimer
|
|
||||||
interval: 0
|
|
||||||
repeat: false
|
|
||||||
onTriggered: {
|
|
||||||
socket.connected = false;
|
|
||||||
Qt.callLater(() => socket.connected = true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function send(data) {
|
|
||||||
const json = typeof data === "string" ? data : JSON.stringify(data);
|
|
||||||
const message = json.endsWith("\n") ? json : json + "\n";
|
|
||||||
socket.write(message);
|
|
||||||
socket.flush();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _scheduleReconnect() {
|
|
||||||
const pow = Math.min(_reconnectAttempt, 10);
|
|
||||||
const base = Math.min(reconnectBaseMs * Math.pow(2, pow), reconnectMaxMs);
|
|
||||||
const jitter = Math.floor(Math.random() * Math.floor(base / 4));
|
|
||||||
reconnectTimer.interval = base + jitter;
|
|
||||||
reconnectTimer.restart();
|
|
||||||
_reconnectAttempt++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,54 +1,3 @@
|
|||||||
pragma ComponentBehavior: Bound
|
import qs.DankCommon.Common as DankCommon
|
||||||
|
|
||||||
import QtQuick
|
DankCommon.ElevationShadow {}
|
||||||
import qs.Common
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property var level: Theme.elevationLevel2
|
|
||||||
property string direction: Theme.elevationLightDirection
|
|
||||||
property real fallbackOffset: 4
|
|
||||||
|
|
||||||
property color targetColor: "white"
|
|
||||||
property real targetRadius: Theme.cornerRadius
|
|
||||||
property real topLeftRadius: targetRadius
|
|
||||||
property real topRightRadius: targetRadius
|
|
||||||
property real bottomLeftRadius: targetRadius
|
|
||||||
property real bottomRightRadius: targetRadius
|
|
||||||
property color borderColor: "transparent"
|
|
||||||
property real borderWidth: 0
|
|
||||||
|
|
||||||
property real sourceX: 0
|
|
||||||
property real sourceY: 0
|
|
||||||
property real sourceWidth: width
|
|
||||||
property real sourceHeight: height
|
|
||||||
|
|
||||||
property bool shadowEnabled: Theme.elevationEnabled
|
|
||||||
property real shadowBlurPx: level && level.blurPx !== undefined ? level.blurPx : 0
|
|
||||||
property real shadowSpreadPx: level && level.spreadPx !== undefined ? level.spreadPx : 0
|
|
||||||
property real shadowOffsetX: Theme.elevationOffsetXFor(level, direction, fallbackOffset)
|
|
||||||
property real shadowOffsetY: Theme.elevationOffsetYFor(level, direction, fallbackOffset)
|
|
||||||
property color shadowColor: Theme.elevationShadowColor(level)
|
|
||||||
property real shadowOpacity: 1
|
|
||||||
|
|
||||||
readonly property var _ambient: Theme.elevationAmbient(level)
|
|
||||||
readonly property real _pad: shadowEnabled ? Math.ceil(Math.max(shadowBlurPx + shadowSpreadPx + Math.max(Math.abs(shadowOffsetX), Math.abs(shadowOffsetY)), _ambient.blurPx + _ambient.spreadPx) + 2) : 0
|
|
||||||
|
|
||||||
ShaderEffect {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: -root._pad
|
|
||||||
fragmentShader: Qt.resolvedUrl("../Shaders/qsb/elevation_rect.frag.qsb")
|
|
||||||
|
|
||||||
property real widthPx: width
|
|
||||||
property real heightPx: height
|
|
||||||
property real borderWidth: root.borderWidth
|
|
||||||
property vector4d rectPx: Qt.vector4d(root._pad + root.sourceX, root._pad + root.sourceY, root.sourceWidth, root.sourceHeight)
|
|
||||||
property vector4d cornerRadius: Qt.vector4d(root.topLeftRadius, root.topRightRadius, root.bottomRightRadius, root.bottomLeftRadius)
|
|
||||||
property vector4d fillColor: Qt.vector4d(root.targetColor.r, root.targetColor.g, root.targetColor.b, root.targetColor.a)
|
|
||||||
property vector4d borderColor: Qt.vector4d(root.borderColor.r, root.borderColor.g, root.borderColor.b, root.borderColor.a)
|
|
||||||
property vector4d shadowColor: Qt.vector4d(root.shadowColor.r, root.shadowColor.g, root.shadowColor.b, root.shadowEnabled ? root.shadowColor.a * root.shadowOpacity : 0)
|
|
||||||
property vector4d shadowParam: Qt.vector4d(Math.max(0, root.shadowBlurPx), root.shadowSpreadPx, root.shadowOffsetX, root.shadowOffsetY)
|
|
||||||
property vector4d ambientParam: Qt.vector4d(root._ambient.blurPx, root._ambient.spreadPx, root.shadowEnabled ? root._ambient.alpha * root.shadowOpacity : 0, 0)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
+78
-12
@@ -25,6 +25,7 @@ Singleton {
|
|||||||
readonly property bool isRtl: _rtlLanguages.includes(_lang)
|
readonly property bool isRtl: _rtlLanguages.includes(_lang)
|
||||||
|
|
||||||
readonly property url translationsFolder: Qt.resolvedUrl("../translations/poexports")
|
readonly property url translationsFolder: Qt.resolvedUrl("../translations/poexports")
|
||||||
|
readonly property url commonTranslationsFolder: Qt.resolvedUrl("../DankCommon/translations/poexports")
|
||||||
|
|
||||||
readonly property alias folder: dir.folder
|
readonly property alias folder: dir.folder
|
||||||
property var presentLocales: ({
|
property var presentLocales: ({
|
||||||
@@ -32,8 +33,11 @@ Singleton {
|
|||||||
})
|
})
|
||||||
property var translations: ({})
|
property var translations: ({})
|
||||||
property bool translationsLoaded: false
|
property bool translationsLoaded: false
|
||||||
|
property var commonTranslations: ({})
|
||||||
|
property bool commonTranslationsLoaded: false
|
||||||
|
|
||||||
property url _selectedPath: ""
|
property url _selectedPath: ""
|
||||||
|
property url _commonSelectedPath: ""
|
||||||
|
|
||||||
FolderListModel {
|
FolderListModel {
|
||||||
id: dir
|
id: dir
|
||||||
@@ -48,6 +52,18 @@ Singleton {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FolderListModel {
|
||||||
|
id: commonDir
|
||||||
|
folder: root.commonTranslationsFolder
|
||||||
|
nameFilters: ["*.json"]
|
||||||
|
showDirs: false
|
||||||
|
showDotAndDotDot: false
|
||||||
|
|
||||||
|
onStatusChanged: if (status === FolderListModel.Ready) {
|
||||||
|
root._pickCommonTranslation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
FileView {
|
FileView {
|
||||||
id: translationLoader
|
id: translationLoader
|
||||||
path: root._selectedPath
|
path: root._selectedPath
|
||||||
@@ -69,6 +85,22 @@ Singleton {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FileView {
|
||||||
|
id: commonTranslationLoader
|
||||||
|
path: root._commonSelectedPath
|
||||||
|
printErrors: false
|
||||||
|
|
||||||
|
onLoaded: {
|
||||||
|
try {
|
||||||
|
root.commonTranslations = JSON.parse(text());
|
||||||
|
root.commonTranslationsLoaded = true;
|
||||||
|
log.info(`I18n: Loaded DankCommon translations (${Object.keys(root.commonTranslations).length} contexts)`);
|
||||||
|
} catch (e) {
|
||||||
|
log.warn("I18n: Error parsing DankCommon translations:", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function locale() {
|
function locale() {
|
||||||
if (SessionData.timeLocale)
|
if (SessionData.timeLocale)
|
||||||
return Qt.locale(SessionData.timeLocale);
|
return Qt.locale(SessionData.timeLocale);
|
||||||
@@ -117,24 +149,58 @@ Singleton {
|
|||||||
log.warn("Falling back to built-in English strings");
|
log.warn("Falling back to built-in English strings");
|
||||||
}
|
}
|
||||||
|
|
||||||
function tr(term, context) {
|
function _pickCommonTranslation() {
|
||||||
if (!translationsLoaded || !translations)
|
const present = {};
|
||||||
return term;
|
for (let i = 0; i < commonDir.count; i++) {
|
||||||
const ctx = context || term;
|
const name = commonDir.get(i, "fileName");
|
||||||
if (translations[ctx] && translations[ctx][term])
|
if (name && name.endsWith(".json"))
|
||||||
return translations[ctx][term];
|
present[name.slice(0, -5)] = true;
|
||||||
for (const c in translations) {
|
}
|
||||||
if (translations[c] && translations[c][term])
|
for (let i = 0; i < _candidates.length; i++) {
|
||||||
return translations[c][term];
|
if (!present[_candidates[i]])
|
||||||
|
continue;
|
||||||
|
_commonSelectedPath = commonTranslationsFolder + "/" + _candidates[i] + ".json";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function _lookup(table, term, context) {
|
||||||
|
if (!table)
|
||||||
|
return "";
|
||||||
|
if (context && table[context] && table[context][term])
|
||||||
|
return table[context][term];
|
||||||
|
if (table[term] && table[term][term])
|
||||||
|
return table[term][term];
|
||||||
|
for (const c in table) {
|
||||||
|
if (table[c] && table[c][term])
|
||||||
|
return table[c][term];
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
// isRealContext is consumed by translations/extract_translations.py only:
|
||||||
|
// pass a literal `true` (same line) to give (term, context) its own POEditor
|
||||||
|
// translation slot. Lookup ignores it -- a real context exists as a bucket
|
||||||
|
// in the export, a comment-only context does not.
|
||||||
|
function tr(term, context, isRealContext) {
|
||||||
|
if (translationsLoaded) {
|
||||||
|
const hit = _lookup(translations, term, context);
|
||||||
|
if (hit)
|
||||||
|
return hit;
|
||||||
|
}
|
||||||
|
if (commonTranslationsLoaded) {
|
||||||
|
const hit = _lookup(commonTranslations, term, context);
|
||||||
|
if (hit)
|
||||||
|
return hit;
|
||||||
}
|
}
|
||||||
return term;
|
return term;
|
||||||
}
|
}
|
||||||
|
|
||||||
function trContext(context, term) {
|
function trContext(context, term) {
|
||||||
if (!translationsLoaded || !translations)
|
if (translationsLoaded && translations[context] && translations[context][term])
|
||||||
return term;
|
|
||||||
if (translations[context] && translations[context][term])
|
|
||||||
return translations[context][term];
|
return translations[context][term];
|
||||||
|
if (commonTranslationsLoaded && commonTranslations[context] && commonTranslations[context][term])
|
||||||
|
return commonTranslations[context][term];
|
||||||
return term;
|
return term;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,72 +1,13 @@
|
|||||||
pragma Singleton
|
pragma Singleton
|
||||||
pragma ComponentBehavior: Bound
|
|
||||||
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import qs.Common
|
import qs.DankCommon.Common as DankCommon
|
||||||
|
|
||||||
// Reusable ListView/GridView transitions
|
|
||||||
Singleton {
|
Singleton {
|
||||||
id: root
|
readonly property bool enabled: DankCommon.ListViewTransitions.enabled
|
||||||
|
readonly property Transition add: DankCommon.ListViewTransitions.add
|
||||||
// 0ms ViewTransitions break ListView delegate cleanup, so null the set when the shortest
|
readonly property Transition remove: DankCommon.ListViewTransitions.remove
|
||||||
// duration truncates to 0. Keep this gate - don't inline these back into add/remove/etc.
|
readonly property Transition displaced: DankCommon.ListViewTransitions.displaced
|
||||||
readonly property bool enabled: Math.floor(Theme.currentAnimationBaseDuration * 0.4) >= 1
|
readonly property Transition move: DankCommon.ListViewTransitions.move
|
||||||
|
|
||||||
readonly property Transition add: enabled ? _add : null
|
|
||||||
readonly property Transition remove: null
|
|
||||||
readonly property Transition displaced: enabled ? _displaced : null
|
|
||||||
readonly property Transition move: enabled ? _move : null
|
|
||||||
|
|
||||||
readonly property int _staggerMs: Math.round(Theme.currentAnimationBaseDuration * 0.03)
|
|
||||||
readonly property int _staggerCap: 8
|
|
||||||
|
|
||||||
readonly property Transition _add: Transition {
|
|
||||||
id: addTransition
|
|
||||||
|
|
||||||
SequentialAnimation {
|
|
||||||
PropertyAction {
|
|
||||||
property: "opacity"
|
|
||||||
value: 0
|
|
||||||
}
|
|
||||||
PauseAnimation {
|
|
||||||
duration: Math.max(0, Math.min(addTransition.ViewTransition.index - (addTransition.ViewTransition.targetIndexes[0] ?? 0), root._staggerCap)) * root._staggerMs
|
|
||||||
}
|
|
||||||
DankAnim {
|
|
||||||
property: "opacity"
|
|
||||||
from: 0
|
|
||||||
to: 1
|
|
||||||
duration: Theme.expressiveDurations.fast
|
|
||||||
easing.bezierCurve: Theme.expressiveCurves.emphasizedDecel
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
readonly property Transition _displaced: Transition {
|
|
||||||
DankAnim {
|
|
||||||
property: "y"
|
|
||||||
duration: Theme.expressiveDurations.fast
|
|
||||||
easing.bezierCurve: Theme.expressiveCurves.standard
|
|
||||||
}
|
|
||||||
DankAnim {
|
|
||||||
property: "opacity"
|
|
||||||
to: 1
|
|
||||||
duration: Theme.expressiveDurations.fast
|
|
||||||
easing.bezierCurve: Theme.expressiveCurves.standard
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
readonly property Transition _move: Transition {
|
|
||||||
DankAnim {
|
|
||||||
property: "y"
|
|
||||||
duration: Theme.expressiveDurations.fast
|
|
||||||
easing.bezierCurve: Theme.expressiveCurves.standard
|
|
||||||
}
|
|
||||||
DankAnim {
|
|
||||||
property: "opacity"
|
|
||||||
to: 1
|
|
||||||
duration: Theme.expressiveDurations.fast
|
|
||||||
easing.bezierCurve: Theme.expressiveCurves.standard
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,6 +108,14 @@ Singleton {
|
|||||||
return themedIconPath(iconName) || DesktopService.resolveIconPath(iconName);
|
return themedIconPath(iconName) || DesktopService.resolveIconPath(iconName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function trashPath(path: string, callback): void {
|
||||||
|
TrashService.trashPath(path, callback);
|
||||||
|
}
|
||||||
|
|
||||||
|
function copyPathToClipboard(path: string): void {
|
||||||
|
Quickshell.execDetached([Proc.dmsBin, "cl", "copy", path]);
|
||||||
|
}
|
||||||
|
|
||||||
function resolveIconUrl(iconName: string): string {
|
function resolveIconUrl(iconName: string): string {
|
||||||
if (!iconName)
|
if (!iconName)
|
||||||
return "";
|
return "";
|
||||||
|
|||||||
+4
-148
@@ -1,157 +1,13 @@
|
|||||||
pragma Singleton
|
pragma Singleton
|
||||||
pragma ComponentBehavior: Bound
|
|
||||||
|
|
||||||
import QtQuick
|
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Io
|
import qs.DankCommon.Common as DankCommon
|
||||||
import qs.Services
|
|
||||||
|
|
||||||
Singleton {
|
Singleton {
|
||||||
id: root
|
readonly property int noTimeout: DankCommon.Proc.noTimeout
|
||||||
readonly property var log: Log.scoped("Proc")
|
readonly property string dmsBin: DankCommon.Proc.dmsBin
|
||||||
|
|
||||||
readonly property int noTimeout: -1
|
|
||||||
readonly property string dmsBin: Quickshell.env("DMS_EXECUTABLE") || "dms"
|
|
||||||
property int defaultDebounceMs: 50
|
|
||||||
property int defaultTimeoutMs: 10000
|
|
||||||
property var _procDebouncers: ({})
|
|
||||||
|
|
||||||
function runCommand(id, command, callback, debounceMs, timeoutMs) {
|
function runCommand(id, command, callback, debounceMs, timeoutMs) {
|
||||||
const wait = (typeof debounceMs === "number" && debounceMs >= 0) ? debounceMs : defaultDebounceMs;
|
DankCommon.Proc.runCommand(id, command, callback, debounceMs, timeoutMs);
|
||||||
const timeout = (typeof timeoutMs === "number") ? timeoutMs : defaultTimeoutMs;
|
|
||||||
let procId = id ? id : Math.random();
|
|
||||||
const isRandomId = !id;
|
|
||||||
|
|
||||||
if (!_procDebouncers[procId]) {
|
|
||||||
const t = debounceTimerComp.createObject(root);
|
|
||||||
t.triggered.connect(function () {
|
|
||||||
_launchProc(procId, isRandomId);
|
|
||||||
});
|
|
||||||
_procDebouncers[procId] = {
|
|
||||||
timer: t,
|
|
||||||
command: command,
|
|
||||||
callback: callback,
|
|
||||||
waitMs: wait,
|
|
||||||
timeoutMs: timeout,
|
|
||||||
isRandomId: isRandomId
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
_procDebouncers[procId].command = command;
|
|
||||||
_procDebouncers[procId].callback = callback;
|
|
||||||
_procDebouncers[procId].waitMs = wait;
|
|
||||||
_procDebouncers[procId].timeoutMs = timeout;
|
|
||||||
}
|
|
||||||
|
|
||||||
const entry = _procDebouncers[procId];
|
|
||||||
entry.timer.interval = entry.waitMs;
|
|
||||||
entry.timer.restart();
|
|
||||||
}
|
|
||||||
|
|
||||||
function _launchProc(id, isRandomId) {
|
|
||||||
const entry = _procDebouncers[id];
|
|
||||||
if (!entry)
|
|
||||||
return;
|
|
||||||
const proc = procComp.createObject(root, {
|
|
||||||
command: entry.command
|
|
||||||
});
|
|
||||||
const timeoutTimer = debounceTimerComp.createObject(root);
|
|
||||||
|
|
||||||
let capturedOut = "";
|
|
||||||
let capturedErr = "";
|
|
||||||
let exitSeen = false;
|
|
||||||
let exitCodeValue = -1;
|
|
||||||
let outSeen = false;
|
|
||||||
let errSeen = false;
|
|
||||||
let timedOut = false;
|
|
||||||
|
|
||||||
timeoutTimer.interval = entry.timeoutMs;
|
|
||||||
timeoutTimer.triggered.connect(function () {
|
|
||||||
if (!exitSeen) {
|
|
||||||
timedOut = true;
|
|
||||||
proc.running = false;
|
|
||||||
exitSeen = true;
|
|
||||||
exitCodeValue = 124;
|
|
||||||
maybeComplete();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
proc.stdout.streamFinished.connect(function () {
|
|
||||||
try {
|
|
||||||
capturedOut = proc.stdout.text || "";
|
|
||||||
} catch (e) {
|
|
||||||
capturedOut = "";
|
|
||||||
}
|
|
||||||
outSeen = true;
|
|
||||||
maybeComplete();
|
|
||||||
});
|
|
||||||
|
|
||||||
proc.stderr.streamFinished.connect(function () {
|
|
||||||
try {
|
|
||||||
capturedErr = proc.stderr.text || "";
|
|
||||||
} catch (e) {
|
|
||||||
capturedErr = "";
|
|
||||||
}
|
|
||||||
errSeen = true;
|
|
||||||
maybeComplete();
|
|
||||||
});
|
|
||||||
|
|
||||||
proc.exited.connect(function (code) {
|
|
||||||
timeoutTimer.stop();
|
|
||||||
exitSeen = true;
|
|
||||||
exitCodeValue = code;
|
|
||||||
maybeComplete();
|
|
||||||
});
|
|
||||||
|
|
||||||
function maybeComplete() {
|
|
||||||
if (!exitSeen || !outSeen || !errSeen)
|
|
||||||
return;
|
|
||||||
timeoutTimer.stop();
|
|
||||||
if (entry && entry.callback && typeof entry.callback === "function") {
|
|
||||||
try {
|
|
||||||
const safeOutput = capturedOut !== null && capturedOut !== undefined ? capturedOut : "";
|
|
||||||
const safeExitCode = exitCodeValue !== null && exitCodeValue !== undefined ? exitCodeValue : -1;
|
|
||||||
entry.callback(safeOutput, safeExitCode);
|
|
||||||
} catch (e) {
|
|
||||||
log.warn("runCommand callback error for command:", entry.command, "Error:", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
proc.destroy();
|
|
||||||
} catch (_) {}
|
|
||||||
try {
|
|
||||||
timeoutTimer.destroy();
|
|
||||||
} catch (_) {}
|
|
||||||
|
|
||||||
if (isRandomId || entry.isRandomId) {
|
|
||||||
Qt.callLater(function () {
|
|
||||||
if (_procDebouncers[id]) {
|
|
||||||
try {
|
|
||||||
_procDebouncers[id].timer.destroy();
|
|
||||||
} catch (_) {}
|
|
||||||
delete _procDebouncers[id];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
proc.running = true;
|
|
||||||
if (entry.timeoutMs !== noTimeout)
|
|
||||||
timeoutTimer.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: debounceTimerComp
|
|
||||||
Timer {
|
|
||||||
repeat: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: procComp
|
|
||||||
Process {
|
|
||||||
running: false
|
|
||||||
stdout: StdioCollector {}
|
|
||||||
stderr: StdioCollector {}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -291,7 +291,7 @@ Singleton {
|
|||||||
_parseError = true;
|
_parseError = true;
|
||||||
const msg = e.message;
|
const msg = e.message;
|
||||||
log.error("Failed to parse session.json - file will not be overwritten.");
|
log.error("Failed to parse session.json - file will not be overwritten.");
|
||||||
Qt.callLater(() => ToastService.showError(I18n.tr("Failed to parse session.json"), msg));
|
Qt.callLater(() => ToastService.showError(I18n.tr("Failed to parse %1").arg("session.json"), msg));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -371,7 +371,7 @@ Singleton {
|
|||||||
_parseError = true;
|
_parseError = true;
|
||||||
const msg = e.message;
|
const msg = e.message;
|
||||||
log.error("Failed to parse session.json - file will not be overwritten.");
|
log.error("Failed to parse session.json - file will not be overwritten.");
|
||||||
Qt.callLater(() => ToastService.showError(I18n.tr("Failed to parse session.json"), msg));
|
Qt.callLater(() => ToastService.showError(I18n.tr("Failed to parse %1").arg("session.json"), msg));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -760,6 +760,7 @@ Singleton {
|
|||||||
property int batteryLowNotificationType: 0
|
property int batteryLowNotificationType: 0
|
||||||
property int batteryCriticalNotificationType: 1
|
property int batteryCriticalNotificationType: 1
|
||||||
property bool batteryAutoPowerSaver: false
|
property bool batteryAutoPowerSaver: false
|
||||||
|
property bool lowerDisplayRefreshRateOnBattery: false
|
||||||
property bool showBatteryPercent: true
|
property bool showBatteryPercent: true
|
||||||
property bool showBatteryPercentOnlyOnBattery: false
|
property bool showBatteryPercentOnlyOnBattery: false
|
||||||
property bool showBatteryTime: false
|
property bool showBatteryTime: false
|
||||||
@@ -974,6 +975,8 @@ Singleton {
|
|||||||
property var hyprlandOutputSettings: ({})
|
property var hyprlandOutputSettings: ({})
|
||||||
property var displayProfiles: ({})
|
property var displayProfiles: ({})
|
||||||
property var activeDisplayProfile: ({})
|
property var activeDisplayProfile: ({})
|
||||||
|
property var activeDisplayProfileModes: ({})
|
||||||
|
property var displayPreviousRefreshModes: ({})
|
||||||
property bool displayProfileAutoSelect: false
|
property bool displayProfileAutoSelect: false
|
||||||
property bool displayShowDisconnected: false
|
property bool displayShowDisconnected: false
|
||||||
property bool displaySnapToEdge: true
|
property bool displaySnapToEdge: true
|
||||||
@@ -1796,7 +1799,7 @@ Singleton {
|
|||||||
_parseError = true;
|
_parseError = true;
|
||||||
const msg = e.message;
|
const msg = e.message;
|
||||||
log.error("Failed to parse settings.json - file will not be overwritten. Error:", msg);
|
log.error("Failed to parse settings.json - file will not be overwritten. Error:", msg);
|
||||||
Qt.callLater(() => ToastService.showError(I18n.tr("Failed to parse settings.json"), msg));
|
Qt.callLater(() => ToastService.showError(I18n.tr("Failed to parse %1").arg("settings.json"), msg));
|
||||||
applyStoredTheme();
|
applyStoredTheme();
|
||||||
} finally {
|
} finally {
|
||||||
_loading = false;
|
_loading = false;
|
||||||
@@ -1894,7 +1897,7 @@ Singleton {
|
|||||||
_pluginParseError = true;
|
_pluginParseError = true;
|
||||||
const msg = e.message;
|
const msg = e.message;
|
||||||
log.error("Failed to parse plugin_settings.json - file will not be overwritten. Error:", msg);
|
log.error("Failed to parse plugin_settings.json - file will not be overwritten. Error:", msg);
|
||||||
Qt.callLater(() => ToastService.showError(I18n.tr("Failed to parse plugin_settings.json"), msg));
|
Qt.callLater(() => ToastService.showError(I18n.tr("Failed to parse %1").arg("plugin_settings.json"), msg));
|
||||||
pluginSettings = {};
|
pluginSettings = {};
|
||||||
} finally {
|
} finally {
|
||||||
_pluginSettingsLoading = false;
|
_pluginSettingsLoading = false;
|
||||||
@@ -3561,6 +3564,27 @@ Singleton {
|
|||||||
saveSettings();
|
saveSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setActiveDisplayProfileModes(compositor, modes) {
|
||||||
|
if (JSON.stringify(activeDisplayProfileModes[compositor] || {}) === JSON.stringify(modes || {}))
|
||||||
|
return;
|
||||||
|
const updated = JSON.parse(JSON.stringify(activeDisplayProfileModes));
|
||||||
|
updated[compositor] = modes;
|
||||||
|
activeDisplayProfileModes = updated;
|
||||||
|
saveSettings();
|
||||||
|
}
|
||||||
|
|
||||||
|
function setDisplayPreviousRefreshModes(compositor, modes) {
|
||||||
|
if (JSON.stringify(displayPreviousRefreshModes[compositor] || {}) === JSON.stringify(modes || {}))
|
||||||
|
return;
|
||||||
|
const updated = JSON.parse(JSON.stringify(displayPreviousRefreshModes));
|
||||||
|
if (Object.keys(modes || {}).length > 0)
|
||||||
|
updated[compositor] = modes;
|
||||||
|
else
|
||||||
|
delete updated[compositor];
|
||||||
|
displayPreviousRefreshModes = updated;
|
||||||
|
saveSettings();
|
||||||
|
}
|
||||||
|
|
||||||
ListModel {
|
ListModel {
|
||||||
id: leftWidgetsModel
|
id: leftWidgetsModel
|
||||||
}
|
}
|
||||||
@@ -3656,7 +3680,7 @@ Singleton {
|
|||||||
_parseError = true;
|
_parseError = true;
|
||||||
const msg = e.message;
|
const msg = e.message;
|
||||||
log.error("Failed to reload settings.json - file will not be overwritten. Error:", msg);
|
log.error("Failed to reload settings.json - file will not be overwritten. Error:", msg);
|
||||||
Qt.callLater(() => ToastService.showError(I18n.tr("Failed to parse settings.json"), msg));
|
Qt.callLater(() => ToastService.showError(I18n.tr("Failed to parse %1").arg("settings.json"), msg));
|
||||||
} finally {
|
} finally {
|
||||||
_loading = false;
|
_loading = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import QtQuick
|
|||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Io
|
import Quickshell.Io
|
||||||
import qs.Common
|
import qs.Common
|
||||||
|
import qs.DankCommon.Common as DankCommon
|
||||||
import qs.Services
|
import qs.Services
|
||||||
import qs.Modules.Greetd
|
import qs.Modules.Greetd
|
||||||
import "StockThemes.js" as StockThemes
|
import "StockThemes.js" as StockThemes
|
||||||
@@ -1230,16 +1231,28 @@ Singleton {
|
|||||||
|
|
||||||
property string fontFamily: {
|
property string fontFamily: {
|
||||||
if (typeof SessionData !== "undefined" && SessionData.isGreeterMode && typeof GreetdSettings !== "undefined") {
|
if (typeof SessionData !== "undefined" && SessionData.isGreeterMode && typeof GreetdSettings !== "undefined") {
|
||||||
return GreetdSettings.getEffectiveFontFamily();
|
return resolvedFontFamily(GreetdSettings.getEffectiveFontFamily());
|
||||||
}
|
}
|
||||||
return typeof SettingsData !== "undefined" ? SettingsData.fontFamily : "Inter Variable";
|
return typeof SettingsData !== "undefined" ? resolvedFontFamily(SettingsData.fontFamily) : DankCommon.Fonts.sans;
|
||||||
}
|
}
|
||||||
|
|
||||||
property string monoFontFamily: {
|
property string monoFontFamily: {
|
||||||
if (typeof SessionData !== "undefined" && SessionData.isGreeterMode && typeof GreetdSettings !== "undefined") {
|
if (typeof SessionData !== "undefined" && SessionData.isGreeterMode && typeof GreetdSettings !== "undefined") {
|
||||||
return GreetdSettings.monoFontFamily;
|
return resolvedMonoFontFamily(GreetdSettings.monoFontFamily);
|
||||||
}
|
}
|
||||||
return typeof SettingsData !== "undefined" ? SettingsData.monoFontFamily : "Fira Code";
|
return typeof SettingsData !== "undefined" ? resolvedMonoFontFamily(SettingsData.monoFontFamily) : DankCommon.Fonts.mono;
|
||||||
|
}
|
||||||
|
|
||||||
|
function resolvedFontFamily(family) {
|
||||||
|
if (family === defaultFontFamily)
|
||||||
|
return DankCommon.Fonts.sans;
|
||||||
|
return family;
|
||||||
|
}
|
||||||
|
|
||||||
|
function resolvedMonoFontFamily(family) {
|
||||||
|
if (family === defaultMonoFontFamily)
|
||||||
|
return DankCommon.Fonts.mono;
|
||||||
|
return family;
|
||||||
}
|
}
|
||||||
|
|
||||||
property int fontWeight: {
|
property int fontWeight: {
|
||||||
@@ -1960,7 +1973,7 @@ Singleton {
|
|||||||
function applyGtkColors() {
|
function applyGtkColors() {
|
||||||
if (!matugenAvailable) {
|
if (!matugenAvailable) {
|
||||||
if (typeof ToastService !== "undefined") {
|
if (typeof ToastService !== "undefined") {
|
||||||
ToastService.showError(I18n.tr("matugen not available or disabled - cannot apply GTK colors"));
|
ToastService.showError(I18n.tr("matugen not available or disabled - cannot apply %1 colors").arg("GTK"));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1973,7 +1986,7 @@ Singleton {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (typeof ToastService !== "undefined") {
|
if (typeof ToastService !== "undefined") {
|
||||||
ToastService.showError(I18n.tr("Failed to apply GTK colors"));
|
ToastService.showError(I18n.tr("Failed to apply %1 colors").arg("GTK"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -1982,7 +1995,7 @@ Singleton {
|
|||||||
function applyQtColors() {
|
function applyQtColors() {
|
||||||
if (!matugenAvailable) {
|
if (!matugenAvailable) {
|
||||||
if (typeof ToastService !== "undefined") {
|
if (typeof ToastService !== "undefined") {
|
||||||
ToastService.showError(I18n.tr("matugen not available or disabled - cannot apply Qt colors"));
|
ToastService.showError(I18n.tr("matugen not available or disabled - cannot apply %1 colors").arg("Qt"));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1994,7 +2007,7 @@ Singleton {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (typeof ToastService !== "undefined") {
|
if (typeof ToastService !== "undefined") {
|
||||||
ToastService.showError(I18n.tr("Failed to apply Qt colors"));
|
ToastService.showError(I18n.tr("Failed to apply %1 colors").arg("Qt"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -650,7 +650,7 @@ Singleton {
|
|||||||
|
|
||||||
onExited: exitCode => {
|
onExited: exitCode => {
|
||||||
if (exitCode === 0) {
|
if (exitCode === 0) {
|
||||||
const message = root.authApplyTerminalFallbackFromPrecheck ? I18n.tr("Terminal opened. Complete authentication setup there; it will close automatically when done.") : I18n.tr("Terminal fallback opened. Complete authentication setup there; it will close automatically when done.");
|
const message = root.authApplyTerminalFallbackFromPrecheck ? I18n.tr("Terminal opened. Complete authentication there; it will close automatically when done.") : I18n.tr("Terminal fallback opened. Complete authentication there; it will close automatically when done.");
|
||||||
ToastService.showInfo(message, "", "", "auth-sync");
|
ToastService.showInfo(message, "", "", "auth-sync");
|
||||||
} else {
|
} else {
|
||||||
let details = (root.authApplyTerminalFallbackStderr || "").trim();
|
let details = (root.authApplyTerminalFallbackStderr || "").trim();
|
||||||
|
|||||||
@@ -347,6 +347,7 @@ var SPEC = {
|
|||||||
batteryLowNotificationType: { def: 0 },
|
batteryLowNotificationType: { def: 0 },
|
||||||
batteryCriticalNotificationType: { def: 1 },
|
batteryCriticalNotificationType: { def: 1 },
|
||||||
batteryAutoPowerSaver: { def: false },
|
batteryAutoPowerSaver: { def: false },
|
||||||
|
lowerDisplayRefreshRateOnBattery: { def: false },
|
||||||
lockBeforeSuspend: { def: false },
|
lockBeforeSuspend: { def: false },
|
||||||
loginctlLockIntegration: { def: true },
|
loginctlLockIntegration: { def: true },
|
||||||
fadeToLockEnabled: { def: true },
|
fadeToLockEnabled: { def: true },
|
||||||
@@ -532,6 +533,8 @@ var SPEC = {
|
|||||||
hyprlandOutputSettings: { def: {} },
|
hyprlandOutputSettings: { def: {} },
|
||||||
displayProfiles: { def: {} },
|
displayProfiles: { def: {} },
|
||||||
activeDisplayProfile: { def: {} },
|
activeDisplayProfile: { def: {} },
|
||||||
|
activeDisplayProfileModes: { def: {} },
|
||||||
|
displayPreviousRefreshModes: { def: {} },
|
||||||
displayProfileAutoSelect: { def: false },
|
displayProfileAutoSelect: { def: false },
|
||||||
displayShowDisconnected: { def: false },
|
displayShowDisconnected: { def: false },
|
||||||
displaySnapToEdge: { def: true },
|
displaySnapToEdge: { def: true },
|
||||||
|
|||||||
@@ -323,7 +323,7 @@ Item {
|
|||||||
target: TrashService
|
target: TrashService
|
||||||
function onEmptyTrashConfirmRequested(itemCount) {
|
function onEmptyTrashConfirmRequested(itemCount) {
|
||||||
emptyTrashConfirm.showWithOptions({
|
emptyTrashConfirm.showWithOptions({
|
||||||
title: I18n.tr("Empty Trash?"),
|
title: I18n.tr("Empty Trash"),
|
||||||
message: I18n.tr("Permanently delete %1 item(s)? This cannot be undone.").arg(itemCount),
|
message: I18n.tr("Permanently delete %1 item(s)? This cannot be undone.").arg(itemCount),
|
||||||
confirmText: I18n.tr("Empty"),
|
confirmText: I18n.tr("Empty"),
|
||||||
cancelText: I18n.tr("Cancel"),
|
cancelText: I18n.tr("Cancel"),
|
||||||
|
|||||||
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
../dank-qml-common/DankCommon
|
||||||
@@ -408,14 +408,14 @@ FocusScope {
|
|||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
text: "↵ " + I18n.tr("open")
|
text: "↵ " + I18n.tr("Open")
|
||||||
font.pixelSize: Theme.fontSizeSmall - 1
|
font.pixelSize: Theme.fontSizeSmall - 1
|
||||||
color: Theme.surfaceVariantText
|
color: Theme.surfaceVariantText
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
text: "Tab " + I18n.tr("actions")
|
text: "Tab " + I18n.tr("Actions")
|
||||||
font.pixelSize: Theme.fontSizeSmall - 1
|
font.pixelSize: Theme.fontSizeSmall - 1
|
||||||
color: Theme.surfaceVariantText
|
color: Theme.surfaceVariantText
|
||||||
visible: actionPanel.hasActions
|
visible: actionPanel.hasActions
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ Item {
|
|||||||
|
|
||||||
function statusTitle() {
|
function statusTitle() {
|
||||||
if (root.controller?.isSearching || root.controller?.isFileSearching)
|
if (root.controller?.isSearching || root.controller?.isFileSearching)
|
||||||
return I18n.tr("Searching");
|
return I18n.tr("Searching...");
|
||||||
if ((root.controller?.searchMode ?? "") === "files" && !DSearchService.dsearchAvailable)
|
if ((root.controller?.searchMode ?? "") === "files" && !DSearchService.dsearchAvailable)
|
||||||
return I18n.tr("File search unavailable");
|
return I18n.tr("File search unavailable");
|
||||||
if ((root.controller?.searchMode ?? "") === "files" && (root.controller?.searchQuery?.length ?? 0) < 2)
|
if ((root.controller?.searchMode ?? "") === "files" && (root.controller?.searchQuery?.length ?? 0) < 2)
|
||||||
|
|||||||
@@ -1,935 +1,3 @@
|
|||||||
import Qt.labs.folderlistmodel
|
import qs.DankCommon.Modals.FileBrowser as DankCommon
|
||||||
import QtCore
|
|
||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import qs.Common
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
FocusScope {
|
DankCommon.FileBrowserContent {}
|
||||||
id: root
|
|
||||||
|
|
||||||
LayoutMirroring.enabled: I18n.isRtl
|
|
||||||
LayoutMirroring.childrenInherit: true
|
|
||||||
|
|
||||||
property string homeDir: StandardPaths.writableLocation(StandardPaths.HomeLocation)
|
|
||||||
property string docsDir: StandardPaths.writableLocation(StandardPaths.DocumentsLocation)
|
|
||||||
property string musicDir: StandardPaths.writableLocation(StandardPaths.MusicLocation)
|
|
||||||
property string videosDir: StandardPaths.writableLocation(StandardPaths.MoviesLocation)
|
|
||||||
property string picsDir: StandardPaths.writableLocation(StandardPaths.PicturesLocation)
|
|
||||||
property string downloadDir: StandardPaths.writableLocation(StandardPaths.DownloadLocation)
|
|
||||||
property string desktopDir: StandardPaths.writableLocation(StandardPaths.DesktopLocation)
|
|
||||||
property string currentPath: ""
|
|
||||||
property var fileExtensions: ["*.*"]
|
|
||||||
property alias filterExtensions: root.fileExtensions
|
|
||||||
property string browserTitle: "Select File"
|
|
||||||
property string browserIcon: "folder_open"
|
|
||||||
property string browserType: "generic"
|
|
||||||
property bool showHiddenFiles: false
|
|
||||||
property int selectedIndex: -1
|
|
||||||
property bool keyboardNavigationActive: false
|
|
||||||
property bool backButtonFocused: false
|
|
||||||
property bool saveMode: false
|
|
||||||
property string defaultFileName: ""
|
|
||||||
property int keyboardSelectionIndex: -1
|
|
||||||
property bool keyboardSelectionRequested: false
|
|
||||||
property bool showKeyboardHints: false
|
|
||||||
property bool showFileInfo: false
|
|
||||||
property string selectedFilePath: ""
|
|
||||||
property string selectedFileName: ""
|
|
||||||
property bool selectedFileIsDir: false
|
|
||||||
property bool showOverwriteConfirmation: false
|
|
||||||
property string pendingFilePath: ""
|
|
||||||
property bool showSidebar: true
|
|
||||||
property string viewMode: "grid"
|
|
||||||
property string sortBy: "name"
|
|
||||||
property bool sortAscending: true
|
|
||||||
property int iconSizeIndex: 1
|
|
||||||
property var iconSizes: [80, 120, 160, 200]
|
|
||||||
property bool pathEditMode: false
|
|
||||||
property bool pathInputHasFocus: false
|
|
||||||
property int actualGridColumns: 5
|
|
||||||
property bool _initialized: false
|
|
||||||
property bool closeOnEscape: true
|
|
||||||
property var windowControls: null
|
|
||||||
|
|
||||||
signal fileSelected(string path)
|
|
||||||
signal closeRequested
|
|
||||||
|
|
||||||
function encodeFileUrl(path) {
|
|
||||||
if (!path)
|
|
||||||
return "";
|
|
||||||
return "file://" + path.split('/').map(s => encodeURIComponent(s)).join('/');
|
|
||||||
}
|
|
||||||
|
|
||||||
function initialize() {
|
|
||||||
loadSettings();
|
|
||||||
currentPath = getLastPath();
|
|
||||||
_initialized = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
function reset() {
|
|
||||||
currentPath = getLastPath();
|
|
||||||
selectedIndex = -1;
|
|
||||||
keyboardNavigationActive = false;
|
|
||||||
backButtonFocused = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function loadSettings() {
|
|
||||||
const type = browserType || "default";
|
|
||||||
const settings = CacheData.fileBrowserSettings[type];
|
|
||||||
const isImageBrowser = ["wallpaper", "profile"].includes(browserType);
|
|
||||||
|
|
||||||
if (settings) {
|
|
||||||
viewMode = settings.viewMode || (isImageBrowser ? "grid" : "list");
|
|
||||||
sortBy = settings.sortBy || "name";
|
|
||||||
sortAscending = settings.sortAscending !== undefined ? settings.sortAscending : true;
|
|
||||||
iconSizeIndex = settings.iconSizeIndex !== undefined ? settings.iconSizeIndex : 1;
|
|
||||||
showSidebar = settings.showSidebar !== undefined ? settings.showSidebar : true;
|
|
||||||
} else {
|
|
||||||
viewMode = isImageBrowser ? "grid" : "list";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function saveSettings() {
|
|
||||||
if (!_initialized)
|
|
||||||
return;
|
|
||||||
const type = browserType || "default";
|
|
||||||
let settings = CacheData.fileBrowserSettings;
|
|
||||||
if (!settings[type]) {
|
|
||||||
settings[type] = {};
|
|
||||||
}
|
|
||||||
settings[type].viewMode = viewMode;
|
|
||||||
settings[type].sortBy = sortBy;
|
|
||||||
settings[type].sortAscending = sortAscending;
|
|
||||||
settings[type].iconSizeIndex = iconSizeIndex;
|
|
||||||
settings[type].showSidebar = showSidebar;
|
|
||||||
settings[type].lastPath = currentPath;
|
|
||||||
CacheData.fileBrowserSettings = settings;
|
|
||||||
|
|
||||||
if (browserType === "wallpaper") {
|
|
||||||
CacheData.wallpaperLastPath = currentPath;
|
|
||||||
} else if (browserType === "profile") {
|
|
||||||
CacheData.profileLastPath = currentPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
CacheData.saveCache();
|
|
||||||
}
|
|
||||||
|
|
||||||
onViewModeChanged: saveSettings()
|
|
||||||
onSortByChanged: saveSettings()
|
|
||||||
onSortAscendingChanged: saveSettings()
|
|
||||||
onIconSizeIndexChanged: saveSettings()
|
|
||||||
onShowSidebarChanged: saveSettings()
|
|
||||||
|
|
||||||
function isImageFile(fileName) {
|
|
||||||
if (!fileName)
|
|
||||||
return false;
|
|
||||||
const ext = fileName.toLowerCase().split('.').pop();
|
|
||||||
return ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg'].includes(ext);
|
|
||||||
}
|
|
||||||
|
|
||||||
function getLastPath() {
|
|
||||||
const type = browserType || "default";
|
|
||||||
const settings = CacheData.fileBrowserSettings[type];
|
|
||||||
const lastPath = settings?.lastPath || "";
|
|
||||||
return (lastPath && lastPath !== "") ? lastPath : homeDir;
|
|
||||||
}
|
|
||||||
|
|
||||||
function saveLastPath(path) {
|
|
||||||
const type = browserType || "default";
|
|
||||||
let settings = CacheData.fileBrowserSettings;
|
|
||||||
if (!settings[type]) {
|
|
||||||
settings[type] = {};
|
|
||||||
}
|
|
||||||
settings[type].lastPath = path;
|
|
||||||
CacheData.fileBrowserSettings = settings;
|
|
||||||
CacheData.saveCache();
|
|
||||||
|
|
||||||
if (browserType === "wallpaper") {
|
|
||||||
CacheData.wallpaperLastPath = path;
|
|
||||||
} else if (browserType === "profile") {
|
|
||||||
CacheData.profileLastPath = path;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function setSelectedFileData(path, name, isDir) {
|
|
||||||
selectedFilePath = path;
|
|
||||||
selectedFileName = name;
|
|
||||||
selectedFileIsDir = isDir;
|
|
||||||
}
|
|
||||||
|
|
||||||
function openItemContextMenu(sender, localX, localY, path, name, isDir) {
|
|
||||||
if (!sender)
|
|
||||||
return;
|
|
||||||
const pos = sender.mapToItem(root, localX, localY);
|
|
||||||
itemContextMenu.showAt(root, pos.x, pos.y, path, name, isDir);
|
|
||||||
}
|
|
||||||
|
|
||||||
function navigateUp() {
|
|
||||||
const path = currentPath;
|
|
||||||
if (path === homeDir)
|
|
||||||
return;
|
|
||||||
const lastSlash = path.lastIndexOf('/');
|
|
||||||
if (lastSlash <= 0)
|
|
||||||
return;
|
|
||||||
const newPath = path.substring(0, lastSlash);
|
|
||||||
if (newPath.length < homeDir.length) {
|
|
||||||
currentPath = homeDir;
|
|
||||||
saveLastPath(homeDir);
|
|
||||||
} else {
|
|
||||||
currentPath = newPath;
|
|
||||||
saveLastPath(newPath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function navigateTo(path) {
|
|
||||||
currentPath = path;
|
|
||||||
saveLastPath(path);
|
|
||||||
selectedIndex = -1;
|
|
||||||
backButtonFocused = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
function keyboardFileSelection(index) {
|
|
||||||
if (index < 0)
|
|
||||||
return;
|
|
||||||
keyboardSelectionTimer.targetIndex = index;
|
|
||||||
keyboardSelectionTimer.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
function executeKeyboardSelection(index) {
|
|
||||||
keyboardSelectionIndex = index;
|
|
||||||
keyboardSelectionRequested = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
function activateFile(path, name, isDir) {
|
|
||||||
if (isDir) {
|
|
||||||
navigateTo(path);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (saveMode) {
|
|
||||||
saveRow.fileName = name;
|
|
||||||
pendingFilePath = path;
|
|
||||||
showOverwriteConfirmation = true;
|
|
||||||
} else {
|
|
||||||
fileSelected(path);
|
|
||||||
closeRequested();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleSaveFile(filePath) {
|
|
||||||
var normalizedPath = filePath;
|
|
||||||
if (!normalizedPath.startsWith("file://")) {
|
|
||||||
normalizedPath = encodeFileUrl(filePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
var exists = false;
|
|
||||||
var fileName = filePath.split('/').pop();
|
|
||||||
|
|
||||||
for (var i = 0; i < folderModel.count; i++) {
|
|
||||||
if (folderModel.get(i, "fileName") === fileName && !folderModel.get(i, "fileIsDir")) {
|
|
||||||
exists = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (exists) {
|
|
||||||
pendingFilePath = normalizedPath;
|
|
||||||
showOverwriteConfirmation = true;
|
|
||||||
} else {
|
|
||||||
fileSelected(normalizedPath);
|
|
||||||
closeRequested();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onCurrentPathChanged: {
|
|
||||||
selectedFilePath = "";
|
|
||||||
selectedFileName = "";
|
|
||||||
selectedFileIsDir = false;
|
|
||||||
saveSettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
onSelectedIndexChanged: {
|
|
||||||
if (selectedIndex >= 0 && folderModel && selectedIndex < folderModel.count) {
|
|
||||||
selectedFilePath = "";
|
|
||||||
selectedFileName = "";
|
|
||||||
selectedFileIsDir = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
property var steamPaths: [StandardPaths.writableLocation(StandardPaths.HomeLocation) + "/.steam/steam/steamapps/workshop/content/431960", StandardPaths.writableLocation(StandardPaths.HomeLocation) + "/.local/share/Steam/steamapps/workshop/content/431960", StandardPaths.writableLocation(StandardPaths.HomeLocation) + "/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/workshop/content/431960", StandardPaths.writableLocation(StandardPaths.HomeLocation) + "/snap/steam/common/.local/share/Steam/steamapps/workshop/content/431960"]
|
|
||||||
|
|
||||||
property var quickAccessLocations: [
|
|
||||||
{
|
|
||||||
"name": I18n.tr("Home"),
|
|
||||||
"path": homeDir,
|
|
||||||
"icon": "home"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": I18n.tr("Documents"),
|
|
||||||
"path": docsDir,
|
|
||||||
"icon": "description"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": I18n.tr("Downloads"),
|
|
||||||
"path": downloadDir,
|
|
||||||
"icon": "download"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": I18n.tr("Pictures"),
|
|
||||||
"path": picsDir,
|
|
||||||
"icon": "image"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": I18n.tr("Music"),
|
|
||||||
"path": musicDir,
|
|
||||||
"icon": "music_note"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": I18n.tr("Videos"),
|
|
||||||
"path": videosDir,
|
|
||||||
"icon": "movie"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": I18n.tr("Desktop"),
|
|
||||||
"path": desktopDir,
|
|
||||||
"icon": "computer"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
FolderListModel {
|
|
||||||
id: folderModel
|
|
||||||
|
|
||||||
showDirsFirst: true
|
|
||||||
showDotAndDotDot: false
|
|
||||||
showHidden: root.showHiddenFiles
|
|
||||||
caseSensitive: false
|
|
||||||
nameFilters: fileExtensions
|
|
||||||
showFiles: true
|
|
||||||
showDirs: true
|
|
||||||
folder: encodeFileUrl(currentPath || homeDir)
|
|
||||||
sortField: {
|
|
||||||
switch (sortBy) {
|
|
||||||
case "name":
|
|
||||||
return FolderListModel.Name;
|
|
||||||
case "size":
|
|
||||||
return FolderListModel.Size;
|
|
||||||
case "modified":
|
|
||||||
return FolderListModel.Time;
|
|
||||||
case "type":
|
|
||||||
return FolderListModel.Type;
|
|
||||||
default:
|
|
||||||
return FolderListModel.Name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
sortReversed: !sortAscending
|
|
||||||
}
|
|
||||||
|
|
||||||
QtObject {
|
|
||||||
id: keyboardController
|
|
||||||
|
|
||||||
property int totalItems: folderModel.count
|
|
||||||
property int gridColumns: viewMode === "list" ? 1 : Math.max(1, actualGridColumns)
|
|
||||||
|
|
||||||
function handleKey(event) {
|
|
||||||
if (event.key === Qt.Key_Escape && root.closeOnEscape) {
|
|
||||||
closeRequested();
|
|
||||||
event.accepted = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (event.key === Qt.Key_F10) {
|
|
||||||
showKeyboardHints = !showKeyboardHints;
|
|
||||||
event.accepted = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (event.key === Qt.Key_F1 || event.key === Qt.Key_I) {
|
|
||||||
showFileInfo = !showFileInfo;
|
|
||||||
event.accepted = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if ((event.modifiers & Qt.AltModifier && event.key === Qt.Key_Left) || event.key === Qt.Key_Backspace) {
|
|
||||||
if (currentPath !== homeDir) {
|
|
||||||
navigateUp();
|
|
||||||
event.accepted = true;
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!keyboardNavigationActive) {
|
|
||||||
const isInitKey = event.key === Qt.Key_Tab || event.key === Qt.Key_Down || event.key === Qt.Key_Right || (event.key === Qt.Key_N && event.modifiers & Qt.ControlModifier) || (event.key === Qt.Key_J && event.modifiers & Qt.ControlModifier) || (event.key === Qt.Key_L && event.modifiers & Qt.ControlModifier);
|
|
||||||
|
|
||||||
if (isInitKey) {
|
|
||||||
keyboardNavigationActive = true;
|
|
||||||
if (currentPath !== homeDir) {
|
|
||||||
backButtonFocused = true;
|
|
||||||
selectedIndex = -1;
|
|
||||||
} else {
|
|
||||||
backButtonFocused = false;
|
|
||||||
selectedIndex = 0;
|
|
||||||
}
|
|
||||||
event.accepted = true;
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
switch (event.key) {
|
|
||||||
case Qt.Key_Tab:
|
|
||||||
if (backButtonFocused) {
|
|
||||||
backButtonFocused = false;
|
|
||||||
selectedIndex = 0;
|
|
||||||
} else if (selectedIndex < totalItems - 1) {
|
|
||||||
selectedIndex++;
|
|
||||||
} else if (currentPath !== homeDir) {
|
|
||||||
backButtonFocused = true;
|
|
||||||
selectedIndex = -1;
|
|
||||||
} else {
|
|
||||||
selectedIndex = 0;
|
|
||||||
}
|
|
||||||
event.accepted = true;
|
|
||||||
break;
|
|
||||||
case Qt.Key_Backtab:
|
|
||||||
if (backButtonFocused) {
|
|
||||||
backButtonFocused = false;
|
|
||||||
selectedIndex = totalItems - 1;
|
|
||||||
} else if (selectedIndex > 0) {
|
|
||||||
selectedIndex--;
|
|
||||||
} else if (currentPath !== homeDir) {
|
|
||||||
backButtonFocused = true;
|
|
||||||
selectedIndex = -1;
|
|
||||||
} else {
|
|
||||||
selectedIndex = totalItems - 1;
|
|
||||||
}
|
|
||||||
event.accepted = true;
|
|
||||||
break;
|
|
||||||
case Qt.Key_N:
|
|
||||||
if (event.modifiers & Qt.ControlModifier) {
|
|
||||||
if (backButtonFocused) {
|
|
||||||
backButtonFocused = false;
|
|
||||||
selectedIndex = 0;
|
|
||||||
} else if (selectedIndex < totalItems - 1) {
|
|
||||||
selectedIndex++;
|
|
||||||
}
|
|
||||||
event.accepted = true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case Qt.Key_P:
|
|
||||||
if (event.modifiers & Qt.ControlModifier) {
|
|
||||||
if (selectedIndex > 0) {
|
|
||||||
selectedIndex--;
|
|
||||||
} else if (currentPath !== homeDir) {
|
|
||||||
backButtonFocused = true;
|
|
||||||
selectedIndex = -1;
|
|
||||||
}
|
|
||||||
event.accepted = true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case Qt.Key_J:
|
|
||||||
if (event.modifiers & Qt.ControlModifier) {
|
|
||||||
if (selectedIndex < totalItems - 1) {
|
|
||||||
selectedIndex++;
|
|
||||||
}
|
|
||||||
event.accepted = true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case Qt.Key_K:
|
|
||||||
if (event.modifiers & Qt.ControlModifier) {
|
|
||||||
if (selectedIndex > 0) {
|
|
||||||
selectedIndex--;
|
|
||||||
} else if (currentPath !== homeDir) {
|
|
||||||
backButtonFocused = true;
|
|
||||||
selectedIndex = -1;
|
|
||||||
}
|
|
||||||
event.accepted = true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case Qt.Key_H:
|
|
||||||
if (event.modifiers & Qt.ControlModifier) {
|
|
||||||
if (!backButtonFocused && selectedIndex > 0) {
|
|
||||||
selectedIndex--;
|
|
||||||
} else if (currentPath !== homeDir) {
|
|
||||||
backButtonFocused = true;
|
|
||||||
selectedIndex = -1;
|
|
||||||
}
|
|
||||||
event.accepted = true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case Qt.Key_L:
|
|
||||||
if (event.modifiers & Qt.ControlModifier) {
|
|
||||||
if (backButtonFocused) {
|
|
||||||
backButtonFocused = false;
|
|
||||||
selectedIndex = 0;
|
|
||||||
} else if (selectedIndex < totalItems - 1) {
|
|
||||||
selectedIndex++;
|
|
||||||
}
|
|
||||||
event.accepted = true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case Qt.Key_Left:
|
|
||||||
if (pathInputHasFocus)
|
|
||||||
return;
|
|
||||||
if (backButtonFocused)
|
|
||||||
return;
|
|
||||||
if (selectedIndex > 0) {
|
|
||||||
selectedIndex--;
|
|
||||||
} else if (currentPath !== homeDir) {
|
|
||||||
backButtonFocused = true;
|
|
||||||
selectedIndex = -1;
|
|
||||||
}
|
|
||||||
event.accepted = true;
|
|
||||||
break;
|
|
||||||
case Qt.Key_Right:
|
|
||||||
if (pathInputHasFocus)
|
|
||||||
return;
|
|
||||||
if (backButtonFocused) {
|
|
||||||
backButtonFocused = false;
|
|
||||||
selectedIndex = 0;
|
|
||||||
} else if (selectedIndex < totalItems - 1) {
|
|
||||||
selectedIndex++;
|
|
||||||
}
|
|
||||||
event.accepted = true;
|
|
||||||
break;
|
|
||||||
case Qt.Key_Up:
|
|
||||||
if (backButtonFocused) {
|
|
||||||
backButtonFocused = false;
|
|
||||||
if (gridColumns === 1) {
|
|
||||||
selectedIndex = 0;
|
|
||||||
} else {
|
|
||||||
var col = selectedIndex % gridColumns;
|
|
||||||
selectedIndex = Math.min(col, totalItems - 1);
|
|
||||||
}
|
|
||||||
} else if (selectedIndex >= gridColumns) {
|
|
||||||
selectedIndex -= gridColumns;
|
|
||||||
} else if (selectedIndex > 0 && gridColumns === 1) {
|
|
||||||
selectedIndex--;
|
|
||||||
} else if (currentPath !== homeDir) {
|
|
||||||
backButtonFocused = true;
|
|
||||||
selectedIndex = -1;
|
|
||||||
}
|
|
||||||
event.accepted = true;
|
|
||||||
break;
|
|
||||||
case Qt.Key_Down:
|
|
||||||
if (backButtonFocused) {
|
|
||||||
backButtonFocused = false;
|
|
||||||
selectedIndex = 0;
|
|
||||||
} else if (gridColumns === 1) {
|
|
||||||
if (selectedIndex < totalItems - 1) {
|
|
||||||
selectedIndex++;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
var newIndex = selectedIndex + gridColumns;
|
|
||||||
if (newIndex < totalItems) {
|
|
||||||
selectedIndex = newIndex;
|
|
||||||
} else {
|
|
||||||
var lastRowStart = Math.floor((totalItems - 1) / gridColumns) * gridColumns;
|
|
||||||
var col = selectedIndex % gridColumns;
|
|
||||||
var targetIndex = lastRowStart + col;
|
|
||||||
if (targetIndex < totalItems && targetIndex > selectedIndex) {
|
|
||||||
selectedIndex = targetIndex;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
event.accepted = true;
|
|
||||||
break;
|
|
||||||
case Qt.Key_Return:
|
|
||||||
case Qt.Key_Enter:
|
|
||||||
case Qt.Key_Space:
|
|
||||||
if (backButtonFocused) {
|
|
||||||
navigateUp();
|
|
||||||
} else if (selectedIndex >= 0 && selectedIndex < totalItems) {
|
|
||||||
root.keyboardFileSelection(selectedIndex);
|
|
||||||
}
|
|
||||||
event.accepted = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Timer {
|
|
||||||
id: keyboardSelectionTimer
|
|
||||||
|
|
||||||
property int targetIndex: -1
|
|
||||||
|
|
||||||
interval: 1
|
|
||||||
onTriggered: {
|
|
||||||
executeKeyboardSelection(targetIndex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
focus: true
|
|
||||||
|
|
||||||
Keys.onPressed: event => {
|
|
||||||
keyboardController.handleKey(event);
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.fill: parent
|
|
||||||
spacing: 0
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: parent.width
|
|
||||||
height: 48
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
onPressed: if (windowControls)
|
|
||||||
windowControls.tryStartMove()
|
|
||||||
onDoubleClicked: if (windowControls)
|
|
||||||
windowControls.tryToggleMaximize()
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: Theme.spacingL
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: browserIcon
|
|
||||||
size: Theme.iconSizeLarge
|
|
||||||
color: Theme.primary
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: browserTitle
|
|
||||||
font.pixelSize: Theme.fontSizeXLarge
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.rightMargin: Theme.spacingM
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
DankActionButton {
|
|
||||||
circular: false
|
|
||||||
iconName: showHiddenFiles ? "visibility_off" : "visibility"
|
|
||||||
iconSize: Theme.iconSize - 4
|
|
||||||
iconColor: showHiddenFiles ? Theme.primary : Theme.surfaceText
|
|
||||||
onClicked: showHiddenFiles = !showHiddenFiles
|
|
||||||
}
|
|
||||||
|
|
||||||
DankActionButton {
|
|
||||||
circular: false
|
|
||||||
iconName: viewMode === "grid" ? "view_list" : "grid_view"
|
|
||||||
iconSize: Theme.iconSize - 4
|
|
||||||
iconColor: Theme.surfaceText
|
|
||||||
onClicked: viewMode = viewMode === "grid" ? "list" : "grid"
|
|
||||||
}
|
|
||||||
|
|
||||||
DankActionButton {
|
|
||||||
circular: false
|
|
||||||
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: viewMode === "grid"
|
|
||||||
onClicked: iconSizeIndex = (iconSizeIndex + 1) % iconSizes.length
|
|
||||||
}
|
|
||||||
|
|
||||||
DankActionButton {
|
|
||||||
circular: false
|
|
||||||
iconName: "info"
|
|
||||||
iconSize: Theme.iconSize - 4
|
|
||||||
iconColor: Theme.surfaceText
|
|
||||||
onClicked: root.showKeyboardHints = !root.showKeyboardHints
|
|
||||||
}
|
|
||||||
|
|
||||||
DankActionButton {
|
|
||||||
visible: windowControls?.supported ?? false
|
|
||||||
circular: false
|
|
||||||
iconName: windowControls?.targetWindow?.maximized ? "fullscreen_exit" : "fullscreen"
|
|
||||||
iconSize: Theme.iconSize - 4
|
|
||||||
iconColor: Theme.surfaceText
|
|
||||||
onClicked: if (windowControls)
|
|
||||||
windowControls.tryToggleMaximize()
|
|
||||||
}
|
|
||||||
|
|
||||||
DankActionButton {
|
|
||||||
circular: false
|
|
||||||
iconName: "close"
|
|
||||||
iconSize: Theme.iconSize - 4
|
|
||||||
iconColor: Theme.surfaceText
|
|
||||||
onClicked: root.closeRequested()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledRect {
|
|
||||||
width: parent.width
|
|
||||||
height: 1
|
|
||||||
color: Theme.outline
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: parent.width
|
|
||||||
height: parent.height - 49
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.bottomMargin: root.saveMode ? 40 + Theme.spacingL * 2 : 0
|
|
||||||
spacing: 0
|
|
||||||
|
|
||||||
Row {
|
|
||||||
width: showSidebar ? 201 : 0
|
|
||||||
height: parent.height
|
|
||||||
spacing: 0
|
|
||||||
visible: showSidebar
|
|
||||||
|
|
||||||
FileBrowserSidebar {
|
|
||||||
height: parent.height
|
|
||||||
quickAccessLocations: root.quickAccessLocations
|
|
||||||
currentPath: root.currentPath
|
|
||||||
onLocationSelected: path => navigateTo(path)
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledRect {
|
|
||||||
width: 1
|
|
||||||
height: parent.height
|
|
||||||
color: Theme.outline
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
width: parent.width - (showSidebar ? 201 : 0)
|
|
||||||
height: parent.height
|
|
||||||
spacing: 0
|
|
||||||
|
|
||||||
FileBrowserNavigation {
|
|
||||||
width: parent.width
|
|
||||||
currentPath: root.currentPath
|
|
||||||
homeDir: root.homeDir
|
|
||||||
backButtonFocused: root.backButtonFocused
|
|
||||||
keyboardNavigationActive: root.keyboardNavigationActive
|
|
||||||
showSidebar: root.showSidebar
|
|
||||||
pathEditMode: root.pathEditMode
|
|
||||||
onNavigateUp: root.navigateUp()
|
|
||||||
onNavigateTo: path => root.navigateTo(path)
|
|
||||||
onPathInputFocusChanged: hasFocus => {
|
|
||||||
root.pathInputHasFocus = hasFocus;
|
|
||||||
if (hasFocus) {
|
|
||||||
root.pathEditMode = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledRect {
|
|
||||||
width: parent.width
|
|
||||||
height: 1
|
|
||||||
color: Theme.outline
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: gridContainer
|
|
||||||
width: parent.width
|
|
||||||
height: parent.height - 41
|
|
||||||
clip: true
|
|
||||||
|
|
||||||
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)
|
|
||||||
|
|
||||||
onGridColumnsChanged: {
|
|
||||||
root.actualGridColumns = gridColumns;
|
|
||||||
}
|
|
||||||
Component.onCompleted: {
|
|
||||||
root.actualGridColumns = gridColumns;
|
|
||||||
}
|
|
||||||
|
|
||||||
DankGridView {
|
|
||||||
id: fileGrid
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.leftMargin: gridContainer.gridLeftMargin
|
|
||||||
anchors.rightMargin: Theme.spacingM
|
|
||||||
anchors.topMargin: Theme.spacingS
|
|
||||||
anchors.bottomMargin: Theme.spacingS
|
|
||||||
visible: viewMode === "grid"
|
|
||||||
cellWidth: gridContainer.gridCellWidth
|
|
||||||
cellHeight: gridContainer.gridCellHeight
|
|
||||||
cacheBuffer: 260
|
|
||||||
model: folderModel
|
|
||||||
currentIndex: selectedIndex
|
|
||||||
onCurrentIndexChanged: {
|
|
||||||
if (keyboardNavigationActive && currentIndex >= 0)
|
|
||||||
positionViewAtIndex(currentIndex, GridView.Contain);
|
|
||||||
}
|
|
||||||
|
|
||||||
ScrollBar.vertical: DankScrollbar {
|
|
||||||
id: gridScrollbar
|
|
||||||
}
|
|
||||||
|
|
||||||
ScrollBar.horizontal: DankScrollbar {
|
|
||||||
policy: ScrollBar.AlwaysOff
|
|
||||||
}
|
|
||||||
|
|
||||||
delegate: FileBrowserGridDelegate {
|
|
||||||
iconSizes: root.iconSizes
|
|
||||||
iconSizeIndex: root.iconSizeIndex
|
|
||||||
selectedIndex: root.selectedIndex
|
|
||||||
keyboardNavigationActive: root.keyboardNavigationActive
|
|
||||||
onItemClicked: (index, path, name, isDir) => {
|
|
||||||
selectedIndex = index;
|
|
||||||
setSelectedFileData(path, name, isDir);
|
|
||||||
root.activateFile(path, name, isDir);
|
|
||||||
}
|
|
||||||
onItemSelected: (index, path, name, isDir) => {
|
|
||||||
setSelectedFileData(path, name, isDir);
|
|
||||||
}
|
|
||||||
onItemContextMenuRequested: (sender, localX, localY, path, name, isDir) => {
|
|
||||||
root.openItemContextMenu(sender, localX, localY, path, name, isDir);
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
function onKeyboardSelectionRequestedChanged() {
|
|
||||||
if (root.keyboardSelectionRequested && root.keyboardSelectionIndex === index) {
|
|
||||||
root.keyboardSelectionRequested = false;
|
|
||||||
selectedIndex = index;
|
|
||||||
setSelectedFileData(filePath, fileName, fileIsDir);
|
|
||||||
root.activateFile(filePath, fileName, fileIsDir);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
target: root
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankListView {
|
|
||||||
id: fileList
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.leftMargin: Theme.spacingM
|
|
||||||
anchors.rightMargin: Theme.spacingM
|
|
||||||
anchors.topMargin: Theme.spacingS
|
|
||||||
anchors.bottomMargin: Theme.spacingS
|
|
||||||
visible: viewMode === "list"
|
|
||||||
spacing: Theme.spacingXXS
|
|
||||||
model: folderModel
|
|
||||||
currentIndex: selectedIndex
|
|
||||||
onCurrentIndexChanged: {
|
|
||||||
if (keyboardNavigationActive && currentIndex >= 0)
|
|
||||||
positionViewAtIndex(currentIndex, ListView.Contain);
|
|
||||||
}
|
|
||||||
|
|
||||||
ScrollBar.vertical: DankScrollbar {
|
|
||||||
id: listScrollbar
|
|
||||||
}
|
|
||||||
|
|
||||||
delegate: FileBrowserListDelegate {
|
|
||||||
width: fileList.width
|
|
||||||
selectedIndex: root.selectedIndex
|
|
||||||
keyboardNavigationActive: root.keyboardNavigationActive
|
|
||||||
onItemClicked: (index, path, name, isDir) => {
|
|
||||||
selectedIndex = index;
|
|
||||||
setSelectedFileData(path, name, isDir);
|
|
||||||
root.activateFile(path, name, isDir);
|
|
||||||
}
|
|
||||||
onItemSelected: (index, path, name, isDir) => {
|
|
||||||
setSelectedFileData(path, name, isDir);
|
|
||||||
}
|
|
||||||
onItemContextMenuRequested: (sender, localX, localY, path, name, isDir) => {
|
|
||||||
root.openItemContextMenu(sender, localX, localY, path, name, isDir);
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
function onKeyboardSelectionRequestedChanged() {
|
|
||||||
if (root.keyboardSelectionRequested && root.keyboardSelectionIndex === index) {
|
|
||||||
root.keyboardSelectionRequested = false;
|
|
||||||
selectedIndex = index;
|
|
||||||
setSelectedFileData(filePath, fileName, fileIsDir);
|
|
||||||
root.activateFile(filePath, fileName, fileIsDir);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
target: root
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FileBrowserSaveRow {
|
|
||||||
id: saveRow
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.margins: Theme.spacingL
|
|
||||||
saveMode: root.saveMode
|
|
||||||
defaultFileName: root.defaultFileName
|
|
||||||
currentPath: root.currentPath
|
|
||||||
onSaveRequested: filePath => handleSaveFile(filePath)
|
|
||||||
}
|
|
||||||
|
|
||||||
KeyboardHints {
|
|
||||||
id: keyboardHints
|
|
||||||
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.margins: Theme.spacingL
|
|
||||||
showHints: root.showKeyboardHints
|
|
||||||
}
|
|
||||||
|
|
||||||
FileInfo {
|
|
||||||
id: fileInfo
|
|
||||||
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.margins: Theme.spacingL
|
|
||||||
width: 300
|
|
||||||
showFileInfo: root.showFileInfo
|
|
||||||
selectedIndex: root.selectedIndex
|
|
||||||
sourceFolderModel: folderModel
|
|
||||||
currentPath: root.currentPath
|
|
||||||
currentFileName: root.selectedFileName
|
|
||||||
currentFileIsDir: root.selectedFileIsDir
|
|
||||||
currentFileExtension: {
|
|
||||||
if (root.selectedFileIsDir || !root.selectedFileName)
|
|
||||||
return "";
|
|
||||||
|
|
||||||
var lastDot = root.selectedFileName.lastIndexOf('.');
|
|
||||||
return lastDot > 0 ? root.selectedFileName.substring(lastDot + 1).toLowerCase() : "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FileBrowserSortMenu {
|
|
||||||
id: sortMenu
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.topMargin: 120
|
|
||||||
anchors.rightMargin: Theme.spacingL
|
|
||||||
sortBy: root.sortBy
|
|
||||||
sortAscending: root.sortAscending
|
|
||||||
onSortBySelected: value => {
|
|
||||||
root.sortBy = value;
|
|
||||||
}
|
|
||||||
onSortOrderSelected: ascending => {
|
|
||||||
root.sortAscending = ascending;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FileBrowserOverwriteDialog {
|
|
||||||
anchors.fill: parent
|
|
||||||
showDialog: showOverwriteConfirmation
|
|
||||||
pendingFilePath: root.pendingFilePath
|
|
||||||
onConfirmed: filePath => {
|
|
||||||
showOverwriteConfirmation = false;
|
|
||||||
fileSelected(filePath);
|
|
||||||
pendingFilePath = "";
|
|
||||||
Qt.callLater(() => root.closeRequested());
|
|
||||||
}
|
|
||||||
onCancelled: {
|
|
||||||
showOverwriteConfirmation = false;
|
|
||||||
pendingFilePath = "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
FileBrowserItemContextMenu {
|
|
||||||
id: itemContextMenu
|
|
||||||
parentFocusItem: root
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,252 +1,3 @@
|
|||||||
import QtQuick
|
import qs.DankCommon.Modals.FileBrowser as DankCommon
|
||||||
import Quickshell.Widgets
|
|
||||||
import qs.Common
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
StyledRect {
|
DankCommon.FileBrowserGridDelegate {}
|
||||||
id: delegateRoot
|
|
||||||
|
|
||||||
required property bool fileIsDir
|
|
||||||
required property string filePath
|
|
||||||
required property string fileName
|
|
||||||
required property int index
|
|
||||||
|
|
||||||
property bool weMode: false
|
|
||||||
property var iconSizes: [80, 120, 160, 200]
|
|
||||||
property int iconSizeIndex: 1
|
|
||||||
property int selectedIndex: -1
|
|
||||||
property bool keyboardNavigationActive: false
|
|
||||||
|
|
||||||
signal itemClicked(int index, string path, string name, bool isDir)
|
|
||||||
signal itemSelected(int index, string path, string name, bool isDir)
|
|
||||||
signal itemContextMenuRequested(var sender, real localX, real localY, string path, string name, bool isDir)
|
|
||||||
|
|
||||||
function getFileExtension(fileName) {
|
|
||||||
const parts = fileName.split('.');
|
|
||||||
if (parts.length > 1) {
|
|
||||||
return parts[parts.length - 1].toLowerCase();
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
function determineFileType(fileName) {
|
|
||||||
const ext = getFileExtension(fileName);
|
|
||||||
|
|
||||||
const imageExts = ["png", "jpg", "jpeg", "gif", "bmp", "webp", "svg", "ico", "jxl", "avif", "heif", "exr"];
|
|
||||||
if (imageExts.includes(ext)) {
|
|
||||||
return "image";
|
|
||||||
}
|
|
||||||
|
|
||||||
const videoExts = ["mp4", "mkv", "avi", "mov", "webm", "flv", "wmv", "m4v"];
|
|
||||||
if (videoExts.includes(ext)) {
|
|
||||||
return "video";
|
|
||||||
}
|
|
||||||
|
|
||||||
const audioExts = ["mp3", "wav", "flac", "ogg", "m4a", "aac", "wma"];
|
|
||||||
if (audioExts.includes(ext)) {
|
|
||||||
return "audio";
|
|
||||||
}
|
|
||||||
|
|
||||||
const codeExts = ["js", "ts", "jsx", "tsx", "py", "go", "rs", "c", "cpp", "h", "java", "kt", "swift", "rb", "php", "html", "css", "scss", "json", "xml", "yaml", "yml", "toml", "sh", "bash", "zsh", "fish", "qml", "vue", "svelte"];
|
|
||||||
if (codeExts.includes(ext)) {
|
|
||||||
return "code";
|
|
||||||
}
|
|
||||||
|
|
||||||
const docExts = ["txt", "md", "pdf", "doc", "docx", "odt", "rtf"];
|
|
||||||
if (docExts.includes(ext)) {
|
|
||||||
return "document";
|
|
||||||
}
|
|
||||||
|
|
||||||
const archiveExts = ["zip", "tar", "gz", "bz2", "xz", "7z", "rar"];
|
|
||||||
if (archiveExts.includes(ext)) {
|
|
||||||
return "archive";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!ext || fileName.indexOf('.') === -1) {
|
|
||||||
return "binary";
|
|
||||||
}
|
|
||||||
|
|
||||||
return "file";
|
|
||||||
}
|
|
||||||
|
|
||||||
function isImageFile(fileName) {
|
|
||||||
if (!fileName) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return determineFileType(fileName) === "image";
|
|
||||||
}
|
|
||||||
|
|
||||||
function isVideoFile(fileName) {
|
|
||||||
if (!fileName) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return determineFileType(fileName) === "video";
|
|
||||||
}
|
|
||||||
|
|
||||||
property bool isImage: isImageFile(delegateRoot.fileName)
|
|
||||||
property bool isVideo: isVideoFile(delegateRoot.fileName)
|
|
||||||
|
|
||||||
property string _xdgCacheHome: Paths.strip(Paths.xdgCache)
|
|
||||||
property string _thumbnailSize: iconSizeIndex >= 2 ? "x-large" : "large"
|
|
||||||
property int _thumbnailPx: iconSizeIndex >= 2 ? 512 : 256
|
|
||||||
property string videoThumbnailPath: {
|
|
||||||
if (!delegateRoot.fileIsDir && isVideo) {
|
|
||||||
const hash = Qt.md5("file://" + delegateRoot.filePath);
|
|
||||||
return _xdgCacheHome + "/thumbnails/" + _thumbnailSize + "/" + hash + ".png";
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
property string _videoThumb: ""
|
|
||||||
property bool _thumbGenAttempted: false
|
|
||||||
|
|
||||||
// Probe the thumbnail optimistically; Image.Error triggers generation
|
|
||||||
onVideoThumbnailPathChanged: {
|
|
||||||
_thumbGenAttempted = false;
|
|
||||||
_videoThumb = videoThumbnailPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
function generateVideoThumbnail() {
|
|
||||||
if (_thumbGenAttempted)
|
|
||||||
return;
|
|
||||||
_thumbGenAttempted = true;
|
|
||||||
_videoThumb = "";
|
|
||||||
const thumbPath = videoThumbnailPath;
|
|
||||||
const thumbDir = _xdgCacheHome + "/thumbnails/" + _thumbnailSize;
|
|
||||||
const script = "mkdir -p \"$1\" && ffmpegthumbnailer -i \"$2\" -o \"$3\" -s " + _thumbnailPx + " -f";
|
|
||||||
Proc.runCommand(null, ["sh", "-c", script, "thumb", thumbDir, delegateRoot.filePath, thumbPath], function (output, exitCode) {
|
|
||||||
if (exitCode === 0)
|
|
||||||
_videoThumb = thumbPath;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function getIconForFile(fileName) {
|
|
||||||
const lowerName = fileName.toLowerCase();
|
|
||||||
if (lowerName.startsWith("dockerfile")) {
|
|
||||||
return "docker";
|
|
||||||
}
|
|
||||||
const ext = fileName.split('.').pop();
|
|
||||||
return ext || "";
|
|
||||||
}
|
|
||||||
|
|
||||||
width: weMode ? 245 : iconSizes[iconSizeIndex] + 16
|
|
||||||
height: weMode ? 205 : iconSizes[iconSizeIndex] + 48
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: {
|
|
||||||
if (keyboardNavigationActive && delegateRoot.index === selectedIndex)
|
|
||||||
return Theme.surfacePressed;
|
|
||||||
|
|
||||||
return mouseArea.containsMouse ? Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) : Theme.withAlpha(Theme.surfaceContainerHigh, 0);
|
|
||||||
}
|
|
||||||
border.color: keyboardNavigationActive && delegateRoot.index === selectedIndex ? Theme.primary : Theme.withAlpha(Theme.primary, 0)
|
|
||||||
border.width: (keyboardNavigationActive && delegateRoot.index === selectedIndex) ? 2 : 0
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
if (keyboardNavigationActive && delegateRoot.index === selectedIndex)
|
|
||||||
itemSelected(delegateRoot.index, delegateRoot.filePath, delegateRoot.fileName, delegateRoot.fileIsDir);
|
|
||||||
}
|
|
||||||
|
|
||||||
onSelectedIndexChanged: {
|
|
||||||
if (keyboardNavigationActive && selectedIndex === delegateRoot.index)
|
|
||||||
itemSelected(delegateRoot.index, delegateRoot.filePath, delegateRoot.fileName, delegateRoot.fileIsDir);
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: weMode ? 225 : (iconSizes[iconSizeIndex] - 8)
|
|
||||||
height: weMode ? 165 : (iconSizes[iconSizeIndex] - 8)
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
|
|
||||||
ClippingRectangle {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: 2
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: "transparent"
|
|
||||||
|
|
||||||
Image {
|
|
||||||
id: gridPreviewImage
|
|
||||||
anchors.fill: parent
|
|
||||||
property var weExtensions: [".jpg", ".jpeg", ".png", ".webp", ".gif", ".bmp", ".tga", ".jxl", ".avif", ".heif", ".exr"]
|
|
||||||
property int weExtIndex: 0
|
|
||||||
property string imagePath: {
|
|
||||||
if (weMode && delegateRoot.fileIsDir)
|
|
||||||
return delegateRoot.filePath + "/preview" + weExtensions[weExtIndex];
|
|
||||||
if (_videoThumb)
|
|
||||||
return _videoThumb;
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
source: imagePath ? "file://" + imagePath.split('/').map(s => encodeURIComponent(s)).join('/') : ""
|
|
||||||
onStatusChanged: {
|
|
||||||
if (status !== Image.Error)
|
|
||||||
return;
|
|
||||||
if (weMode && delegateRoot.fileIsDir) {
|
|
||||||
if (weExtIndex < weExtensions.length - 1) {
|
|
||||||
weExtIndex++;
|
|
||||||
} else {
|
|
||||||
imagePath = "";
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (_videoThumb)
|
|
||||||
generateVideoThumbnail();
|
|
||||||
}
|
|
||||||
fillMode: Image.PreserveAspectCrop
|
|
||||||
sourceSize.width: weMode ? 225 : iconSizes[iconSizeIndex]
|
|
||||||
sourceSize.height: weMode ? 225 : iconSizes[iconSizeIndex]
|
|
||||||
asynchronous: true
|
|
||||||
visible: status === Image.Ready && ((!delegateRoot.fileIsDir && isVideo) || (weMode && delegateRoot.fileIsDir))
|
|
||||||
}
|
|
||||||
|
|
||||||
CachingImage {
|
|
||||||
anchors.fill: parent
|
|
||||||
imagePath: !delegateRoot.fileIsDir && isImage ? delegateRoot.filePath : ""
|
|
||||||
maxCacheSize: 256
|
|
||||||
animate: false
|
|
||||||
visible: !delegateRoot.fileIsDir && isImage
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankNFIcon {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
name: delegateRoot.fileIsDir ? "folder" : getIconForFile(delegateRoot.fileName)
|
|
||||||
size: iconSizes[iconSizeIndex] * 0.45
|
|
||||||
color: delegateRoot.fileIsDir ? Theme.primary : Theme.surfaceText
|
|
||||||
visible: (!delegateRoot.fileIsDir && !isImage && !(isVideo && gridPreviewImage.status === Image.Ready)) || (delegateRoot.fileIsDir && !weMode)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: delegateRoot.fileName || ""
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceText
|
|
||||||
width: delegateRoot.width - Theme.spacingM
|
|
||||||
elide: Text.ElideRight
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
maximumLineCount: 2
|
|
||||||
wrapMode: Text.Wrap
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: mouseArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
|
||||||
onClicked: mouse => {
|
|
||||||
switch (mouse.button) {
|
|
||||||
case Qt.LeftButton:
|
|
||||||
itemClicked(delegateRoot.index, delegateRoot.filePath, delegateRoot.fileName, delegateRoot.fileIsDir);
|
|
||||||
break;
|
|
||||||
case Qt.RightButton:
|
|
||||||
itemContextMenuRequested(delegateRoot, mouse.x, mouse.y, delegateRoot.filePath, delegateRoot.fileName, delegateRoot.fileIsDir);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,153 +1,3 @@
|
|||||||
import QtQuick
|
import qs.DankCommon.Modals.FileBrowser as DankCommon
|
||||||
import QtQuick.Controls
|
|
||||||
import Quickshell
|
|
||||||
import qs.Common
|
|
||||||
import qs.Services
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
Popup {
|
DankCommon.FileBrowserItemContextMenu {}
|
||||||
id: root
|
|
||||||
|
|
||||||
property string filePath: ""
|
|
||||||
property string fileName: ""
|
|
||||||
property bool fileIsDir: false
|
|
||||||
property var parentFocusItem: null
|
|
||||||
|
|
||||||
signal trashed
|
|
||||||
signal menuClosed
|
|
||||||
|
|
||||||
readonly property var menuItems: [
|
|
||||||
{
|
|
||||||
text: I18n.tr("Move to Trash"),
|
|
||||||
icon: "delete",
|
|
||||||
action: trashItem,
|
|
||||||
enabled: filePath.length > 0,
|
|
||||||
dangerous: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: I18n.tr("Copy path"),
|
|
||||||
icon: "content_copy",
|
|
||||||
action: copyPath,
|
|
||||||
enabled: filePath.length > 0
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
function showAt(parentItem, localX, localY, path, name, isDir) {
|
|
||||||
if (!parentItem)
|
|
||||||
return;
|
|
||||||
parent = parentItem;
|
|
||||||
filePath = path || "";
|
|
||||||
fileName = name || "";
|
|
||||||
fileIsDir = !!isDir;
|
|
||||||
x = Math.max(0, Math.min(parentItem.width - width, localX));
|
|
||||||
y = Math.max(0, Math.min(parentItem.height - height, localY));
|
|
||||||
open();
|
|
||||||
}
|
|
||||||
|
|
||||||
function trashItem() {
|
|
||||||
if (!filePath)
|
|
||||||
return;
|
|
||||||
TrashService.trashPath(filePath, ok => {
|
|
||||||
if (ok)
|
|
||||||
root.trashed();
|
|
||||||
});
|
|
||||||
close();
|
|
||||||
}
|
|
||||||
|
|
||||||
function copyPath() {
|
|
||||||
if (!filePath)
|
|
||||||
return;
|
|
||||||
Quickshell.execDetached(["dms", "cl", "copy", filePath]);
|
|
||||||
close();
|
|
||||||
}
|
|
||||||
|
|
||||||
width: 220
|
|
||||||
height: menuColumn.implicitHeight + Theme.spacingS * 2
|
|
||||||
padding: 0
|
|
||||||
modal: false
|
|
||||||
closePolicy: Popup.CloseOnEscape
|
|
||||||
|
|
||||||
onClosed: {
|
|
||||||
closePolicy = Popup.CloseOnEscape;
|
|
||||||
menuClosed();
|
|
||||||
if (parentFocusItem)
|
|
||||||
Qt.callLater(() => parentFocusItem.forceActiveFocus());
|
|
||||||
}
|
|
||||||
|
|
||||||
onOpened: outsideClickTimer.start()
|
|
||||||
|
|
||||||
Timer {
|
|
||||||
id: outsideClickTimer
|
|
||||||
interval: 100
|
|
||||||
onTriggered: root.closePolicy = Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
|
||||||
}
|
|
||||||
|
|
||||||
background: Rectangle {
|
|
||||||
color: "transparent"
|
|
||||||
}
|
|
||||||
|
|
||||||
contentItem: Rectangle {
|
|
||||||
color: Theme.floatingSurface
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
border.color: BlurService.borderColor
|
|
||||||
border.width: BlurService.borderWidth
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: menuColumn
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingS
|
|
||||||
spacing: 1
|
|
||||||
|
|
||||||
Repeater {
|
|
||||||
model: root.menuItems
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: parent.width
|
|
||||||
height: 32
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
opacity: modelData.enabled ? 1 : 0.5
|
|
||||||
color: {
|
|
||||||
if (!modelData.enabled || !area.containsMouse)
|
|
||||||
return "transparent";
|
|
||||||
if (modelData.dangerous)
|
|
||||||
return Theme.errorHover;
|
|
||||||
return BlurService.hoverColor(Theme.widgetBaseHoverColor);
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: Theme.spacingS
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.rightMargin: Theme.spacingS
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
name: modelData.icon
|
|
||||||
size: 16
|
|
||||||
color: modelData.dangerous && area.containsMouse && modelData.enabled ? Theme.error : Theme.surfaceText
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
text: modelData.text
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: modelData.dangerous && area.containsMouse && modelData.enabled ? Theme.error : Theme.surfaceText
|
|
||||||
elide: Text.ElideRight
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: area
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
enabled: modelData.enabled
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: modelData.action()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,256 +1,3 @@
|
|||||||
import QtQuick
|
import qs.DankCommon.Modals.FileBrowser as DankCommon
|
||||||
import Quickshell.Widgets
|
|
||||||
import qs.Common
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
StyledRect {
|
DankCommon.FileBrowserListDelegate {}
|
||||||
id: listDelegateRoot
|
|
||||||
|
|
||||||
required property bool fileIsDir
|
|
||||||
required property string filePath
|
|
||||||
required property string fileName
|
|
||||||
required property int index
|
|
||||||
required property var fileModified
|
|
||||||
required property int fileSize
|
|
||||||
|
|
||||||
property int selectedIndex: -1
|
|
||||||
property bool keyboardNavigationActive: false
|
|
||||||
|
|
||||||
signal itemClicked(int index, string path, string name, bool isDir)
|
|
||||||
signal itemSelected(int index, string path, string name, bool isDir)
|
|
||||||
signal itemContextMenuRequested(var sender, real localX, real localY, string path, string name, bool isDir)
|
|
||||||
|
|
||||||
function getFileExtension(fileName) {
|
|
||||||
const parts = fileName.split('.');
|
|
||||||
if (parts.length > 1) {
|
|
||||||
return parts[parts.length - 1].toLowerCase();
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
function determineFileType(fileName) {
|
|
||||||
const ext = getFileExtension(fileName);
|
|
||||||
|
|
||||||
const imageExts = ["png", "jpg", "jpeg", "gif", "bmp", "webp", "svg", "ico", "jxl", "avif", "heif", "exr"];
|
|
||||||
if (imageExts.includes(ext)) {
|
|
||||||
return "image";
|
|
||||||
}
|
|
||||||
|
|
||||||
const videoExts = ["mp4", "mkv", "avi", "mov", "webm", "flv", "wmv", "m4v"];
|
|
||||||
if (videoExts.includes(ext)) {
|
|
||||||
return "video";
|
|
||||||
}
|
|
||||||
|
|
||||||
const audioExts = ["mp3", "wav", "flac", "ogg", "m4a", "aac", "wma"];
|
|
||||||
if (audioExts.includes(ext)) {
|
|
||||||
return "audio";
|
|
||||||
}
|
|
||||||
|
|
||||||
const codeExts = ["js", "ts", "jsx", "tsx", "py", "go", "rs", "c", "cpp", "h", "java", "kt", "swift", "rb", "php", "html", "css", "scss", "json", "xml", "yaml", "yml", "toml", "sh", "bash", "zsh", "fish", "qml", "vue", "svelte"];
|
|
||||||
if (codeExts.includes(ext)) {
|
|
||||||
return "code";
|
|
||||||
}
|
|
||||||
|
|
||||||
const docExts = ["txt", "md", "pdf", "doc", "docx", "odt", "rtf"];
|
|
||||||
if (docExts.includes(ext)) {
|
|
||||||
return "document";
|
|
||||||
}
|
|
||||||
|
|
||||||
const archiveExts = ["zip", "tar", "gz", "bz2", "xz", "7z", "rar"];
|
|
||||||
if (archiveExts.includes(ext)) {
|
|
||||||
return "archive";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!ext || fileName.indexOf('.') === -1) {
|
|
||||||
return "binary";
|
|
||||||
}
|
|
||||||
|
|
||||||
return "file";
|
|
||||||
}
|
|
||||||
|
|
||||||
function isImageFile(fileName) {
|
|
||||||
if (!fileName) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return determineFileType(fileName) === "image";
|
|
||||||
}
|
|
||||||
|
|
||||||
function isVideoFile(fileName) {
|
|
||||||
if (!fileName) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return determineFileType(fileName) === "video";
|
|
||||||
}
|
|
||||||
|
|
||||||
property bool isImage: isImageFile(listDelegateRoot.fileName)
|
|
||||||
property bool isVideo: isVideoFile(listDelegateRoot.fileName)
|
|
||||||
|
|
||||||
property string _xdgCacheHome: Paths.strip(Paths.xdgCache)
|
|
||||||
property string videoThumbnailPath: {
|
|
||||||
if (!listDelegateRoot.fileIsDir && isVideo) {
|
|
||||||
const hash = Qt.md5("file://" + listDelegateRoot.filePath);
|
|
||||||
return _xdgCacheHome + "/thumbnails/normal/" + hash + ".png";
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
property string _videoThumb: ""
|
|
||||||
property bool _thumbGenAttempted: false
|
|
||||||
|
|
||||||
// Probe the thumbnail optimistically; Image.Error triggers generation
|
|
||||||
onVideoThumbnailPathChanged: {
|
|
||||||
_thumbGenAttempted = false;
|
|
||||||
_videoThumb = videoThumbnailPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
function generateVideoThumbnail() {
|
|
||||||
if (_thumbGenAttempted)
|
|
||||||
return;
|
|
||||||
_thumbGenAttempted = true;
|
|
||||||
_videoThumb = "";
|
|
||||||
const thumbPath = videoThumbnailPath;
|
|
||||||
const thumbDir = _xdgCacheHome + "/thumbnails/normal";
|
|
||||||
const script = "mkdir -p \"$1\" && ffmpegthumbnailer -i \"$2\" -o \"$3\" -s 128 -f";
|
|
||||||
Proc.runCommand(null, ["sh", "-c", script, "thumb", thumbDir, listDelegateRoot.filePath, thumbPath], function (output, exitCode) {
|
|
||||||
if (exitCode === 0)
|
|
||||||
_videoThumb = thumbPath;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function getIconForFile(fileName) {
|
|
||||||
const lowerName = fileName.toLowerCase();
|
|
||||||
if (lowerName.startsWith("dockerfile")) {
|
|
||||||
return "docker";
|
|
||||||
}
|
|
||||||
const ext = fileName.split('.').pop();
|
|
||||||
return ext || "";
|
|
||||||
}
|
|
||||||
|
|
||||||
function formatFileSize(size) {
|
|
||||||
if (size < 1024)
|
|
||||||
return size + " B";
|
|
||||||
if (size < 1024 * 1024)
|
|
||||||
return (size / 1024).toFixed(1) + " KB";
|
|
||||||
if (size < 1024 * 1024 * 1024)
|
|
||||||
return (size / (1024 * 1024)).toFixed(1) + " MB";
|
|
||||||
return (size / (1024 * 1024 * 1024)).toFixed(1) + " GB";
|
|
||||||
}
|
|
||||||
|
|
||||||
height: 44
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: {
|
|
||||||
if (keyboardNavigationActive && listDelegateRoot.index === selectedIndex)
|
|
||||||
return Theme.surfacePressed;
|
|
||||||
return listMouseArea.containsMouse ? Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) : Theme.withAlpha(Theme.surfaceContainerHigh, 0);
|
|
||||||
}
|
|
||||||
border.color: keyboardNavigationActive && listDelegateRoot.index === selectedIndex ? Theme.primary : Theme.withAlpha(Theme.primary, 0)
|
|
||||||
border.width: (keyboardNavigationActive && listDelegateRoot.index === selectedIndex) ? 2 : 0
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
if (keyboardNavigationActive && listDelegateRoot.index === selectedIndex)
|
|
||||||
itemSelected(listDelegateRoot.index, listDelegateRoot.filePath, listDelegateRoot.fileName, listDelegateRoot.fileIsDir);
|
|
||||||
}
|
|
||||||
|
|
||||||
onSelectedIndexChanged: {
|
|
||||||
if (keyboardNavigationActive && selectedIndex === listDelegateRoot.index)
|
|
||||||
itemSelected(listDelegateRoot.index, listDelegateRoot.filePath, listDelegateRoot.fileName, listDelegateRoot.fileIsDir);
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.leftMargin: Theme.spacingS
|
|
||||||
anchors.rightMargin: Theme.spacingS
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: 28
|
|
||||||
height: 28
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
ClippingRectangle {
|
|
||||||
anchors.fill: parent
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: "transparent"
|
|
||||||
|
|
||||||
Image {
|
|
||||||
id: listPreviewImage
|
|
||||||
anchors.fill: parent
|
|
||||||
property string imagePath: _videoThumb
|
|
||||||
source: imagePath ? "file://" + imagePath.split('/').map(s => encodeURIComponent(s)).join('/') : ""
|
|
||||||
fillMode: Image.PreserveAspectCrop
|
|
||||||
sourceSize.width: 32
|
|
||||||
sourceSize.height: 32
|
|
||||||
asynchronous: true
|
|
||||||
visible: status === Image.Ready && !listDelegateRoot.fileIsDir && isVideo
|
|
||||||
onStatusChanged: {
|
|
||||||
if (status === Image.Error && _videoThumb)
|
|
||||||
generateVideoThumbnail();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
CachingImage {
|
|
||||||
anchors.fill: parent
|
|
||||||
imagePath: !listDelegateRoot.fileIsDir && isImage ? listDelegateRoot.filePath : ""
|
|
||||||
maxCacheSize: 256
|
|
||||||
animate: false
|
|
||||||
visible: !listDelegateRoot.fileIsDir && isImage
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankNFIcon {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
name: listDelegateRoot.fileIsDir ? "folder" : getIconForFile(listDelegateRoot.fileName)
|
|
||||||
size: Theme.iconSize - 2
|
|
||||||
color: listDelegateRoot.fileIsDir ? Theme.primary : Theme.surfaceText
|
|
||||||
visible: listDelegateRoot.fileIsDir || (!isImage && !(isVideo && listPreviewImage.status === Image.Ready))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: listDelegateRoot.fileName || ""
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
width: parent.width - 280
|
|
||||||
elide: Text.ElideRight
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
maximumLineCount: 1
|
|
||||||
clip: true
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: listDelegateRoot.fileIsDir ? "" : formatFileSize(listDelegateRoot.fileSize)
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceTextMedium
|
|
||||||
width: 70
|
|
||||||
horizontalAlignment: Text.AlignRight
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: Qt.formatDateTime(listDelegateRoot.fileModified, "MMM d, yyyy h:mm AP")
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceTextMedium
|
|
||||||
width: 140
|
|
||||||
horizontalAlignment: Text.AlignRight
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: listMouseArea
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
|
||||||
onClicked: mouse => {
|
|
||||||
switch (mouse.button) {
|
|
||||||
case Qt.LeftButton:
|
|
||||||
itemClicked(listDelegateRoot.index, listDelegateRoot.filePath, listDelegateRoot.fileName, listDelegateRoot.fileIsDir);
|
|
||||||
break;
|
|
||||||
case Qt.RightButton:
|
|
||||||
itemContextMenuRequested(listDelegateRoot, mouse.x, mouse.y, listDelegateRoot.filePath, listDelegateRoot.fileName, listDelegateRoot.fileIsDir);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,100 +1,3 @@
|
|||||||
import QtQuick
|
import qs.DankCommon.Modals.FileBrowser as DankCommon
|
||||||
import Quickshell
|
|
||||||
import qs.Common
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
FloatingWindow {
|
DankCommon.FileBrowserModal {}
|
||||||
id: fileBrowserModal
|
|
||||||
|
|
||||||
property bool disablePopupTransparency: true
|
|
||||||
property string browserTitle: "Select File"
|
|
||||||
property string browserIcon: "folder_open"
|
|
||||||
property string browserType: "generic"
|
|
||||||
property var fileExtensions: ["*.*"]
|
|
||||||
property alias filterExtensions: fileBrowserModal.fileExtensions
|
|
||||||
property bool showHiddenFiles: false
|
|
||||||
property bool saveMode: false
|
|
||||||
property string defaultFileName: ""
|
|
||||||
property var parentModal: null
|
|
||||||
parentWindow: parentModal
|
|
||||||
property bool shouldHaveFocus: visible
|
|
||||||
property bool allowFocusOverride: false
|
|
||||||
property bool shouldBeVisible: visible
|
|
||||||
property bool allowStacking: true
|
|
||||||
|
|
||||||
signal fileSelected(string path)
|
|
||||||
signal dialogClosed
|
|
||||||
|
|
||||||
function open() {
|
|
||||||
visible = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
function close() {
|
|
||||||
visible = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
objectName: "fileBrowserModal"
|
|
||||||
title: "Files - " + browserTitle
|
|
||||||
minimumSize: Qt.size(500, 400)
|
|
||||||
implicitWidth: 800
|
|
||||||
implicitHeight: 600
|
|
||||||
color: Theme.surfaceContainer
|
|
||||||
visible: false
|
|
||||||
|
|
||||||
onClosed: close()
|
|
||||||
|
|
||||||
onVisibleChanged: {
|
|
||||||
if (visible) {
|
|
||||||
if (parentModal && "shouldHaveFocus" in parentModal) {
|
|
||||||
parentModal.shouldHaveFocus = false;
|
|
||||||
parentModal.allowFocusOverride = true;
|
|
||||||
}
|
|
||||||
Qt.callLater(() => {
|
|
||||||
if (content) {
|
|
||||||
content.reset();
|
|
||||||
content.forceActiveFocus();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
if (parentModal && "allowFocusOverride" in parentModal) {
|
|
||||||
parentModal.allowFocusOverride = false;
|
|
||||||
parentModal.shouldHaveFocus = Qt.binding(() => parentModal.shouldBeVisible);
|
|
||||||
}
|
|
||||||
dialogClosed();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Loader {
|
|
||||||
id: contentLoader
|
|
||||||
anchors.fill: parent
|
|
||||||
active: fileBrowserModal.visible
|
|
||||||
sourceComponent: FileBrowserContent {
|
|
||||||
id: content
|
|
||||||
anchors.fill: parent
|
|
||||||
focus: true
|
|
||||||
closeOnEscape: false
|
|
||||||
windowControls: fileBrowserModal.windowControlsRef
|
|
||||||
|
|
||||||
browserTitle: fileBrowserModal.browserTitle
|
|
||||||
browserIcon: fileBrowserModal.browserIcon
|
|
||||||
browserType: fileBrowserModal.browserType
|
|
||||||
fileExtensions: fileBrowserModal.fileExtensions
|
|
||||||
showHiddenFiles: fileBrowserModal.showHiddenFiles
|
|
||||||
saveMode: fileBrowserModal.saveMode
|
|
||||||
defaultFileName: fileBrowserModal.defaultFileName
|
|
||||||
|
|
||||||
Component.onCompleted: initialize()
|
|
||||||
|
|
||||||
onFileSelected: path => fileBrowserModal.fileSelected(path)
|
|
||||||
onCloseRequested: fileBrowserModal.close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
property alias content: contentLoader.item
|
|
||||||
property alias windowControlsRef: windowControls
|
|
||||||
|
|
||||||
FloatingWindowControls {
|
|
||||||
id: windowControls
|
|
||||||
targetWindow: fileBrowserModal
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,130 +1,3 @@
|
|||||||
import QtQuick
|
import qs.DankCommon.Modals.FileBrowser as DankCommon
|
||||||
import qs.Common
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
Row {
|
DankCommon.FileBrowserNavigation {}
|
||||||
id: navigation
|
|
||||||
|
|
||||||
property string currentPath: ""
|
|
||||||
property string homeDir: ""
|
|
||||||
property bool backButtonFocused: false
|
|
||||||
property bool keyboardNavigationActive: false
|
|
||||||
property bool showSidebar: true
|
|
||||||
property bool pathEditMode: false
|
|
||||||
property bool pathInputHasFocus: false
|
|
||||||
|
|
||||||
signal navigateUp
|
|
||||||
signal navigateTo(string path)
|
|
||||||
signal pathInputFocusChanged(bool hasFocus)
|
|
||||||
|
|
||||||
height: 40
|
|
||||||
leftPadding: Theme.spacingM
|
|
||||||
rightPadding: Theme.spacingM
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
StyledRect {
|
|
||||||
width: 32
|
|
||||||
height: 32
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: (backButtonMouseArea.containsMouse || (backButtonFocused && keyboardNavigationActive)) && currentPath !== homeDir ? Theme.surfaceVariant : Theme.withAlpha(Theme.surfaceVariant, 0)
|
|
||||||
opacity: currentPath !== homeDir ? 1 : 0
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
name: "arrow_back"
|
|
||||||
size: Theme.iconSizeSmall
|
|
||||||
color: Theme.surfaceText
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: backButtonMouseArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: currentPath !== homeDir
|
|
||||||
cursorShape: currentPath !== homeDir ? Qt.PointingHandCursor : Qt.ArrowCursor
|
|
||||||
enabled: currentPath !== homeDir
|
|
||||||
onClicked: navigation.navigateUp()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: Math.max(0, (parent?.width ?? 0) - 40 - Theme.spacingS - (showSidebar ? 0 : 80))
|
|
||||||
height: 32
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
StyledRect {
|
|
||||||
anchors.fill: parent
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: pathEditMode ? Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency) : Theme.withAlpha(Theme.surfaceContainer, 0)
|
|
||||||
border.color: pathEditMode ? Theme.primary : Theme.withAlpha(Theme.primary, 0)
|
|
||||||
border.width: pathEditMode ? 1 : 0
|
|
||||||
visible: !pathEditMode
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
id: pathDisplay
|
|
||||||
text: currentPath.replace("file://", "")
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.leftMargin: Theme.spacingS
|
|
||||||
anchors.rightMargin: Theme.spacingS
|
|
||||||
elide: Text.ElideMiddle
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
maximumLineCount: 1
|
|
||||||
wrapMode: Text.NoWrap
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
cursorShape: Qt.IBeamCursor
|
|
||||||
onClicked: {
|
|
||||||
pathEditMode = true;
|
|
||||||
pathInput.text = currentPath.replace("file://", "");
|
|
||||||
Qt.callLater(() => pathInput.forceActiveFocus());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DankTextField {
|
|
||||||
id: pathInput
|
|
||||||
anchors.fill: parent
|
|
||||||
visible: pathEditMode
|
|
||||||
topPadding: Theme.spacingXS
|
|
||||||
bottomPadding: Theme.spacingXS
|
|
||||||
onAccepted: {
|
|
||||||
const newPath = text.trim();
|
|
||||||
if (newPath !== "") {
|
|
||||||
navigation.navigateTo(newPath);
|
|
||||||
}
|
|
||||||
pathEditMode = false;
|
|
||||||
}
|
|
||||||
Keys.onEscapePressed: {
|
|
||||||
pathEditMode = false;
|
|
||||||
}
|
|
||||||
Keys.onDownPressed: {
|
|
||||||
pathEditMode = false;
|
|
||||||
}
|
|
||||||
onActiveFocusChanged: {
|
|
||||||
navigation.pathInputFocusChanged(activeFocus);
|
|
||||||
if (!activeFocus && pathEditMode) {
|
|
||||||
pathEditMode = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
visible: !showSidebar
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
DankActionButton {
|
|
||||||
circular: false
|
|
||||||
iconName: "sort"
|
|
||||||
iconSize: Theme.iconSize - 6
|
|
||||||
iconColor: Theme.surfaceText
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,127 +1,3 @@
|
|||||||
import QtQuick
|
import qs.DankCommon.Modals.FileBrowser as DankCommon
|
||||||
import qs.Common
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
Item {
|
DankCommon.FileBrowserOverwriteDialog {}
|
||||||
id: overwriteDialog
|
|
||||||
|
|
||||||
property bool showDialog: false
|
|
||||||
property string pendingFilePath: ""
|
|
||||||
|
|
||||||
signal confirmed(string filePath)
|
|
||||||
signal cancelled
|
|
||||||
|
|
||||||
visible: showDialog
|
|
||||||
focus: showDialog
|
|
||||||
|
|
||||||
Keys.onEscapePressed: {
|
|
||||||
cancelled();
|
|
||||||
}
|
|
||||||
|
|
||||||
Keys.onReturnPressed: {
|
|
||||||
confirmed(pendingFilePath);
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
anchors.fill: parent
|
|
||||||
color: Theme.shadowStrong
|
|
||||||
opacity: 0.8
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked: {
|
|
||||||
cancelled();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledRect {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
width: 400
|
|
||||||
height: 160
|
|
||||||
color: Theme.surfaceContainer
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
border.color: Theme.outlineMedium
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
width: parent.width - Theme.spacingL * 2
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: I18n.tr("File Already Exists")
|
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
|
||||||
font.weight: Font.Medium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: I18n.tr("A file with this name already exists. Do you want to overwrite it?")
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.surfaceTextMedium
|
|
||||||
width: parent.width
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
StyledRect {
|
|
||||||
width: 80
|
|
||||||
height: 36
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: cancelArea.containsMouse ? Qt.lighter(Theme.surfaceVariant, 1.2) : Theme.surfaceVariant
|
|
||||||
border.color: Theme.outline
|
|
||||||
border.width: 1
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
text: I18n.tr("Cancel")
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: cancelArea
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: {
|
|
||||||
cancelled();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledRect {
|
|
||||||
width: 90
|
|
||||||
height: 36
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: overwriteArea.containsMouse ? Qt.darker(Theme.primary, 1.1) : Theme.primary
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
text: I18n.tr("Overwrite")
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.background
|
|
||||||
font.weight: Font.Medium
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: overwriteArea
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: {
|
|
||||||
confirmed(pendingFilePath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,75 +1,3 @@
|
|||||||
import QtQuick
|
import qs.DankCommon.Modals.FileBrowser as DankCommon
|
||||||
import qs.Common
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
Row {
|
DankCommon.FileBrowserSaveRow {}
|
||||||
id: saveRow
|
|
||||||
|
|
||||||
property bool saveMode: false
|
|
||||||
property string defaultFileName: ""
|
|
||||||
property string currentPath: ""
|
|
||||||
property alias fileName: fileNameInput.text
|
|
||||||
|
|
||||||
signal saveRequested(string filePath)
|
|
||||||
|
|
||||||
height: saveMode ? 40 : 0
|
|
||||||
visible: saveMode
|
|
||||||
spacing: Theme.spacingM
|
|
||||||
|
|
||||||
DankTextField {
|
|
||||||
id: fileNameInput
|
|
||||||
|
|
||||||
width: parent.width - saveButton.width - Theme.spacingM
|
|
||||||
height: 40
|
|
||||||
text: defaultFileName
|
|
||||||
placeholderText: I18n.tr("Enter filename...")
|
|
||||||
ignoreLeftRightKeys: false
|
|
||||||
focus: saveMode
|
|
||||||
topPadding: Theme.spacingS
|
|
||||||
bottomPadding: Theme.spacingS
|
|
||||||
Component.onCompleted: {
|
|
||||||
if (saveMode)
|
|
||||||
Qt.callLater(() => {
|
|
||||||
forceActiveFocus();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
onAccepted: {
|
|
||||||
if (text.trim() !== "") {
|
|
||||||
var basePath = currentPath.replace(/^file:\/\//, '');
|
|
||||||
var fullPath = basePath + "/" + text.trim();
|
|
||||||
fullPath = fullPath.replace(/\/+/g, '/');
|
|
||||||
saveRequested(fullPath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledRect {
|
|
||||||
id: saveButton
|
|
||||||
|
|
||||||
width: 80
|
|
||||||
height: 40
|
|
||||||
color: fileNameInput.text.trim() !== "" ? Theme.primary : Theme.surfaceVariant
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
text: I18n.tr("Save")
|
|
||||||
color: fileNameInput.text.trim() !== "" ? Theme.primaryText : Theme.surfaceVariantText
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
}
|
|
||||||
|
|
||||||
StateLayer {
|
|
||||||
stateColor: Theme.primary
|
|
||||||
cornerRadius: Theme.cornerRadius
|
|
||||||
enabled: fileNameInput.text.trim() !== ""
|
|
||||||
onClicked: {
|
|
||||||
if (fileNameInput.text.trim() !== "") {
|
|
||||||
var basePath = currentPath.replace(/^file:\/\//, '');
|
|
||||||
var fullPath = basePath + "/" + fileNameInput.text.trim();
|
|
||||||
fullPath = fullPath.replace(/\/+/g, '/');
|
|
||||||
saveRequested(fullPath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,70 +1,3 @@
|
|||||||
import QtQuick
|
import qs.DankCommon.Modals.FileBrowser as DankCommon
|
||||||
import qs.Common
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
StyledRect {
|
DankCommon.FileBrowserSidebar {}
|
||||||
id: sidebar
|
|
||||||
|
|
||||||
property var quickAccessLocations: []
|
|
||||||
property string currentPath: ""
|
|
||||||
signal locationSelected(string path)
|
|
||||||
|
|
||||||
width: 200
|
|
||||||
color: Theme.nestedSurface
|
|
||||||
clip: true
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: Theme.spacingS
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: I18n.tr("Quick Access")
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceTextMedium
|
|
||||||
font.weight: Font.Medium
|
|
||||||
leftPadding: Theme.spacingS
|
|
||||||
bottomPadding: Theme.spacingXS
|
|
||||||
}
|
|
||||||
|
|
||||||
Repeater {
|
|
||||||
model: quickAccessLocations
|
|
||||||
|
|
||||||
StyledRect {
|
|
||||||
width: parent?.width ?? 0
|
|
||||||
height: 38
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: quickAccessMouseArea.containsMouse ? Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) : (currentPath === modelData?.path ? Theme.surfacePressed : Theme.withAlpha(Theme.surfacePressed, 0))
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.leftMargin: Theme.spacingM
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: modelData?.icon ?? ""
|
|
||||||
size: Theme.iconSize - 2
|
|
||||||
color: currentPath === modelData?.path ? Theme.primary : Theme.surfaceText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: modelData?.name ?? ""
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: currentPath === modelData?.path ? Theme.primary : Theme.surfaceText
|
|
||||||
font.weight: currentPath === modelData?.path ? Font.Medium : Font.Normal
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: quickAccessMouseArea
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: locationSelected(modelData?.path ?? "")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,189 +1,3 @@
|
|||||||
import QtQuick
|
import qs.DankCommon.Modals.FileBrowser as DankCommon
|
||||||
import qs.Common
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
StyledRect {
|
DankCommon.FileBrowserSortMenu {}
|
||||||
id: sortMenu
|
|
||||||
|
|
||||||
property string sortBy: "name"
|
|
||||||
property bool sortAscending: true
|
|
||||||
property color surfaceColor: Theme.surfaceContainer
|
|
||||||
|
|
||||||
signal sortBySelected(string value)
|
|
||||||
signal sortOrderSelected(bool ascending)
|
|
||||||
|
|
||||||
width: 200
|
|
||||||
height: sortColumn.height + Theme.spacingM * 2
|
|
||||||
color: surfaceColor
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
border.color: Theme.outlineMedium
|
|
||||||
border.width: 1
|
|
||||||
visible: false
|
|
||||||
z: 100
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: sortColumn
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.margins: Theme.spacingM
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Sort By"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceTextMedium
|
|
||||||
font.weight: Font.Medium
|
|
||||||
}
|
|
||||||
|
|
||||||
Repeater {
|
|
||||||
model: [
|
|
||||||
{
|
|
||||||
"name": "Name",
|
|
||||||
"value": "name"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Size",
|
|
||||||
"value": "size"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Modified",
|
|
||||||
"value": "modified"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Type",
|
|
||||||
"value": "type"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
StyledRect {
|
|
||||||
width: sortColumn?.width ?? 0
|
|
||||||
height: 32
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: sortMouseArea.containsMouse ? Theme.surfaceVariant : (sortBy === modelData?.value ? Theme.surfacePressed : Theme.withAlpha(Theme.surfacePressed, 0))
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.leftMargin: Theme.spacingS
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: sortBy === modelData?.value ? "check" : ""
|
|
||||||
size: Theme.iconSizeSmall
|
|
||||||
color: Theme.primary
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
visible: sortBy === modelData?.value
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: modelData?.name ?? ""
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: sortBy === modelData?.value ? Theme.primary : Theme.surfaceText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: sortMouseArea
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: {
|
|
||||||
sortMenu.sortBySelected(modelData?.value ?? "name");
|
|
||||||
sortMenu.visible = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledRect {
|
|
||||||
width: sortColumn.width
|
|
||||||
height: 1
|
|
||||||
color: Theme.outline
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Order"
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceTextMedium
|
|
||||||
font.weight: Font.Medium
|
|
||||||
topPadding: Theme.spacingXS
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledRect {
|
|
||||||
width: sortColumn?.width ?? 0
|
|
||||||
height: 32
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: ascMouseArea.containsMouse ? Theme.surfaceVariant : (sortAscending ? Theme.surfacePressed : Theme.withAlpha(Theme.surfacePressed, 0))
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.leftMargin: Theme.spacingS
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "arrow_upward"
|
|
||||||
size: Theme.iconSizeSmall
|
|
||||||
color: sortAscending ? Theme.primary : Theme.surfaceText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Ascending"
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: sortAscending ? Theme.primary : Theme.surfaceText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: ascMouseArea
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: {
|
|
||||||
sortMenu.sortOrderSelected(true);
|
|
||||||
sortMenu.visible = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledRect {
|
|
||||||
width: sortColumn?.width ?? 0
|
|
||||||
height: 32
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: descMouseArea.containsMouse ? Theme.surfaceVariant : (!sortAscending ? Theme.surfacePressed : Theme.withAlpha(Theme.surfacePressed, 0))
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.leftMargin: Theme.spacingS
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "arrow_downward"
|
|
||||||
size: Theme.iconSizeSmall
|
|
||||||
color: !sortAscending ? Theme.primary : Theme.surfaceText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Descending"
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: !sortAscending ? Theme.primary : Theme.surfaceText
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: descMouseArea
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
|
||||||
onClicked: {
|
|
||||||
sortMenu.sortOrderSelected(false);
|
|
||||||
sortMenu.visible = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,236 +1,3 @@
|
|||||||
import QtQuick
|
import qs.DankCommon.Modals.FileBrowser as DankCommon
|
||||||
import Quickshell.Io
|
|
||||||
import qs.Common
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
Rectangle {
|
DankCommon.FileInfo {}
|
||||||
id: root
|
|
||||||
|
|
||||||
property bool showFileInfo: false
|
|
||||||
property int selectedIndex: -1
|
|
||||||
property var sourceFolderModel: null
|
|
||||||
property string currentPath: ""
|
|
||||||
|
|
||||||
height: 200
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Theme.withAlpha(Theme.surfaceContainer, 0.95)
|
|
||||||
border.color: Theme.secondary
|
|
||||||
border.width: 2
|
|
||||||
opacity: showFileInfo ? 1 : 0
|
|
||||||
z: 100
|
|
||||||
|
|
||||||
onShowFileInfoChanged: {
|
|
||||||
if (showFileInfo && currentFileName && currentPath) {
|
|
||||||
const fullPath = currentPath + "/" + currentFileName;
|
|
||||||
fileStatProcess.selectedFilePath = fullPath;
|
|
||||||
fileStatProcess.running = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Process {
|
|
||||||
id: fileStatProcess
|
|
||||||
command: ["stat", "-c", "%y|%A|%s|%n", selectedFilePath]
|
|
||||||
property string selectedFilePath: ""
|
|
||||||
property var fileStats: null
|
|
||||||
running: false
|
|
||||||
|
|
||||||
stdout: StdioCollector {
|
|
||||||
onStreamFinished: {
|
|
||||||
if (text && text.trim()) {
|
|
||||||
const parts = text.trim().split('|');
|
|
||||||
if (parts.length >= 4) {
|
|
||||||
fileStatProcess.fileStats = {
|
|
||||||
"modifiedTime": parts[0],
|
|
||||||
"permissions": parts[1],
|
|
||||||
"size": parseInt(parts[2]) || 0,
|
|
||||||
"fullPath": parts[3]
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onExited: function (exitCode) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
property string currentFileName: ""
|
|
||||||
property bool currentFileIsDir: false
|
|
||||||
property string currentFileExtension: ""
|
|
||||||
|
|
||||||
onCurrentFileNameChanged: {
|
|
||||||
if (showFileInfo && currentFileName && currentPath) {
|
|
||||||
const fullPath = currentPath + "/" + currentFileName;
|
|
||||||
if (fullPath !== fileStatProcess.selectedFilePath) {
|
|
||||||
fileStatProcess.selectedFilePath = fullPath;
|
|
||||||
fileStatProcess.running = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateFileInfo(filePath, fileName, isDirectory) {
|
|
||||||
if (filePath && filePath !== fileStatProcess.selectedFilePath) {
|
|
||||||
fileStatProcess.selectedFilePath = filePath;
|
|
||||||
currentFileName = fileName || "";
|
|
||||||
currentFileIsDir = isDirectory || false;
|
|
||||||
|
|
||||||
let ext = "";
|
|
||||||
if (!isDirectory && fileName) {
|
|
||||||
const lastDot = fileName.lastIndexOf('.');
|
|
||||||
if (lastDot > 0) {
|
|
||||||
ext = fileName.substring(lastDot + 1).toLowerCase();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
currentFileExtension = ext;
|
|
||||||
|
|
||||||
if (showFileInfo) {
|
|
||||||
fileStatProcess.running = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
readonly property var currentFileDisplayData: {
|
|
||||||
if (selectedIndex < 0 || !sourceFolderModel) {
|
|
||||||
return {
|
|
||||||
"exists": false,
|
|
||||||
"name": "No selection",
|
|
||||||
"type": "",
|
|
||||||
"size": "",
|
|
||||||
"modified": "",
|
|
||||||
"permissions": "",
|
|
||||||
"extension": "",
|
|
||||||
"position": "N/A"
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const hasValidFile = currentFileName !== "";
|
|
||||||
return {
|
|
||||||
"exists": hasValidFile,
|
|
||||||
"name": hasValidFile ? currentFileName : "Loading...",
|
|
||||||
"type": currentFileIsDir ? "Directory" : "File",
|
|
||||||
"size": fileStatProcess.fileStats ? formatFileSize(fileStatProcess.fileStats.size) : "Calculating...",
|
|
||||||
"modified": fileStatProcess.fileStats ? formatDateTime(fileStatProcess.fileStats.modifiedTime) : "Loading...",
|
|
||||||
"permissions": fileStatProcess.fileStats ? fileStatProcess.fileStats.permissions : "Loading...",
|
|
||||||
"extension": currentFileExtension,
|
|
||||||
"position": sourceFolderModel ? ((selectedIndex + 1) + " of " + sourceFolderModel.count) : "N/A"
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.margins: Theme.spacingM
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
|
|
||||||
Row {
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingS
|
|
||||||
|
|
||||||
DankIcon {
|
|
||||||
name: "info"
|
|
||||||
size: Theme.iconSize
|
|
||||||
color: Theme.secondary
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: I18n.tr("File Information")
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
font.weight: Font.Medium
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingXS
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: currentFileDisplayData.name
|
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
|
||||||
color: Theme.surfaceText
|
|
||||||
width: parent.width
|
|
||||||
elide: Text.ElideMiddle
|
|
||||||
wrapMode: Text.NoWrap
|
|
||||||
font.weight: Font.Medium
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: currentFileDisplayData.type + (currentFileDisplayData.extension ? " (." + currentFileDisplayData.extension + ")" : "")
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceTextMedium
|
|
||||||
width: parent.width
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: currentFileDisplayData.size
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceTextMedium
|
|
||||||
width: parent.width
|
|
||||||
visible: currentFileDisplayData.exists && !currentFileIsDir
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: currentFileDisplayData.modified
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceTextMedium
|
|
||||||
width: parent.width
|
|
||||||
elide: Text.ElideRight
|
|
||||||
visible: currentFileDisplayData.exists
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: currentFileDisplayData.permissions
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceTextMedium
|
|
||||||
visible: currentFileDisplayData.exists
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: currentFileDisplayData.position
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceTextMedium
|
|
||||||
width: parent.width
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: I18n.tr("F1/I: Toggle • F10: Help")
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceTextMedium
|
|
||||||
anchors.bottom: parent.bottom
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.margins: Theme.spacingM
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
function formatFileSize(bytes) {
|
|
||||||
if (bytes === 0 || !bytes) {
|
|
||||||
return "0 B";
|
|
||||||
}
|
|
||||||
const k = 1024;
|
|
||||||
const sizes = ['B', 'KB', 'MB', 'GB', 'TB'];
|
|
||||||
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
||||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(1)) + ' ' + sizes[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
function formatDateTime(dateTimeString) {
|
|
||||||
if (!dateTimeString) {
|
|
||||||
return "Unknown";
|
|
||||||
}
|
|
||||||
const parts = dateTimeString.split(' ');
|
|
||||||
if (parts.length >= 2) {
|
|
||||||
return parts[0] + " " + parts[1].split('.')[0];
|
|
||||||
}
|
|
||||||
return dateTimeString;
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on opacity {
|
|
||||||
NumberAnimation {
|
|
||||||
duration: Theme.shortDuration
|
|
||||||
easing.type: Theme.standardEasing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,50 +1,3 @@
|
|||||||
import QtQuick
|
import qs.DankCommon.Modals.FileBrowser as DankCommon
|
||||||
import qs.Common
|
|
||||||
import qs.Widgets
|
|
||||||
|
|
||||||
Rectangle {
|
DankCommon.KeyboardHints {}
|
||||||
id: root
|
|
||||||
|
|
||||||
property bool showHints: false
|
|
||||||
|
|
||||||
height: 80
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: Theme.withAlpha(Theme.surfaceContainer, 0.95)
|
|
||||||
border.color: Theme.primary
|
|
||||||
border.width: 2
|
|
||||||
opacity: showHints ? 1 : 0
|
|
||||||
z: 100
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.margins: Theme.spacingS
|
|
||||||
spacing: Theme.spacingXXS
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: I18n.tr("Tab/Shift+Tab: Nav • ←→↑↓: Grid Nav • Enter/Space: Select")
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceText
|
|
||||||
width: parent.width
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: I18n.tr("Alt+←/Backspace: Back • F1/I: File Info • F10: Help • Esc: Close")
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
color: Theme.surfaceText
|
|
||||||
width: parent.width
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on opacity {
|
|
||||||
NumberAnimation {
|
|
||||||
duration: Theme.shortDuration
|
|
||||||
easing.type: Theme.standardEasing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -294,7 +294,7 @@ FocusScope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: I18n.tr("Authentication failed, please try again")
|
text: I18n.tr("Authentication failed - try again")
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: Theme.error
|
color: Theme.error
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|||||||
@@ -494,7 +494,7 @@ FloatingWindow {
|
|||||||
spacing: Theme.spacingXS
|
spacing: Theme.spacingXS
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: I18n.tr("Processes:", "process count label in footer")
|
text: I18n.tr("Processes", "process count label in footer") + ":"
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: Theme.surfaceVariantText
|
color: Theme.surfaceVariantText
|
||||||
}
|
}
|
||||||
@@ -511,7 +511,7 @@ FloatingWindow {
|
|||||||
spacing: Theme.spacingXS
|
spacing: Theme.spacingXS
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: I18n.tr("Uptime:", "uptime label in footer")
|
text: I18n.tr("Uptime", "uptime label in footer") + ":"
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: Theme.surfaceVariantText
|
color: Theme.surfaceVariantText
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ PluginComponent {
|
|||||||
ccWidgetPrimaryText: I18n.tr("Printers")
|
ccWidgetPrimaryText: I18n.tr("Printers")
|
||||||
ccWidgetSecondaryText: {
|
ccWidgetSecondaryText: {
|
||||||
if (CupsService.cupsAvailable && CupsService.getPrintersNum() > 0) {
|
if (CupsService.cupsAvailable && CupsService.getPrintersNum() > 0) {
|
||||||
return I18n.tr("Printers: ") + CupsService.getPrintersNum() + " - " + I18n.tr("Jobs: ") + CupsService.getTotalJobsNum();
|
return I18n.tr("Printers") + ": " + CupsService.getPrintersNum() + " - " + I18n.tr("Jobs") + ": " + CupsService.getTotalJobsNum();
|
||||||
} else {
|
} else {
|
||||||
if (!CupsService.cupsAvailable) {
|
if (!CupsService.cupsAvailable) {
|
||||||
return I18n.tr("Print Server not available");
|
return I18n.tr("Print Server not available");
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ PluginComponent {
|
|||||||
ccWidgetPrimaryText: I18n.tr("VPN")
|
ccWidgetPrimaryText: I18n.tr("VPN")
|
||||||
ccWidgetSecondaryText: {
|
ccWidgetSecondaryText: {
|
||||||
if (vpnActivating)
|
if (vpnActivating)
|
||||||
return I18n.tr("Connecting…");
|
return I18n.tr("Connecting...");
|
||||||
if (!vpnActivated)
|
if (!vpnActivated)
|
||||||
return I18n.tr("Disconnected");
|
return I18n.tr("Disconnected");
|
||||||
const names = DMSNetworkService.activeNames || [];
|
const names = DMSNetworkService.activeNames || [];
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: scanButton.isDiscovering ? I18n.tr("Scanning") : I18n.tr("Scan")
|
text: scanButton.isDiscovering ? I18n.tr("Scanning...") : I18n.tr("Scan")
|
||||||
color: scanButton.adapterEnabled ? Theme.primary : Theme.surfaceVariantText
|
color: scanButton.adapterEnabled ? Theme.primary : Theme.surfaceVariantText
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
font.weight: Font.Medium
|
font.weight: Font.Medium
|
||||||
|
|||||||
@@ -624,7 +624,7 @@ Rectangle {
|
|||||||
spacing: Theme.spacingXS
|
spacing: Theme.spacingXS
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: wifiDelegate.isConnecting ? I18n.tr("Connecting...") + " \u2022" : (wifiDelegate.isConnected ? I18n.tr("Connected") + " \u2022" : (modelData.secured ? I18n.tr("Secured") + " \u2022" : I18n.tr("Open") + " \u2022"))
|
text: wifiDelegate.isConnecting ? I18n.tr("Connecting...") + " \u2022" : (wifiDelegate.isConnected ? I18n.tr("Connected") + " \u2022" : (modelData.secured ? I18n.tr("Secured") + " \u2022" : I18n.tr("Open", "network security type", true) + " \u2022"))
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: wifiDelegate.isConnecting ? Theme.warning : Theme.surfaceVariantText
|
color: wifiDelegate.isConnecting ? Theme.warning : Theme.surfaceVariantText
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ Item {
|
|||||||
readonly property real _barInsetPaddingAuto: _barIsVertical ? Theme.spacingXS : _edgeBaseMargin
|
readonly property real _barInsetPaddingAuto: _barIsVertical ? Theme.spacingXS : _edgeBaseMargin
|
||||||
readonly property real _barInsetPadding: _barInsetPaddingRaw < 0 ? _barInsetPaddingAuto : _barInsetPaddingRaw
|
readonly property real _barInsetPadding: _barInsetPaddingRaw < 0 ? _barInsetPaddingAuto : _barInsetPaddingRaw
|
||||||
// Connected-frame Bar Inset Padding: absolute free-end inset (auto < 0 = frameThickness, 0 = edge-to-edge).
|
// Connected-frame Bar Inset Padding: absolute free-end inset (auto < 0 = frameThickness, 0 = edge-to-edge).
|
||||||
// Any amount beyond the frameThickness baseline is also added at the bar-clearance ends (all ends).
|
// FrameExclusions already moves a free bar end inward by frameThickness so use frame inset to mangage the gap
|
||||||
readonly property real _frameInsetResolved: SettingsData.frameBarInsetPadding < 0 ? SettingsData.frameThickness : SettingsData.frameBarInsetPadding
|
readonly property real _frameInsetResolved: SettingsData.frameBarInsetPadding < 0 ? SettingsData.frameThickness : SettingsData.frameBarInsetPadding
|
||||||
readonly property real _frameInsetExtra: Math.max(0, _frameInsetResolved - SettingsData.frameThickness)
|
readonly property real _frameInsetExtra: Math.max(0, _frameInsetResolved - SettingsData.frameThickness)
|
||||||
|
|
||||||
@@ -47,28 +47,28 @@ Item {
|
|||||||
if (_barIsVertical)
|
if (_barIsVertical)
|
||||||
return _edgeBaseMargin;
|
return _edgeBaseMargin;
|
||||||
if (_usesFrameBarChrome)
|
if (_usesFrameBarChrome)
|
||||||
return hasAdjacentLeftBarLive ? (_edgeBaseMargin + SettingsData.frameBarSize + _frameInsetExtra) : Math.max(0, _frameInsetResolved);
|
return hasAdjacentLeftBarLive ? (_edgeBaseMargin + SettingsData.frameBarSize + _frameInsetExtra) : _frameInsetExtra;
|
||||||
return Math.max(0, _barInsetPadding);
|
return Math.max(0, _barInsetPadding);
|
||||||
}
|
}
|
||||||
readonly property real _rightMargin: {
|
readonly property real _rightMargin: {
|
||||||
if (_barIsVertical)
|
if (_barIsVertical)
|
||||||
return _edgeBaseMargin;
|
return _edgeBaseMargin;
|
||||||
if (_usesFrameBarChrome)
|
if (_usesFrameBarChrome)
|
||||||
return hasAdjacentRightBarLive ? (_edgeBaseMargin + SettingsData.frameBarSize + _frameInsetExtra) : Math.max(0, _frameInsetResolved);
|
return hasAdjacentRightBarLive ? (_edgeBaseMargin + SettingsData.frameBarSize + _frameInsetExtra) : _frameInsetExtra;
|
||||||
return Math.max(0, _barInsetPadding);
|
return Math.max(0, _barInsetPadding);
|
||||||
}
|
}
|
||||||
readonly property real _topMargin: {
|
readonly property real _topMargin: {
|
||||||
if (!_barIsVertical)
|
if (!_barIsVertical)
|
||||||
return 0;
|
return 0;
|
||||||
if (_usesFrameBarChrome)
|
if (_usesFrameBarChrome)
|
||||||
return hasAdjacentTopBarLive ? (outlineThickness + SettingsData.frameThickness + _frameInsetExtra) : Math.max(0, _frameInsetResolved);
|
return hasAdjacentTopBarLive ? (outlineThickness + SettingsData.frameThickness + _frameInsetExtra) : _frameInsetExtra;
|
||||||
return Math.max(0, _barInsetPadding);
|
return Math.max(0, _barInsetPadding);
|
||||||
}
|
}
|
||||||
readonly property real _bottomMargin: {
|
readonly property real _bottomMargin: {
|
||||||
if (!_barIsVertical)
|
if (!_barIsVertical)
|
||||||
return 0;
|
return 0;
|
||||||
if (_usesFrameBarChrome)
|
if (_usesFrameBarChrome)
|
||||||
return hasAdjacentBottomBarLive ? (outlineThickness + SettingsData.frameThickness + _frameInsetExtra) : Math.max(0, _frameInsetResolved);
|
return hasAdjacentBottomBarLive ? (outlineThickness + SettingsData.frameThickness + _frameInsetExtra) : _frameInsetExtra;
|
||||||
return Math.max(0, _barInsetPadding);
|
return Math.max(0, _barInsetPadding);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ import qs.Widgets
|
|||||||
BasePill {
|
BasePill {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
|
property color idleColor: Theme.widgetTextColor
|
||||||
|
property color inhibitColor: Theme.primary
|
||||||
|
|
||||||
content: Component {
|
content: Component {
|
||||||
Item {
|
Item {
|
||||||
implicitWidth: icon.width
|
implicitWidth: icon.width
|
||||||
@@ -17,7 +20,7 @@ BasePill {
|
|||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
name: SessionService.idleInhibited ? "motion_sensor_active" : "motion_sensor_idle"
|
name: SessionService.idleInhibited ? "motion_sensor_active" : "motion_sensor_idle"
|
||||||
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
size: Theme.barIconSize(root.barThickness, -4, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||||
color: Theme.widgetTextColor
|
color: SessionService.idleInhibited ? inhibitColor : idleColor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -329,7 +329,7 @@ Item {
|
|||||||
spacing: Theme.spacingS
|
spacing: Theme.spacingS
|
||||||
|
|
||||||
DankButton {
|
DankButton {
|
||||||
text: root.saving ? I18n.tr("Saving…") : I18n.tr("Save")
|
text: root.saving ? I18n.tr("Saving...") : I18n.tr("Save")
|
||||||
iconName: "check"
|
iconName: "check"
|
||||||
buttonHeight: 32
|
buttonHeight: 32
|
||||||
backgroundColor: Theme.primary
|
backgroundColor: Theme.primary
|
||||||
|
|||||||
@@ -692,14 +692,14 @@ Item {
|
|||||||
spacing: Theme.spacingM
|
spacing: Theme.spacingM
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: I18n.tr("Unsaved Changes")
|
text: I18n.tr("Unsaved changes")
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
font.pixelSize: Theme.fontSizeLarge
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
font.weight: Font.Medium
|
font.weight: Font.Medium
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: root.pendingAction === "new" ? I18n.tr("You have unsaved changes. Save before creating a new file?") : root.pendingAction.startsWith("close_tab_") ? I18n.tr("You have unsaved changes. Save before closing this tab?") : root.pendingAction === "load_file" || root.pendingAction === "open" ? I18n.tr("You have unsaved changes. Save before opening a file?") : I18n.tr("You have unsaved changes. Save before continuing?")
|
text: I18n.tr("You have unsaved changes. Save before continuing?")
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
color: Theme.surfaceTextMedium
|
color: Theme.surfaceTextMedium
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: I18n.tr("Notification Timeouts")
|
text: I18n.tr("Timeouts")
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
font.weight: Font.Medium
|
font.weight: Font.Medium
|
||||||
color: Theme.surfaceVariantText
|
color: Theme.surfaceVariantText
|
||||||
@@ -182,7 +182,6 @@ Rectangle {
|
|||||||
id: lowTimeoutDropdown
|
id: lowTimeoutDropdown
|
||||||
transientSurfaceTracker: root.transientSurfaceTracker
|
transientSurfaceTracker: root.transientSurfaceTracker
|
||||||
text: I18n.tr("Low Priority")
|
text: I18n.tr("Low Priority")
|
||||||
description: I18n.tr("Timeout for low priority notifications")
|
|
||||||
currentValue: getTimeoutText(SettingsData.notificationTimeoutLow)
|
currentValue: getTimeoutText(SettingsData.notificationTimeoutLow)
|
||||||
options: timeoutOptions.map(opt => opt.text)
|
options: timeoutOptions.map(opt => opt.text)
|
||||||
onValueChanged: value => {
|
onValueChanged: value => {
|
||||||
@@ -199,7 +198,6 @@ Rectangle {
|
|||||||
id: normalTimeoutDropdown
|
id: normalTimeoutDropdown
|
||||||
transientSurfaceTracker: root.transientSurfaceTracker
|
transientSurfaceTracker: root.transientSurfaceTracker
|
||||||
text: I18n.tr("Normal Priority")
|
text: I18n.tr("Normal Priority")
|
||||||
description: I18n.tr("Timeout for normal priority notifications")
|
|
||||||
currentValue: getTimeoutText(SettingsData.notificationTimeoutNormal)
|
currentValue: getTimeoutText(SettingsData.notificationTimeoutNormal)
|
||||||
options: timeoutOptions.map(opt => opt.text)
|
options: timeoutOptions.map(opt => opt.text)
|
||||||
onValueChanged: value => {
|
onValueChanged: value => {
|
||||||
@@ -216,7 +214,6 @@ Rectangle {
|
|||||||
id: criticalTimeoutDropdown
|
id: criticalTimeoutDropdown
|
||||||
transientSurfaceTracker: root.transientSurfaceTracker
|
transientSurfaceTracker: root.transientSurfaceTracker
|
||||||
text: I18n.tr("Critical Priority")
|
text: I18n.tr("Critical Priority")
|
||||||
description: I18n.tr("Timeout for critical priority notifications")
|
|
||||||
currentValue: getTimeoutText(SettingsData.notificationTimeoutCritical)
|
currentValue: getTimeoutText(SettingsData.notificationTimeoutCritical)
|
||||||
options: timeoutOptions.map(opt => opt.text)
|
options: timeoutOptions.map(opt => opt.text)
|
||||||
onValueChanged: value => {
|
onValueChanged: value => {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Effects
|
import QtQuick.Effects
|
||||||
import qs.Common
|
import qs.Common
|
||||||
|
import qs.DankCommon.Common as DankCommon
|
||||||
import qs.Services
|
import qs.Services
|
||||||
import qs.Widgets
|
import qs.Widgets
|
||||||
|
|
||||||
@@ -176,14 +177,9 @@ Item {
|
|||||||
text: "DANK LINUX"
|
text: "DANK LINUX"
|
||||||
font.pixelSize: parent.compactLogo ? 32 : 48
|
font.pixelSize: parent.compactLogo ? 32 : 48
|
||||||
font.weight: Font.Bold
|
font.weight: Font.Bold
|
||||||
font.family: interFont.name
|
font.family: DankCommon.Fonts.sans
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
antialiasing: true
|
antialiasing: true
|
||||||
|
|
||||||
FontLoader {
|
|
||||||
id: interFont
|
|
||||||
source: Qt.resolvedUrl("../../assets/fonts/inter/InterVariable.ttf")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,8 +48,9 @@ done
|
|||||||
SettingsCard {
|
SettingsCard {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
iconName: "battery_charging_full"
|
iconName: "battery_charging_full"
|
||||||
title: I18n.tr("Battery Status")
|
title: I18n.tr("Status")
|
||||||
settingKey: "batteryStatusCard"
|
settingKey: "batteryStatusCard"
|
||||||
|
tags: ["battery", "status", "charge", "health"]
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
width: parent.width - Theme.spacingM * 2
|
width: parent.width - Theme.spacingM * 2
|
||||||
@@ -167,8 +168,9 @@ done
|
|||||||
SettingsCard {
|
SettingsCard {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
iconName: "tune"
|
iconName: "tune"
|
||||||
title: I18n.tr("Battery Protection")
|
title: I18n.tr("Protection")
|
||||||
settingKey: "batteryProtection"
|
settingKey: "batteryProtection"
|
||||||
|
tags: ["battery", "protection", "charge", "limit"]
|
||||||
|
|
||||||
SettingsSliderRow {
|
SettingsSliderRow {
|
||||||
settingKey: "batteryChargeLimit"
|
settingKey: "batteryChargeLimit"
|
||||||
@@ -230,8 +232,9 @@ done
|
|||||||
SettingsCard {
|
SettingsCard {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
iconName: "notifications"
|
iconName: "notifications"
|
||||||
title: I18n.tr("Battery Alerts")
|
title: I18n.tr("Alerts")
|
||||||
settingKey: "batteryAlerts"
|
settingKey: "batteryAlerts"
|
||||||
|
tags: ["battery", "alerts", "low", "warning"]
|
||||||
|
|
||||||
SettingsSliderRow {
|
SettingsSliderRow {
|
||||||
settingKey: "batteryLowThreshold"
|
settingKey: "batteryLowThreshold"
|
||||||
@@ -332,7 +335,6 @@ done
|
|||||||
SettingsDropdownRow {
|
SettingsDropdownRow {
|
||||||
settingKey: "acProfileName"
|
settingKey: "acProfileName"
|
||||||
text: I18n.tr("Profile when Plugged In (AC)")
|
text: I18n.tr("Profile when Plugged In (AC)")
|
||||||
description: I18n.tr("Power profile to use when AC power is connected.")
|
|
||||||
options: [I18n.tr("Don't Change"), Theme.getPowerProfileLabel(0), Theme.getPowerProfileLabel(1), Theme.getPowerProfileLabel(2)]
|
options: [I18n.tr("Don't Change"), Theme.getPowerProfileLabel(0), Theme.getPowerProfileLabel(1), Theme.getPowerProfileLabel(2)]
|
||||||
currentValue: {
|
currentValue: {
|
||||||
const val = SettingsData.acProfileName;
|
const val = SettingsData.acProfileName;
|
||||||
@@ -350,7 +352,6 @@ done
|
|||||||
SettingsDropdownRow {
|
SettingsDropdownRow {
|
||||||
settingKey: "batteryProfileName"
|
settingKey: "batteryProfileName"
|
||||||
text: I18n.tr("Profile when on Battery")
|
text: I18n.tr("Profile when on Battery")
|
||||||
description: I18n.tr("Power profile to use when running on battery power.")
|
|
||||||
options: [I18n.tr("Don't Change"), Theme.getPowerProfileLabel(0), Theme.getPowerProfileLabel(1), Theme.getPowerProfileLabel(2)]
|
options: [I18n.tr("Don't Change"), Theme.getPowerProfileLabel(0), Theme.getPowerProfileLabel(1), Theme.getPowerProfileLabel(2)]
|
||||||
currentValue: {
|
currentValue: {
|
||||||
const val = SettingsData.batteryProfileName;
|
const val = SettingsData.batteryProfileName;
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ Item {
|
|||||||
]
|
]
|
||||||
|
|
||||||
readonly property var entryActionKeys: ["copy", "paste", "pin", "edit", "delete"]
|
readonly property var entryActionKeys: ["copy", "paste", "pin", "edit", "delete"]
|
||||||
readonly property var entryActionLabels: [I18n.tr("Copy"), I18n.tr("Paste"), I18n.tr("Pin"), I18n.tr("Edit"), I18n.tr("Delete")]
|
readonly property var entryActionLabels: [I18n.tr("Copy"), I18n.tr("Paste"), I18n.tr("Pin", "pin item action"), I18n.tr("Edit"), I18n.tr("Delete")]
|
||||||
|
|
||||||
function getMaxHistoryText(value) {
|
function getMaxHistoryText(value) {
|
||||||
if (value <= 0)
|
if (value <= 0)
|
||||||
@@ -341,7 +341,6 @@ Item {
|
|||||||
tags: ["clipboard", "entry", "size", "limit"]
|
tags: ["clipboard", "entry", "size", "limit"]
|
||||||
settingKey: "maxEntrySize"
|
settingKey: "maxEntrySize"
|
||||||
text: I18n.tr("Maximum Entry Size")
|
text: I18n.tr("Maximum Entry Size")
|
||||||
description: I18n.tr("Maximum size per clipboard entry")
|
|
||||||
options: root.maxEntrySizeOptions.map(opt => opt.text)
|
options: root.maxEntrySizeOptions.map(opt => opt.text)
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ Item {
|
|||||||
|
|
||||||
function fixLayoutInclude() {
|
function fixLayoutInclude() {
|
||||||
if (readOnly) {
|
if (readOnly) {
|
||||||
ToastService.showWarning(I18n.tr("Hyprland conf mode"), I18n.tr("This install is still using hyprland.conf. Run dms setup to migrate before editing layout settings."), "dms setup", "hyprland-migration");
|
ToastService.showWarning(I18n.tr("Hyprland conf mode"), I18n.tr("This install is still using hyprland.conf. Run dms setup to migrate before changing these settings."), "dms setup", "hyprland-migration");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const paths = getLayoutConfigPaths();
|
const paths = getLayoutConfigPaths();
|
||||||
@@ -208,7 +208,7 @@ awk '$1 == "xray" { print FILENAME ":" FNR; exit }' $files 2>/dev/null`;
|
|||||||
StyledText {
|
StyledText {
|
||||||
text: {
|
text: {
|
||||||
if (warningBox.showLegacy)
|
if (warningBox.showLegacy)
|
||||||
return I18n.tr("This install is still using hyprland.conf. Run dms setup to migrate before editing layout settings.");
|
return I18n.tr("This install is still using hyprland.conf. Run dms setup to migrate before changing these settings.");
|
||||||
if (warningBox.showSetup)
|
if (warningBox.showSetup)
|
||||||
return I18n.tr("Click 'Setup' to create %1 and add include to your compositor config.").arg("dms/layout");
|
return I18n.tr("Click 'Setup' to create %1 and add include to your compositor config.").arg("dms/layout");
|
||||||
return "";
|
return "";
|
||||||
@@ -270,7 +270,7 @@ awk '$1 == "xray" { print FILENAME ":" FNR; exit }' $files 2>/dev/null`;
|
|||||||
SettingsCard {
|
SettingsCard {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
tags: ["niri", "layout", "gaps", "radius", "window", "border"]
|
tags: ["niri", "layout", "gaps", "radius", "window", "border"]
|
||||||
title: I18n.tr("Niri Layout Overrides")
|
title: I18n.tr("%1 Layout Overrides").arg("niri")
|
||||||
settingKey: "niriLayout"
|
settingKey: "niriLayout"
|
||||||
iconName: "layers"
|
iconName: "layers"
|
||||||
visible: CompositorService.isNiri
|
visible: CompositorService.isNiri
|
||||||
@@ -279,7 +279,7 @@ awk '$1 == "xray" { print FILENAME ":" FNR; exit }' $files 2>/dev/null`;
|
|||||||
tags: ["niri", "gaps", "override", "unmanaged"]
|
tags: ["niri", "gaps", "override", "unmanaged"]
|
||||||
settingKey: "niriLayoutGapsMode"
|
settingKey: "niriLayoutGapsMode"
|
||||||
text: I18n.tr("Gaps")
|
text: I18n.tr("Gaps")
|
||||||
description: I18n.tr("Auto matches bar spacing; Off leaves gaps to your niri config")
|
description: I18n.tr("Auto matches bar spacing; Off leaves gaps to your %1 config").arg("niri")
|
||||||
model: [I18n.tr("Auto"), I18n.tr("Custom"), I18n.tr("Off")]
|
model: [I18n.tr("Auto"), I18n.tr("Custom"), I18n.tr("Off")]
|
||||||
currentIndex: {
|
currentIndex: {
|
||||||
if (SettingsData.niriLayoutGapsOverride === -2)
|
if (SettingsData.niriLayoutGapsOverride === -2)
|
||||||
@@ -399,7 +399,7 @@ awk '$1 == "xray" { print FILENAME ":" FNR; exit }' $files 2>/dev/null`;
|
|||||||
SettingsCard {
|
SettingsCard {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
tags: ["hyprland", "layout", "gaps", "radius", "window", "border", "rounding"]
|
tags: ["hyprland", "layout", "gaps", "radius", "window", "border", "rounding"]
|
||||||
title: I18n.tr("Hyprland Layout Overrides")
|
title: I18n.tr("%1 Layout Overrides").arg("Hyprland")
|
||||||
settingKey: "hyprlandLayout"
|
settingKey: "hyprlandLayout"
|
||||||
iconName: "crop_square"
|
iconName: "crop_square"
|
||||||
visible: CompositorService.isHyprland
|
visible: CompositorService.isHyprland
|
||||||
@@ -408,7 +408,7 @@ awk '$1 == "xray" { print FILENAME ":" FNR; exit }' $files 2>/dev/null`;
|
|||||||
tags: ["hyprland", "gaps", "override", "inner", "outer", "unmanaged"]
|
tags: ["hyprland", "gaps", "override", "inner", "outer", "unmanaged"]
|
||||||
settingKey: "hyprlandLayoutGapsMode"
|
settingKey: "hyprlandLayoutGapsMode"
|
||||||
text: I18n.tr("Gaps")
|
text: I18n.tr("Gaps")
|
||||||
description: I18n.tr("Auto matches bar spacing; Off leaves gaps to your Hyprland config")
|
description: I18n.tr("Auto matches bar spacing; Off leaves gaps to your %1 config").arg("Hyprland")
|
||||||
model: [I18n.tr("Auto"), I18n.tr("Custom"), I18n.tr("Off")]
|
model: [I18n.tr("Auto"), I18n.tr("Custom"), I18n.tr("Off")]
|
||||||
currentIndex: {
|
currentIndex: {
|
||||||
if (SettingsData.hyprlandLayoutGapsOverride === -2)
|
if (SettingsData.hyprlandLayoutGapsOverride === -2)
|
||||||
@@ -492,7 +492,6 @@ awk '$1 == "xray" { print FILENAME ":" FNR; exit }' $files 2>/dev/null`;
|
|||||||
tags: ["hyprland", "border", "override"]
|
tags: ["hyprland", "border", "override"]
|
||||||
settingKey: "hyprlandLayoutBorderSizeEnabled"
|
settingKey: "hyprlandLayoutBorderSizeEnabled"
|
||||||
text: I18n.tr("Override Border Size")
|
text: I18n.tr("Override Border Size")
|
||||||
description: I18n.tr("Use custom border size")
|
|
||||||
checked: SettingsData.hyprlandLayoutBorderSize >= 0
|
checked: SettingsData.hyprlandLayoutBorderSize >= 0
|
||||||
onToggled: checked => {
|
onToggled: checked => {
|
||||||
if (checked) {
|
if (checked) {
|
||||||
@@ -551,7 +550,7 @@ awk '$1 == "xray" { print FILENAME ":" FNR; exit }' $files 2>/dev/null`;
|
|||||||
SettingsCard {
|
SettingsCard {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
tags: ["mangowc", "mango", "dwl", "layout", "gaps", "radius", "window", "border"]
|
tags: ["mangowc", "mango", "dwl", "layout", "gaps", "radius", "window", "border"]
|
||||||
title: I18n.tr("MangoWC Layout Overrides")
|
title: I18n.tr("%1 Layout Overrides").arg("MangoWC")
|
||||||
settingKey: "mangoLayout"
|
settingKey: "mangoLayout"
|
||||||
iconName: "crop_square"
|
iconName: "crop_square"
|
||||||
visible: CompositorService.isMango
|
visible: CompositorService.isMango
|
||||||
@@ -560,7 +559,7 @@ awk '$1 == "xray" { print FILENAME ":" FNR; exit }' $files 2>/dev/null`;
|
|||||||
tags: ["mangowc", "mango", "gaps", "override", "inner", "outer", "unmanaged"]
|
tags: ["mangowc", "mango", "gaps", "override", "inner", "outer", "unmanaged"]
|
||||||
settingKey: "mangoLayoutGapsMode"
|
settingKey: "mangoLayoutGapsMode"
|
||||||
text: I18n.tr("Gaps")
|
text: I18n.tr("Gaps")
|
||||||
description: I18n.tr("Auto matches bar spacing; Off leaves gaps to your MangoWC config")
|
description: I18n.tr("Auto matches bar spacing; Off leaves gaps to your %1 config").arg("MangoWC")
|
||||||
model: [I18n.tr("Auto"), I18n.tr("Custom"), I18n.tr("Off")]
|
model: [I18n.tr("Auto"), I18n.tr("Custom"), I18n.tr("Off")]
|
||||||
currentIndex: {
|
currentIndex: {
|
||||||
if (SettingsData.mangoLayoutGapsOverride === -2)
|
if (SettingsData.mangoLayoutGapsOverride === -2)
|
||||||
@@ -644,7 +643,6 @@ awk '$1 == "xray" { print FILENAME ":" FNR; exit }' $files 2>/dev/null`;
|
|||||||
tags: ["mangowc", "mango", "border", "override"]
|
tags: ["mangowc", "mango", "border", "override"]
|
||||||
settingKey: "mangoLayoutBorderSizeEnabled"
|
settingKey: "mangoLayoutBorderSizeEnabled"
|
||||||
text: I18n.tr("Override Border Size")
|
text: I18n.tr("Override Border Size")
|
||||||
description: I18n.tr("Use custom border size")
|
|
||||||
checked: SettingsData.mangoLayoutBorderSize >= 0
|
checked: SettingsData.mangoLayoutBorderSize >= 0
|
||||||
onToggled: checked => {
|
onToggled: checked => {
|
||||||
if (checked) {
|
if (checked) {
|
||||||
|
|||||||
@@ -266,7 +266,7 @@ Item {
|
|||||||
|
|
||||||
SettingsCard {
|
SettingsCard {
|
||||||
iconName: "dashboard"
|
iconName: "dashboard"
|
||||||
title: I18n.tr("Bar Configurations")
|
title: I18n.tr("Configurations")
|
||||||
settingKey: "barConfigurations"
|
settingKey: "barConfigurations"
|
||||||
visible: !dankBarTab.appearanceOnly
|
visible: !dankBarTab.appearanceOnly
|
||||||
|
|
||||||
@@ -490,7 +490,7 @@ Item {
|
|||||||
DankButtonGroup {
|
DankButtonGroup {
|
||||||
id: positionButtonGroup
|
id: positionButtonGroup
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
model: [I18n.tr("Top"), I18n.tr("Bottom"), I18n.tr("Left"), I18n.tr("Right")]
|
model: [I18n.tr("Top", "screen edge position"), I18n.tr("Bottom", "screen edge position"), I18n.tr("Left", "screen edge position"), I18n.tr("Right", "screen edge position")]
|
||||||
currentIndex: {
|
currentIndex: {
|
||||||
selectedBarId;
|
selectedBarId;
|
||||||
const config = SettingsData.getBarConfig(selectedBarId);
|
const config = SettingsData.getBarConfig(selectedBarId);
|
||||||
@@ -820,7 +820,6 @@ Item {
|
|||||||
id: barTransparencySlider
|
id: barTransparencySlider
|
||||||
visible: !SettingsData.frameEnabled
|
visible: !SettingsData.frameEnabled
|
||||||
text: I18n.tr("Bar Opacity")
|
text: I18n.tr("Bar Opacity")
|
||||||
description: I18n.tr("Controls opacity of the bar background")
|
|
||||||
value: (selectedBarConfig?.transparency ?? 1.0) * 100
|
value: (selectedBarConfig?.transparency ?? 1.0) * 100
|
||||||
minimum: 0
|
minimum: 0
|
||||||
maximum: 100
|
maximum: 100
|
||||||
@@ -843,7 +842,6 @@ Item {
|
|||||||
SettingsSliderRow {
|
SettingsSliderRow {
|
||||||
id: widgetTransparencySlider
|
id: widgetTransparencySlider
|
||||||
text: I18n.tr("Widget Opacity")
|
text: I18n.tr("Widget Opacity")
|
||||||
description: I18n.tr("Controls opacity of widget backgrounds")
|
|
||||||
value: (selectedBarConfig?.widgetTransparency ?? 1.0) * 100
|
value: (selectedBarConfig?.widgetTransparency ?? 1.0) * 100
|
||||||
minimum: 0
|
minimum: 0
|
||||||
maximum: 100
|
maximum: 100
|
||||||
@@ -1463,7 +1461,6 @@ Item {
|
|||||||
SettingsSliderRow {
|
SettingsSliderRow {
|
||||||
id: borderOpacitySlider
|
id: borderOpacitySlider
|
||||||
text: I18n.tr("Opacity")
|
text: I18n.tr("Opacity")
|
||||||
description: I18n.tr("Controls opacity of the border")
|
|
||||||
value: (selectedBarConfig?.borderOpacity ?? 1.0) * 100
|
value: (selectedBarConfig?.borderOpacity ?? 1.0) * 100
|
||||||
minimum: 0
|
minimum: 0
|
||||||
maximum: 100
|
maximum: 100
|
||||||
@@ -1558,7 +1555,6 @@ Item {
|
|||||||
SettingsSliderRow {
|
SettingsSliderRow {
|
||||||
id: widgetOutlineOpacitySlider
|
id: widgetOutlineOpacitySlider
|
||||||
text: I18n.tr("Opacity")
|
text: I18n.tr("Opacity")
|
||||||
description: I18n.tr("Controls opacity of the widget outline")
|
|
||||||
value: (selectedBarConfig?.widgetOutlineOpacity ?? 1.0) * 100
|
value: (selectedBarConfig?.widgetOutlineOpacity ?? 1.0) * 100
|
||||||
minimum: 0
|
minimum: 0
|
||||||
maximum: 100
|
maximum: 100
|
||||||
@@ -1667,7 +1663,6 @@ Item {
|
|||||||
SettingsSliderRow {
|
SettingsSliderRow {
|
||||||
visible: shadowCard.shadowActive
|
visible: shadowCard.shadowActive
|
||||||
text: I18n.tr("Opacity")
|
text: I18n.tr("Opacity")
|
||||||
description: I18n.tr("Controls opacity of the shadow layer")
|
|
||||||
minimum: 10
|
minimum: 10
|
||||||
maximum: 100
|
maximum: 100
|
||||||
unit: "%"
|
unit: "%"
|
||||||
|
|||||||
@@ -312,7 +312,6 @@ Item {
|
|||||||
text: I18n.tr("Calendar", "Calendar")
|
text: I18n.tr("Calendar", "Calendar")
|
||||||
category: root.appCategory.Calendar
|
category: root.appCategory.Calendar
|
||||||
tags: ["calendar", "events"]
|
tags: ["calendar", "events"]
|
||||||
description: I18n.tr("Manages calendar events", "Manages calendar events")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -330,7 +329,6 @@ Item {
|
|||||||
text: I18n.tr("PDF Reader", "PDF Reader")
|
text: I18n.tr("PDF Reader", "PDF Reader")
|
||||||
category: root.appCategory.PDFReader
|
category: root.appCategory.PDFReader
|
||||||
tags: ["pdf", "reader"]
|
tags: ["pdf", "reader"]
|
||||||
description: I18n.tr("For reading PDF files", "For reading PDF files")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -341,13 +339,11 @@ Item {
|
|||||||
text: I18n.tr("Image Viewer", "Image Viewer")
|
text: I18n.tr("Image Viewer", "Image Viewer")
|
||||||
category: root.appCategory.ImageViewer
|
category: root.appCategory.ImageViewer
|
||||||
tags: ["image", "viewer"]
|
tags: ["image", "viewer"]
|
||||||
description: I18n.tr("Opens image files", "Opens image files")
|
|
||||||
}
|
}
|
||||||
AppSelector {
|
AppSelector {
|
||||||
text: I18n.tr("Video Player", "Video Player")
|
text: I18n.tr("Video Player", "Video Player")
|
||||||
category: root.appCategory.VideoPlayer
|
category: root.appCategory.VideoPlayer
|
||||||
tags: ["video", "player"]
|
tags: ["video", "player"]
|
||||||
description: I18n.tr("Plays video files", "Plays video files")
|
|
||||||
}
|
}
|
||||||
AppSelector {
|
AppSelector {
|
||||||
text: I18n.tr("Music Player", "Music Player")
|
text: I18n.tr("Music Player", "Music Player")
|
||||||
|
|||||||
@@ -264,6 +264,24 @@ Singleton {
|
|||||||
callback(true);
|
callback(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function publishActiveProfileModes() {
|
||||||
|
const compositor = CompositorService.compositor;
|
||||||
|
const profileId = SettingsData.getActiveDisplayProfile(compositor);
|
||||||
|
const profile = profileId ? validatedProfiles[profileId] : null;
|
||||||
|
const outputs = profile?.outputs || {};
|
||||||
|
const modes = {};
|
||||||
|
|
||||||
|
for (const outputId in outputs) {
|
||||||
|
const mode = outputs[outputId]?.mode;
|
||||||
|
if (mode)
|
||||||
|
modes[outputId] = {
|
||||||
|
"mode": mode
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsData.setActiveDisplayProfileModes(compositor, modes);
|
||||||
|
}
|
||||||
|
|
||||||
function generateProfileId() {
|
function generateProfileId() {
|
||||||
return "profile_" + Date.now() + "_" + Math.random().toString(36).slice(2, 9);
|
return "profile_" + Date.now() + "_" + Math.random().toString(36).slice(2, 9);
|
||||||
}
|
}
|
||||||
@@ -362,6 +380,7 @@ Singleton {
|
|||||||
};
|
};
|
||||||
validatedProfiles = updated;
|
validatedProfiles = updated;
|
||||||
matchedProfile = findMatchingProfile();
|
matchedProfile = findMatchingProfile();
|
||||||
|
publishActiveProfileModes();
|
||||||
profileSaved(profileId, profileName);
|
profileSaved(profileId, profileName);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -543,6 +562,7 @@ Singleton {
|
|||||||
};
|
};
|
||||||
const onWriteSuccess = () => {
|
const onWriteSuccess = () => {
|
||||||
SettingsData.setActiveDisplayProfile(CompositorService.compositor, configId);
|
SettingsData.setActiveDisplayProfile(CompositorService.compositor, configId);
|
||||||
|
publishActiveProfileModes();
|
||||||
if (isManual) {
|
if (isManual) {
|
||||||
profilesLoading = false;
|
profilesLoading = false;
|
||||||
profileActivated(configId, profileName);
|
profileActivated(configId, profileName);
|
||||||
@@ -586,6 +606,7 @@ Singleton {
|
|||||||
writeMonitorsJson(data, null);
|
writeMonitorsJson(data, null);
|
||||||
validatedProfiles = validated;
|
validatedProfiles = validated;
|
||||||
matchedProfile = findMatchingProfile();
|
matchedProfile = findMatchingProfile();
|
||||||
|
publishActiveProfileModes();
|
||||||
if (!profilesReady) {
|
if (!profilesReady) {
|
||||||
profilesReady = true;
|
profilesReady = true;
|
||||||
applyAutoConfig();
|
applyAutoConfig();
|
||||||
@@ -633,6 +654,7 @@ Singleton {
|
|||||||
currentOutputSet = buildCurrentOutputSet();
|
currentOutputSet = buildCurrentOutputSet();
|
||||||
matchedProfile = findMatchingProfile();
|
matchedProfile = findMatchingProfile();
|
||||||
SettingsData.setActiveDisplayProfile(CompositorService.compositor, id);
|
SettingsData.setActiveDisplayProfile(CompositorService.compositor, id);
|
||||||
|
publishActiveProfileModes();
|
||||||
profileSaved(id, profileName);
|
profileSaved(id, profileName);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -678,6 +700,7 @@ Singleton {
|
|||||||
delete updated[profileId];
|
delete updated[profileId];
|
||||||
validatedProfiles = updated;
|
validatedProfiles = updated;
|
||||||
matchedProfile = findMatchingProfile();
|
matchedProfile = findMatchingProfile();
|
||||||
|
publishActiveProfileModes();
|
||||||
profileDeleted(profileId);
|
profileDeleted(profileId);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -890,6 +913,14 @@ Singleton {
|
|||||||
target: CompositorService
|
target: CompositorService
|
||||||
function onCompositorChanged() {
|
function onCompositorChanged() {
|
||||||
root.checkIncludeStatus();
|
root.checkIncludeStatus();
|
||||||
|
root.publishActiveProfileModes();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: SettingsData
|
||||||
|
function onActiveDisplayProfileChanged() {
|
||||||
|
root.publishActiveProfileModes();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1518,7 +1549,7 @@ Singleton {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function showHyprlandReadOnlyWarning() {
|
function showHyprlandReadOnlyWarning() {
|
||||||
ToastService.showWarning(I18n.tr("Hyprland conf mode"), I18n.tr("This install is still using hyprland.conf. Run dms setup to migrate before editing display settings."), "dms setup", "display-config");
|
ToastService.showWarning(I18n.tr("Hyprland conf mode"), I18n.tr("This install is still using hyprland.conf. Run dms setup to migrate before changing these settings."), "dms setup", "display-config");
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildOutputsMap() {
|
function buildOutputsMap() {
|
||||||
@@ -2251,7 +2282,16 @@ Singleton {
|
|||||||
"name": match.entry.name || "",
|
"name": match.entry.name || "",
|
||||||
"outputs": outputConfigs
|
"outputs": outputConfigs
|
||||||
};
|
};
|
||||||
writeMonitorsJson(data, null);
|
writeMonitorsJson(data, success => {
|
||||||
|
if (!success || !profileId)
|
||||||
|
return;
|
||||||
|
const updated = JSON.parse(JSON.stringify(validatedProfiles));
|
||||||
|
if (updated[profileId]) {
|
||||||
|
updated[profileId].outputs = outputConfigs;
|
||||||
|
validatedProfiles = updated;
|
||||||
|
publishActiveProfileModes();
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
clearPendingChanges();
|
clearPendingChanges();
|
||||||
@@ -2639,7 +2679,7 @@ Singleton {
|
|||||||
function getTransformLabel(transform) {
|
function getTransformLabel(transform) {
|
||||||
switch (transform) {
|
switch (transform) {
|
||||||
case "Normal":
|
case "Normal":
|
||||||
return I18n.tr("Normal");
|
return I18n.tr("Normal", "display rotation option", true);
|
||||||
case "90":
|
case "90":
|
||||||
return I18n.tr("90°");
|
return I18n.tr("90°");
|
||||||
case "180":
|
case "180":
|
||||||
@@ -2655,12 +2695,12 @@ Singleton {
|
|||||||
case "Flipped270":
|
case "Flipped270":
|
||||||
return I18n.tr("Flipped 270°");
|
return I18n.tr("Flipped 270°");
|
||||||
default:
|
default:
|
||||||
return I18n.tr("Normal");
|
return I18n.tr("Normal", "display rotation option", true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTransformValue(label) {
|
function getTransformValue(label) {
|
||||||
if (label === I18n.tr("Normal"))
|
if (label === I18n.tr("Normal", "display rotation option", true))
|
||||||
return "Normal";
|
return "Normal";
|
||||||
if (label === I18n.tr("90°"))
|
if (label === I18n.tr("90°"))
|
||||||
return "90";
|
return "90";
|
||||||
|
|||||||
@@ -60,9 +60,9 @@ StyledRect {
|
|||||||
StyledText {
|
StyledText {
|
||||||
text: {
|
text: {
|
||||||
if (root.showLegacy)
|
if (root.showLegacy)
|
||||||
return I18n.tr("This install is still using hyprland.conf. Run dms setup to migrate before editing display settings.");
|
return I18n.tr("This install is still using hyprland.conf. Run dms setup to migrate before changing these settings.");
|
||||||
if (root.showSetup)
|
if (root.showSetup)
|
||||||
return I18n.tr("Click 'Setup' to create the outputs config and add include to your compositor config.");
|
return I18n.tr("Click 'Setup' to create %1 and add include to your compositor config.").arg("dms/outputs");
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
|
|||||||
@@ -93,21 +93,21 @@ Column {
|
|||||||
|
|
||||||
currentValue: {
|
currentValue: {
|
||||||
if (!hotCornersData)
|
if (!hotCornersData)
|
||||||
return I18n.tr("Inherit");
|
return I18n.tr("Inherit", "inherit from global setting");
|
||||||
if (hotCornersData.off)
|
if (hotCornersData.off)
|
||||||
return I18n.tr("Off");
|
return I18n.tr("Off");
|
||||||
const corners = hotCornersData.corners || [];
|
const corners = hotCornersData.corners || [];
|
||||||
if (corners.length === 0)
|
if (corners.length === 0)
|
||||||
return I18n.tr("Inherit");
|
return I18n.tr("Inherit", "inherit from global setting");
|
||||||
if (corners.length === 4)
|
if (corners.length === 4)
|
||||||
return I18n.tr("All");
|
return I18n.tr("All");
|
||||||
return I18n.tr("Select...");
|
return I18n.tr("Select...");
|
||||||
}
|
}
|
||||||
options: [I18n.tr("Inherit"), I18n.tr("Off"), I18n.tr("All"), I18n.tr("Select...")]
|
options: [I18n.tr("Inherit", "inherit from global setting"), I18n.tr("Off"), I18n.tr("All"), I18n.tr("Select...")]
|
||||||
|
|
||||||
onValueChanged: value => {
|
onValueChanged: value => {
|
||||||
switch (value) {
|
switch (value) {
|
||||||
case I18n.tr("Inherit"):
|
case I18n.tr("Inherit", "inherit from global setting"):
|
||||||
DisplayConfigState.setNiriSetting(root.outputData, root.outputName, "hotCorners", null);
|
DisplayConfigState.setNiriSetting(root.outputData, root.outputName, "hotCorners", null);
|
||||||
break;
|
break;
|
||||||
case I18n.tr("Off"):
|
case I18n.tr("Off"):
|
||||||
@@ -232,7 +232,7 @@ Column {
|
|||||||
DankTextField {
|
DankTextField {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: 40
|
height: 40
|
||||||
placeholderText: I18n.tr("Inherit")
|
placeholderText: I18n.tr("Inherit", "inherit from global setting")
|
||||||
enabled: !settingsColumn.isDisabled
|
enabled: !settingsColumn.isDisabled
|
||||||
text: {
|
text: {
|
||||||
const layout = DisplayConfigState.getNiriSetting(root.outputData, root.outputName, "layout", null);
|
const layout = DisplayConfigState.getNiriSetting(root.outputData, root.outputName, "layout", null);
|
||||||
@@ -270,7 +270,7 @@ Column {
|
|||||||
DankTextField {
|
DankTextField {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: 40
|
height: 40
|
||||||
placeholderText: I18n.tr("Inherit")
|
placeholderText: I18n.tr("Inherit", "inherit from global setting")
|
||||||
enabled: !settingsColumn.isDisabled
|
enabled: !settingsColumn.isDisabled
|
||||||
text: {
|
text: {
|
||||||
const layout = DisplayConfigState.getNiriSetting(root.outputData, root.outputName, "layout", null);
|
const layout = DisplayConfigState.getNiriSetting(root.outputData, root.outputName, "layout", null);
|
||||||
@@ -321,7 +321,7 @@ Column {
|
|||||||
DankTextField {
|
DankTextField {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: 40
|
height: 40
|
||||||
placeholderText: I18n.tr("Inherit")
|
placeholderText: I18n.tr("Inherit", "inherit from global setting")
|
||||||
enabled: !settingsColumn.isDisabled
|
enabled: !settingsColumn.isDisabled
|
||||||
text: {
|
text: {
|
||||||
const layout = DisplayConfigState.getNiriSetting(root.outputData, root.outputName, "layout", null);
|
const layout = DisplayConfigState.getNiriSetting(root.outputData, root.outputName, "layout", null);
|
||||||
|
|||||||
@@ -308,7 +308,7 @@ StyledRect {
|
|||||||
return DisplayConfigState.getTransformLabel(pendingTransform);
|
return DisplayConfigState.getTransformLabel(pendingTransform);
|
||||||
return DisplayConfigState.getTransformLabel(root.outputData?.logical?.transform ?? "Normal");
|
return DisplayConfigState.getTransformLabel(root.outputData?.logical?.transform ?? "Normal");
|
||||||
}
|
}
|
||||||
options: [I18n.tr("Normal"), I18n.tr("90°"), I18n.tr("180°"), I18n.tr("270°"), I18n.tr("Flipped"), I18n.tr("Flipped 90°"), I18n.tr("Flipped 180°"), I18n.tr("Flipped 270°")]
|
options: [I18n.tr("Normal", "display rotation option", true), I18n.tr("90°"), I18n.tr("180°"), I18n.tr("270°"), I18n.tr("Flipped"), I18n.tr("Flipped 90°"), I18n.tr("Flipped 180°"), I18n.tr("Flipped 270°")]
|
||||||
onValueChanged: value => DisplayConfigState.setPendingChange(root.outputName, "transform", DisplayConfigState.getTransformValue(value))
|
onValueChanged: value => DisplayConfigState.setPendingChange(root.outputName, "transform", DisplayConfigState.getTransformValue(value))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -399,7 +399,6 @@ Item {
|
|||||||
DankToggle {
|
DankToggle {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
text: I18n.tr("All displays")
|
text: I18n.tr("All displays")
|
||||||
description: I18n.tr("Show on all connected displays")
|
|
||||||
checked: {
|
checked: {
|
||||||
var prefs = root.getScreenPreferences(parent.componentId);
|
var prefs = root.getScreenPreferences(parent.componentId);
|
||||||
return prefs.includes("all") || (typeof prefs[0] === "string" && prefs[0] === "all");
|
return prefs.includes("all") || (typeof prefs[0] === "string" && prefs[0] === "all");
|
||||||
@@ -420,7 +419,6 @@ Item {
|
|||||||
DankToggle {
|
DankToggle {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
text: I18n.tr("Focused Monitor Only")
|
text: I18n.tr("Focused Monitor Only")
|
||||||
description: I18n.tr("Show notifications only on the currently focused monitor")
|
|
||||||
visible: parent.componentId === "notifications"
|
visible: parent.componentId === "notifications"
|
||||||
checked: SettingsData.notificationFocusedMonitor
|
checked: SettingsData.notificationFocusedMonitor
|
||||||
onToggled: checked => SettingsData.set("notificationFocusedMonitor", checked)
|
onToggled: checked => SettingsData.set("notificationFocusedMonitor", checked)
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ Item {
|
|||||||
SettingsCard {
|
SettingsCard {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
iconName: "dock_to_bottom"
|
iconName: "dock_to_bottom"
|
||||||
title: I18n.tr("Dock Visibility")
|
title: I18n.tr("Visibility")
|
||||||
settingKey: "dockVisibility"
|
settingKey: "dockVisibility"
|
||||||
|
|
||||||
SettingsToggleRow {
|
SettingsToggleRow {
|
||||||
@@ -228,7 +228,6 @@ Item {
|
|||||||
settingKey: "dockShowOverflowBadge"
|
settingKey: "dockShowOverflowBadge"
|
||||||
tags: ["dock", "overflow", "badge", "count", "indicator"]
|
tags: ["dock", "overflow", "badge", "count", "indicator"]
|
||||||
text: I18n.tr("Show Overflow Badge Count")
|
text: I18n.tr("Show Overflow Badge Count")
|
||||||
description: I18n.tr("Displays count when overflow is active")
|
|
||||||
checked: SettingsData.dockShowOverflowBadge
|
checked: SettingsData.dockShowOverflowBadge
|
||||||
onToggled: checked => SettingsData.set("dockShowOverflowBadge", checked)
|
onToggled: checked => SettingsData.set("dockShowOverflowBadge", checked)
|
||||||
}
|
}
|
||||||
@@ -461,7 +460,7 @@ Item {
|
|||||||
if (!PopoutService.colorPickerModal)
|
if (!PopoutService.colorPickerModal)
|
||||||
return;
|
return;
|
||||||
PopoutService.colorPickerModal.selectedColor = SettingsData.dockLauncherLogoColorOverride;
|
PopoutService.colorPickerModal.selectedColor = SettingsData.dockLauncherLogoColorOverride;
|
||||||
PopoutService.colorPickerModal.pickerTitle = I18n.tr("Choose Dock Launcher Logo Color");
|
PopoutService.colorPickerModal.pickerTitle = I18n.tr("Choose Launcher Logo Color");
|
||||||
PopoutService.colorPickerModal.onColorSelectedCallback = function (selectedColor) {
|
PopoutService.colorPickerModal.onColorSelectedCallback = function (selectedColor) {
|
||||||
SettingsData.set("dockLauncherLogoColorOverride", selectedColor);
|
SettingsData.set("dockLauncherLogoColorOverride", selectedColor);
|
||||||
};
|
};
|
||||||
@@ -683,7 +682,6 @@ Item {
|
|||||||
|
|
||||||
SettingsButtonGroupRow {
|
SettingsButtonGroupRow {
|
||||||
text: I18n.tr("Border Color")
|
text: I18n.tr("Border Color")
|
||||||
description: I18n.tr("Choose the border accent color")
|
|
||||||
visible: SettingsData.dockBorderEnabled
|
visible: SettingsData.dockBorderEnabled
|
||||||
model: [I18n.tr("Surface", "color option"), I18n.tr("Secondary", "color option"), I18n.tr("Primary", "color option")]
|
model: [I18n.tr("Surface", "color option"), I18n.tr("Secondary", "color option"), I18n.tr("Primary", "color option")]
|
||||||
buttonPadding: Theme.spacingS
|
buttonPadding: Theme.spacingS
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ Item {
|
|||||||
SettingsCard {
|
SettingsCard {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
iconName: "frame_source"
|
iconName: "frame_source"
|
||||||
title: I18n.tr("Frame")
|
title: I18n.tr("General")
|
||||||
settingKey: "frameEnabled"
|
settingKey: "frameEnabled"
|
||||||
|
|
||||||
SettingsToggleRow {
|
SettingsToggleRow {
|
||||||
|
|||||||
@@ -122,7 +122,6 @@ Item {
|
|||||||
tags: ["gamma", "day", "temperature", "kelvin", "color"]
|
tags: ["gamma", "day", "temperature", "kelvin", "color"]
|
||||||
width: parent.width - parent.leftPadding - parent.rightPadding
|
width: parent.width - parent.leftPadding - parent.rightPadding
|
||||||
text: I18n.tr("Day Temperature")
|
text: I18n.tr("Day Temperature")
|
||||||
description: I18n.tr("Color temperature for day time")
|
|
||||||
minimum: SessionData.nightModeTemperature
|
minimum: SessionData.nightModeTemperature
|
||||||
maximum: 10000
|
maximum: 10000
|
||||||
step: 100
|
step: 100
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ Item {
|
|||||||
|
|
||||||
function confirmResetBind(key, remainingKey) {
|
function confirmResetBind(key, remainingKey) {
|
||||||
removeBindConfirm.showWithOptions({
|
removeBindConfirm.showWithOptions({
|
||||||
title: I18n.tr("Reset to Default?"),
|
title: I18n.tr("Reset to default"),
|
||||||
message: I18n.tr("Drop your override for %1 so the DMS default action re-applies?").arg(key),
|
message: I18n.tr("Drop your override for %1 so the DMS default action re-applies?").arg(key),
|
||||||
confirmText: I18n.tr("Reset"),
|
confirmText: I18n.tr("Reset"),
|
||||||
confirmColor: Theme.primary,
|
confirmColor: Theme.primary,
|
||||||
@@ -397,7 +397,7 @@ Item {
|
|||||||
StyledText {
|
StyledText {
|
||||||
text: {
|
text: {
|
||||||
if (warningBox.showLegacy)
|
if (warningBox.showLegacy)
|
||||||
return I18n.tr("This install is still using hyprland.conf. Run dms setup to migrate before editing shortcuts in Settings.");
|
return I18n.tr("This install is still using hyprland.conf. Run dms setup to migrate before changing these settings.");
|
||||||
if (warningBox.showSetup)
|
if (warningBox.showSetup)
|
||||||
return I18n.tr("Click 'Setup' to create %1 and add include to your compositor config.").arg("dms/binds");
|
return I18n.tr("Click 'Setup' to create %1 and add include to your compositor config.").arg("dms/binds");
|
||||||
if (warningBox.showWarning) {
|
if (warningBox.showWarning) {
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: !root.keybindsAvailable ? I18n.tr("Bind the spotlight IPC action in your compositor config.") : SettingsData.connectedFrameModeActive ? I18n.tr("Opens the connected launcher in Connected Frame Mode.") : I18n.tr("Follows the default launcher choice selected above.")
|
text: !root.keybindsAvailable ? I18n.tr("Bind the %1 IPC action in your compositor config.").arg("spotlight") : SettingsData.connectedFrameModeActive ? I18n.tr("Opens the connected launcher in Connected Frame Mode.") : I18n.tr("Follows the default launcher choice selected above.")
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: Theme.surfaceVariantText
|
color: Theme.surfaceVariantText
|
||||||
width: parent.width
|
width: parent.width
|
||||||
@@ -173,7 +173,6 @@ Item {
|
|||||||
settingKey: "launcherUseOverlayLayer"
|
settingKey: "launcherUseOverlayLayer"
|
||||||
tags: ["launcher", "fullscreen", "overlay", "layer"]
|
tags: ["launcher", "fullscreen", "overlay", "layer"]
|
||||||
text: I18n.tr("Use Overlay Layer", "launcher layer toggle: use Wayland overlay layer")
|
text: I18n.tr("Use Overlay Layer", "launcher layer toggle: use Wayland overlay layer")
|
||||||
description: I18n.tr("Use the overlay layer when opening the launcher")
|
|
||||||
checked: SettingsData.launcherUseOverlayLayer
|
checked: SettingsData.launcherUseOverlayLayer
|
||||||
onToggled: checked => SettingsData.set("launcherUseOverlayLayer", checked)
|
onToggled: checked => SettingsData.set("launcherUseOverlayLayer", checked)
|
||||||
}
|
}
|
||||||
@@ -233,7 +232,7 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: !root.keybindsAvailable ? I18n.tr("Bind the spotlight-bar IPC action in your compositor config.") : I18n.tr("Uses the spotlight-bar IPC action and always opens the minimal bar.")
|
text: !root.keybindsAvailable ? I18n.tr("Bind the %1 IPC action in your compositor config.").arg("spotlight-bar") : I18n.tr("Uses the spotlight-bar IPC action and always opens the minimal bar.")
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: Theme.surfaceVariantText
|
color: Theme.surfaceVariantText
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ Item {
|
|||||||
SettingsCard {
|
SettingsCard {
|
||||||
tab: "locale"
|
tab: "locale"
|
||||||
tags: ["locale", "language", "country"]
|
tags: ["locale", "language", "country"]
|
||||||
title: I18n.tr("Locale Settings")
|
title: I18n.tr("General")
|
||||||
iconName: "language"
|
iconName: "language"
|
||||||
|
|
||||||
SettingsDropdownRow {
|
SettingsDropdownRow {
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ Item {
|
|||||||
SettingsCard {
|
SettingsCard {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
iconName: "music_note"
|
iconName: "music_note"
|
||||||
title: I18n.tr("Media Player Settings")
|
title: I18n.tr("General")
|
||||||
settingKey: "mediaPlayer"
|
settingKey: "mediaPlayer"
|
||||||
|
|
||||||
SettingsToggleRow {
|
SettingsToggleRow {
|
||||||
@@ -146,7 +146,7 @@ Item {
|
|||||||
SettingsCard {
|
SettingsCard {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
iconName: "do_not_disturb_on"
|
iconName: "do_not_disturb_on"
|
||||||
title: I18n.tr("Excluded Media Players")
|
title: I18n.tr("Excluded Players")
|
||||||
settingKey: "mediaExcludePlayers"
|
settingKey: "mediaExcludePlayers"
|
||||||
tags: ["media", "music", "exclude", "ignore", "player", "mpris"]
|
tags: ["media", "music", "exclude", "ignore", "player", "mpris"]
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ Item {
|
|||||||
SettingsCard {
|
SettingsCard {
|
||||||
tab: "mux"
|
tab: "mux"
|
||||||
tags: ["mux", "multiplexer", "tmux", "zellij", "type"]
|
tags: ["mux", "multiplexer", "tmux", "zellij", "type"]
|
||||||
title: I18n.tr("Multiplexer")
|
title: I18n.tr("General")
|
||||||
iconName: "terminal"
|
iconName: "terminal"
|
||||||
|
|
||||||
SettingsDropdownRow {
|
SettingsDropdownRow {
|
||||||
@@ -33,7 +33,6 @@ Item {
|
|||||||
tags: ["mux", "multiplexer", "tmux", "zellij", "type", "backend"]
|
tags: ["mux", "multiplexer", "tmux", "zellij", "type", "backend"]
|
||||||
settingKey: "muxType"
|
settingKey: "muxType"
|
||||||
text: I18n.tr("Multiplexer Type")
|
text: I18n.tr("Multiplexer Type")
|
||||||
description: I18n.tr("Terminal multiplexer backend to use")
|
|
||||||
options: root.muxTypeOptions
|
options: root.muxTypeOptions
|
||||||
currentValue: SettingsData.muxType
|
currentValue: SettingsData.muxType
|
||||||
onValueChanged: value => SettingsData.set("muxType", value)
|
onValueChanged: value => SettingsData.set("muxType", value)
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ Item {
|
|||||||
SettingsCard {
|
SettingsCard {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
title: I18n.tr("Network Status")
|
title: I18n.tr("Status")
|
||||||
iconName: "lan"
|
iconName: "lan"
|
||||||
settingKey: "networkStatus"
|
settingKey: "networkStatus"
|
||||||
tags: ["status", "network", "connectivity", "internet"]
|
tags: ["status", "network", "connectivity", "internet"]
|
||||||
@@ -128,7 +128,7 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: I18n.tr("Primary")
|
text: I18n.tr("Primary", "primary network connection label", true)
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
color: Theme.surfaceVariantText
|
color: Theme.surfaceVariantText
|
||||||
visible: NetworkService.primaryConnection.length > 0
|
visible: NetworkService.primaryConnection.length > 0
|
||||||
|
|||||||
@@ -318,7 +318,7 @@ Item {
|
|||||||
visible: NetworkService.wifiConnected
|
visible: NetworkService.wifiConnected
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: I18n.tr("Signal:")
|
text: I18n.tr("Signal") + ":"
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
color: Theme.surfaceVariantText
|
color: Theme.surfaceVariantText
|
||||||
width: 100
|
width: 100
|
||||||
@@ -563,7 +563,7 @@ Item {
|
|||||||
spacing: Theme.spacingXS
|
spacing: Theme.spacingXS
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: isConnecting ? I18n.tr("Connecting...") : (isConnected ? I18n.tr("Connected") : (modelData.secured ? I18n.tr("Secured") : I18n.tr("Open")))
|
text: isConnecting ? I18n.tr("Connecting...") : (isConnected ? I18n.tr("Connected") : (modelData.secured ? I18n.tr("Secured") : I18n.tr("Open", "network security type", true)))
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: isConnecting ? Theme.warning : (isConnected ? Theme.primary : Theme.surfaceVariantText)
|
color: isConnecting ? Theme.warning : (isConnected ? Theme.primary : Theme.surfaceVariantText)
|
||||||
}
|
}
|
||||||
@@ -770,7 +770,7 @@ Item {
|
|||||||
});
|
});
|
||||||
fields.push({
|
fields.push({
|
||||||
label: I18n.tr("Security"),
|
label: I18n.tr("Security"),
|
||||||
value: net.secured ? (net.enterprise ? I18n.tr("Enterprise") : I18n.tr("WPA/WPA2")) : I18n.tr("Open")
|
value: net.secured ? (net.enterprise ? I18n.tr("Enterprise") : I18n.tr("WPA/WPA2")) : I18n.tr("Open", "network security type", true)
|
||||||
});
|
});
|
||||||
|
|
||||||
return fields;
|
return fields;
|
||||||
@@ -966,7 +966,7 @@ Item {
|
|||||||
text: {
|
text: {
|
||||||
if (isConnecting)
|
if (isConnecting)
|
||||||
return I18n.tr("Connecting...");
|
return I18n.tr("Connecting...");
|
||||||
const parts = [isConnected ? I18n.tr("Connected") : (modelData.secured ? I18n.tr("Secured") : I18n.tr("Open"))];
|
const parts = [isConnected ? I18n.tr("Connected") : (modelData.secured ? I18n.tr("Secured") : I18n.tr("Open", "network security type", true))];
|
||||||
parts.push(isOutOfRange ? I18n.tr("Unavailable") : (modelData.signal || 0) + "%");
|
parts.push(isOutOfRange ? I18n.tr("Unavailable") : (modelData.signal || 0) + "%");
|
||||||
if (modelData.hidden || false)
|
if (modelData.hidden || false)
|
||||||
parts.push(I18n.tr("Hidden"));
|
parts.push(I18n.tr("Hidden"));
|
||||||
@@ -1131,7 +1131,7 @@ Item {
|
|||||||
});
|
});
|
||||||
fields.push({
|
fields.push({
|
||||||
label: I18n.tr("Security"),
|
label: I18n.tr("Security"),
|
||||||
value: net.secured ? (net.enterprise ? I18n.tr("Enterprise") : I18n.tr("WPA/WPA2")) : I18n.tr("Open")
|
value: net.secured ? (net.enterprise ? I18n.tr("Enterprise") : I18n.tr("WPA/WPA2")) : I18n.tr("Open", "network security type", true)
|
||||||
});
|
});
|
||||||
|
|
||||||
return fields;
|
return fields;
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ Item {
|
|||||||
SettingsCard {
|
SettingsCard {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
iconName: "notifications"
|
iconName: "notifications"
|
||||||
title: I18n.tr("Notification Popups")
|
title: I18n.tr("Popups")
|
||||||
settingKey: "notificationPopups"
|
settingKey: "notificationPopups"
|
||||||
|
|
||||||
// Font size selectors for summary and body
|
// Font size selectors for summary and body
|
||||||
@@ -211,7 +211,6 @@ Item {
|
|||||||
settingKey: "notificationSummaryFontSize"
|
settingKey: "notificationSummaryFontSize"
|
||||||
tags: ["notification", "font", "summary", "size"]
|
tags: ["notification", "font", "summary", "size"]
|
||||||
text: I18n.tr("Summary Font Size")
|
text: I18n.tr("Summary Font Size")
|
||||||
description: I18n.tr("Set the font size for notification summary text")
|
|
||||||
options: [I18n.tr("Unset"), "10", "12", "14", "16", "18"]
|
options: [I18n.tr("Unset"), "10", "12", "14", "16", "18"]
|
||||||
currentValue: (SettingsData.notificationSummaryFontSize || I18n.tr("Unset")).toString()
|
currentValue: (SettingsData.notificationSummaryFontSize || I18n.tr("Unset")).toString()
|
||||||
onValueChanged: value => {
|
onValueChanged: value => {
|
||||||
@@ -349,7 +348,6 @@ Item {
|
|||||||
settingKey: "notificationFocusedMonitor"
|
settingKey: "notificationFocusedMonitor"
|
||||||
tags: ["notification", "popup", "focused", "monitor", "display", "screen", "active"]
|
tags: ["notification", "popup", "focused", "monitor", "display", "screen", "active"]
|
||||||
text: I18n.tr("Focused Monitor Only")
|
text: I18n.tr("Focused Monitor Only")
|
||||||
description: I18n.tr("Show notification popups only on the currently focused monitor")
|
|
||||||
checked: SettingsData.notificationFocusedMonitor
|
checked: SettingsData.notificationFocusedMonitor
|
||||||
onToggled: checked => SettingsData.set("notificationFocusedMonitor", checked)
|
onToggled: checked => SettingsData.set("notificationFocusedMonitor", checked)
|
||||||
}
|
}
|
||||||
@@ -454,7 +452,7 @@ Item {
|
|||||||
id: notificationRulesCard
|
id: notificationRulesCard
|
||||||
width: parent.width
|
width: parent.width
|
||||||
iconName: "rule_settings"
|
iconName: "rule_settings"
|
||||||
title: I18n.tr("Notification Rules")
|
title: I18n.tr("Rules")
|
||||||
settingKey: "notificationRules"
|
settingKey: "notificationRules"
|
||||||
tags: ["notification", "rules", "mute", "ignore", "priority", "regex", "history"]
|
tags: ["notification", "rules", "mute", "ignore", "priority", "regex", "history"]
|
||||||
collapsible: true
|
collapsible: true
|
||||||
@@ -519,7 +517,7 @@ Item {
|
|||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
id: ruleLabel
|
id: ruleLabel
|
||||||
text: I18n.tr("Rule") + " " + (index + 1)
|
text: I18n.tr("Rule %1").arg(index + 1)
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: Theme.surfaceVariantText
|
color: Theme.surfaceVariantText
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
@@ -794,7 +792,7 @@ Item {
|
|||||||
SettingsCard {
|
SettingsCard {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
iconName: "timer"
|
iconName: "timer"
|
||||||
title: I18n.tr("Notification Timeouts")
|
title: I18n.tr("Timeouts")
|
||||||
settingKey: "notificationTimeouts"
|
settingKey: "notificationTimeouts"
|
||||||
collapsible: true
|
collapsible: true
|
||||||
expanded: false
|
expanded: false
|
||||||
@@ -803,7 +801,6 @@ Item {
|
|||||||
settingKey: "notificationTimeoutLow"
|
settingKey: "notificationTimeoutLow"
|
||||||
tags: ["notification", "timeout", "low", "priority", "duration"]
|
tags: ["notification", "timeout", "low", "priority", "duration"]
|
||||||
text: I18n.tr("Low Priority")
|
text: I18n.tr("Low Priority")
|
||||||
description: I18n.tr("Timeout for low priority notifications")
|
|
||||||
currentValue: root.getTimeoutText(SettingsData.notificationTimeoutLow)
|
currentValue: root.getTimeoutText(SettingsData.notificationTimeoutLow)
|
||||||
options: root.timeoutOptions.map(opt => opt.text)
|
options: root.timeoutOptions.map(opt => opt.text)
|
||||||
onValueChanged: value => {
|
onValueChanged: value => {
|
||||||
@@ -820,7 +817,6 @@ Item {
|
|||||||
settingKey: "notificationTimeoutNormal"
|
settingKey: "notificationTimeoutNormal"
|
||||||
tags: ["notification", "timeout", "normal", "priority", "duration"]
|
tags: ["notification", "timeout", "normal", "priority", "duration"]
|
||||||
text: I18n.tr("Normal Priority")
|
text: I18n.tr("Normal Priority")
|
||||||
description: I18n.tr("Timeout for normal priority notifications")
|
|
||||||
currentValue: root.getTimeoutText(SettingsData.notificationTimeoutNormal)
|
currentValue: root.getTimeoutText(SettingsData.notificationTimeoutNormal)
|
||||||
options: root.timeoutOptions.map(opt => opt.text)
|
options: root.timeoutOptions.map(opt => opt.text)
|
||||||
onValueChanged: value => {
|
onValueChanged: value => {
|
||||||
@@ -837,7 +833,6 @@ Item {
|
|||||||
settingKey: "notificationTimeoutCritical"
|
settingKey: "notificationTimeoutCritical"
|
||||||
tags: ["notification", "timeout", "critical", "priority", "duration"]
|
tags: ["notification", "timeout", "critical", "priority", "duration"]
|
||||||
text: I18n.tr("Critical Priority")
|
text: I18n.tr("Critical Priority")
|
||||||
description: I18n.tr("Timeout for critical priority notifications")
|
|
||||||
currentValue: root.getTimeoutText(SettingsData.notificationTimeoutCritical)
|
currentValue: root.getTimeoutText(SettingsData.notificationTimeoutCritical)
|
||||||
options: root.timeoutOptions.map(opt => opt.text)
|
options: root.timeoutOptions.map(opt => opt.text)
|
||||||
onValueChanged: value => {
|
onValueChanged: value => {
|
||||||
|
|||||||
@@ -91,7 +91,6 @@ Item {
|
|||||||
SettingsToggleRow {
|
SettingsToggleRow {
|
||||||
settingKey: "osdVolumeEnabled"
|
settingKey: "osdVolumeEnabled"
|
||||||
text: I18n.tr("Volume")
|
text: I18n.tr("Volume")
|
||||||
description: I18n.tr("Show on-screen display when volume changes")
|
|
||||||
checked: SettingsData.osdVolumeEnabled
|
checked: SettingsData.osdVolumeEnabled
|
||||||
onToggled: checked => SettingsData.set("osdVolumeEnabled", checked)
|
onToggled: checked => SettingsData.set("osdVolumeEnabled", checked)
|
||||||
}
|
}
|
||||||
@@ -99,7 +98,6 @@ Item {
|
|||||||
SettingsToggleRow {
|
SettingsToggleRow {
|
||||||
settingKey: "osdMediaVolumeEnabled"
|
settingKey: "osdMediaVolumeEnabled"
|
||||||
text: I18n.tr("Media Volume")
|
text: I18n.tr("Media Volume")
|
||||||
description: I18n.tr("Show on-screen display when media player volume changes")
|
|
||||||
checked: SettingsData.osdMediaVolumeEnabled
|
checked: SettingsData.osdMediaVolumeEnabled
|
||||||
onToggled: checked => SettingsData.set("osdMediaVolumeEnabled", checked)
|
onToggled: checked => SettingsData.set("osdMediaVolumeEnabled", checked)
|
||||||
}
|
}
|
||||||
@@ -107,7 +105,6 @@ Item {
|
|||||||
SettingsToggleRow {
|
SettingsToggleRow {
|
||||||
settingKey: "osdMediaPlaybackEnabled"
|
settingKey: "osdMediaPlaybackEnabled"
|
||||||
text: I18n.tr("Media Playback")
|
text: I18n.tr("Media Playback")
|
||||||
description: I18n.tr("Show on-screen display when media player status changes")
|
|
||||||
checked: SettingsData.osdMediaPlaybackEnabled
|
checked: SettingsData.osdMediaPlaybackEnabled
|
||||||
onToggled: checked => SettingsData.set("osdMediaPlaybackEnabled", checked)
|
onToggled: checked => SettingsData.set("osdMediaPlaybackEnabled", checked)
|
||||||
}
|
}
|
||||||
@@ -115,7 +112,6 @@ Item {
|
|||||||
SettingsToggleRow {
|
SettingsToggleRow {
|
||||||
settingKey: "osdBrightnessEnabled"
|
settingKey: "osdBrightnessEnabled"
|
||||||
text: I18n.tr("Brightness")
|
text: I18n.tr("Brightness")
|
||||||
description: I18n.tr("Show on-screen display when brightness changes")
|
|
||||||
checked: SettingsData.osdBrightnessEnabled
|
checked: SettingsData.osdBrightnessEnabled
|
||||||
onToggled: checked => SettingsData.set("osdBrightnessEnabled", checked)
|
onToggled: checked => SettingsData.set("osdBrightnessEnabled", checked)
|
||||||
}
|
}
|
||||||
@@ -123,7 +119,6 @@ Item {
|
|||||||
SettingsToggleRow {
|
SettingsToggleRow {
|
||||||
settingKey: "osdIdleInhibitorEnabled"
|
settingKey: "osdIdleInhibitorEnabled"
|
||||||
text: I18n.tr("Idle Inhibitor")
|
text: I18n.tr("Idle Inhibitor")
|
||||||
description: I18n.tr("Show on-screen display when idle inhibitor state changes")
|
|
||||||
checked: SettingsData.osdIdleInhibitorEnabled
|
checked: SettingsData.osdIdleInhibitorEnabled
|
||||||
onToggled: checked => SettingsData.set("osdIdleInhibitorEnabled", checked)
|
onToggled: checked => SettingsData.set("osdIdleInhibitorEnabled", checked)
|
||||||
}
|
}
|
||||||
@@ -131,7 +126,6 @@ Item {
|
|||||||
SettingsToggleRow {
|
SettingsToggleRow {
|
||||||
settingKey: "osdMicMuteEnabled"
|
settingKey: "osdMicMuteEnabled"
|
||||||
text: I18n.tr("Microphone Mute")
|
text: I18n.tr("Microphone Mute")
|
||||||
description: I18n.tr("Show on-screen display when microphone is muted/unmuted")
|
|
||||||
checked: SettingsData.osdMicMuteEnabled
|
checked: SettingsData.osdMicMuteEnabled
|
||||||
onToggled: checked => SettingsData.set("osdMicMuteEnabled", checked)
|
onToggled: checked => SettingsData.set("osdMicMuteEnabled", checked)
|
||||||
}
|
}
|
||||||
@@ -139,7 +133,6 @@ Item {
|
|||||||
SettingsToggleRow {
|
SettingsToggleRow {
|
||||||
settingKey: "osdCapsLockEnabled"
|
settingKey: "osdCapsLockEnabled"
|
||||||
text: I18n.tr("Caps Lock")
|
text: I18n.tr("Caps Lock")
|
||||||
description: I18n.tr("Show on-screen display when caps lock state changes")
|
|
||||||
checked: SettingsData.osdCapsLockEnabled
|
checked: SettingsData.osdCapsLockEnabled
|
||||||
onToggled: checked => SettingsData.set("osdCapsLockEnabled", checked)
|
onToggled: checked => SettingsData.set("osdCapsLockEnabled", checked)
|
||||||
}
|
}
|
||||||
@@ -147,7 +140,6 @@ Item {
|
|||||||
SettingsToggleRow {
|
SettingsToggleRow {
|
||||||
settingKey: "osdPowerProfileEnabled"
|
settingKey: "osdPowerProfileEnabled"
|
||||||
text: I18n.tr("Power Profile")
|
text: I18n.tr("Power Profile")
|
||||||
description: I18n.tr("Show on-screen display when power profile changes")
|
|
||||||
checked: SettingsData.osdPowerProfileEnabled
|
checked: SettingsData.osdPowerProfileEnabled
|
||||||
onToggled: checked => SettingsData.set("osdPowerProfileEnabled", checked)
|
onToggled: checked => SettingsData.set("osdPowerProfileEnabled", checked)
|
||||||
}
|
}
|
||||||
@@ -155,7 +147,6 @@ Item {
|
|||||||
SettingsToggleRow {
|
SettingsToggleRow {
|
||||||
settingKey: "osdAudioOutputEnabled"
|
settingKey: "osdAudioOutputEnabled"
|
||||||
text: I18n.tr("Audio Output Switch")
|
text: I18n.tr("Audio Output Switch")
|
||||||
description: I18n.tr("Show on-screen display when cycling audio output devices")
|
|
||||||
checked: SettingsData.osdAudioOutputEnabled
|
checked: SettingsData.osdAudioOutputEnabled
|
||||||
onToggled: checked => SettingsData.set("osdAudioOutputEnabled", checked)
|
onToggled: checked => SettingsData.set("osdAudioOutputEnabled", checked)
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user