mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-05-15 08:42:47 -04:00
Compare commits
40 Commits
blur
..
5324201c26
| Author | SHA1 | Date | |
|---|---|---|---|
| 5324201c26 | |||
| bd4eb0cea1 | |||
| 4fa09d0cad | |||
| 7fcec82161 | |||
| 9b8c8de4da | |||
| b760dc1c0d | |||
| 60cc82bc1d | |||
| 9b1aa5c9d7 | |||
| cb195fbe90 | |||
| 9cde1b0b5e | |||
| 214e4cf738 | |||
| 842071e2a7 | |||
| ce12eba0d8 | |||
| 32c063aab8 | |||
| 37f92677cf | |||
| 13e8130858 | |||
| f6e590a518 | |||
| 3194fc3fbe | |||
| 3318864ece | |||
| e224417593 | |||
| 3f7f6c5d2c | |||
| 0b88055742 | |||
| 2b0826e397 | |||
| 7db04c9660 | |||
| 14d1e1d985 | |||
| 903ab1e61d | |||
| 5982655539 | |||
| 1021a210cf | |||
| e34edb15bb | |||
| 61ee5f4336 | |||
| ce2a92ec27 | |||
| 66ce79b9bf | |||
| 30dd640314 | |||
| 28f9aabcd9 | |||
| 3d9bd73336 | |||
| 3497d5f523 | |||
| 8ef1d95e65 | |||
| e9aeb9ac60 | |||
| fb02f7294d | |||
| f15d49d80a |
@@ -1,26 +1,13 @@
|
|||||||
repos:
|
repos:
|
||||||
- repo: local
|
- repo: https://github.com/golangci/golangci-lint
|
||||||
|
rev: v2.10.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: golangci-lint-fmt
|
- id: golangci-lint-fmt
|
||||||
name: golangci-lint-fmt
|
|
||||||
entry: go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.11.3 fmt
|
|
||||||
language: system
|
|
||||||
require_serial: true
|
require_serial: true
|
||||||
types: [go]
|
|
||||||
pass_filenames: false
|
|
||||||
- id: golangci-lint-full
|
- id: golangci-lint-full
|
||||||
name: golangci-lint-full
|
|
||||||
entry: go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.11.3 run --fix
|
|
||||||
language: system
|
|
||||||
require_serial: true
|
|
||||||
types: [go]
|
|
||||||
pass_filenames: false
|
|
||||||
- id: golangci-lint-config-verify
|
- id: golangci-lint-config-verify
|
||||||
name: golangci-lint-config-verify
|
- repo: local
|
||||||
entry: go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.11.3 config verify
|
hooks:
|
||||||
language: system
|
|
||||||
files: \.golangci\.(?:yml|yaml|toml|json)
|
|
||||||
pass_filenames: false
|
|
||||||
- id: go-test
|
- id: go-test
|
||||||
name: go test
|
name: go test
|
||||||
entry: go test ./...
|
entry: go test ./...
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"github.com/AvengeMedia/DankMaterialShell/core/internal/blur"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
)
|
||||||
|
|
||||||
|
var blurCmd = &cobra.Command{
|
||||||
|
Use: "blur",
|
||||||
|
Short: "Background blur utilities",
|
||||||
|
}
|
||||||
|
|
||||||
|
var blurCheckCmd = &cobra.Command{
|
||||||
|
Use: "check",
|
||||||
|
Short: "Check if the compositor supports background blur (ext-background-effect-v1)",
|
||||||
|
Args: cobra.NoArgs,
|
||||||
|
Run: runBlurCheck,
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
blurCmd.AddCommand(blurCheckCmd)
|
||||||
|
}
|
||||||
|
|
||||||
|
func runBlurCheck(cmd *cobra.Command, args []string) {
|
||||||
|
supported, err := blur.ProbeSupport()
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
switch supported {
|
||||||
|
case true:
|
||||||
|
fmt.Println("supported")
|
||||||
|
default:
|
||||||
|
fmt.Println("unsupported")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -525,5 +525,6 @@ func getCommonCommands() []*cobra.Command {
|
|||||||
configCmd,
|
configCmd,
|
||||||
dlCmd,
|
dlCmd,
|
||||||
randrCmd,
|
randrCmd,
|
||||||
|
blurCmd,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -820,10 +820,14 @@ func checkOptionalDependencies() []checkResult {
|
|||||||
results = append(results, checkImageFormatPlugins()...)
|
results = append(results, checkImageFormatPlugins()...)
|
||||||
|
|
||||||
terminals := []string{"ghostty", "kitty", "alacritty", "foot", "wezterm"}
|
terminals := []string{"ghostty", "kitty", "alacritty", "foot", "wezterm"}
|
||||||
if idx := slices.IndexFunc(terminals, utils.CommandExists); idx >= 0 {
|
terminals = slices.DeleteFunc(terminals, func(t string) bool {
|
||||||
results = append(results, checkResult{catOptionalFeatures, "Terminal", statusOK, terminals[idx], "", optionalFeaturesURL})
|
return !utils.CommandExists(t)
|
||||||
|
})
|
||||||
|
|
||||||
|
if len(terminals) > 0 {
|
||||||
|
results = append(results, checkResult{catOptionalFeatures, "Terminal", statusOK, strings.Join(terminals, ", "), "", optionalFeaturesURL})
|
||||||
} else {
|
} else {
|
||||||
results = append(results, checkResult{catOptionalFeatures, "Terminal", statusWarn, "None found", "Install ghostty, kitty, or alacritty", optionalFeaturesURL})
|
results = append(results, checkResult{catOptionalFeatures, "Terminal", statusWarn, "None found", "Install ghostty, kitty, foot or alacritty", optionalFeaturesURL})
|
||||||
}
|
}
|
||||||
|
|
||||||
networkResult, err := network.DetectNetworkStack()
|
networkResult, err := network.DetectNetworkStack()
|
||||||
|
|||||||
@@ -109,16 +109,41 @@ func updateArchLinux() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var packageName string
|
var packageName string
|
||||||
if isArchPackageInstalled("dms-shell-bin") {
|
var isAUR bool
|
||||||
packageName = "dms-shell-bin"
|
if isArchPackageInstalled("dms-shell") {
|
||||||
|
packageName = "dms-shell"
|
||||||
} else if isArchPackageInstalled("dms-shell-git") {
|
} else if isArchPackageInstalled("dms-shell-git") {
|
||||||
packageName = "dms-shell-git"
|
packageName = "dms-shell-git"
|
||||||
|
isAUR = true
|
||||||
|
} else if isArchPackageInstalled("dms-shell-bin") {
|
||||||
|
packageName = "dms-shell-bin"
|
||||||
|
isAUR = true
|
||||||
} else {
|
} else {
|
||||||
fmt.Println("Info: Neither dms-shell-bin nor dms-shell-git package found.")
|
fmt.Println("Info: No dms-shell package found.")
|
||||||
fmt.Println("Info: Falling back to git-based update method...")
|
fmt.Println("Info: Falling back to git-based update method...")
|
||||||
return updateOtherDistros()
|
return updateOtherDistros()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !isAUR {
|
||||||
|
fmt.Printf("This will update %s using pacman.\n", packageName)
|
||||||
|
if !confirmUpdate() {
|
||||||
|
return errdefs.ErrUpdateCancelled
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Printf("\nRunning: sudo pacman -S %s\n", packageName)
|
||||||
|
cmd := exec.Command("sudo", "pacman", "-S", "--noconfirm", packageName)
|
||||||
|
cmd.Stdin = os.Stdin
|
||||||
|
cmd.Stdout = os.Stdout
|
||||||
|
cmd.Stderr = os.Stderr
|
||||||
|
if err := cmd.Run(); err != nil {
|
||||||
|
fmt.Printf("Error: Failed to update using pacman: %v\n", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Println("dms successfully updated")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
var helper string
|
var helper string
|
||||||
var updateCmd *exec.Cmd
|
var updateCmd *exec.Cmd
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
"github.com/AvengeMedia/DankMaterialShell/core/internal/clipboard"
|
||||||
"github.com/AvengeMedia/DankMaterialShell/core/internal/log"
|
"github.com/AvengeMedia/DankMaterialShell/core/internal/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -30,7 +31,9 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
if os.Geteuid() == 0 {
|
clipboard.MaybeServeAndExit()
|
||||||
|
|
||||||
|
if os.Geteuid() == 0 && !isReadOnlyCommand(os.Args) {
|
||||||
log.Fatal("This program should not be run as root. Exiting.")
|
log.Fatal("This program should not be run as root. Exiting.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
"github.com/AvengeMedia/DankMaterialShell/core/internal/clipboard"
|
||||||
"github.com/AvengeMedia/DankMaterialShell/core/internal/log"
|
"github.com/AvengeMedia/DankMaterialShell/core/internal/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -27,7 +28,9 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
if os.Geteuid() == 0 {
|
clipboard.MaybeServeAndExit()
|
||||||
|
|
||||||
|
if os.Geteuid() == 0 && !isReadOnlyCommand(os.Args) {
|
||||||
log.Fatal("This program should not be run as root. Exiting.")
|
log.Fatal("This program should not be run as root. Exiting.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,22 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// isReadOnlyCommand returns true if the CLI args indicate a command that is
|
||||||
|
// safe to run as root (e.g. shell completion, help).
|
||||||
|
func isReadOnlyCommand(args []string) bool {
|
||||||
|
for _, arg := range args[1:] {
|
||||||
|
if strings.HasPrefix(arg, "-") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
switch arg {
|
||||||
|
case "completion", "help", "__complete":
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
func isArchPackageInstalled(packageName string) bool {
|
func isArchPackageInstalled(packageName string) bool {
|
||||||
cmd := exec.Command("pacman", "-Q", packageName)
|
cmd := exec.Command("pacman", "-Q", packageName)
|
||||||
err := cmd.Run()
|
err := cmd.Run()
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package blur
|
||||||
|
|
||||||
|
import (
|
||||||
|
wlhelpers "github.com/AvengeMedia/DankMaterialShell/core/internal/wayland/client"
|
||||||
|
client "github.com/AvengeMedia/DankMaterialShell/core/pkg/go-wayland/wayland/client"
|
||||||
|
)
|
||||||
|
|
||||||
|
const extBackgroundEffectInterface = "ext_background_effect_manager_v1"
|
||||||
|
|
||||||
|
func ProbeSupport() (bool, error) {
|
||||||
|
display, err := client.Connect("")
|
||||||
|
if err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
defer display.Context().Close()
|
||||||
|
|
||||||
|
registry, err := display.GetRegistry()
|
||||||
|
if err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
|
||||||
|
found := false
|
||||||
|
registry.SetGlobalHandler(func(e client.RegistryGlobalEvent) {
|
||||||
|
switch e.Interface {
|
||||||
|
case extBackgroundEffectInterface:
|
||||||
|
found = true
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
if err := wlhelpers.Roundtrip(display, display.Context()); err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return found, nil
|
||||||
|
}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
package clipboard
|
package clipboard
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
@@ -13,66 +12,142 @@ import (
|
|||||||
wlclient "github.com/AvengeMedia/DankMaterialShell/core/pkg/go-wayland/wayland/client"
|
wlclient "github.com/AvengeMedia/DankMaterialShell/core/pkg/go-wayland/wayland/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const envServe = "_DMS_CLIPBOARD_SERVE"
|
||||||
|
const envMime = "_DMS_CLIPBOARD_MIME"
|
||||||
|
const envPasteOnce = "_DMS_CLIPBOARD_PASTE_ONCE"
|
||||||
|
const envCacheFile = "_DMS_CLIPBOARD_CACHE"
|
||||||
|
|
||||||
|
// MaybeServeAndExit intercepts before cobra when re-exec'd as a clipboard
|
||||||
|
// child. Reads source data into memory, deletes any cache file, then serves.
|
||||||
|
func MaybeServeAndExit() {
|
||||||
|
if os.Getenv(envServe) == "" {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
mimeType := os.Getenv(envMime)
|
||||||
|
pasteOnce := os.Getenv(envPasteOnce) == "1"
|
||||||
|
cachePath := os.Getenv(envCacheFile)
|
||||||
|
|
||||||
|
var data []byte
|
||||||
|
var err error
|
||||||
|
|
||||||
|
switch {
|
||||||
|
case cachePath != "":
|
||||||
|
data, err = os.ReadFile(cachePath)
|
||||||
|
os.Remove(cachePath)
|
||||||
|
default:
|
||||||
|
data, err = io.ReadAll(os.Stdin)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintf(os.Stderr, "clipboard: read source: %v\n", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := serveClipboard(data, mimeType, pasteOnce); err != nil {
|
||||||
|
fmt.Fprintf(os.Stderr, "clipboard: serve: %v\n", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
os.Exit(0)
|
||||||
|
}
|
||||||
|
|
||||||
func Copy(data []byte, mimeType string) error {
|
func Copy(data []byte, mimeType string) error {
|
||||||
return CopyReader(bytes.NewReader(data), mimeType, false, false)
|
return copyForkCached(data, mimeType, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
func CopyOpts(data []byte, mimeType string, foreground, pasteOnce bool) error {
|
func CopyOpts(data []byte, mimeType string, foreground, pasteOnce bool) error {
|
||||||
if foreground {
|
if foreground {
|
||||||
return copyServeWithWriter(func(writer io.Writer) error {
|
return serveClipboard(data, mimeType, pasteOnce)
|
||||||
total := 0
|
|
||||||
for total < len(data) {
|
|
||||||
n, err := writer.Write(data[total:])
|
|
||||||
total += n
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if total != len(data) {
|
|
||||||
return io.ErrShortWrite
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}, mimeType, pasteOnce)
|
|
||||||
}
|
}
|
||||||
return CopyReader(bytes.NewReader(data), mimeType, foreground, pasteOnce)
|
return copyForkCached(data, mimeType, pasteOnce)
|
||||||
}
|
}
|
||||||
|
|
||||||
func CopyReader(data io.Reader, mimeType string, foreground, pasteOnce bool) error {
|
func CopyReader(data io.Reader, mimeType string, foreground, pasteOnce bool) error {
|
||||||
if !foreground {
|
if foreground {
|
||||||
return copyFork(data, mimeType, pasteOnce)
|
buf, err := io.ReadAll(data)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("read source: %w", err)
|
||||||
|
}
|
||||||
|
return serveClipboard(buf, mimeType, pasteOnce)
|
||||||
}
|
}
|
||||||
return copyServeReader(data, mimeType, pasteOnce)
|
return copyFork(data, mimeType, pasteOnce)
|
||||||
}
|
}
|
||||||
|
|
||||||
func copyFork(data io.Reader, mimeType string, pasteOnce bool) error {
|
func newForkCmd(mimeType string, pasteOnce bool, extra ...string) *exec.Cmd {
|
||||||
args := []string{os.Args[0], "cl", "copy", "--foreground"}
|
cmd := exec.Command(os.Args[0])
|
||||||
if pasteOnce {
|
|
||||||
args = append(args, "--paste-once")
|
|
||||||
}
|
|
||||||
args = append(args, "--type", mimeType)
|
|
||||||
|
|
||||||
cmd := exec.Command(args[0], args[1:]...)
|
|
||||||
cmd.Stderr = nil
|
cmd.Stderr = nil
|
||||||
cmd.SysProcAttr = &syscall.SysProcAttr{Setsid: true}
|
cmd.SysProcAttr = &syscall.SysProcAttr{Setsid: true}
|
||||||
cmd.Env = append(os.Environ(), "DMS_CLIP_FORKED=1")
|
cmd.Env = append(os.Environ(),
|
||||||
|
envServe+"=1",
|
||||||
|
envMime+"="+mimeType,
|
||||||
|
)
|
||||||
|
if pasteOnce {
|
||||||
|
cmd.Env = append(cmd.Env, envPasteOnce+"=1")
|
||||||
|
}
|
||||||
|
cmd.Env = append(cmd.Env, extra...)
|
||||||
|
return cmd
|
||||||
|
}
|
||||||
|
|
||||||
|
func waitReady(cmd *exec.Cmd) error {
|
||||||
stdout, err := cmd.StdoutPipe()
|
stdout, err := cmd.StdoutPipe()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("stdout pipe: %w", err)
|
return fmt.Errorf("stdout pipe: %w", err)
|
||||||
}
|
}
|
||||||
|
if err := cmd.Start(); err != nil {
|
||||||
|
return fmt.Errorf("start: %w", err)
|
||||||
|
}
|
||||||
|
var buf [1]byte
|
||||||
|
if _, err := stdout.Read(buf[:]); err != nil {
|
||||||
|
return fmt.Errorf("waiting for clipboard ready: %w", err)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func copyForkCached(data []byte, mimeType string, pasteOnce bool) error {
|
||||||
|
cacheFile, err := createClipboardCacheFile()
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("create cache file: %w", err)
|
||||||
|
}
|
||||||
|
cachePath := cacheFile.Name()
|
||||||
|
|
||||||
|
if _, err := cacheFile.Write(data); err != nil {
|
||||||
|
cacheFile.Close()
|
||||||
|
os.Remove(cachePath)
|
||||||
|
return fmt.Errorf("write cache file: %w", err)
|
||||||
|
}
|
||||||
|
if err := cacheFile.Close(); err != nil {
|
||||||
|
os.Remove(cachePath)
|
||||||
|
return fmt.Errorf("close cache file: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
cmd := newForkCmd(mimeType, pasteOnce, envCacheFile+"="+cachePath)
|
||||||
|
cmd.Stdin = nil
|
||||||
|
if err := waitReady(cmd); err != nil {
|
||||||
|
os.Remove(cachePath)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func copyFork(data io.Reader, mimeType string, pasteOnce bool) error {
|
||||||
|
cmd := newForkCmd(mimeType, pasteOnce)
|
||||||
|
|
||||||
switch src := data.(type) {
|
switch src := data.(type) {
|
||||||
case *os.File:
|
case *os.File:
|
||||||
cmd.Stdin = src
|
cmd.Stdin = src
|
||||||
if err := cmd.Start(); err != nil {
|
return waitReady(cmd)
|
||||||
return fmt.Errorf("start: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
stdin, err := cmd.StdinPipe()
|
stdin, err := cmd.StdinPipe()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("stdin pipe: %w", err)
|
return fmt.Errorf("stdin pipe: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stdout, err := cmd.StdoutPipe()
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("stdout pipe: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
if err := cmd.Start(); err != nil {
|
if err := cmd.Start(); err != nil {
|
||||||
return fmt.Errorf("start: %w", err)
|
return fmt.Errorf("start: %w", err)
|
||||||
}
|
}
|
||||||
@@ -83,50 +158,22 @@ func copyFork(data io.Reader, mimeType string, pasteOnce bool) error {
|
|||||||
if err := stdin.Close(); err != nil {
|
if err := stdin.Close(); err != nil {
|
||||||
return fmt.Errorf("close stdin: %w", err)
|
return fmt.Errorf("close stdin: %w", err)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
var buf [1]byte
|
var buf [1]byte
|
||||||
if _, err := stdout.Read(buf[:]); err != nil {
|
if _, err := stdout.Read(buf[:]); err != nil {
|
||||||
return fmt.Errorf("waiting for clipboard ready: %w", err)
|
return fmt.Errorf("waiting for clipboard ready: %w", err)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func signalReady() {
|
func signalReady() {
|
||||||
if os.Getenv("DMS_CLIP_FORKED") == "" {
|
if os.Getenv(envServe) == "" {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
os.Stdout.Write([]byte{1})
|
os.Stdout.Write([]byte{1})
|
||||||
}
|
}
|
||||||
|
|
||||||
func copyServeReader(data io.Reader, mimeType string, pasteOnce bool) error {
|
|
||||||
cachedData, err := createClipboardCacheFile()
|
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("create clipboard cache file: %w", err)
|
|
||||||
}
|
|
||||||
defer os.Remove(cachedData.Name())
|
|
||||||
|
|
||||||
if _, err := io.Copy(cachedData, data); err != nil {
|
|
||||||
return fmt.Errorf("cache clipboard data: %w", err)
|
|
||||||
}
|
|
||||||
if err := cachedData.Close(); err != nil {
|
|
||||||
return fmt.Errorf("close temp cache file: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
return copyServeWithWriter(func(writer io.Writer) error {
|
|
||||||
cachedFile, err := os.Open(cachedData.Name())
|
|
||||||
if err != nil {
|
|
||||||
return fmt.Errorf("open temp cache file: %w", err)
|
|
||||||
}
|
|
||||||
defer cachedFile.Close()
|
|
||||||
|
|
||||||
if _, err := io.Copy(writer, cachedFile); err != nil {
|
|
||||||
return fmt.Errorf("write clipboard data: %w", err)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}, mimeType, pasteOnce)
|
|
||||||
}
|
|
||||||
|
|
||||||
func createClipboardCacheFile() (*os.File, error) {
|
func createClipboardCacheFile() (*os.File, error) {
|
||||||
preferredDirs := []string{}
|
preferredDirs := []string{}
|
||||||
|
|
||||||
@@ -147,7 +194,7 @@ func createClipboardCacheFile() (*os.File, error) {
|
|||||||
return os.CreateTemp("", "dms-clipboard-*")
|
return os.CreateTemp("", "dms-clipboard-*")
|
||||||
}
|
}
|
||||||
|
|
||||||
func copyServeWithWriter(writeTo func(io.Writer) error, mimeType string, pasteOnce bool) error {
|
func serveClipboard(data []byte, mimeType string, pasteOnce bool) error {
|
||||||
display, err := wlclient.Connect("")
|
display, err := wlclient.Connect("")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("wayland connect: %w", err)
|
return fmt.Errorf("wayland connect: %w", err)
|
||||||
@@ -189,12 +236,10 @@ func copyServeWithWriter(writeTo func(io.Writer) error, mimeType string, pasteOn
|
|||||||
if bindErr != nil {
|
if bindErr != nil {
|
||||||
return fmt.Errorf("registry bind: %w", bindErr)
|
return fmt.Errorf("registry bind: %w", bindErr)
|
||||||
}
|
}
|
||||||
|
|
||||||
if dataControlMgr == nil {
|
if dataControlMgr == nil {
|
||||||
return fmt.Errorf("compositor does not support ext_data_control_manager_v1")
|
return fmt.Errorf("compositor does not support ext_data_control_manager_v1")
|
||||||
}
|
}
|
||||||
defer dataControlMgr.Destroy()
|
defer dataControlMgr.Destroy()
|
||||||
|
|
||||||
if seat == nil {
|
if seat == nil {
|
||||||
return fmt.Errorf("no seat available")
|
return fmt.Errorf("no seat available")
|
||||||
}
|
}
|
||||||
@@ -233,18 +278,12 @@ func copyServeWithWriter(writeTo func(io.Writer) error, mimeType string, pasteOn
|
|||||||
|
|
||||||
cancelled := make(chan struct{})
|
cancelled := make(chan struct{})
|
||||||
pasted := make(chan struct{}, 1)
|
pasted := make(chan struct{}, 1)
|
||||||
sendErr := make(chan error, 1)
|
|
||||||
|
|
||||||
source.SetSendHandler(func(e ext_data_control.ExtDataControlSourceV1SendEvent) {
|
source.SetSendHandler(func(e ext_data_control.ExtDataControlSourceV1SendEvent) {
|
||||||
defer syscall.Close(e.Fd)
|
_ = syscall.SetNonblock(e.Fd, false)
|
||||||
file := os.NewFile(uintptr(e.Fd), "pipe")
|
file := os.NewFile(uintptr(e.Fd), "pipe")
|
||||||
defer file.Close()
|
defer file.Close()
|
||||||
if err := writeTo(file); err != nil {
|
_, _ = file.Write(data)
|
||||||
select {
|
|
||||||
case sendErr <- err:
|
|
||||||
default:
|
|
||||||
}
|
|
||||||
}
|
|
||||||
select {
|
select {
|
||||||
case pasted <- struct{}{}:
|
case pasted <- struct{}{}:
|
||||||
default:
|
default:
|
||||||
@@ -266,8 +305,6 @@ func copyServeWithWriter(writeTo func(io.Writer) error, mimeType string, pasteOn
|
|||||||
select {
|
select {
|
||||||
case <-cancelled:
|
case <-cancelled:
|
||||||
return nil
|
return nil
|
||||||
case err := <-sendErr:
|
|
||||||
return err
|
|
||||||
case <-pasted:
|
case <-pasted:
|
||||||
if pasteOnce {
|
if pasteOnce {
|
||||||
return nil
|
return nil
|
||||||
@@ -521,12 +558,10 @@ func copyMultiServe(offers []Offer, pasteOnce bool) error {
|
|||||||
if bindErr != nil {
|
if bindErr != nil {
|
||||||
return fmt.Errorf("registry bind: %w", bindErr)
|
return fmt.Errorf("registry bind: %w", bindErr)
|
||||||
}
|
}
|
||||||
|
|
||||||
if dataControlMgr == nil {
|
if dataControlMgr == nil {
|
||||||
return fmt.Errorf("compositor does not support ext_data_control_manager_v1")
|
return fmt.Errorf("compositor does not support ext_data_control_manager_v1")
|
||||||
}
|
}
|
||||||
defer dataControlMgr.Destroy()
|
defer dataControlMgr.Destroy()
|
||||||
|
|
||||||
if seat == nil {
|
if seat == nil {
|
||||||
return fmt.Errorf("no seat available")
|
return fmt.Errorf("no seat available")
|
||||||
}
|
}
|
||||||
@@ -554,12 +589,12 @@ func copyMultiServe(offers []Offer, pasteOnce bool) error {
|
|||||||
pasted := make(chan struct{}, 1)
|
pasted := make(chan struct{}, 1)
|
||||||
|
|
||||||
source.SetSendHandler(func(e ext_data_control.ExtDataControlSourceV1SendEvent) {
|
source.SetSendHandler(func(e ext_data_control.ExtDataControlSourceV1SendEvent) {
|
||||||
defer syscall.Close(e.Fd)
|
_ = syscall.SetNonblock(e.Fd, false)
|
||||||
file := os.NewFile(uintptr(e.Fd), "pipe")
|
file := os.NewFile(uintptr(e.Fd), "pipe")
|
||||||
defer file.Close()
|
defer file.Close()
|
||||||
|
|
||||||
if data, ok := offerMap[e.MimeType]; ok {
|
if data, ok := offerMap[e.MimeType]; ok {
|
||||||
file.Write(data)
|
_, _ = file.Write(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
select {
|
select {
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ bind = SUPER, bracketright, layoutmsg, preselect r
|
|||||||
|
|
||||||
# === Sizing & Layout ===
|
# === Sizing & Layout ===
|
||||||
bind = SUPER, R, layoutmsg, togglesplit
|
bind = SUPER, R, layoutmsg, togglesplit
|
||||||
bind = SUPER CTRL, F, resizeactive, exact 100%
|
bind = SUPER CTRL, F, resizeactive, exact 100% 100%
|
||||||
|
|
||||||
# === Move/resize windows with mainMod + LMB/RMB and dragging ===
|
# === Move/resize windows with mainMod + LMB/RMB and dragging ===
|
||||||
bindmd = SUPER, mouse:272, Move window, movewindow
|
bindmd = SUPER, mouse:272, Move window, movewindow
|
||||||
|
|||||||
@@ -94,6 +94,7 @@ windowrule = tile on, match:class ^(gnome-control-center)$
|
|||||||
windowrule = tile on, match:class ^(pavucontrol)$
|
windowrule = tile on, match:class ^(pavucontrol)$
|
||||||
windowrule = tile on, match:class ^(nm-connection-editor)$
|
windowrule = tile on, match:class ^(nm-connection-editor)$
|
||||||
|
|
||||||
|
windowrule = float on, match:class ^(org\.gnome\.Calculator)$
|
||||||
windowrule = float on, match:class ^(gnome-calculator)$
|
windowrule = float on, match:class ^(gnome-calculator)$
|
||||||
windowrule = float on, match:class ^(galculator)$
|
windowrule = float on, match:class ^(galculator)$
|
||||||
windowrule = float on, match:class ^(blueman-manager)$
|
windowrule = float on, match:class ^(blueman-manager)$
|
||||||
|
|||||||
@@ -224,6 +224,7 @@ window-rule {
|
|||||||
open-floating false
|
open-floating false
|
||||||
}
|
}
|
||||||
window-rule {
|
window-rule {
|
||||||
|
match app-id=r#"^org\.gnome\.Calculator$"#
|
||||||
match app-id=r#"^gnome-calculator$"#
|
match app-id=r#"^gnome-calculator$"#
|
||||||
match app-id=r#"^galculator$"#
|
match app-id=r#"^galculator$"#
|
||||||
match app-id=r#"^blueman-manager$"#
|
match app-id=r#"^blueman-manager$"#
|
||||||
|
|||||||
@@ -242,11 +242,7 @@ func (a *ArchDistribution) getDMSMapping(variant deps.PackageVariant) PackageMap
|
|||||||
return PackageMapping{Name: "dms-shell-git", Repository: RepoTypeAUR}
|
return PackageMapping{Name: "dms-shell-git", Repository: RepoTypeAUR}
|
||||||
}
|
}
|
||||||
|
|
||||||
if a.packageInstalled("dms-shell-bin") {
|
return PackageMapping{Name: "dms-shell", Repository: RepoTypeSystem}
|
||||||
return PackageMapping{Name: "dms-shell-bin", Repository: RepoTypeAUR}
|
|
||||||
}
|
|
||||||
|
|
||||||
return PackageMapping{Name: "dms-shell-bin", Repository: RepoTypeAUR}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *ArchDistribution) detectXwaylandSatellite() deps.Dependency {
|
func (a *ArchDistribution) detectXwaylandSatellite() deps.Dependency {
|
||||||
@@ -540,7 +536,7 @@ func (a *ArchDistribution) reorderAURPackages(packages []string) []string {
|
|||||||
var dmsShell []string
|
var dmsShell []string
|
||||||
|
|
||||||
for _, pkg := range packages {
|
for _, pkg := range packages {
|
||||||
if pkg == "dms-shell-git" || pkg == "dms-shell-bin" {
|
if pkg == "dms-shell-git" {
|
||||||
dmsShell = append(dmsShell, pkg)
|
dmsShell = append(dmsShell, pkg)
|
||||||
} else {
|
} else {
|
||||||
isDep := false
|
isDep := false
|
||||||
@@ -621,7 +617,7 @@ func (a *ArchDistribution) installSingleAURPackageInternal(ctx context.Context,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if pkg == "dms-shell-git" || pkg == "dms-shell-bin" {
|
if pkg == "dms-shell-git" {
|
||||||
srcinfoPath := filepath.Join(packageDir, ".SRCINFO")
|
srcinfoPath := filepath.Join(packageDir, ".SRCINFO")
|
||||||
depsToRemove := []string{
|
depsToRemove := []string{
|
||||||
"depends = quickshell",
|
"depends = quickshell",
|
||||||
@@ -644,15 +640,7 @@ func (a *ArchDistribution) installSingleAURPackageInternal(ctx context.Context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
srcinfoPath = filepath.Join(packageDir, ".SRCINFO")
|
srcinfoPath = filepath.Join(packageDir, ".SRCINFO")
|
||||||
if pkg == "dms-shell-bin" {
|
{
|
||||||
progressChan <- InstallProgressMsg{
|
|
||||||
Phase: PhaseAURPackages,
|
|
||||||
Progress: startProgress + 0.35*(endProgress-startProgress),
|
|
||||||
Step: fmt.Sprintf("Skipping dependency installation for %s (manually managed)...", pkg),
|
|
||||||
IsComplete: false,
|
|
||||||
LogOutput: fmt.Sprintf("Dependencies for %s are installed separately", pkg),
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
progressChan <- InstallProgressMsg{
|
progressChan <- InstallProgressMsg{
|
||||||
Phase: PhaseAURPackages,
|
Phase: PhaseAURPackages,
|
||||||
Progress: startProgress + 0.3*(endProgress-startProgress),
|
Progress: startProgress + 0.3*(endProgress-startProgress),
|
||||||
@@ -739,42 +727,9 @@ func (a *ArchDistribution) installSingleAURPackageInternal(ctx context.Context,
|
|||||||
CommandInfo: "sudo pacman -U built-package",
|
CommandInfo: "sudo pacman -U built-package",
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find .pkg.tar* files - for split packages, install the base and any installed compositor variants
|
|
||||||
var files []string
|
var files []string
|
||||||
if pkg == "dms-shell-git" || pkg == "dms-shell-bin" {
|
matches, _ := filepath.Glob(filepath.Join(packageDir, "*.pkg.tar*"))
|
||||||
// For DMS split packages, install base package
|
files = matches
|
||||||
pattern := filepath.Join(packageDir, fmt.Sprintf("%s-%s*.pkg.tar*", pkg, "*"))
|
|
||||||
matches, err := filepath.Glob(pattern)
|
|
||||||
if err == nil {
|
|
||||||
for _, match := range matches {
|
|
||||||
basename := filepath.Base(match)
|
|
||||||
// Always include base package
|
|
||||||
if !strings.Contains(basename, "hyprland") && !strings.Contains(basename, "niri") {
|
|
||||||
files = append(files, match)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Also update compositor-specific packages if they're installed
|
|
||||||
if strings.HasSuffix(pkg, "-git") {
|
|
||||||
if a.packageInstalled("dms-shell-hyprland-git") {
|
|
||||||
hyprlandPattern := filepath.Join(packageDir, "dms-shell-hyprland-git-*.pkg.tar*")
|
|
||||||
if hyprlandMatches, err := filepath.Glob(hyprlandPattern); err == nil && len(hyprlandMatches) > 0 {
|
|
||||||
files = append(files, hyprlandMatches[0])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if a.packageInstalled("dms-shell-niri-git") {
|
|
||||||
niriPattern := filepath.Join(packageDir, "dms-shell-niri-git-*.pkg.tar*")
|
|
||||||
if niriMatches, err := filepath.Glob(niriPattern); err == nil && len(niriMatches) > 0 {
|
|
||||||
files = append(files, niriMatches[0])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// For other packages, install all built packages
|
|
||||||
matches, _ := filepath.Glob(filepath.Join(packageDir, "*.pkg.tar*"))
|
|
||||||
files = matches
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(files) == 0 {
|
if len(files) == 0 {
|
||||||
return fmt.Errorf("no package files found after building %s", pkg)
|
return fmt.Errorf("no package files found after building %s", pkg)
|
||||||
|
|||||||
@@ -444,20 +444,21 @@ func GetFocusedMonitor() string {
|
|||||||
|
|
||||||
type outputInfo struct {
|
type outputInfo struct {
|
||||||
x, y int32
|
x, y int32
|
||||||
|
scale float64
|
||||||
transform int32
|
transform int32
|
||||||
}
|
}
|
||||||
|
|
||||||
func getOutputInfo(outputName string) (*outputInfo, bool) {
|
func getAllOutputInfos() map[string]*outputInfo {
|
||||||
display, err := client.Connect("")
|
display, err := client.Connect("")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, false
|
return nil
|
||||||
}
|
}
|
||||||
ctx := display.Context()
|
ctx := display.Context()
|
||||||
defer ctx.Close()
|
defer ctx.Close()
|
||||||
|
|
||||||
registry, err := display.GetRegistry()
|
registry, err := display.GetRegistry()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, false
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var outputManager *wlr_output_management.ZwlrOutputManagerV1
|
var outputManager *wlr_output_management.ZwlrOutputManagerV1
|
||||||
@@ -476,16 +477,17 @@ func getOutputInfo(outputName string) (*outputInfo, bool) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
if err := wlhelpers.Roundtrip(display, ctx); err != nil {
|
if err := wlhelpers.Roundtrip(display, ctx); err != nil {
|
||||||
return nil, false
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if outputManager == nil {
|
if outputManager == nil {
|
||||||
return nil, false
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type headState struct {
|
type headState struct {
|
||||||
name string
|
name string
|
||||||
x, y int32
|
x, y int32
|
||||||
|
scale float64
|
||||||
transform int32
|
transform int32
|
||||||
}
|
}
|
||||||
heads := make(map[*wlr_output_management.ZwlrOutputHeadV1]*headState)
|
heads := make(map[*wlr_output_management.ZwlrOutputHeadV1]*headState)
|
||||||
@@ -501,6 +503,9 @@ func getOutputInfo(outputName string) (*outputInfo, bool) {
|
|||||||
state.x = pe.X
|
state.x = pe.X
|
||||||
state.y = pe.Y
|
state.y = pe.Y
|
||||||
})
|
})
|
||||||
|
e.Head.SetScaleHandler(func(se wlr_output_management.ZwlrOutputHeadV1ScaleEvent) {
|
||||||
|
state.scale = se.Scale
|
||||||
|
})
|
||||||
e.Head.SetTransformHandler(func(te wlr_output_management.ZwlrOutputHeadV1TransformEvent) {
|
e.Head.SetTransformHandler(func(te wlr_output_management.ZwlrOutputHeadV1TransformEvent) {
|
||||||
state.transform = te.Transform
|
state.transform = te.Transform
|
||||||
})
|
})
|
||||||
@@ -511,21 +516,32 @@ func getOutputInfo(outputName string) (*outputInfo, bool) {
|
|||||||
|
|
||||||
for !done {
|
for !done {
|
||||||
if err := ctx.Dispatch(); err != nil {
|
if err := ctx.Dispatch(); err != nil {
|
||||||
return nil, false
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
result := make(map[string]*outputInfo, len(heads))
|
||||||
for _, state := range heads {
|
for _, state := range heads {
|
||||||
if state.name == outputName {
|
if state.name == "" {
|
||||||
return &outputInfo{
|
continue
|
||||||
x: state.x,
|
}
|
||||||
y: state.y,
|
result[state.name] = &outputInfo{
|
||||||
transform: state.transform,
|
x: state.x,
|
||||||
}, true
|
y: state.y,
|
||||||
|
scale: state.scale,
|
||||||
|
transform: state.transform,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
return nil, false
|
func getOutputInfo(outputName string) (*outputInfo, bool) {
|
||||||
|
infos := getAllOutputInfos()
|
||||||
|
if infos == nil {
|
||||||
|
return nil, false
|
||||||
|
}
|
||||||
|
info, ok := infos[outputName]
|
||||||
|
return info, ok
|
||||||
}
|
}
|
||||||
|
|
||||||
func getDWLActiveWindow() (*WindowGeometry, error) {
|
func getDWLActiveWindow() (*WindowGeometry, error) {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package screenshot
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"math"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/AvengeMedia/DankMaterialShell/core/internal/log"
|
"github.com/AvengeMedia/DankMaterialShell/core/internal/log"
|
||||||
@@ -304,22 +305,20 @@ func (s *Screenshoter) captureAllScreens() (*CaptureResult, error) {
|
|||||||
if len(outputs) == 0 {
|
if len(outputs) == 0 {
|
||||||
return nil, fmt.Errorf("no outputs available")
|
return nil, fmt.Errorf("no outputs available")
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(outputs) == 1 {
|
if len(outputs) == 1 {
|
||||||
return s.captureWholeOutput(outputs[0])
|
return s.captureWholeOutput(outputs[0])
|
||||||
}
|
}
|
||||||
|
|
||||||
// Capture all outputs first to get actual buffer sizes
|
wlrInfos := getAllOutputInfos()
|
||||||
type capturedOutput struct {
|
|
||||||
output *WaylandOutput
|
|
||||||
result *CaptureResult
|
|
||||||
physX int
|
|
||||||
physY int
|
|
||||||
}
|
|
||||||
captured := make([]capturedOutput, 0, len(outputs))
|
|
||||||
|
|
||||||
var minX, minY, maxX, maxY int
|
type pendingOutput struct {
|
||||||
first := true
|
result *CaptureResult
|
||||||
|
logX float64
|
||||||
|
logY float64
|
||||||
|
scale float64
|
||||||
|
}
|
||||||
|
var pending []pendingOutput
|
||||||
|
maxScale := 1.0
|
||||||
|
|
||||||
for _, output := range outputs {
|
for _, output := range outputs {
|
||||||
result, err := s.captureWholeOutput(output)
|
result, err := s.captureWholeOutput(output)
|
||||||
@@ -328,50 +327,74 @@ func (s *Screenshoter) captureAllScreens() (*CaptureResult, error) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
outX, outY := output.x, output.y
|
logX, logY := float64(output.x), float64(output.y)
|
||||||
scale := float64(output.scale)
|
scale := float64(output.scale)
|
||||||
|
|
||||||
switch DetectCompositor() {
|
switch DetectCompositor() {
|
||||||
case CompositorHyprland:
|
case CompositorHyprland:
|
||||||
if hx, hy, _, _, ok := GetHyprlandMonitorGeometry(output.name); ok {
|
if hx, hy, _, _, ok := GetHyprlandMonitorGeometry(output.name); ok {
|
||||||
outX, outY = hx, hy
|
logX, logY = float64(hx), float64(hy)
|
||||||
}
|
}
|
||||||
if s := GetHyprlandMonitorScale(output.name); s > 0 {
|
if hs := GetHyprlandMonitorScale(output.name); hs > 0 {
|
||||||
scale = s
|
scale = hs
|
||||||
}
|
}
|
||||||
case CompositorDWL:
|
default:
|
||||||
if info, ok := getOutputInfo(output.name); ok {
|
if wlrInfos != nil {
|
||||||
outX, outY = info.x, info.y
|
if info, ok := wlrInfos[output.name]; ok {
|
||||||
|
logX, logY = float64(info.x), float64(info.y)
|
||||||
|
if info.scale > 0 {
|
||||||
|
scale = info.scale
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if scale <= 0 {
|
if scale <= 0 {
|
||||||
scale = 1.0
|
scale = 1.0
|
||||||
}
|
}
|
||||||
|
|
||||||
physX := int(float64(outX) * scale)
|
pending = append(pending, pendingOutput{result: result, logX: logX, logY: logY, scale: scale})
|
||||||
physY := int(float64(outY) * scale)
|
if scale > maxScale {
|
||||||
|
maxScale = scale
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
captured = append(captured, capturedOutput{
|
if len(pending) == 0 {
|
||||||
output: output,
|
return nil, fmt.Errorf("failed to capture any outputs")
|
||||||
result: result,
|
}
|
||||||
physX: physX,
|
if len(pending) == 1 {
|
||||||
physY: physY,
|
return pending[0].result, nil
|
||||||
})
|
}
|
||||||
|
|
||||||
right := physX + result.Buffer.Width
|
type layoutEntry struct {
|
||||||
bottom := physY + result.Buffer.Height
|
result *CaptureResult
|
||||||
|
canvasX int
|
||||||
|
canvasY int
|
||||||
|
canvasW int
|
||||||
|
canvasH int
|
||||||
|
}
|
||||||
|
entries := make([]layoutEntry, len(pending))
|
||||||
|
var minX, minY, maxX, maxY int
|
||||||
|
|
||||||
if first {
|
for i, p := range pending {
|
||||||
minX, minY = physX, physY
|
cx := int(math.Round(p.logX * maxScale))
|
||||||
maxX, maxY = right, bottom
|
cy := int(math.Round(p.logY * maxScale))
|
||||||
first = false
|
cw := int(math.Round(float64(p.result.Buffer.Width) * maxScale / p.scale))
|
||||||
|
ch := int(math.Round(float64(p.result.Buffer.Height) * maxScale / p.scale))
|
||||||
|
|
||||||
|
entries[i] = layoutEntry{result: p.result, canvasX: cx, canvasY: cy, canvasW: cw, canvasH: ch}
|
||||||
|
|
||||||
|
right := cx + cw
|
||||||
|
bottom := cy + ch
|
||||||
|
if i == 0 {
|
||||||
|
minX, minY, maxX, maxY = cx, cy, right, bottom
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
if cx < minX {
|
||||||
if physX < minX {
|
minX = cx
|
||||||
minX = physX
|
|
||||||
}
|
}
|
||||||
if physY < minY {
|
if cy < minY {
|
||||||
minY = physY
|
minY = cy
|
||||||
}
|
}
|
||||||
if right > maxX {
|
if right > maxX {
|
||||||
maxX = right
|
maxX = right
|
||||||
@@ -381,35 +404,26 @@ func (s *Screenshoter) captureAllScreens() (*CaptureResult, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(captured) == 0 {
|
|
||||||
return nil, fmt.Errorf("failed to capture any outputs")
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(captured) == 1 {
|
|
||||||
return captured[0].result, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
totalW := maxX - minX
|
totalW := maxX - minX
|
||||||
totalH := maxY - minY
|
totalH := maxY - minY
|
||||||
|
composite, err := CreateShmBuffer(totalW, totalH, totalW*4)
|
||||||
compositeStride := totalW * 4
|
|
||||||
composite, err := CreateShmBuffer(totalW, totalH, compositeStride)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
for _, c := range captured {
|
for _, e := range entries {
|
||||||
c.result.Buffer.Close()
|
e.result.Buffer.Close()
|
||||||
}
|
}
|
||||||
return nil, fmt.Errorf("create composite buffer: %w", err)
|
return nil, fmt.Errorf("create composite buffer: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
composite.Clear()
|
composite.Clear()
|
||||||
|
|
||||||
var format uint32
|
var format uint32
|
||||||
for _, c := range captured {
|
for _, e := range entries {
|
||||||
if format == 0 {
|
if format == 0 {
|
||||||
format = c.result.Format
|
format = e.result.Format
|
||||||
}
|
}
|
||||||
s.blitBuffer(composite, c.result.Buffer, c.physX-minX, c.physY-minY, c.result.YInverted)
|
s.blitBufferScaled(composite, e.result.Buffer,
|
||||||
c.result.Buffer.Close()
|
e.canvasX-minX, e.canvasY-minY, e.canvasW, e.canvasH,
|
||||||
|
e.result.YInverted)
|
||||||
|
e.result.Buffer.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
return &CaptureResult{
|
return &CaptureResult{
|
||||||
@@ -419,32 +433,44 @@ func (s *Screenshoter) captureAllScreens() (*CaptureResult, error) {
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Screenshoter) blitBuffer(dst, src *ShmBuffer, dstX, dstY int, yInverted bool) {
|
func (s *Screenshoter) blitBufferScaled(dst, src *ShmBuffer, dstX, dstY, dstW, dstH int, yInverted bool) {
|
||||||
|
if dstW <= 0 || dstH <= 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
srcData := src.Data()
|
srcData := src.Data()
|
||||||
dstData := dst.Data()
|
dstData := dst.Data()
|
||||||
|
|
||||||
for srcY := 0; srcY < src.Height; srcY++ {
|
for dy := 0; dy < dstH; dy++ {
|
||||||
actualSrcY := srcY
|
canvasY := dstY + dy
|
||||||
if yInverted {
|
if canvasY < 0 || canvasY >= dst.Height {
|
||||||
actualSrcY = src.Height - 1 - srcY
|
|
||||||
}
|
|
||||||
|
|
||||||
dy := dstY + srcY
|
|
||||||
if dy < 0 || dy >= dst.Height {
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
srcRowOff := actualSrcY * src.Stride
|
srcY := dy * src.Height / dstH
|
||||||
dstRowOff := dy * dst.Stride
|
if yInverted {
|
||||||
|
srcY = src.Height - 1 - srcY
|
||||||
|
}
|
||||||
|
if srcY < 0 || srcY >= src.Height {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
for srcX := 0; srcX < src.Width; srcX++ {
|
srcRowOff := srcY * src.Stride
|
||||||
dx := dstX + srcX
|
dstRowOff := canvasY * dst.Stride
|
||||||
if dx < 0 || dx >= dst.Width {
|
|
||||||
|
for dx := 0; dx < dstW; dx++ {
|
||||||
|
canvasX := dstX + dx
|
||||||
|
if canvasX < 0 || canvasX >= dst.Width {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
srcX := dx * src.Width / dstW
|
||||||
|
if srcX >= src.Width {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
si := srcRowOff + srcX*4
|
si := srcRowOff + srcX*4
|
||||||
di := dstRowOff + dx*4
|
di := dstRowOff + canvasX*4
|
||||||
|
|
||||||
if si+3 >= len(srcData) || di+3 >= len(dstData) {
|
if si+3 >= len(srcData) || di+3 >= len(dstData) {
|
||||||
continue
|
continue
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import (
|
|||||||
"github.com/AvengeMedia/DankMaterialShell/core/internal/server/models"
|
"github.com/AvengeMedia/DankMaterialShell/core/internal/server/models"
|
||||||
"github.com/AvengeMedia/DankMaterialShell/core/internal/server/network"
|
"github.com/AvengeMedia/DankMaterialShell/core/internal/server/network"
|
||||||
"github.com/AvengeMedia/DankMaterialShell/core/internal/server/thememode"
|
"github.com/AvengeMedia/DankMaterialShell/core/internal/server/thememode"
|
||||||
|
"github.com/AvengeMedia/DankMaterialShell/core/internal/server/trayrecovery"
|
||||||
"github.com/AvengeMedia/DankMaterialShell/core/internal/server/wayland"
|
"github.com/AvengeMedia/DankMaterialShell/core/internal/server/wayland"
|
||||||
"github.com/AvengeMedia/DankMaterialShell/core/internal/server/wlcontext"
|
"github.com/AvengeMedia/DankMaterialShell/core/internal/server/wlcontext"
|
||||||
"github.com/AvengeMedia/DankMaterialShell/core/internal/server/wlroutput"
|
"github.com/AvengeMedia/DankMaterialShell/core/internal/server/wlroutput"
|
||||||
@@ -72,6 +73,7 @@ var clipboardManager *clipboard.Manager
|
|||||||
var dbusManager *serverDbus.Manager
|
var dbusManager *serverDbus.Manager
|
||||||
var wlContext *wlcontext.SharedContext
|
var wlContext *wlcontext.SharedContext
|
||||||
var themeModeManager *thememode.Manager
|
var themeModeManager *thememode.Manager
|
||||||
|
var trayRecoveryManager *trayrecovery.Manager
|
||||||
var locationManager *location.Manager
|
var locationManager *location.Manager
|
||||||
var geoClientInstance geolocation.Client
|
var geoClientInstance geolocation.Client
|
||||||
|
|
||||||
@@ -394,6 +396,18 @@ func InitializeThemeModeManager() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func InitializeTrayRecoveryManager() error {
|
||||||
|
manager, err := trayrecovery.NewManager()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
trayRecoveryManager = manager
|
||||||
|
|
||||||
|
log.Info("TrayRecovery manager initialized")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func InitializeLocationManager(geoClient geolocation.Client) error {
|
func InitializeLocationManager(geoClient geolocation.Client) error {
|
||||||
manager, err := location.NewManager(geoClient)
|
manager, err := location.NewManager(geoClient)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -1325,6 +1339,9 @@ func cleanupManagers() {
|
|||||||
if themeModeManager != nil {
|
if themeModeManager != nil {
|
||||||
themeModeManager.Close()
|
themeModeManager.Close()
|
||||||
}
|
}
|
||||||
|
if trayRecoveryManager != nil {
|
||||||
|
trayRecoveryManager.Close()
|
||||||
|
}
|
||||||
if wlContext != nil {
|
if wlContext != nil {
|
||||||
wlContext.Close()
|
wlContext.Close()
|
||||||
}
|
}
|
||||||
@@ -1610,6 +1627,18 @@ func Start(printDocs bool) error {
|
|||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
go func() {
|
||||||
|
<-loginctlReady
|
||||||
|
if loginctlManager == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if err := InitializeTrayRecoveryManager(); err != nil {
|
||||||
|
log.Warnf("TrayRecovery manager unavailable: %v", err)
|
||||||
|
} else {
|
||||||
|
trayRecoveryManager.WatchLoginctl(loginctlManager)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
geoClient := geolocation.NewClient()
|
geoClient := geolocation.NewClient()
|
||||||
geoClientInstance = geoClient
|
geoClientInstance = geoClient
|
||||||
|
|||||||
@@ -0,0 +1,93 @@
|
|||||||
|
package trayrecovery
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"sync"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/AvengeMedia/DankMaterialShell/core/internal/log"
|
||||||
|
"github.com/AvengeMedia/DankMaterialShell/core/internal/server/loginctl"
|
||||||
|
"github.com/godbus/dbus/v5"
|
||||||
|
)
|
||||||
|
|
||||||
|
const resumeDelay = 3 * time.Second
|
||||||
|
|
||||||
|
type Manager struct {
|
||||||
|
conn *dbus.Conn
|
||||||
|
stopChan chan struct{}
|
||||||
|
wg sync.WaitGroup
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewManager() (*Manager, error) {
|
||||||
|
conn, err := dbus.ConnectSessionBus()
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("failed to connect to session bus: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
m := &Manager{
|
||||||
|
conn: conn,
|
||||||
|
stopChan: make(chan struct{}),
|
||||||
|
}
|
||||||
|
|
||||||
|
// Run a startup scan after a delay — covers the case where the process
|
||||||
|
// was killed during suspend and restarted by systemd (Type=dbus).
|
||||||
|
// The fresh process never sees the PrepareForSleep true→false transition,
|
||||||
|
// so the loginctl watcher alone is not enough.
|
||||||
|
go m.scheduleRecovery()
|
||||||
|
|
||||||
|
return m, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// WatchLoginctl subscribes to loginctl session state changes and triggers
|
||||||
|
// tray recovery after resume from suspend (PrepareForSleep false transition).
|
||||||
|
// This handles the case where the process survives suspend.
|
||||||
|
func (m *Manager) WatchLoginctl(lm *loginctl.Manager) {
|
||||||
|
ch := lm.Subscribe("tray-recovery")
|
||||||
|
m.wg.Add(1)
|
||||||
|
go func() {
|
||||||
|
defer m.wg.Done()
|
||||||
|
defer lm.Unsubscribe("tray-recovery")
|
||||||
|
|
||||||
|
wasSleeping := false
|
||||||
|
for {
|
||||||
|
select {
|
||||||
|
case <-m.stopChan:
|
||||||
|
return
|
||||||
|
case state, ok := <-ch:
|
||||||
|
if !ok {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if state.PreparingForSleep {
|
||||||
|
wasSleeping = true
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if wasSleeping {
|
||||||
|
wasSleeping = false
|
||||||
|
go m.scheduleRecovery()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Manager) scheduleRecovery() {
|
||||||
|
select {
|
||||||
|
case <-time.After(resumeDelay):
|
||||||
|
m.recoverTrayItems()
|
||||||
|
case <-m.stopChan:
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Manager) Close() {
|
||||||
|
select {
|
||||||
|
case <-m.stopChan:
|
||||||
|
return
|
||||||
|
default:
|
||||||
|
close(m.stopChan)
|
||||||
|
}
|
||||||
|
m.wg.Wait()
|
||||||
|
if m.conn != nil {
|
||||||
|
m.conn.Close()
|
||||||
|
}
|
||||||
|
log.Info("TrayRecovery manager closed")
|
||||||
|
}
|
||||||
@@ -0,0 +1,262 @@
|
|||||||
|
package trayrecovery
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"strings"
|
||||||
|
"sync"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/AvengeMedia/DankMaterialShell/core/internal/log"
|
||||||
|
"github.com/godbus/dbus/v5"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
sniWatcherDest = "org.kde.StatusNotifierWatcher"
|
||||||
|
sniWatcherPath = "/StatusNotifierWatcher"
|
||||||
|
sniWatcherIface = "org.kde.StatusNotifierWatcher"
|
||||||
|
sniItemIface = "org.kde.StatusNotifierItem"
|
||||||
|
dbusIface = "org.freedesktop.DBus"
|
||||||
|
propsIface = "org.freedesktop.DBus.Properties"
|
||||||
|
probeTimeout = 300 * time.Millisecond
|
||||||
|
connProbeTimeout = 150 * time.Millisecond
|
||||||
|
batchSize = 30
|
||||||
|
)
|
||||||
|
|
||||||
|
var excludedPrefixes = []string{
|
||||||
|
"org.freedesktop.",
|
||||||
|
"org.gnome.",
|
||||||
|
"org.kde.StatusNotifier",
|
||||||
|
"com.canonical.AppMenu",
|
||||||
|
"org.mpris.",
|
||||||
|
"org.pipewire.",
|
||||||
|
"org.pulseaudio",
|
||||||
|
"fi.epitaph",
|
||||||
|
"quickshell",
|
||||||
|
"org.kde.quickshell",
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Manager) recoverTrayItems() {
|
||||||
|
registeredItems := m.getRegisteredItems()
|
||||||
|
allNames := m.getDBusNames()
|
||||||
|
if allNames == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
registeredConnIDs := m.buildRegisteredConnIDs(registeredItems)
|
||||||
|
|
||||||
|
count := len(registeredItems)
|
||||||
|
log.Infof("TrayRecoveryService: scanning DBus for unregistered SNI items (%d already registered)...", count)
|
||||||
|
|
||||||
|
m.scanWellKnownNames(allNames, registeredItems, registeredConnIDs)
|
||||||
|
m.scanConnectionIDs(allNames, registeredItems, registeredConnIDs)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Manager) getRegisteredItems() []string {
|
||||||
|
obj := m.conn.Object(sniWatcherDest, sniWatcherPath)
|
||||||
|
variant, err := obj.GetProperty(sniWatcherIface + ".RegisteredStatusNotifierItems")
|
||||||
|
if err != nil {
|
||||||
|
log.Warnf("TrayRecoveryService: failed to get registered items: %v", err)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
switch v := variant.Value().(type) {
|
||||||
|
case []string:
|
||||||
|
return v
|
||||||
|
case []any:
|
||||||
|
items := make([]string, 0, len(v))
|
||||||
|
for _, elem := range v {
|
||||||
|
if s, ok := elem.(string); ok {
|
||||||
|
items = append(items, s)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return items
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Manager) getDBusNames() []string {
|
||||||
|
var names []string
|
||||||
|
err := m.conn.BusObject().Call(dbusIface+".ListNames", 0).Store(&names)
|
||||||
|
if err != nil {
|
||||||
|
log.Warnf("TrayRecoveryService: failed to list bus names: %v", err)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return names
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Manager) getNameOwner(name string) string {
|
||||||
|
var owner string
|
||||||
|
err := m.conn.BusObject().Call(dbusIface+".GetNameOwner", 0, name).Store(&owner)
|
||||||
|
if err != nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return owner
|
||||||
|
}
|
||||||
|
|
||||||
|
// buildRegisteredConnIDs resolves every registered SNI item (well-known name
|
||||||
|
// or :1.xxx connection ID) to a canonical connection ID. This prevents
|
||||||
|
// duplicates in both directions.
|
||||||
|
func (m *Manager) buildRegisteredConnIDs(registeredItems []string) map[string]bool {
|
||||||
|
connIDs := make(map[string]bool, len(registeredItems))
|
||||||
|
for _, item := range registeredItems {
|
||||||
|
name := extractName(item)
|
||||||
|
if strings.HasPrefix(name, ":1.") {
|
||||||
|
connIDs[name] = true
|
||||||
|
} else {
|
||||||
|
owner := m.getNameOwner(name)
|
||||||
|
if owner != "" {
|
||||||
|
connIDs[owner] = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return connIDs
|
||||||
|
}
|
||||||
|
|
||||||
|
// scanWellKnownNames probes well-known names (e.g. DinoX, nm-applet) for
|
||||||
|
// unregistered SNI items and re-registers them.
|
||||||
|
func (m *Manager) scanWellKnownNames(allNames []string, registeredItems []string, registeredConnIDs map[string]bool) {
|
||||||
|
registeredRaw := strings.Join(registeredItems, "\n")
|
||||||
|
|
||||||
|
for _, name := range allNames {
|
||||||
|
if strings.HasPrefix(name, ":") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if strings.Contains(registeredRaw, name) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
// Skip if this name's connection ID is already in the registered set
|
||||||
|
// (handles the case where the app registered via connection ID instead)
|
||||||
|
connForName := m.getNameOwner(name)
|
||||||
|
if connForName != "" && registeredConnIDs[connForName] {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if isExcludedName(name) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
short := shortName(name)
|
||||||
|
objectPaths := []string{
|
||||||
|
"/StatusNotifierItem",
|
||||||
|
"/org/ayatana/NotificationItem/" + short,
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, objPath := range objectPaths {
|
||||||
|
if m.probeSNI(name, objPath, probeTimeout) {
|
||||||
|
m.registerSNI(name)
|
||||||
|
// Update set so the connection-ID section won't double-register this app
|
||||||
|
if connForName != "" {
|
||||||
|
registeredConnIDs[connForName] = true
|
||||||
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// scanConnectionIDs probes all :1.xxx connections in parallel for unregistered
|
||||||
|
// SNI items (e.g. Vesktop, Electron apps). Most non-SNI connections return an
|
||||||
|
// error instantly, so this is fast.
|
||||||
|
func (m *Manager) scanConnectionIDs(allNames []string, registeredItems []string, registeredConnIDs map[string]bool) {
|
||||||
|
registeredRaw := strings.Join(registeredItems, "\n")
|
||||||
|
registeredLower := strings.ToLower(registeredRaw)
|
||||||
|
|
||||||
|
var wg sync.WaitGroup
|
||||||
|
sem := make(chan struct{}, batchSize)
|
||||||
|
|
||||||
|
for _, name := range allNames {
|
||||||
|
if !strings.HasPrefix(name, ":1.") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if registeredConnIDs[name] {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
sem <- struct{}{}
|
||||||
|
wg.Add(1)
|
||||||
|
go func(conn string) {
|
||||||
|
defer wg.Done()
|
||||||
|
defer func() { <-sem }()
|
||||||
|
|
||||||
|
sniID := m.getSNIId(conn, connProbeTimeout)
|
||||||
|
if sniID == "" {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Skip if an item with the same Id is already registered (case-insensitive)
|
||||||
|
if strings.Contains(registeredLower, strings.ToLower(sniID)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
m.registerSNI(conn)
|
||||||
|
log.Infof("TrayRecovery: re-registered %s (Id: %s)", conn, sniID)
|
||||||
|
}(name)
|
||||||
|
}
|
||||||
|
wg.Wait()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Manager) probeSNI(dest, path string, timeout time.Duration) bool {
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
obj := m.conn.Object(dest, dbus.ObjectPath(path))
|
||||||
|
var props map[string]dbus.Variant
|
||||||
|
err := obj.CallWithContext(ctx, propsIface+".GetAll", 0, sniItemIface).Store(&props)
|
||||||
|
if err != nil {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
_, hasID := props["Id"]
|
||||||
|
return hasID
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Manager) getSNIId(dest string, timeout time.Duration) string {
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), timeout)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
obj := m.conn.Object(dest, "/StatusNotifierItem")
|
||||||
|
var variant dbus.Variant
|
||||||
|
err := obj.CallWithContext(ctx, propsIface+".Get", 0, sniItemIface, "Id").Store(&variant)
|
||||||
|
if err != nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
id, _ := variant.Value().(string)
|
||||||
|
return id
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *Manager) registerSNI(name string) {
|
||||||
|
obj := m.conn.Object(sniWatcherDest, sniWatcherPath)
|
||||||
|
call := obj.Call(sniWatcherIface+".RegisterStatusNotifierItem", 0, name)
|
||||||
|
if call.Err != nil {
|
||||||
|
log.Warnf("TrayRecovery: failed to register %s: %v", name, call.Err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
log.Infof("TrayRecovery: re-registered %s", name)
|
||||||
|
}
|
||||||
|
|
||||||
|
func extractName(item string) string {
|
||||||
|
if idx := strings.IndexByte(item, '/'); idx != -1 {
|
||||||
|
return item[:idx]
|
||||||
|
}
|
||||||
|
return item
|
||||||
|
}
|
||||||
|
|
||||||
|
func shortName(name string) string {
|
||||||
|
parts := strings.Split(name, ".")
|
||||||
|
if len(parts) > 0 {
|
||||||
|
return parts[len(parts)-1]
|
||||||
|
}
|
||||||
|
return name
|
||||||
|
}
|
||||||
|
|
||||||
|
func isExcludedName(name string) bool {
|
||||||
|
for _, prefix := range excludedPrefixes {
|
||||||
|
if strings.HasPrefix(name, prefix) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
@@ -139,7 +139,7 @@ func dmsPackageName(distroID string, dependencies []deps.Dependency) string {
|
|||||||
if isGit {
|
if isGit {
|
||||||
return "dms-shell-git"
|
return "dms-shell-git"
|
||||||
}
|
}
|
||||||
return "dms-shell-bin"
|
return "dms-shell"
|
||||||
case distros.FamilyFedora, distros.FamilyUbuntu, distros.FamilyDebian, distros.FamilySUSE:
|
case distros.FamilyFedora, distros.FamilyUbuntu, distros.FamilyDebian, distros.FamilySUSE:
|
||||||
if isGit {
|
if isGit {
|
||||||
return "dms-git"
|
return "dms-git"
|
||||||
|
|||||||
@@ -0,0 +1,179 @@
|
|||||||
|
pragma Singleton
|
||||||
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
import Quickshell
|
||||||
|
import qs.Common
|
||||||
|
|
||||||
|
// AnimVariants — Central tuning for animation and Motion Effects variants
|
||||||
|
// (Material/Fluent/Dynamic) (Standard/Directional/Depth)
|
||||||
|
|
||||||
|
Singleton {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
readonly property list<real> variantEnterCurve: {
|
||||||
|
if (typeof SettingsData === "undefined")
|
||||||
|
return Anims.expressiveDefaultSpatial;
|
||||||
|
switch (SettingsData.animationVariant) {
|
||||||
|
case 1:
|
||||||
|
return Anims.standardDecel;
|
||||||
|
case 2:
|
||||||
|
return Anims.expressiveFastSpatial;
|
||||||
|
default:
|
||||||
|
return Anims.expressiveDefaultSpatial;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
readonly property list<real> variantExitCurve: {
|
||||||
|
if (typeof SettingsData === "undefined")
|
||||||
|
return Anims.emphasized;
|
||||||
|
switch (SettingsData.animationVariant) {
|
||||||
|
case 1:
|
||||||
|
return Anims.standard;
|
||||||
|
case 2:
|
||||||
|
return Anims.emphasized;
|
||||||
|
default:
|
||||||
|
return Anims.emphasized;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Modal-specific entry curve
|
||||||
|
readonly property list<real> variantModalEnterCurve: {
|
||||||
|
if (typeof SettingsData === "undefined")
|
||||||
|
return Anims.expressiveDefaultSpatial;
|
||||||
|
if (isDirectionalEffect) {
|
||||||
|
if (SettingsData.animationVariant === 1)
|
||||||
|
return Anims.standardDecel;
|
||||||
|
if (SettingsData.animationVariant === 2)
|
||||||
|
return Anims.expressiveFastSpatial;
|
||||||
|
}
|
||||||
|
return variantEnterCurve;
|
||||||
|
}
|
||||||
|
|
||||||
|
readonly property list<real> variantModalExitCurve: {
|
||||||
|
if (typeof SettingsData === "undefined")
|
||||||
|
return Anims.emphasized;
|
||||||
|
if (isDirectionalEffect) {
|
||||||
|
if (SettingsData.animationVariant === 1)
|
||||||
|
return Anims.emphasizedAccel;
|
||||||
|
if (SettingsData.animationVariant === 2)
|
||||||
|
return Anims.emphasizedAccel;
|
||||||
|
}
|
||||||
|
return variantExitCurve;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Popout-specific entry curve
|
||||||
|
readonly property list<real> variantPopoutEnterCurve: {
|
||||||
|
if (typeof SettingsData === "undefined")
|
||||||
|
return Anims.expressiveDefaultSpatial;
|
||||||
|
if (isDirectionalEffect) {
|
||||||
|
if (SettingsData.animationVariant === 1)
|
||||||
|
return Anims.standardDecel;
|
||||||
|
if (SettingsData.animationVariant === 2)
|
||||||
|
return Anims.expressiveFastSpatial;
|
||||||
|
return Anims.standardDecel;
|
||||||
|
}
|
||||||
|
return variantEnterCurve;
|
||||||
|
}
|
||||||
|
|
||||||
|
readonly property list<real> variantPopoutExitCurve: {
|
||||||
|
if (typeof SettingsData === "undefined")
|
||||||
|
return Anims.emphasized;
|
||||||
|
if (isDirectionalEffect) {
|
||||||
|
if (SettingsData.animationVariant === 1)
|
||||||
|
return Anims.emphasizedAccel;
|
||||||
|
if (SettingsData.animationVariant === 2)
|
||||||
|
return Anims.emphasizedAccel;
|
||||||
|
}
|
||||||
|
return variantExitCurve;
|
||||||
|
}
|
||||||
|
|
||||||
|
readonly property real variantEnterDurationFactor: {
|
||||||
|
if (typeof SettingsData === "undefined")
|
||||||
|
return 1.0;
|
||||||
|
switch (SettingsData.animationVariant) {
|
||||||
|
case 1:
|
||||||
|
return 0.9;
|
||||||
|
case 2:
|
||||||
|
return 1.08;
|
||||||
|
default:
|
||||||
|
return 1.0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
readonly property real variantExitDurationFactor: {
|
||||||
|
if (typeof SettingsData === "undefined")
|
||||||
|
return 1.0;
|
||||||
|
switch (SettingsData.animationVariant) {
|
||||||
|
case 1:
|
||||||
|
return 0.85;
|
||||||
|
case 2:
|
||||||
|
return 0.92;
|
||||||
|
default:
|
||||||
|
return 1.0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fluent: opacity at ~55% of duration; Material/Dynamic: 1:1 with position
|
||||||
|
readonly property real variantOpacityDurationScale: {
|
||||||
|
if (typeof SettingsData === "undefined")
|
||||||
|
return 1.0;
|
||||||
|
return SettingsData.animationVariant === 1 ? 0.55 : 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
function variantDuration(baseDuration, entering) {
|
||||||
|
const factor = entering ? variantEnterDurationFactor : variantExitDurationFactor;
|
||||||
|
return Math.max(0, Math.round(baseDuration * factor));
|
||||||
|
}
|
||||||
|
|
||||||
|
function variantExitCleanupPadding() {
|
||||||
|
if (typeof SettingsData === "undefined")
|
||||||
|
return 50;
|
||||||
|
switch (SettingsData.motionEffect) {
|
||||||
|
case 1:
|
||||||
|
return 8;
|
||||||
|
case 2:
|
||||||
|
return 24;
|
||||||
|
default:
|
||||||
|
return 50;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function variantCloseInterval(baseDuration) {
|
||||||
|
return variantDuration(baseDuration, false) + variantExitCleanupPadding();
|
||||||
|
}
|
||||||
|
|
||||||
|
readonly property bool isDirectionalEffect: isConnectedEffect
|
||||||
|
|| (typeof SettingsData !== "undefined" && SettingsData.motionEffect === 1)
|
||||||
|
readonly property bool isDepthEffect: typeof SettingsData !== "undefined" && SettingsData.motionEffect === 2
|
||||||
|
readonly property bool isConnectedEffect: typeof SettingsData !== "undefined"
|
||||||
|
&& SettingsData.frameEnabled
|
||||||
|
&& SettingsData.motionEffect === 1
|
||||||
|
&& SettingsData.directionalAnimationMode === 3
|
||||||
|
|
||||||
|
readonly property real effectScaleCollapsed: {
|
||||||
|
if (typeof SettingsData === "undefined")
|
||||||
|
return 0.96;
|
||||||
|
switch (SettingsData.motionEffect) {
|
||||||
|
case 1:
|
||||||
|
return 1.0;
|
||||||
|
case 2:
|
||||||
|
return 0.88;
|
||||||
|
default:
|
||||||
|
return 0.96;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
readonly property real effectAnimOffset: {
|
||||||
|
if (typeof SettingsData === "undefined")
|
||||||
|
return 16;
|
||||||
|
switch (SettingsData.motionEffect) {
|
||||||
|
case 1:
|
||||||
|
return 144;
|
||||||
|
case 2:
|
||||||
|
return 56;
|
||||||
|
default:
|
||||||
|
return 16;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -22,4 +22,9 @@ Singleton {
|
|||||||
readonly property var standard: [0.20, 0.00, 0.00, 1.00, 1.00, 1.00]
|
readonly property var standard: [0.20, 0.00, 0.00, 1.00, 1.00, 1.00]
|
||||||
readonly property var standardDecel: [0.00, 0.00, 0.00, 1.00, 1.00, 1.00]
|
readonly property var standardDecel: [0.00, 0.00, 0.00, 1.00, 1.00, 1.00]
|
||||||
readonly property var standardAccel: [0.30, 0.00, 1.00, 1.00, 1.00, 1.00]
|
readonly property var standardAccel: [0.30, 0.00, 1.00, 1.00, 1.00, 1.00]
|
||||||
|
|
||||||
|
// Used by AnimVariants for variant/effect logic
|
||||||
|
readonly property var expressiveDefaultSpatial: [0.38, 1.21, 0.22, 1, 1, 1]
|
||||||
|
readonly property var expressiveFastSpatial: [0.34, 1.5, 0.2, 1.0, 1.0, 1.0]
|
||||||
|
readonly property var expressiveEffects: [0.34, 0.8, 0.34, 1, 1, 1]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,204 @@
|
|||||||
|
pragma Singleton
|
||||||
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
import Quickshell
|
||||||
|
|
||||||
|
Singleton {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
readonly property var emptyDockState: ({
|
||||||
|
"reveal": false,
|
||||||
|
"barSide": "bottom",
|
||||||
|
"bodyX": 0,
|
||||||
|
"bodyY": 0,
|
||||||
|
"bodyW": 0,
|
||||||
|
"bodyH": 0,
|
||||||
|
"slideX": 0,
|
||||||
|
"slideY": 0
|
||||||
|
})
|
||||||
|
|
||||||
|
// Popout state (updated by DankPopout when connectedFrameModeActive)
|
||||||
|
property string popoutOwnerId: ""
|
||||||
|
property bool popoutVisible: false
|
||||||
|
property string popoutBarSide: "top"
|
||||||
|
property real popoutBodyX: 0
|
||||||
|
property real popoutBodyY: 0
|
||||||
|
property real popoutBodyW: 0
|
||||||
|
property real popoutBodyH: 0
|
||||||
|
property real popoutAnimX: 0
|
||||||
|
property real popoutAnimY: 0
|
||||||
|
property string popoutScreen: ""
|
||||||
|
|
||||||
|
// Dock state (updated by Dock when connectedFrameModeActive), keyed by screen.name
|
||||||
|
property var dockStates: ({})
|
||||||
|
|
||||||
|
// Dock slide offsets — hot-path updates separated from full geometry state
|
||||||
|
property var dockSlides: ({})
|
||||||
|
|
||||||
|
function hasPopoutOwner(claimId) {
|
||||||
|
return !!claimId && popoutOwnerId === claimId;
|
||||||
|
}
|
||||||
|
|
||||||
|
function claimPopout(claimId, state) {
|
||||||
|
if (!claimId)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
popoutOwnerId = claimId;
|
||||||
|
return updatePopout(claimId, state);
|
||||||
|
}
|
||||||
|
|
||||||
|
function updatePopout(claimId, state) {
|
||||||
|
if (!hasPopoutOwner(claimId) || !state)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (state.visible !== undefined)
|
||||||
|
popoutVisible = !!state.visible;
|
||||||
|
if (state.barSide !== undefined)
|
||||||
|
popoutBarSide = state.barSide || "top";
|
||||||
|
if (state.bodyX !== undefined)
|
||||||
|
popoutBodyX = Number(state.bodyX);
|
||||||
|
if (state.bodyY !== undefined)
|
||||||
|
popoutBodyY = Number(state.bodyY);
|
||||||
|
if (state.bodyW !== undefined)
|
||||||
|
popoutBodyW = Number(state.bodyW);
|
||||||
|
if (state.bodyH !== undefined)
|
||||||
|
popoutBodyH = Number(state.bodyH);
|
||||||
|
if (state.animX !== undefined)
|
||||||
|
popoutAnimX = Number(state.animX);
|
||||||
|
if (state.animY !== undefined)
|
||||||
|
popoutAnimY = Number(state.animY);
|
||||||
|
if (state.screen !== undefined)
|
||||||
|
popoutScreen = state.screen || "";
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function releasePopout(claimId) {
|
||||||
|
if (!hasPopoutOwner(claimId))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
popoutOwnerId = "";
|
||||||
|
popoutVisible = false;
|
||||||
|
popoutBarSide = "top";
|
||||||
|
popoutBodyX = 0;
|
||||||
|
popoutBodyY = 0;
|
||||||
|
popoutBodyW = 0;
|
||||||
|
popoutBodyH = 0;
|
||||||
|
popoutAnimX = 0;
|
||||||
|
popoutAnimY = 0;
|
||||||
|
popoutScreen = "";
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _cloneDockStates() {
|
||||||
|
const next = {};
|
||||||
|
for (const screenName in dockStates)
|
||||||
|
next[screenName] = dockStates[screenName];
|
||||||
|
return next;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _normalizeDockState(state) {
|
||||||
|
return {
|
||||||
|
"reveal": !!(state && state.reveal),
|
||||||
|
"barSide": state && state.barSide ? state.barSide : "bottom",
|
||||||
|
"bodyX": Number(state && state.bodyX !== undefined ? state.bodyX : 0),
|
||||||
|
"bodyY": Number(state && state.bodyY !== undefined ? state.bodyY : 0),
|
||||||
|
"bodyW": Number(state && state.bodyW !== undefined ? state.bodyW : 0),
|
||||||
|
"bodyH": Number(state && state.bodyH !== undefined ? state.bodyH : 0),
|
||||||
|
"slideX": Number(state && state.slideX !== undefined ? state.slideX : 0),
|
||||||
|
"slideY": Number(state && state.slideY !== undefined ? state.slideY : 0)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function setDockState(screenName, state) {
|
||||||
|
if (!screenName || !state)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
const next = _cloneDockStates();
|
||||||
|
next[screenName] = _normalizeDockState(state);
|
||||||
|
dockStates = next;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function clearDockState(screenName) {
|
||||||
|
if (!screenName || !dockStates[screenName])
|
||||||
|
return false;
|
||||||
|
|
||||||
|
const next = _cloneDockStates();
|
||||||
|
delete next[screenName];
|
||||||
|
dockStates = next;
|
||||||
|
|
||||||
|
// Also clear corresponding slide
|
||||||
|
if (dockSlides[screenName]) {
|
||||||
|
const nextSlides = {};
|
||||||
|
for (const k in dockSlides)
|
||||||
|
nextSlides[k] = dockSlides[k];
|
||||||
|
delete nextSlides[screenName];
|
||||||
|
dockSlides = nextSlides;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setDockSlide(screenName, x, y) {
|
||||||
|
if (!screenName)
|
||||||
|
return false;
|
||||||
|
const next = {};
|
||||||
|
for (const k in dockSlides)
|
||||||
|
next[k] = dockSlides[k];
|
||||||
|
next[screenName] = { "x": Number(x), "y": Number(y) };
|
||||||
|
dockSlides = next;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── Notification state (per screen, updated by NotificationSurface) ──────
|
||||||
|
|
||||||
|
readonly property var emptyNotificationState: ({
|
||||||
|
"visible": false,
|
||||||
|
"barSide": "top",
|
||||||
|
"bodyX": 0,
|
||||||
|
"bodyY": 0,
|
||||||
|
"bodyW": 0,
|
||||||
|
"bodyH": 0
|
||||||
|
})
|
||||||
|
|
||||||
|
property var notificationStates: ({})
|
||||||
|
|
||||||
|
function _cloneNotificationStates() {
|
||||||
|
const next = {};
|
||||||
|
for (const screenName in notificationStates)
|
||||||
|
next[screenName] = notificationStates[screenName];
|
||||||
|
return next;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _normalizeNotificationState(state) {
|
||||||
|
return {
|
||||||
|
"visible": !!(state && state.visible),
|
||||||
|
"barSide": state && state.barSide ? state.barSide : "top",
|
||||||
|
"bodyX": Number(state && state.bodyX !== undefined ? state.bodyX : 0),
|
||||||
|
"bodyY": Number(state && state.bodyY !== undefined ? state.bodyY : 0),
|
||||||
|
"bodyW": Number(state && state.bodyW !== undefined ? state.bodyW : 0),
|
||||||
|
"bodyH": Number(state && state.bodyH !== undefined ? state.bodyH : 0)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function setNotificationState(screenName, state) {
|
||||||
|
if (!screenName || !state)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
const next = _cloneNotificationStates();
|
||||||
|
next[screenName] = _normalizeNotificationState(state);
|
||||||
|
notificationStates = next;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function clearNotificationState(screenName) {
|
||||||
|
if (!screenName || !notificationStates[screenName])
|
||||||
|
return false;
|
||||||
|
|
||||||
|
const next = _cloneNotificationStates();
|
||||||
|
delete next[screenName];
|
||||||
|
notificationStates = next;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -13,8 +13,13 @@ Item {
|
|||||||
|
|
||||||
property color targetColor: "white"
|
property color targetColor: "white"
|
||||||
property real targetRadius: Theme.cornerRadius
|
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 color borderColor: "transparent"
|
||||||
property real borderWidth: 0
|
property real borderWidth: 0
|
||||||
|
property bool useCustomSource: false
|
||||||
|
|
||||||
property bool shadowEnabled: Theme.elevationEnabled
|
property bool shadowEnabled: Theme.elevationEnabled
|
||||||
property real shadowBlurPx: level && level.blurPx !== undefined ? level.blurPx : 0
|
property real shadowBlurPx: level && level.blurPx !== undefined ? level.blurPx : 0
|
||||||
@@ -46,7 +51,11 @@ Item {
|
|||||||
Rectangle {
|
Rectangle {
|
||||||
id: sourceRect
|
id: sourceRect
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
radius: root.targetRadius
|
visible: !root.useCustomSource
|
||||||
|
topLeftRadius: root.topLeftRadius
|
||||||
|
topRightRadius: root.topRightRadius
|
||||||
|
bottomLeftRadius: root.bottomLeftRadius
|
||||||
|
bottomRightRadius: root.bottomRightRadius
|
||||||
color: root.targetColor
|
color: root.targetColor
|
||||||
border.color: root.borderColor
|
border.color: root.borderColor
|
||||||
border.width: root.borderWidth
|
border.width: root.borderWidth
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import "settings/SettingsStore.js" as Store
|
|||||||
Singleton {
|
Singleton {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
readonly property int settingsConfigVersion: 5
|
readonly property int settingsConfigVersion: 11
|
||||||
|
|
||||||
readonly property bool isGreeterMode: Quickshell.env("DMS_RUN_GREETER") === "1" || Quickshell.env("DMS_RUN_GREETER") === "true"
|
readonly property bool isGreeterMode: Quickshell.env("DMS_RUN_GREETER") === "1" || Quickshell.env("DMS_RUN_GREETER") === "true"
|
||||||
|
|
||||||
@@ -37,6 +37,18 @@ Singleton {
|
|||||||
Custom
|
Custom
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum AnimationVariant {
|
||||||
|
Material,
|
||||||
|
Fluent,
|
||||||
|
Dynamic
|
||||||
|
}
|
||||||
|
|
||||||
|
enum AnimationEffect {
|
||||||
|
Standard, // 0 — M3: scale-in, rises from below
|
||||||
|
Directional, // 1 — pure large slide, no scale
|
||||||
|
Depth // 2 — medium slide with deep depth scale pop
|
||||||
|
}
|
||||||
|
|
||||||
enum SuspendBehavior {
|
enum SuspendBehavior {
|
||||||
Suspend,
|
Suspend,
|
||||||
Hibernate,
|
Hibernate,
|
||||||
@@ -168,6 +180,12 @@ Singleton {
|
|||||||
property int modalCustomAnimationDuration: 150
|
property int modalCustomAnimationDuration: 150
|
||||||
property bool enableRippleEffects: true
|
property bool enableRippleEffects: true
|
||||||
onEnableRippleEffectsChanged: saveSettings()
|
onEnableRippleEffectsChanged: saveSettings()
|
||||||
|
property int animationVariant: SettingsData.AnimationVariant.Material
|
||||||
|
onAnimationVariantChanged: saveSettings()
|
||||||
|
property int motionEffect: SettingsData.AnimationEffect.Standard
|
||||||
|
onMotionEffectChanged: saveSettings()
|
||||||
|
property int directionalAnimationMode: 0
|
||||||
|
onDirectionalAnimationModeChanged: saveSettings()
|
||||||
property bool m3ElevationEnabled: true
|
property bool m3ElevationEnabled: true
|
||||||
onM3ElevationEnabledChanged: saveSettings()
|
onM3ElevationEnabledChanged: saveSettings()
|
||||||
property int m3ElevationIntensity: 12
|
property int m3ElevationIntensity: 12
|
||||||
@@ -186,6 +204,7 @@ Singleton {
|
|||||||
onPopoutElevationEnabledChanged: saveSettings()
|
onPopoutElevationEnabledChanged: saveSettings()
|
||||||
property bool barElevationEnabled: true
|
property bool barElevationEnabled: true
|
||||||
onBarElevationEnabledChanged: saveSettings()
|
onBarElevationEnabledChanged: saveSettings()
|
||||||
|
|
||||||
property bool blurEnabled: false
|
property bool blurEnabled: false
|
||||||
onBlurEnabledChanged: saveSettings()
|
onBlurEnabledChanged: saveSettings()
|
||||||
property string blurBorderColor: "outline"
|
property string blurBorderColor: "outline"
|
||||||
@@ -198,6 +217,50 @@ Singleton {
|
|||||||
property bool blurredWallpaperLayer: false
|
property bool blurredWallpaperLayer: false
|
||||||
property bool blurWallpaperOnOverview: false
|
property bool blurWallpaperOnOverview: false
|
||||||
|
|
||||||
|
property bool frameEnabled: false
|
||||||
|
onFrameEnabledChanged: saveSettings()
|
||||||
|
property real frameThickness: 16
|
||||||
|
onFrameThicknessChanged: saveSettings()
|
||||||
|
property real frameRounding: 23
|
||||||
|
onFrameRoundingChanged: saveSettings()
|
||||||
|
property string frameColor: ""
|
||||||
|
onFrameColorChanged: saveSettings()
|
||||||
|
property real frameOpacity: 1.0
|
||||||
|
onFrameOpacityChanged: saveSettings()
|
||||||
|
property var frameScreenPreferences: ["all"]
|
||||||
|
onFrameScreenPreferencesChanged: saveSettings()
|
||||||
|
property real frameBarSize: 40
|
||||||
|
onFrameBarSizeChanged: saveSettings()
|
||||||
|
property bool frameShowOnOverview: false
|
||||||
|
onFrameShowOnOverviewChanged: saveSettings()
|
||||||
|
property bool frameBlurEnabled: true
|
||||||
|
onFrameBlurEnabledChanged: saveSettings()
|
||||||
|
property int previousDirectionalMode: 1
|
||||||
|
onPreviousDirectionalModeChanged: saveSettings()
|
||||||
|
property var connectedFrameBarStyleBackups: ({})
|
||||||
|
onConnectedFrameBarStyleBackupsChanged: saveSettings()
|
||||||
|
readonly property bool connectedFrameModeActive: frameEnabled
|
||||||
|
&& motionEffect === SettingsData.AnimationEffect.Directional
|
||||||
|
&& directionalAnimationMode === 3
|
||||||
|
onConnectedFrameModeActiveChanged: {
|
||||||
|
if (_loading)
|
||||||
|
return;
|
||||||
|
if (connectedFrameModeActive) {
|
||||||
|
_captureConnectedFrameBarStyleBackups(barConfigs, true);
|
||||||
|
_enforceConnectedModeBarStyleReset();
|
||||||
|
} else {
|
||||||
|
_restoreConnectedFrameBarStyleBackups();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
readonly property color effectiveFrameColor: {
|
||||||
|
const fc = frameColor;
|
||||||
|
if (!fc || fc === "default") return Theme.surfaceContainer;
|
||||||
|
if (fc === "primary") return Theme.primary;
|
||||||
|
if (fc === "surface") return Theme.surface;
|
||||||
|
return fc;
|
||||||
|
}
|
||||||
|
|
||||||
property bool showLauncherButton: true
|
property bool showLauncherButton: true
|
||||||
property bool showWorkspaceSwitcher: true
|
property bool showWorkspaceSwitcher: true
|
||||||
property bool showFocusedWindow: true
|
property bool showFocusedWindow: true
|
||||||
@@ -301,6 +364,7 @@ Singleton {
|
|||||||
property var workspaceNameIcons: ({})
|
property var workspaceNameIcons: ({})
|
||||||
property bool waveProgressEnabled: true
|
property bool waveProgressEnabled: true
|
||||||
property bool scrollTitleEnabled: true
|
property bool scrollTitleEnabled: true
|
||||||
|
property bool mediaAdaptiveWidthEnabled: true
|
||||||
property bool audioVisualizerEnabled: true
|
property bool audioVisualizerEnabled: true
|
||||||
property string audioScrollMode: "volume"
|
property string audioScrollMode: "volume"
|
||||||
property int audioWheelScrollAmount: 5
|
property int audioWheelScrollAmount: 5
|
||||||
@@ -434,6 +498,7 @@ Singleton {
|
|||||||
property bool soundNewNotification: true
|
property bool soundNewNotification: true
|
||||||
property bool soundVolumeChanged: true
|
property bool soundVolumeChanged: true
|
||||||
property bool soundPluggedIn: true
|
property bool soundPluggedIn: true
|
||||||
|
property bool soundLogin: false
|
||||||
|
|
||||||
property int acMonitorTimeout: 0
|
property int acMonitorTimeout: 0
|
||||||
property int acLockTimeout: 0
|
property int acLockTimeout: 0
|
||||||
@@ -1283,6 +1348,7 @@ Singleton {
|
|||||||
_loading = false;
|
_loading = false;
|
||||||
}
|
}
|
||||||
loadPluginSettings();
|
loadPluginSettings();
|
||||||
|
Qt.callLater(() => _reconcileConnectedFrameBarStyles());
|
||||||
}
|
}
|
||||||
|
|
||||||
property var _pendingMigration: null
|
property var _pendingMigration: null
|
||||||
@@ -1396,6 +1462,149 @@ Singleton {
|
|||||||
pluginSettingsFile.setText(JSON.stringify(pluginSettings, null, 2));
|
pluginSettingsFile.setText(JSON.stringify(pluginSettings, null, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function _connectedFrameBarStyleSnapshot(config) {
|
||||||
|
return {
|
||||||
|
"shadowIntensity": config?.shadowIntensity ?? 0,
|
||||||
|
"squareCorners": config?.squareCorners ?? false,
|
||||||
|
"gothCornersEnabled": config?.gothCornersEnabled ?? false,
|
||||||
|
"borderEnabled": config?.borderEnabled ?? false
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function _hasConnectedFrameBarStyleBackups() {
|
||||||
|
return connectedFrameBarStyleBackups && Object.keys(connectedFrameBarStyleBackups).length > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _captureConnectedFrameBarStyleBackups(configs, overwriteExisting) {
|
||||||
|
if (!Array.isArray(configs))
|
||||||
|
return;
|
||||||
|
|
||||||
|
const nextBackups = JSON.parse(JSON.stringify(connectedFrameBarStyleBackups || {}));
|
||||||
|
const validIds = {};
|
||||||
|
let changed = false;
|
||||||
|
|
||||||
|
for (let i = 0; i < configs.length; i++) {
|
||||||
|
const config = configs[i];
|
||||||
|
if (!config?.id)
|
||||||
|
continue;
|
||||||
|
validIds[config.id] = true;
|
||||||
|
|
||||||
|
if (!overwriteExisting && nextBackups[config.id] !== undefined)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
const snapshot = _connectedFrameBarStyleSnapshot(config);
|
||||||
|
if (JSON.stringify(nextBackups[config.id]) !== JSON.stringify(snapshot)) {
|
||||||
|
nextBackups[config.id] = snapshot;
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (overwriteExisting) {
|
||||||
|
for (const barId in nextBackups) {
|
||||||
|
if (validIds[barId])
|
||||||
|
continue;
|
||||||
|
delete nextBackups[barId];
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (changed)
|
||||||
|
connectedFrameBarStyleBackups = nextBackups;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _restoreConnectedFrameBarStyleBackups() {
|
||||||
|
if (!_hasConnectedFrameBarStyleBackups())
|
||||||
|
return;
|
||||||
|
|
||||||
|
const backups = connectedFrameBarStyleBackups || {};
|
||||||
|
const configs = JSON.parse(JSON.stringify(barConfigs));
|
||||||
|
let changed = false;
|
||||||
|
|
||||||
|
for (let i = 0; i < configs.length; i++) {
|
||||||
|
const backup = backups[configs[i].id];
|
||||||
|
if (!backup)
|
||||||
|
continue;
|
||||||
|
for (const key in backup) {
|
||||||
|
if (configs[i][key] === backup[key])
|
||||||
|
continue;
|
||||||
|
configs[i][key] = backup[key];
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (changed)
|
||||||
|
barConfigs = configs;
|
||||||
|
connectedFrameBarStyleBackups = ({});
|
||||||
|
if (changed)
|
||||||
|
updateBarConfigs();
|
||||||
|
}
|
||||||
|
|
||||||
|
function _reconcileConnectedFrameBarStyles() {
|
||||||
|
if (connectedFrameModeActive) {
|
||||||
|
if (!_hasConnectedFrameBarStyleBackups())
|
||||||
|
_captureConnectedFrameBarStyleBackups(barConfigs, true);
|
||||||
|
_enforceConnectedModeBarStyleReset();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_restoreConnectedFrameBarStyleBackups();
|
||||||
|
}
|
||||||
|
|
||||||
|
function _sanitizeBarConfigForConnectedFrame(config) {
|
||||||
|
if (!connectedFrameModeActive || !config)
|
||||||
|
return config;
|
||||||
|
|
||||||
|
let changed = false;
|
||||||
|
const sanitized = Object.assign({}, config);
|
||||||
|
|
||||||
|
if ((sanitized.shadowIntensity ?? 0) !== 0) {
|
||||||
|
sanitized.shadowIntensity = 0;
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
if (sanitized.squareCorners ?? false) {
|
||||||
|
sanitized.squareCorners = false;
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
if (sanitized.gothCornersEnabled ?? false) {
|
||||||
|
sanitized.gothCornersEnabled = false;
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
if (sanitized.borderEnabled ?? false) {
|
||||||
|
sanitized.borderEnabled = false;
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return changed ? sanitized : config;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _sanitizeBarConfigsForConnectedFrame(configs) {
|
||||||
|
if (!connectedFrameModeActive || !Array.isArray(configs))
|
||||||
|
return {
|
||||||
|
"configs": configs,
|
||||||
|
"changed": false
|
||||||
|
};
|
||||||
|
|
||||||
|
let changed = false;
|
||||||
|
const sanitizedConfigs = configs.map(config => {
|
||||||
|
const sanitized = _sanitizeBarConfigForConnectedFrame(config);
|
||||||
|
if (sanitized !== config)
|
||||||
|
changed = true;
|
||||||
|
return sanitized;
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
"configs": changed ? sanitizedConfigs : configs,
|
||||||
|
"changed": changed
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function _enforceConnectedModeBarStyleReset() {
|
||||||
|
const result = _sanitizeBarConfigsForConnectedFrame(barConfigs);
|
||||||
|
if (!result.changed)
|
||||||
|
return;
|
||||||
|
barConfigs = result.configs;
|
||||||
|
updateBarConfigs();
|
||||||
|
}
|
||||||
|
|
||||||
function detectAvailableIconThemes() {
|
function detectAvailableIconThemes() {
|
||||||
const xdgDataDirs = Quickshell.env("XDG_DATA_DIRS") || "";
|
const xdgDataDirs = Quickshell.env("XDG_DATA_DIRS") || "";
|
||||||
const localData = Paths.strip(StandardPaths.writableLocation(StandardPaths.GenericDataLocation));
|
const localData = Paths.strip(StandardPaths.writableLocation(StandardPaths.GenericDataLocation));
|
||||||
@@ -1543,35 +1752,37 @@ Singleton {
|
|||||||
const spacing = barSpacing !== undefined ? barSpacing : (defaultBar?.spacing ?? 4);
|
const spacing = barSpacing !== undefined ? barSpacing : (defaultBar?.spacing ?? 4);
|
||||||
const position = barPosition !== undefined ? barPosition : (defaultBar?.position ?? SettingsData.Position.Top);
|
const position = barPosition !== undefined ? barPosition : (defaultBar?.position ?? SettingsData.Position.Top);
|
||||||
const rawBottomGap = barConfig ? (barConfig.bottomGap !== undefined ? barConfig.bottomGap : (defaultBar?.bottomGap ?? 0)) : (defaultBar?.bottomGap ?? 0);
|
const rawBottomGap = barConfig ? (barConfig.bottomGap !== undefined ? barConfig.bottomGap : (defaultBar?.bottomGap ?? 0)) : (defaultBar?.bottomGap ?? 0);
|
||||||
const bottomGap = Math.max(0, rawBottomGap);
|
const isConnected = connectedFrameModeActive;
|
||||||
|
const bottomGap = isConnected ? 0 : Math.max(0, rawBottomGap);
|
||||||
|
|
||||||
const useAutoGaps = (barConfig && barConfig.popupGapsAuto !== undefined) ? barConfig.popupGapsAuto : (defaultBar?.popupGapsAuto ?? true);
|
const useAutoGaps = (barConfig && barConfig.popupGapsAuto !== undefined) ? barConfig.popupGapsAuto : (defaultBar?.popupGapsAuto ?? true);
|
||||||
const manualGapValue = (barConfig && barConfig.popupGapsManual !== undefined) ? barConfig.popupGapsManual : (defaultBar?.popupGapsManual ?? 4);
|
const manualGapValue = (barConfig && barConfig.popupGapsManual !== undefined) ? barConfig.popupGapsManual : (defaultBar?.popupGapsManual ?? 4);
|
||||||
const popupGap = useAutoGaps ? Math.max(4, spacing) : manualGapValue;
|
const popupGap = isConnected ? 0 : (useAutoGaps ? Math.max(4, spacing) : manualGapValue);
|
||||||
|
const edgeSpacing = isConnected ? 0 : spacing;
|
||||||
|
|
||||||
switch (position) {
|
switch (position) {
|
||||||
case SettingsData.Position.Left:
|
case SettingsData.Position.Left:
|
||||||
return {
|
return {
|
||||||
"x": barThickness + spacing + popupGap,
|
"x": barThickness + edgeSpacing + popupGap,
|
||||||
"y": relativeY,
|
"y": relativeY,
|
||||||
"width": widgetWidth
|
"width": widgetWidth
|
||||||
};
|
};
|
||||||
case SettingsData.Position.Right:
|
case SettingsData.Position.Right:
|
||||||
return {
|
return {
|
||||||
"x": (screen?.width || 0) - (barThickness + spacing + popupGap),
|
"x": (screen?.width || 0) - (barThickness + edgeSpacing + popupGap),
|
||||||
"y": relativeY,
|
"y": relativeY,
|
||||||
"width": widgetWidth
|
"width": widgetWidth
|
||||||
};
|
};
|
||||||
case SettingsData.Position.Bottom:
|
case SettingsData.Position.Bottom:
|
||||||
return {
|
return {
|
||||||
"x": relativeX,
|
"x": relativeX,
|
||||||
"y": (screen?.height || 0) - (barThickness + spacing + bottomGap + popupGap),
|
"y": (screen?.height || 0) - (barThickness + edgeSpacing + bottomGap + popupGap),
|
||||||
"width": widgetWidth
|
"width": widgetWidth
|
||||||
};
|
};
|
||||||
default:
|
default:
|
||||||
return {
|
return {
|
||||||
"x": relativeX,
|
"x": relativeX,
|
||||||
"y": barThickness + spacing + bottomGap + popupGap,
|
"y": barThickness + edgeSpacing + bottomGap + popupGap,
|
||||||
"width": widgetWidth
|
"width": widgetWidth
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -1665,7 +1876,9 @@ Singleton {
|
|||||||
const screenWidth = screen.width;
|
const screenWidth = screen.width;
|
||||||
const screenHeight = screen.height;
|
const screenHeight = screen.height;
|
||||||
const position = barPosition !== undefined ? barPosition : (defaultBar?.position ?? SettingsData.Position.Top);
|
const position = barPosition !== undefined ? barPosition : (defaultBar?.position ?? SettingsData.Position.Top);
|
||||||
const bottomGap = barConfig ? (barConfig.bottomGap !== undefined ? barConfig.bottomGap : (defaultBar?.bottomGap ?? 0)) : (defaultBar?.bottomGap ?? 0);
|
const isConnected = connectedFrameModeActive;
|
||||||
|
const rawBottomGap = barConfig ? (barConfig.bottomGap !== undefined ? barConfig.bottomGap : (defaultBar?.bottomGap ?? 0)) : (defaultBar?.bottomGap ?? 0);
|
||||||
|
const bottomGap = isConnected ? 0 : rawBottomGap;
|
||||||
|
|
||||||
let topOffset = 0;
|
let topOffset = 0;
|
||||||
let bottomOffset = 0;
|
let bottomOffset = 0;
|
||||||
@@ -1687,7 +1900,7 @@ Singleton {
|
|||||||
const otherSpacing = other.spacing !== undefined ? other.spacing : (defaultBar?.spacing ?? 4);
|
const otherSpacing = other.spacing !== undefined ? other.spacing : (defaultBar?.spacing ?? 4);
|
||||||
const otherPadding = other.innerPadding !== undefined ? other.innerPadding : (defaultBar?.innerPadding ?? 4);
|
const otherPadding = other.innerPadding !== undefined ? other.innerPadding : (defaultBar?.innerPadding ?? 4);
|
||||||
const otherThickness = Math.max(26 + otherPadding * 0.6, Theme.barHeight - 4 - (8 - otherPadding)) + otherSpacing + wingSize;
|
const otherThickness = Math.max(26 + otherPadding * 0.6, Theme.barHeight - 4 - (8 - otherPadding)) + otherSpacing + wingSize;
|
||||||
const otherBottomGap = other.bottomGap !== undefined ? other.bottomGap : (defaultBar?.bottomGap ?? 0);
|
const otherBottomGap = isConnected ? 0 : (other.bottomGap !== undefined ? other.bottomGap : (defaultBar?.bottomGap ?? 0));
|
||||||
|
|
||||||
switch (other.position) {
|
switch (other.position) {
|
||||||
case SettingsData.Position.Top:
|
case SettingsData.Position.Top:
|
||||||
@@ -1778,7 +1991,9 @@ Singleton {
|
|||||||
function addBarConfig(config) {
|
function addBarConfig(config) {
|
||||||
const configs = JSON.parse(JSON.stringify(barConfigs));
|
const configs = JSON.parse(JSON.stringify(barConfigs));
|
||||||
configs.push(config);
|
configs.push(config);
|
||||||
barConfigs = configs;
|
if (connectedFrameModeActive)
|
||||||
|
_captureConnectedFrameBarStyleBackups(configs, false);
|
||||||
|
barConfigs = _sanitizeBarConfigsForConnectedFrame(configs).configs;
|
||||||
updateBarConfigs();
|
updateBarConfigs();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1790,7 +2005,7 @@ Singleton {
|
|||||||
const positionChanged = updates.position !== undefined && configs[index].position !== updates.position;
|
const positionChanged = updates.position !== undefined && configs[index].position !== updates.position;
|
||||||
|
|
||||||
Object.assign(configs[index], updates);
|
Object.assign(configs[index], updates);
|
||||||
barConfigs = configs;
|
barConfigs = _sanitizeBarConfigsForConnectedFrame(configs).configs;
|
||||||
updateBarConfigs();
|
updateBarConfigs();
|
||||||
|
|
||||||
if (positionChanged) {
|
if (positionChanged) {
|
||||||
@@ -1844,6 +2059,11 @@ Singleton {
|
|||||||
return;
|
return;
|
||||||
const configs = barConfigs.filter(cfg => cfg.id !== barId);
|
const configs = barConfigs.filter(cfg => cfg.id !== barId);
|
||||||
barConfigs = configs;
|
barConfigs = configs;
|
||||||
|
if (connectedFrameBarStyleBackups?.[barId] !== undefined) {
|
||||||
|
const nextBackups = JSON.parse(JSON.stringify(connectedFrameBarStyleBackups || {}));
|
||||||
|
delete nextBackups[barId];
|
||||||
|
connectedFrameBarStyleBackups = nextBackups;
|
||||||
|
}
|
||||||
updateBarConfigs();
|
updateBarConfigs();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1938,6 +2158,66 @@ Singleton {
|
|||||||
return filtered;
|
return filtered;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getFrameFilteredScreens() {
|
||||||
|
var prefs = frameScreenPreferences || ["all"];
|
||||||
|
if (!prefs || prefs.length === 0 || prefs.includes("all")) {
|
||||||
|
return Quickshell.screens;
|
||||||
|
}
|
||||||
|
return Quickshell.screens.filter(screen => isScreenInPreferences(screen, prefs));
|
||||||
|
}
|
||||||
|
|
||||||
|
function getActiveBarEdgeForScreen(screen) {
|
||||||
|
if (!screen) return "";
|
||||||
|
for (var i = 0; i < barConfigs.length; i++) {
|
||||||
|
var bc = barConfigs[i];
|
||||||
|
if (!bc.enabled) continue;
|
||||||
|
var prefs = bc.screenPreferences || ["all"];
|
||||||
|
if (!prefs.includes("all") && !isScreenInPreferences(screen, prefs)) continue;
|
||||||
|
switch (bc.position ?? 0) {
|
||||||
|
case SettingsData.Position.Top: return "top";
|
||||||
|
case SettingsData.Position.Bottom: return "bottom";
|
||||||
|
case SettingsData.Position.Left: return "left";
|
||||||
|
case SettingsData.Position.Right: return "right";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
function getActiveBarEdgesForScreen(screen) {
|
||||||
|
if (!screen) return [];
|
||||||
|
var edges = [];
|
||||||
|
for (var i = 0; i < barConfigs.length; i++) {
|
||||||
|
var bc = barConfigs[i];
|
||||||
|
if (!bc.enabled) continue;
|
||||||
|
var prefs = bc.screenPreferences || ["all"];
|
||||||
|
if (!prefs.includes("all") && !isScreenInPreferences(screen, prefs)) continue;
|
||||||
|
switch (bc.position ?? 0) {
|
||||||
|
case SettingsData.Position.Top: edges.push("top"); break;
|
||||||
|
case SettingsData.Position.Bottom: edges.push("bottom"); break;
|
||||||
|
case SettingsData.Position.Left: edges.push("left"); break;
|
||||||
|
case SettingsData.Position.Right: edges.push("right"); break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return edges;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getActiveBarThicknessForScreen(screen) {
|
||||||
|
if (frameEnabled) return frameBarSize;
|
||||||
|
if (!screen) return frameThickness;
|
||||||
|
for (var i = 0; i < barConfigs.length; i++) {
|
||||||
|
var bc = barConfigs[i];
|
||||||
|
if (!bc.enabled) continue;
|
||||||
|
var prefs = bc.screenPreferences || ["all"];
|
||||||
|
if (!prefs.includes("all") && !isScreenInPreferences(screen, prefs)) continue;
|
||||||
|
const innerPadding = bc.innerPadding ?? 4;
|
||||||
|
const barT = Math.max(26 + innerPadding * 0.6, Theme.barHeight - 4 - (8 - innerPadding));
|
||||||
|
const spacing = bc.spacing ?? 4;
|
||||||
|
const bottomGap = bc.bottomGap ?? 0;
|
||||||
|
return barT + spacing + bottomGap;
|
||||||
|
}
|
||||||
|
return frameThickness;
|
||||||
|
}
|
||||||
|
|
||||||
function sendTestNotifications() {
|
function sendTestNotifications() {
|
||||||
NotificationService.dismissAllPopups();
|
NotificationService.dismissAllPopups();
|
||||||
sendTestNotification(0);
|
sendTestNotification(0);
|
||||||
|
|||||||
@@ -960,6 +960,40 @@ Singleton {
|
|||||||
"expressiveEffects": [0.34, 0.8, 0.34, 1, 1, 1]
|
"expressiveEffects": [0.34, 0.8, 0.34, 1, 1, 1]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Delegates to AnimVariants.qml for curves, timing, scale, and offsets.
|
||||||
|
readonly property list<real> variantEnterCurve: AnimVariants.variantEnterCurve
|
||||||
|
readonly property list<real> variantExitCurve: AnimVariants.variantExitCurve
|
||||||
|
readonly property list<real> variantModalEnterCurve: AnimVariants.variantModalEnterCurve
|
||||||
|
readonly property list<real> variantModalExitCurve: AnimVariants.variantModalExitCurve
|
||||||
|
readonly property list<real> variantPopoutEnterCurve: AnimVariants.variantPopoutEnterCurve
|
||||||
|
readonly property list<real> variantPopoutExitCurve: AnimVariants.variantPopoutExitCurve
|
||||||
|
readonly property real variantEnterDurationFactor: AnimVariants.variantEnterDurationFactor
|
||||||
|
readonly property real variantExitDurationFactor: AnimVariants.variantExitDurationFactor
|
||||||
|
readonly property real variantOpacityDurationScale: AnimVariants.variantOpacityDurationScale
|
||||||
|
readonly property bool isDirectionalEffect: AnimVariants.isDirectionalEffect
|
||||||
|
readonly property bool isDepthEffect: AnimVariants.isDepthEffect
|
||||||
|
readonly property bool isConnectedEffect: AnimVariants.isConnectedEffect
|
||||||
|
readonly property real connectedCornerRadius: {
|
||||||
|
if (typeof SettingsData === "undefined") return 12;
|
||||||
|
return SettingsData.connectedFrameModeActive ? SettingsData.frameRounding : cornerRadius;
|
||||||
|
}
|
||||||
|
readonly property color connectedSurfaceColor: {
|
||||||
|
if (typeof SettingsData === "undefined")
|
||||||
|
return withAlpha(surfaceContainer, popupTransparency);
|
||||||
|
return isConnectedEffect
|
||||||
|
? Qt.rgba(SettingsData.effectiveFrameColor.r, SettingsData.effectiveFrameColor.g, SettingsData.effectiveFrameColor.b, SettingsData.frameOpacity)
|
||||||
|
: withAlpha(surfaceContainer, popupTransparency);
|
||||||
|
}
|
||||||
|
readonly property real connectedSurfaceRadius: isConnectedEffect ? connectedCornerRadius : cornerRadius
|
||||||
|
readonly property bool connectedSurfaceBlurEnabled: (typeof SettingsData === "undefined")
|
||||||
|
? true
|
||||||
|
: (!isConnectedEffect || SettingsData.frameBlurEnabled)
|
||||||
|
readonly property real effectScaleCollapsed: AnimVariants.effectScaleCollapsed
|
||||||
|
readonly property real effectAnimOffset: AnimVariants.effectAnimOffset
|
||||||
|
function variantDuration(baseDuration, entering) { return AnimVariants.variantDuration(baseDuration, entering); }
|
||||||
|
function variantExitCleanupPadding() { return AnimVariants.variantExitCleanupPadding(); }
|
||||||
|
function variantCloseInterval(baseDuration) { return AnimVariants.variantCloseInterval(baseDuration); }
|
||||||
|
|
||||||
readonly property var animationPresetDurations: {
|
readonly property var animationPresetDurations: {
|
||||||
"none": 0,
|
"none": 0,
|
||||||
"short": 250,
|
"short": 250,
|
||||||
@@ -1125,7 +1159,13 @@ Singleton {
|
|||||||
property real iconSizeLarge: 32
|
property real iconSizeLarge: 32
|
||||||
|
|
||||||
property real panelTransparency: 0.85
|
property real panelTransparency: 0.85
|
||||||
property real popupTransparency: typeof SettingsData !== "undefined" && SettingsData.popupTransparency !== undefined ? SettingsData.popupTransparency : 1.0
|
property real popupTransparency: {
|
||||||
|
if (typeof SettingsData === "undefined")
|
||||||
|
return 1.0;
|
||||||
|
if (isConnectedEffect)
|
||||||
|
return SettingsData.frameOpacity !== undefined ? SettingsData.frameOpacity : 1.0;
|
||||||
|
return SettingsData.popupTransparency !== undefined ? SettingsData.popupTransparency : 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
function screenTransition() {
|
function screenTransition() {
|
||||||
if (CompositorService.isNiri) {
|
if (CompositorService.isNiri) {
|
||||||
@@ -1824,6 +1864,12 @@ Singleton {
|
|||||||
return Qt.rgba(c.r, c.g, c.b, a);
|
return Qt.rgba(c.r, c.g, c.b, a);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function popupLayerColor(baseColor) {
|
||||||
|
if (isConnectedEffect)
|
||||||
|
return connectedSurfaceColor;
|
||||||
|
return withAlpha(baseColor, popupTransparency);
|
||||||
|
}
|
||||||
|
|
||||||
function blendAlpha(c, a) {
|
function blendAlpha(c, a) {
|
||||||
return Qt.rgba(c.r, c.g, c.b, c.a * a);
|
return Qt.rgba(c.r, c.g, c.b, c.a * a);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,6 +49,10 @@ var SPEC = {
|
|||||||
modalAnimationSpeed: { def: 1 },
|
modalAnimationSpeed: { def: 1 },
|
||||||
modalCustomAnimationDuration: { def: 150 },
|
modalCustomAnimationDuration: { def: 150 },
|
||||||
enableRippleEffects: { def: true },
|
enableRippleEffects: { def: true },
|
||||||
|
animationVariant: { def: 0 },
|
||||||
|
motionEffect: { def: 0 },
|
||||||
|
directionalAnimationMode: { def: 0 },
|
||||||
|
previousDirectionalMode: { def: 1 },
|
||||||
m3ElevationEnabled: { def: true },
|
m3ElevationEnabled: { def: true },
|
||||||
m3ElevationIntensity: { def: 12 },
|
m3ElevationIntensity: { def: 12 },
|
||||||
m3ElevationOpacity: { def: 30 },
|
m3ElevationOpacity: { def: 30 },
|
||||||
@@ -140,6 +144,7 @@ var SPEC = {
|
|||||||
workspaceNameIcons: { def: {} },
|
workspaceNameIcons: { def: {} },
|
||||||
waveProgressEnabled: { def: true },
|
waveProgressEnabled: { def: true },
|
||||||
scrollTitleEnabled: { def: true },
|
scrollTitleEnabled: { def: true },
|
||||||
|
mediaAdaptiveWidthEnabled: { def: true },
|
||||||
audioVisualizerEnabled: { def: true },
|
audioVisualizerEnabled: { def: true },
|
||||||
audioScrollMode: { def: "volume" },
|
audioScrollMode: { def: "volume" },
|
||||||
audioWheelScrollAmount: { def: 5 },
|
audioWheelScrollAmount: { def: 5 },
|
||||||
@@ -242,6 +247,7 @@ var SPEC = {
|
|||||||
|
|
||||||
soundsEnabled: { def: true },
|
soundsEnabled: { def: true },
|
||||||
useSystemSoundTheme: { def: false },
|
useSystemSoundTheme: { def: false },
|
||||||
|
soundLogin: { def: false },
|
||||||
soundNewNotification: { def: true },
|
soundNewNotification: { def: true },
|
||||||
soundVolumeChanged: { def: true },
|
soundVolumeChanged: { def: true },
|
||||||
soundPluggedIn: { def: true },
|
soundPluggedIn: { def: true },
|
||||||
@@ -441,6 +447,7 @@ var SPEC = {
|
|||||||
displayProfileAutoSelect: { def: false },
|
displayProfileAutoSelect: { def: false },
|
||||||
displayShowDisconnected: { def: false },
|
displayShowDisconnected: { def: false },
|
||||||
displaySnapToEdge: { def: true },
|
displaySnapToEdge: { def: true },
|
||||||
|
connectedFrameBarStyleBackups: { def: {} },
|
||||||
|
|
||||||
barConfigs: {
|
barConfigs: {
|
||||||
def: [{
|
def: [{
|
||||||
@@ -547,7 +554,17 @@ var SPEC = {
|
|||||||
clipboardEnterToPaste: { def: false },
|
clipboardEnterToPaste: { def: false },
|
||||||
|
|
||||||
launcherPluginVisibility: { def: {} },
|
launcherPluginVisibility: { def: {} },
|
||||||
launcherPluginOrder: { def: [] }
|
launcherPluginOrder: { def: [] },
|
||||||
|
|
||||||
|
frameEnabled: { def: false },
|
||||||
|
frameThickness: { def: 16 },
|
||||||
|
frameRounding: { def: 23 },
|
||||||
|
frameColor: { def: "" },
|
||||||
|
frameOpacity: { def: 1.0 },
|
||||||
|
frameScreenPreferences: { def: ["all"] },
|
||||||
|
frameBarSize: { def: 40 },
|
||||||
|
frameShowOnOverview: { def: false },
|
||||||
|
frameBlurEnabled: { def: true }
|
||||||
};
|
};
|
||||||
|
|
||||||
function getValidKeys() {
|
function getValidKeys() {
|
||||||
|
|||||||
@@ -248,6 +248,10 @@ function migrateToVersion(obj, targetVersion) {
|
|||||||
settings.configVersion = 6;
|
settings.configVersion = 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (currentVersion < 11) {
|
||||||
|
settings.configVersion = 11;
|
||||||
|
}
|
||||||
|
|
||||||
return settings;
|
return settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import qs.Modules.OSD
|
|||||||
import qs.Modules.ProcessList
|
import qs.Modules.ProcessList
|
||||||
import qs.Modules.DankBar
|
import qs.Modules.DankBar
|
||||||
import qs.Modules.DankBar.Popouts
|
import qs.Modules.DankBar.Popouts
|
||||||
|
import qs.Modules.Frame
|
||||||
import qs.Modules.WorkspaceOverlays
|
import qs.Modules.WorkspaceOverlays
|
||||||
import qs.Services
|
import qs.Services
|
||||||
|
|
||||||
@@ -176,6 +177,8 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Frame {}
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
id: dankBarRepeater
|
id: dankBarRepeater
|
||||||
model: ScriptModel {
|
model: ScriptModel {
|
||||||
@@ -221,10 +224,22 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: loginSoundTimer
|
||||||
|
// Half a second delay before playing login sound, otherwise the sound may be cut off
|
||||||
|
// 50 is the minimum that seems to work, but 500 is safer
|
||||||
|
interval: 500
|
||||||
|
repeat: false
|
||||||
|
onTriggered: {
|
||||||
|
AudioService.playLoginSoundIfApplicable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
dockRecreateDebounce.start();
|
dockRecreateDebounce.start();
|
||||||
// Force PolkitService singleton to initialize
|
// Force PolkitService singleton to initialize
|
||||||
PolkitService.polkitAvailable;
|
PolkitService.polkitAvailable;
|
||||||
|
loginSoundTimer.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
|
|||||||
@@ -369,9 +369,7 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function previous(): void {
|
function previous(): void {
|
||||||
if (MprisController.activePlayer && MprisController.activePlayer.canGoPrevious) {
|
MprisController.previousOrRewind();
|
||||||
MprisController.activePlayer.previous();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function next(): void {
|
function next(): void {
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: I18n.tr("No recent clipboard entries found")
|
text: clipboardContent.modal.clipboardAvailable ? I18n.tr("No recent clipboard entries found") : I18n.tr("Connecting to clipboard service…")
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
color: Theme.surfaceVariantText
|
color: Theme.surfaceVariantText
|
||||||
@@ -181,7 +181,7 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: I18n.tr("No saved clipboard entries")
|
text: clipboardContent.modal.clipboardAvailable ? I18n.tr("No saved clipboard entries") : I18n.tr("Connecting to clipboard service…")
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
font.pixelSize: Theme.fontSizeMedium
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
color: Theme.surfaceVariantText
|
color: Theme.surfaceVariantText
|
||||||
|
|||||||
@@ -60,18 +60,23 @@ DankModal {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function show() {
|
function show() {
|
||||||
if (!clipboardAvailable) {
|
|
||||||
ToastService.showError(I18n.tr("Clipboard service not available"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
open();
|
open();
|
||||||
activeImageLoads = 0;
|
activeImageLoads = 0;
|
||||||
shouldHaveFocus = true;
|
shouldHaveFocus = true;
|
||||||
ClipboardService.reset();
|
ClipboardService.reset();
|
||||||
ClipboardService.refresh();
|
|
||||||
keyboardController.reset();
|
keyboardController.reset();
|
||||||
|
|
||||||
Qt.callLater(function () {
|
Qt.callLater(function () {
|
||||||
|
if (clipboardAvailable) {
|
||||||
|
if (Theme.isConnectedEffect) {
|
||||||
|
Qt.callLater(() => {
|
||||||
|
if (clipboardHistoryModal.shouldBeVisible)
|
||||||
|
ClipboardService.refresh();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
ClipboardService.refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
if (contentLoader.item?.searchField) {
|
if (contentLoader.item?.searchField) {
|
||||||
contentLoader.item.searchField.text = "";
|
contentLoader.item.searchField.text = "";
|
||||||
contentLoader.item.searchField.forceActiveFocus();
|
contentLoader.item.searchField.forceActiveFocus();
|
||||||
|
|||||||
@@ -50,14 +50,9 @@ DankPopout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function show() {
|
function show() {
|
||||||
if (!clipboardAvailable) {
|
|
||||||
ToastService.showError(I18n.tr("Clipboard service not available"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
open();
|
open();
|
||||||
activeImageLoads = 0;
|
activeImageLoads = 0;
|
||||||
ClipboardService.reset();
|
ClipboardService.reset();
|
||||||
ClipboardService.refresh();
|
|
||||||
keyboardController.reset();
|
keyboardController.reset();
|
||||||
|
|
||||||
Qt.callLater(function () {
|
Qt.callLater(function () {
|
||||||
@@ -122,10 +117,18 @@ DankPopout {
|
|||||||
onBackgroundClicked: hide()
|
onBackgroundClicked: hide()
|
||||||
|
|
||||||
onShouldBeVisibleChanged: {
|
onShouldBeVisibleChanged: {
|
||||||
if (!shouldBeVisible) {
|
if (!shouldBeVisible)
|
||||||
return;
|
return;
|
||||||
|
if (clipboardAvailable) {
|
||||||
|
if (Theme.isConnectedEffect) {
|
||||||
|
Qt.callLater(() => {
|
||||||
|
if (root.shouldBeVisible)
|
||||||
|
ClipboardService.refresh();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
ClipboardService.refresh();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ClipboardService.refresh();
|
|
||||||
keyboardController.reset();
|
keyboardController.reset();
|
||||||
Qt.callLater(function () {
|
Qt.callLater(function () {
|
||||||
if (contentLoader.item?.searchField) {
|
if (contentLoader.item?.searchField) {
|
||||||
|
|||||||
@@ -26,15 +26,22 @@ Item {
|
|||||||
property bool closeOnEscapeKey: true
|
property bool closeOnEscapeKey: true
|
||||||
property bool closeOnBackgroundClick: true
|
property bool closeOnBackgroundClick: true
|
||||||
property string animationType: "scale"
|
property string animationType: "scale"
|
||||||
property int animationDuration: Theme.modalAnimationDuration
|
readonly property bool connectedMotionParity: Theme.isConnectedEffect
|
||||||
property real animationScaleCollapsed: 0.96
|
property int animationDuration: connectedMotionParity ? Theme.popoutAnimationDuration : Theme.modalAnimationDuration
|
||||||
property real animationOffset: Theme.spacingL
|
property real animationScaleCollapsed: Theme.effectScaleCollapsed
|
||||||
property list<real> animationEnterCurve: Theme.expressiveCurves.expressiveDefaultSpatial
|
property real animationOffset: Theme.effectAnimOffset
|
||||||
property list<real> animationExitCurve: Theme.expressiveCurves.emphasized
|
property list<real> animationEnterCurve: connectedMotionParity ? Theme.variantPopoutEnterCurve : Theme.variantModalEnterCurve
|
||||||
|
property list<real> animationExitCurve: connectedMotionParity ? Theme.variantPopoutExitCurve : Theme.variantModalExitCurve
|
||||||
property color backgroundColor: Theme.surfaceContainer
|
property color backgroundColor: Theme.surfaceContainer
|
||||||
property color borderColor: Theme.outlineMedium
|
property color borderColor: Theme.outlineMedium
|
||||||
property real borderWidth: 0
|
property real borderWidth: 0
|
||||||
property real cornerRadius: Theme.cornerRadius
|
property real cornerRadius: Theme.cornerRadius
|
||||||
|
readonly property bool connectedSurfaceOverride: Theme.isConnectedEffect
|
||||||
|
readonly property color effectiveBackgroundColor: connectedSurfaceOverride ? Theme.connectedSurfaceColor : backgroundColor
|
||||||
|
readonly property color effectiveBorderColor: connectedSurfaceOverride ? "transparent" : borderColor
|
||||||
|
readonly property real effectiveBorderWidth: connectedSurfaceOverride ? 0 : borderWidth
|
||||||
|
readonly property real effectiveCornerRadius: connectedSurfaceOverride ? Theme.connectedSurfaceRadius : cornerRadius
|
||||||
|
readonly property bool effectiveBlurEnabled: Theme.connectedSurfaceBlurEnabled
|
||||||
property bool enableShadow: true
|
property bool enableShadow: true
|
||||||
property alias modalFocusScope: focusScope
|
property alias modalFocusScope: focusScope
|
||||||
property bool shouldBeVisible: false
|
property bool shouldBeVisible: false
|
||||||
@@ -45,11 +52,13 @@ Item {
|
|||||||
property bool keepPopoutsOpen: false
|
property bool keepPopoutsOpen: false
|
||||||
property var customKeyboardFocus: null
|
property var customKeyboardFocus: null
|
||||||
property bool useOverlayLayer: false
|
property bool useOverlayLayer: false
|
||||||
|
property real frozenMotionOffsetX: 0
|
||||||
|
property real frozenMotionOffsetY: 0
|
||||||
readonly property alias contentWindow: contentWindow
|
readonly property alias contentWindow: contentWindow
|
||||||
readonly property alias clickCatcher: clickCatcher
|
readonly property alias clickCatcher: clickCatcher
|
||||||
readonly property bool useHyprlandFocusGrab: CompositorService.useHyprlandFocusGrab
|
readonly property bool useHyprlandFocusGrab: CompositorService.useHyprlandFocusGrab
|
||||||
readonly property bool useBackground: showBackground && SettingsData.modalDarkenBackground
|
readonly property bool useBackground: showBackground && SettingsData.modalDarkenBackground
|
||||||
readonly property bool useSingleWindow: CompositorService.isHyprland || useBackground
|
readonly property bool useSingleWindow: CompositorService.isHyprland
|
||||||
|
|
||||||
signal opened
|
signal opened
|
||||||
signal dialogClosed
|
signal dialogClosed
|
||||||
@@ -59,33 +68,34 @@ Item {
|
|||||||
|
|
||||||
function open() {
|
function open() {
|
||||||
closeTimer.stop();
|
closeTimer.stop();
|
||||||
const focusedScreen = CompositorService.getFocusedScreen();
|
animationsEnabled = false;
|
||||||
const screenChanged = focusedScreen && contentWindow.screen !== focusedScreen;
|
frozenMotionOffsetX = modalContainer ? modalContainer.offsetX : 0;
|
||||||
if (focusedScreen) {
|
frozenMotionOffsetY = modalContainer ? modalContainer.offsetY : animationOffset;
|
||||||
if (screenChanged)
|
|
||||||
contentWindow.visible = false;
|
|
||||||
contentWindow.screen = focusedScreen;
|
|
||||||
if (!useSingleWindow) {
|
|
||||||
if (screenChanged)
|
|
||||||
clickCatcher.visible = false;
|
|
||||||
clickCatcher.screen = focusedScreen;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (screenChanged) {
|
|
||||||
Qt.callLater(() => root._finishOpen());
|
|
||||||
} else {
|
|
||||||
_finishOpen();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function _finishOpen() {
|
const focusedScreen = CompositorService.getFocusedScreen();
|
||||||
|
if (focusedScreen) {
|
||||||
|
contentWindow.screen = focusedScreen;
|
||||||
|
if (!useSingleWindow)
|
||||||
|
clickCatcher.screen = focusedScreen;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Theme.isDirectionalEffect || root.useBackground) {
|
||||||
|
if (!useSingleWindow)
|
||||||
|
clickCatcher.visible = true;
|
||||||
|
contentWindow.visible = true;
|
||||||
|
}
|
||||||
ModalManager.openModal(root);
|
ModalManager.openModal(root);
|
||||||
shouldBeVisible = true;
|
|
||||||
if (!useSingleWindow)
|
Qt.callLater(() => {
|
||||||
clickCatcher.visible = true;
|
animationsEnabled = true;
|
||||||
contentWindow.visible = true;
|
shouldBeVisible = true;
|
||||||
shouldHaveFocus = false;
|
if (!useSingleWindow && !clickCatcher.visible)
|
||||||
Qt.callLater(() => shouldHaveFocus = Qt.binding(() => shouldBeVisible));
|
clickCatcher.visible = true;
|
||||||
|
if (!contentWindow.visible)
|
||||||
|
contentWindow.visible = true;
|
||||||
|
shouldHaveFocus = false;
|
||||||
|
Qt.callLater(() => shouldHaveFocus = Qt.binding(() => shouldBeVisible));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function close() {
|
function close() {
|
||||||
@@ -146,7 +156,7 @@ Item {
|
|||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
id: closeTimer
|
id: closeTimer
|
||||||
interval: animationDuration + 50
|
interval: Theme.variantCloseInterval(animationDuration)
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
if (shouldBeVisible)
|
if (shouldBeVisible)
|
||||||
return;
|
return;
|
||||||
@@ -160,7 +170,19 @@ Item {
|
|||||||
readonly property var shadowLevel: Theme.elevationLevel3
|
readonly property var shadowLevel: Theme.elevationLevel3
|
||||||
readonly property real shadowFallbackOffset: 6
|
readonly property real shadowFallbackOffset: 6
|
||||||
readonly property real shadowRenderPadding: (root.enableShadow && Theme.elevationEnabled && SettingsData.modalElevationEnabled) ? Theme.elevationRenderPadding(shadowLevel, Theme.elevationLightDirection, shadowFallbackOffset, 8, 16) : 0
|
readonly property real shadowRenderPadding: (root.enableShadow && Theme.elevationEnabled && SettingsData.modalElevationEnabled) ? Theme.elevationRenderPadding(shadowLevel, Theme.elevationLightDirection, shadowFallbackOffset, 8, 16) : 0
|
||||||
readonly property real shadowMotionPadding: animationType === "slide" ? 30 : Math.max(0, animationOffset)
|
readonly property real shadowMotionPadding: {
|
||||||
|
if (Theme.isConnectedEffect)
|
||||||
|
return 0;
|
||||||
|
if (typeof SettingsData !== "undefined" && SettingsData.directionalAnimationMode > 0 && Theme.isDirectionalEffect)
|
||||||
|
return 0; // Wayland native overlap mask
|
||||||
|
if (animationType === "slide")
|
||||||
|
return 30;
|
||||||
|
if (Theme.isDirectionalEffect)
|
||||||
|
return Math.max(Math.max(0, animationOffset), Math.max(alignedWidth, alignedHeight) * 0.9);
|
||||||
|
if (Theme.isDepthEffect)
|
||||||
|
return Math.max(Math.max(0, animationOffset), Math.max(alignedWidth, alignedHeight) * 0.35);
|
||||||
|
return Math.max(0, animationOffset);
|
||||||
|
}
|
||||||
readonly property real shadowBuffer: Theme.snap(shadowRenderPadding + shadowMotionPadding, dpr)
|
readonly property real shadowBuffer: Theme.snap(shadowRenderPadding + shadowMotionPadding, dpr)
|
||||||
readonly property real alignedWidth: Theme.px(modalWidth, dpr)
|
readonly property real alignedWidth: Theme.px(modalWidth, dpr)
|
||||||
readonly property real alignedHeight: Theme.px(modalHeight, dpr)
|
readonly property real alignedHeight: Theme.px(modalHeight, dpr)
|
||||||
@@ -220,9 +242,26 @@ Item {
|
|||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
enabled: root.closeOnBackgroundClick && root.shouldBeVisible
|
enabled: !root.useSingleWindow && root.closeOnBackgroundClick && root.shouldBeVisible
|
||||||
onClicked: root.backgroundClicked()
|
onClicked: root.backgroundClicked()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
anchors.fill: parent
|
||||||
|
z: -1
|
||||||
|
color: "black"
|
||||||
|
opacity: (!root.useSingleWindow && root.useBackground) ? (root.shouldBeVisible ? root.backgroundOpacity : 0) : 0
|
||||||
|
visible: opacity > 0
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
enabled: root.animationsEnabled && (!Theme.isDirectionalEffect || Theme.isConnectedEffect)
|
||||||
|
NumberAnimation {
|
||||||
|
duration: Math.round(Theme.variantDuration(root.animationDuration, root.shouldBeVisible) * Theme.variantOpacityDurationScale)
|
||||||
|
easing.type: Easing.BezierSpline
|
||||||
|
easing.bezierCurve: root.shouldBeVisible ? root.animationEnterCurve : root.animationExitCurve
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PanelWindow {
|
PanelWindow {
|
||||||
@@ -232,12 +271,13 @@ Item {
|
|||||||
|
|
||||||
WindowBlur {
|
WindowBlur {
|
||||||
targetWindow: contentWindow
|
targetWindow: contentWindow
|
||||||
|
blurEnabled: root.effectiveBlurEnabled
|
||||||
readonly property real s: Math.min(1, modalContainer.scaleValue)
|
readonly property real s: Math.min(1, modalContainer.scaleValue)
|
||||||
blurX: modalContainer.x + modalContainer.width * (1 - s) * 0.5 + Theme.snap(modalContainer.animX, root.dpr)
|
blurX: modalContainer.x + modalContainer.width * (1 - s) * 0.5 + Theme.snap(modalContainer.animX, root.dpr)
|
||||||
blurY: modalContainer.y + modalContainer.height * (1 - s) * 0.5 + Theme.snap(modalContainer.animY, root.dpr)
|
blurY: modalContainer.y + modalContainer.height * (1 - s) * 0.5 + Theme.snap(modalContainer.animY, root.dpr)
|
||||||
blurWidth: (shouldBeVisible && animatedContent.opacity > 0) ? modalContainer.width * s : 0
|
blurWidth: (root.shouldBeVisible && animatedContent.opacity > 0) ? modalContainer.width * s : 0
|
||||||
blurHeight: (shouldBeVisible && animatedContent.opacity > 0) ? modalContainer.height * s : 0
|
blurHeight: (root.shouldBeVisible && animatedContent.opacity > 0) ? modalContainer.height * s : 0
|
||||||
blurRadius: root.cornerRadius
|
blurRadius: root.effectiveCornerRadius
|
||||||
}
|
}
|
||||||
|
|
||||||
WlrLayershell.namespace: root.layerNamespace
|
WlrLayershell.namespace: root.layerNamespace
|
||||||
@@ -275,9 +315,12 @@ Item {
|
|||||||
bottom: root.useSingleWindow
|
bottom: root.useSingleWindow
|
||||||
}
|
}
|
||||||
|
|
||||||
|
readonly property real actualMarginLeft: root.useSingleWindow ? 0 : Math.max(0, Theme.snap(root.alignedX - shadowBuffer, dpr))
|
||||||
|
readonly property real actualMarginTop: root.useSingleWindow ? 0 : Math.max(0, Theme.snap(root.alignedY - shadowBuffer, dpr))
|
||||||
|
|
||||||
WlrLayershell.margins {
|
WlrLayershell.margins {
|
||||||
left: root.useSingleWindow ? 0 : Math.max(0, Theme.snap(root.alignedX - shadowBuffer, dpr))
|
left: actualMarginLeft
|
||||||
top: root.useSingleWindow ? 0 : Math.max(0, Theme.snap(root.alignedY - shadowBuffer, dpr))
|
top: actualMarginTop
|
||||||
right: 0
|
right: 0
|
||||||
bottom: 0
|
bottom: 0
|
||||||
}
|
}
|
||||||
@@ -307,13 +350,14 @@ Item {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
z: -1
|
z: -1
|
||||||
color: "black"
|
color: "black"
|
||||||
opacity: root.useBackground ? (root.shouldBeVisible ? root.backgroundOpacity : 0) : 0
|
opacity: (root.useSingleWindow && root.useBackground) ? (root.shouldBeVisible ? root.backgroundOpacity : 0) : 0
|
||||||
visible: root.useBackground
|
visible: opacity > 0
|
||||||
|
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
enabled: root.animationsEnabled
|
enabled: root.animationsEnabled && (!Theme.isDirectionalEffect || Theme.isConnectedEffect)
|
||||||
DankAnim {
|
NumberAnimation {
|
||||||
duration: root.animationDuration
|
duration: Math.round(Theme.variantDuration(root.animationDuration, root.shouldBeVisible) * Theme.variantOpacityDurationScale)
|
||||||
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: root.shouldBeVisible ? root.animationEnterCurve : root.animationExitCurve
|
easing.bezierCurve: root.shouldBeVisible ? root.animationEnterCurve : root.animationExitCurve
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -321,8 +365,8 @@ Item {
|
|||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: modalContainer
|
id: modalContainer
|
||||||
x: root.useSingleWindow ? root.alignedX : shadowBuffer
|
x: (root.useSingleWindow ? root.alignedX : (root.alignedX - contentWindow.actualMarginLeft)) + Theme.snap(animX, root.dpr)
|
||||||
y: root.useSingleWindow ? root.alignedY : shadowBuffer
|
y: (root.useSingleWindow ? root.alignedY : (root.alignedY - contentWindow.actualMarginTop)) + Theme.snap(animY, root.dpr)
|
||||||
|
|
||||||
width: root.alignedWidth
|
width: root.alignedWidth
|
||||||
height: root.alignedHeight
|
height: root.alignedHeight
|
||||||
@@ -338,45 +382,117 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
readonly property bool slide: root.animationType === "slide"
|
readonly property bool slide: root.animationType === "slide"
|
||||||
readonly property real offsetX: slide ? 15 : 0
|
readonly property bool directionalEffect: Theme.isDirectionalEffect
|
||||||
readonly property real offsetY: slide ? -30 : root.animationOffset
|
readonly property bool depthEffect: Theme.isDepthEffect
|
||||||
|
readonly property real directionalTravel: Math.max(root.animationOffset, Math.max(root.alignedWidth, root.alignedHeight) * 0.8)
|
||||||
property real animX: 0
|
readonly property real depthTravel: Math.max(root.animationOffset * 0.8, 36)
|
||||||
property real animY: 0
|
readonly property real customAnchorX: root.alignedX + root.alignedWidth * 0.5
|
||||||
property real scaleValue: root.animationScaleCollapsed
|
readonly property real customAnchorY: root.alignedY + root.alignedHeight * 0.5
|
||||||
|
readonly property real customDistLeft: customAnchorX
|
||||||
onOffsetXChanged: animX = Theme.snap(root.shouldBeVisible ? 0 : offsetX, root.dpr)
|
readonly property real customDistRight: root.screenWidth - customAnchorX
|
||||||
onOffsetYChanged: animY = Theme.snap(root.shouldBeVisible ? 0 : offsetY, root.dpr)
|
readonly property real customDistTop: customAnchorY
|
||||||
|
readonly property real customDistBottom: root.screenHeight - customAnchorY
|
||||||
Connections {
|
readonly property real offsetX: {
|
||||||
target: root
|
if (typeof SettingsData !== "undefined" && SettingsData.directionalAnimationMode === 2 && Theme.isDirectionalEffect)
|
||||||
function onShouldBeVisibleChanged() {
|
return 0;
|
||||||
modalContainer.animX = Theme.snap(root.shouldBeVisible ? 0 : modalContainer.offsetX, root.dpr);
|
if (slide && !directionalEffect && !depthEffect)
|
||||||
modalContainer.animY = Theme.snap(root.shouldBeVisible ? 0 : modalContainer.offsetY, root.dpr);
|
return 15;
|
||||||
modalContainer.scaleValue = root.shouldBeVisible ? 1.0 : root.animationScaleCollapsed;
|
if (directionalEffect) {
|
||||||
|
switch (root.positioning) {
|
||||||
|
case "top-right":
|
||||||
|
return 0;
|
||||||
|
case "custom":
|
||||||
|
if (customDistLeft <= customDistRight && customDistLeft <= customDistTop && customDistLeft <= customDistBottom)
|
||||||
|
return -directionalTravel;
|
||||||
|
if (customDistRight <= customDistTop && customDistRight <= customDistBottom)
|
||||||
|
return directionalTravel;
|
||||||
|
return 0;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if (depthEffect) {
|
||||||
|
switch (root.positioning) {
|
||||||
|
case "top-right":
|
||||||
|
return 0;
|
||||||
|
case "custom":
|
||||||
|
if (customDistLeft <= customDistRight && customDistLeft <= customDistTop && customDistLeft <= customDistBottom)
|
||||||
|
return -depthTravel;
|
||||||
|
if (customDistRight <= customDistTop && customDistRight <= customDistBottom)
|
||||||
|
return depthTravel;
|
||||||
|
return 0;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
readonly property real offsetY: {
|
||||||
|
if (typeof SettingsData !== "undefined" && SettingsData.directionalAnimationMode === 2 && Theme.isDirectionalEffect)
|
||||||
|
return 0;
|
||||||
|
if (slide && !directionalEffect && !depthEffect)
|
||||||
|
return -30;
|
||||||
|
if (directionalEffect) {
|
||||||
|
switch (root.positioning) {
|
||||||
|
case "top-right":
|
||||||
|
return -Math.max(directionalTravel * 0.65, 96);
|
||||||
|
case "custom":
|
||||||
|
if (customDistTop <= customDistBottom && customDistTop <= customDistLeft && customDistTop <= customDistRight)
|
||||||
|
return -directionalTravel;
|
||||||
|
if (customDistBottom <= customDistLeft && customDistBottom <= customDistRight)
|
||||||
|
return directionalTravel;
|
||||||
|
return 0;
|
||||||
|
default:
|
||||||
|
// Default to sliding down from top when centered
|
||||||
|
return -Math.max(directionalTravel, root.screenHeight * 0.24);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (depthEffect) {
|
||||||
|
switch (root.positioning) {
|
||||||
|
case "top-right":
|
||||||
|
return -depthTravel * 0.75;
|
||||||
|
case "custom":
|
||||||
|
if (customDistTop <= customDistBottom && customDistTop <= customDistLeft && customDistTop <= customDistRight)
|
||||||
|
return -depthTravel;
|
||||||
|
if (customDistBottom <= customDistLeft && customDistBottom <= customDistRight)
|
||||||
|
return depthTravel;
|
||||||
|
return depthTravel * 0.45;
|
||||||
|
default:
|
||||||
|
return -depthTravel;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return root.animationOffset;
|
||||||
|
}
|
||||||
|
|
||||||
|
property real animX: root.shouldBeVisible ? 0 : root.frozenMotionOffsetX
|
||||||
|
property real animY: root.shouldBeVisible ? 0 : root.frozenMotionOffsetY
|
||||||
|
|
||||||
|
readonly property real computedScaleCollapsed: (typeof SettingsData !== "undefined" && SettingsData.directionalAnimationMode === 2 && Theme.isDirectionalEffect) ? 0.0 : root.animationScaleCollapsed
|
||||||
|
property real scaleValue: root.shouldBeVisible ? 1.0 : computedScaleCollapsed
|
||||||
|
|
||||||
Behavior on animX {
|
Behavior on animX {
|
||||||
enabled: root.animationsEnabled
|
enabled: root.animationsEnabled
|
||||||
DankAnim {
|
NumberAnimation {
|
||||||
duration: root.animationDuration
|
duration: Theme.variantDuration(root.animationDuration, root.shouldBeVisible)
|
||||||
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: root.shouldBeVisible ? root.animationEnterCurve : root.animationExitCurve
|
easing.bezierCurve: root.shouldBeVisible ? root.animationEnterCurve : root.animationExitCurve
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on animY {
|
Behavior on animY {
|
||||||
enabled: root.animationsEnabled
|
enabled: root.animationsEnabled
|
||||||
DankAnim {
|
NumberAnimation {
|
||||||
duration: root.animationDuration
|
duration: Theme.variantDuration(root.animationDuration, root.shouldBeVisible)
|
||||||
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: root.shouldBeVisible ? root.animationEnterCurve : root.animationExitCurve
|
easing.bezierCurve: root.shouldBeVisible ? root.animationEnterCurve : root.animationExitCurve
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on scaleValue {
|
Behavior on scaleValue {
|
||||||
enabled: root.animationsEnabled
|
enabled: root.animationsEnabled
|
||||||
DankAnim {
|
NumberAnimation {
|
||||||
duration: root.animationDuration
|
duration: Theme.variantDuration(root.animationDuration, root.shouldBeVisible)
|
||||||
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: root.shouldBeVisible ? root.animationEnterCurve : root.animationExitCurve
|
easing.bezierCurve: root.shouldBeVisible ? root.animationEnterCurve : root.animationExitCurve
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -392,15 +508,14 @@ Item {
|
|||||||
id: animatedContent
|
id: animatedContent
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
clip: false
|
clip: false
|
||||||
opacity: root.shouldBeVisible ? 1 : 0
|
opacity: (Theme.isDirectionalEffect && !Theme.isConnectedEffect) ? 1 : (root.shouldBeVisible ? 1 : 0)
|
||||||
scale: modalContainer.scaleValue
|
scale: modalContainer.scaleValue
|
||||||
x: Theme.snap(modalContainer.animX, root.dpr) + (parent.width - width) * (1 - modalContainer.scaleValue) * 0.5
|
transformOrigin: Item.Center
|
||||||
y: Theme.snap(modalContainer.animY, root.dpr) + (parent.height - height) * (1 - modalContainer.scaleValue) * 0.5
|
|
||||||
|
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
enabled: root.animationsEnabled
|
enabled: root.animationsEnabled && (!Theme.isDirectionalEffect || Theme.isConnectedEffect)
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: animationDuration
|
duration: Math.round(Theme.variantDuration(animationDuration, root.shouldBeVisible) * Theme.variantOpacityDurationScale)
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: root.shouldBeVisible ? root.animationEnterCurve : root.animationExitCurve
|
easing.bezierCurve: root.shouldBeVisible ? root.animationEnterCurve : root.animationExitCurve
|
||||||
}
|
}
|
||||||
@@ -411,19 +526,19 @@ Item {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
level: root.shadowLevel
|
level: root.shadowLevel
|
||||||
fallbackOffset: root.shadowFallbackOffset
|
fallbackOffset: root.shadowFallbackOffset
|
||||||
targetRadius: root.cornerRadius
|
targetRadius: root.effectiveCornerRadius
|
||||||
targetColor: root.backgroundColor
|
targetColor: root.effectiveBackgroundColor
|
||||||
borderColor: root.borderColor
|
borderColor: root.effectiveBorderColor
|
||||||
borderWidth: root.borderWidth
|
borderWidth: root.effectiveBorderWidth
|
||||||
shadowEnabled: root.enableShadow && Theme.elevationEnabled && SettingsData.modalElevationEnabled && Quickshell.env("DMS_DISABLE_LAYER") !== "true" && Quickshell.env("DMS_DISABLE_LAYER") !== "1"
|
shadowEnabled: root.enableShadow && Theme.elevationEnabled && SettingsData.modalElevationEnabled && Quickshell.env("DMS_DISABLE_LAYER") !== "true" && Quickshell.env("DMS_DISABLE_LAYER") !== "1"
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
radius: root.cornerRadius
|
radius: root.effectiveCornerRadius
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
border.color: BlurService.borderColor
|
border.color: root.connectedSurfaceOverride ? "transparent" : BlurService.borderColor
|
||||||
border.width: BlurService.borderWidth
|
border.width: root.connectedSurfaceOverride ? 0 : BlurService.borderWidth
|
||||||
z: 100
|
z: 100
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ DankModal {
|
|||||||
|
|
||||||
modalWidth: 680
|
modalWidth: 680
|
||||||
modalHeight: contentLoader.item ? contentLoader.item.implicitHeight + Theme.spacingM * 2 : 680
|
modalHeight: contentLoader.item ? contentLoader.item.implicitHeight + Theme.spacingM * 2 : 680
|
||||||
backgroundColor: Theme.surfaceContainer
|
backgroundColor: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
||||||
cornerRadius: Theme.cornerRadius
|
cornerRadius: Theme.cornerRadius
|
||||||
borderColor: Theme.outlineMedium
|
borderColor: Theme.outlineMedium
|
||||||
borderWidth: 1
|
borderWidth: 1
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
|
import QtQuick.Effects
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Wayland
|
import Quickshell.Wayland
|
||||||
import Quickshell.Hyprland
|
import Quickshell.Hyprland
|
||||||
@@ -14,16 +15,24 @@ Item {
|
|||||||
property bool spotlightOpen: false
|
property bool spotlightOpen: false
|
||||||
property bool keyboardActive: false
|
property bool keyboardActive: false
|
||||||
property bool contentVisible: false
|
property bool contentVisible: false
|
||||||
|
readonly property bool launcherMotionVisible: Theme.isConnectedEffect ? _motionActive : (Theme.isDirectionalEffect ? spotlightOpen : _motionActive)
|
||||||
property var spotlightContent: launcherContentLoader.item
|
property var spotlightContent: launcherContentLoader.item
|
||||||
property bool openedFromOverview: false
|
property bool openedFromOverview: false
|
||||||
property bool isClosing: false
|
property bool isClosing: false
|
||||||
|
property bool _windowEnabled: true
|
||||||
property bool _pendingInitialize: false
|
property bool _pendingInitialize: false
|
||||||
property string _pendingQuery: ""
|
property string _pendingQuery: ""
|
||||||
property string _pendingMode: ""
|
property string _pendingMode: ""
|
||||||
readonly property bool unloadContentOnClose: SettingsData.dankLauncherV2UnloadOnClose
|
readonly property bool unloadContentOnClose: SettingsData.dankLauncherV2UnloadOnClose
|
||||||
|
|
||||||
|
// Animation state — matches DankPopout/DankModal pattern
|
||||||
|
property bool animationsEnabled: true
|
||||||
|
property bool _motionActive: false
|
||||||
|
property real _frozenMotionX: 0
|
||||||
|
property real _frozenMotionY: 0
|
||||||
|
|
||||||
readonly property bool useHyprlandFocusGrab: CompositorService.useHyprlandFocusGrab
|
readonly property bool useHyprlandFocusGrab: CompositorService.useHyprlandFocusGrab
|
||||||
readonly property var effectiveScreen: launcherWindow.screen
|
readonly property var effectiveScreen: contentWindow.screen
|
||||||
readonly property real screenWidth: effectiveScreen?.width ?? 1920
|
readonly property real screenWidth: effectiveScreen?.width ?? 1920
|
||||||
readonly property real screenHeight: effectiveScreen?.height ?? 1080
|
readonly property real screenHeight: effectiveScreen?.height ?? 1080
|
||||||
readonly property real dpr: effectiveScreen ? CompositorService.getScreenScale(effectiveScreen) : 1
|
readonly property real dpr: effectiveScreen ? CompositorService.getScreenScale(effectiveScreen) : 1
|
||||||
@@ -57,8 +66,12 @@ Item {
|
|||||||
readonly property real modalX: (screenWidth - modalWidth) / 2
|
readonly property real modalX: (screenWidth - modalWidth) / 2
|
||||||
readonly property real modalY: (screenHeight - modalHeight) / 2
|
readonly property real modalY: (screenHeight - modalHeight) / 2
|
||||||
|
|
||||||
readonly property color backgroundColor: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
readonly property bool connectedSurfaceOverride: Theme.isConnectedEffect
|
||||||
readonly property real cornerRadius: Theme.cornerRadius
|
readonly property int launcherAnimationDuration: Theme.isConnectedEffect ? Theme.popoutAnimationDuration : Theme.modalAnimationDuration
|
||||||
|
readonly property list<real> launcherEnterCurve: Theme.isConnectedEffect ? Theme.variantPopoutEnterCurve : Theme.variantModalEnterCurve
|
||||||
|
readonly property list<real> launcherExitCurve: Theme.isConnectedEffect ? Theme.variantPopoutExitCurve : Theme.variantModalExitCurve
|
||||||
|
readonly property color backgroundColor: connectedSurfaceOverride ? Theme.connectedSurfaceColor : Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
||||||
|
readonly property real cornerRadius: connectedSurfaceOverride ? Theme.connectedSurfaceRadius : Theme.cornerRadius
|
||||||
readonly property color borderColor: {
|
readonly property color borderColor: {
|
||||||
if (!SettingsData.dankLauncherV2BorderEnabled)
|
if (!SettingsData.dankLauncherV2BorderEnabled)
|
||||||
return Theme.outlineMedium;
|
return Theme.outlineMedium;
|
||||||
@@ -76,6 +89,37 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
readonly property int borderWidth: SettingsData.dankLauncherV2BorderEnabled ? SettingsData.dankLauncherV2BorderThickness : 0
|
readonly property int borderWidth: SettingsData.dankLauncherV2BorderEnabled ? SettingsData.dankLauncherV2BorderThickness : 0
|
||||||
|
readonly property color effectiveBorderColor: connectedSurfaceOverride ? "transparent" : borderColor
|
||||||
|
readonly property int effectiveBorderWidth: connectedSurfaceOverride ? 0 : borderWidth
|
||||||
|
readonly property bool effectiveBlurEnabled: Theme.connectedSurfaceBlurEnabled
|
||||||
|
|
||||||
|
// Shadow padding for the content window (render padding only, no motion padding)
|
||||||
|
readonly property var shadowLevel: Theme.elevationLevel3
|
||||||
|
readonly property real shadowFallbackOffset: 6
|
||||||
|
readonly property real shadowRenderPadding: (Theme.elevationEnabled && SettingsData.modalElevationEnabled) ? Theme.elevationRenderPadding(shadowLevel, Theme.elevationLightDirection, shadowFallbackOffset, 8, 16) : 0
|
||||||
|
readonly property real shadowPad: Theme.snap(shadowRenderPadding, dpr)
|
||||||
|
readonly property real alignedWidth: Theme.px(modalWidth, dpr)
|
||||||
|
readonly property real alignedHeight: Theme.px(modalHeight, dpr)
|
||||||
|
readonly property real alignedX: Theme.snap(modalX, dpr)
|
||||||
|
readonly property real alignedY: Theme.snap(modalY, dpr)
|
||||||
|
|
||||||
|
// For directional/depth: window extends from screen top (content slides within)
|
||||||
|
// For standard: small window tightly around the modal + shadow padding
|
||||||
|
readonly property bool _needsExtendedWindow: (Theme.isDirectionalEffect && !Theme.isConnectedEffect) || Theme.isDepthEffect
|
||||||
|
// Content window geometry
|
||||||
|
readonly property real _cwMarginLeft: Theme.snap(alignedX - shadowPad, dpr)
|
||||||
|
readonly property real _cwMarginTop: _needsExtendedWindow ? 0 : Theme.snap(alignedY - shadowPad, dpr)
|
||||||
|
readonly property real _cwWidth: alignedWidth + shadowPad * 2
|
||||||
|
readonly property real _cwHeight: {
|
||||||
|
if (Theme.isDirectionalEffect && !Theme.isConnectedEffect)
|
||||||
|
return screenHeight + shadowPad;
|
||||||
|
if (Theme.isDepthEffect)
|
||||||
|
return alignedY + alignedHeight + shadowPad;
|
||||||
|
return alignedHeight + shadowPad * 2;
|
||||||
|
}
|
||||||
|
// Where the content container sits inside the content window
|
||||||
|
readonly property real _ccX: shadowPad
|
||||||
|
readonly property real _ccY: _needsExtendedWindow ? alignedY : shadowPad
|
||||||
|
|
||||||
signal dialogClosed
|
signal dialogClosed
|
||||||
|
|
||||||
@@ -96,18 +140,11 @@ Item {
|
|||||||
if (!spotlightContent)
|
if (!spotlightContent)
|
||||||
return;
|
return;
|
||||||
contentVisible = true;
|
contentVisible = true;
|
||||||
spotlightContent.searchField.forceActiveFocus();
|
// NOTE: forceActiveFocus() is deliberately NOT called here.
|
||||||
|
// It is deferred to after animation starts to avoid compositor IPC stalls.
|
||||||
var targetQuery = "";
|
|
||||||
|
|
||||||
if (query) {
|
|
||||||
targetQuery = query;
|
|
||||||
} else if (SettingsData.rememberLastQuery) {
|
|
||||||
targetQuery = SessionData.launcherLastQuery || "";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (spotlightContent.searchField) {
|
if (spotlightContent.searchField) {
|
||||||
spotlightContent.searchField.text = targetQuery;
|
spotlightContent.searchField.text = query;
|
||||||
}
|
}
|
||||||
if (spotlightContent.controller) {
|
if (spotlightContent.controller) {
|
||||||
var targetMode = mode || SessionData.launcherLastMode || "all";
|
var targetMode = mode || SessionData.launcherLastMode || "all";
|
||||||
@@ -122,10 +159,12 @@ Item {
|
|||||||
spotlightContent.controller.collapsedSections = {};
|
spotlightContent.controller.collapsedSections = {};
|
||||||
spotlightContent.controller.selectedFlatIndex = 0;
|
spotlightContent.controller.selectedFlatIndex = 0;
|
||||||
spotlightContent.controller.selectedItem = null;
|
spotlightContent.controller.selectedItem = null;
|
||||||
spotlightContent.controller.historyIndex = -1;
|
if (query) {
|
||||||
spotlightContent.controller.searchQuery = targetQuery;
|
spotlightContent.controller.setSearchQuery(query);
|
||||||
|
} else {
|
||||||
spotlightContent.controller.performSearch();
|
spotlightContent.controller.searchQuery = "";
|
||||||
|
spotlightContent.controller.performSearch();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (spotlightContent.resetScroll) {
|
if (spotlightContent.resetScroll) {
|
||||||
spotlightContent.resetScroll();
|
spotlightContent.resetScroll();
|
||||||
@@ -135,47 +174,59 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function _finishShow(query, mode) {
|
function _openCommon(query, mode) {
|
||||||
spotlightOpen = true;
|
closeCleanupTimer.stop();
|
||||||
isClosing = false;
|
isClosing = false;
|
||||||
openedFromOverview = false;
|
openedFromOverview = false;
|
||||||
|
|
||||||
keyboardActive = true;
|
// Disable animations so the snap is instant
|
||||||
|
animationsEnabled = false;
|
||||||
|
|
||||||
|
// Freeze the collapsed offsets (they depend on height which could change)
|
||||||
|
_frozenMotionX = contentContainer ? contentContainer.collapsedMotionX : 0;
|
||||||
|
_frozenMotionY = contentContainer ? contentContainer.collapsedMotionY : (Theme.isDirectionalEffect ? Math.max(root.screenHeight - root._ccY + root.shadowPad, Theme.effectAnimOffset * 1.1) : -Theme.effectAnimOffset);
|
||||||
|
|
||||||
|
var focusedScreen = CompositorService.getFocusedScreen();
|
||||||
|
if (focusedScreen) {
|
||||||
|
backgroundWindow.screen = focusedScreen;
|
||||||
|
contentWindow.screen = focusedScreen;
|
||||||
|
}
|
||||||
|
|
||||||
|
// _motionActive = false ensures motionX/Y snap to frozen collapsed position
|
||||||
|
_motionActive = false;
|
||||||
|
|
||||||
|
// Make windows visible but do NOT request keyboard focus yet
|
||||||
ModalManager.openModal(root);
|
ModalManager.openModal(root);
|
||||||
|
spotlightOpen = true;
|
||||||
|
backgroundWindow.visible = true;
|
||||||
|
contentWindow.visible = true;
|
||||||
if (useHyprlandFocusGrab)
|
if (useHyprlandFocusGrab)
|
||||||
focusGrab.active = true;
|
focusGrab.active = true;
|
||||||
|
|
||||||
|
// Load content and initialize (but no forceActiveFocus — that's deferred)
|
||||||
_ensureContentLoadedAndInitialize(query || "", mode || "");
|
_ensureContentLoadedAndInitialize(query || "", mode || "");
|
||||||
|
|
||||||
|
// Frame 1: enable animations and trigger enter motion
|
||||||
|
Qt.callLater(() => {
|
||||||
|
root.animationsEnabled = true;
|
||||||
|
root._motionActive = true;
|
||||||
|
|
||||||
|
// Frame 2: request keyboard focus + activate search field
|
||||||
|
// Double-deferred to avoid compositor IPC competing with animation frames
|
||||||
|
Qt.callLater(() => {
|
||||||
|
root.keyboardActive = true;
|
||||||
|
if (root.spotlightContent && root.spotlightContent.searchField)
|
||||||
|
root.spotlightContent.searchField.forceActiveFocus();
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function show() {
|
function show() {
|
||||||
closeCleanupTimer.stop();
|
_openCommon("", "");
|
||||||
|
|
||||||
var focusedScreen = CompositorService.getFocusedScreen();
|
|
||||||
if (focusedScreen && launcherWindow.screen !== focusedScreen) {
|
|
||||||
spotlightOpen = false;
|
|
||||||
isClosing = false;
|
|
||||||
launcherWindow.screen = focusedScreen;
|
|
||||||
Qt.callLater(() => root._finishShow("", ""));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_finishShow("", "");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function showWithQuery(query) {
|
function showWithQuery(query) {
|
||||||
closeCleanupTimer.stop();
|
_openCommon(query, "");
|
||||||
|
|
||||||
var focusedScreen = CompositorService.getFocusedScreen();
|
|
||||||
if (focusedScreen && launcherWindow.screen !== focusedScreen) {
|
|
||||||
spotlightOpen = false;
|
|
||||||
isClosing = false;
|
|
||||||
launcherWindow.screen = focusedScreen;
|
|
||||||
Qt.callLater(() => root._finishShow(query, ""));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_finishShow(query, "");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function hide() {
|
function hide() {
|
||||||
@@ -183,13 +234,17 @@ Item {
|
|||||||
return;
|
return;
|
||||||
openedFromOverview = false;
|
openedFromOverview = false;
|
||||||
isClosing = true;
|
isClosing = true;
|
||||||
contentVisible = false;
|
// For directional effects, defer contentVisible=false so content stays rendered during exit slide
|
||||||
|
if (!Theme.isDirectionalEffect)
|
||||||
|
contentVisible = false;
|
||||||
|
|
||||||
|
// Trigger exit animation — Behaviors will animate motionX/Y to frozen collapsed position
|
||||||
|
_motionActive = false;
|
||||||
|
|
||||||
keyboardActive = false;
|
keyboardActive = false;
|
||||||
spotlightOpen = false;
|
spotlightOpen = false;
|
||||||
focusGrab.active = false;
|
focusGrab.active = false;
|
||||||
ModalManager.closeModal(root);
|
ModalManager.closeModal(root);
|
||||||
|
|
||||||
closeCleanupTimer.start();
|
closeCleanupTimer.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -198,27 +253,7 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function showWithMode(mode) {
|
function showWithMode(mode) {
|
||||||
closeCleanupTimer.stop();
|
_openCommon("", mode);
|
||||||
|
|
||||||
var focusedScreen = CompositorService.getFocusedScreen();
|
|
||||||
if (focusedScreen && launcherWindow.screen !== focusedScreen) {
|
|
||||||
spotlightOpen = false;
|
|
||||||
isClosing = false;
|
|
||||||
launcherWindow.screen = focusedScreen;
|
|
||||||
Qt.callLater(() => root._finishShow("", mode));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
spotlightOpen = true;
|
|
||||||
isClosing = false;
|
|
||||||
openedFromOverview = false;
|
|
||||||
|
|
||||||
keyboardActive = true;
|
|
||||||
ModalManager.openModal(root);
|
|
||||||
if (useHyprlandFocusGrab)
|
|
||||||
focusGrab.active = true;
|
|
||||||
|
|
||||||
_ensureContentLoadedAndInitialize("", mode);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleWithMode(mode) {
|
function toggleWithMode(mode) {
|
||||||
@@ -239,10 +274,13 @@ Item {
|
|||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
id: closeCleanupTimer
|
id: closeCleanupTimer
|
||||||
interval: Theme.modalAnimationDuration + 50
|
interval: Theme.variantCloseInterval(root.launcherAnimationDuration)
|
||||||
repeat: false
|
repeat: false
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
isClosing = false;
|
isClosing = false;
|
||||||
|
contentVisible = false;
|
||||||
|
contentWindow.visible = false;
|
||||||
|
backgroundWindow.visible = false;
|
||||||
if (root.unloadContentOnClose)
|
if (root.unloadContentOnClose)
|
||||||
launcherContentLoader.active = false;
|
launcherContentLoader.active = false;
|
||||||
dialogClosed();
|
dialogClosed();
|
||||||
@@ -251,7 +289,6 @@ Item {
|
|||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: spotlightContent?.controller ?? null
|
target: spotlightContent?.controller ?? null
|
||||||
|
|
||||||
function onModeChanged(mode) {
|
function onModeChanged(mode) {
|
||||||
if (spotlightContent.controller.autoSwitchedToFiles)
|
if (spotlightContent.controller.autoSwitchedToFiles)
|
||||||
return;
|
return;
|
||||||
@@ -261,7 +298,7 @@ Item {
|
|||||||
|
|
||||||
HyprlandFocusGrab {
|
HyprlandFocusGrab {
|
||||||
id: focusGrab
|
id: focusGrab
|
||||||
windows: [launcherWindow]
|
windows: [contentWindow]
|
||||||
active: false
|
active: false
|
||||||
|
|
||||||
onCleared: {
|
onCleared: {
|
||||||
@@ -286,55 +323,53 @@ Item {
|
|||||||
if (Quickshell.screens.length === 0)
|
if (Quickshell.screens.length === 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const screenName = launcherWindow.screen?.name;
|
const screen = contentWindow.screen;
|
||||||
if (screenName) {
|
const screenName = screen?.name;
|
||||||
|
|
||||||
|
let needsReset = !screen || !screenName;
|
||||||
|
if (!needsReset) {
|
||||||
|
needsReset = true;
|
||||||
for (let i = 0; i < Quickshell.screens.length; i++) {
|
for (let i = 0; i < Quickshell.screens.length; i++) {
|
||||||
if (Quickshell.screens[i].name === screenName)
|
if (Quickshell.screens[i].name === screenName) {
|
||||||
return;
|
needsReset = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (spotlightOpen)
|
if (!needsReset)
|
||||||
hide();
|
return;
|
||||||
|
|
||||||
const newScreen = CompositorService.getFocusedScreen() ?? Quickshell.screens[0];
|
const newScreen = CompositorService.getFocusedScreen() ?? Quickshell.screens[0];
|
||||||
if (newScreen)
|
if (!newScreen)
|
||||||
launcherWindow.screen = newScreen;
|
return;
|
||||||
|
|
||||||
|
root._windowEnabled = false;
|
||||||
|
backgroundWindow.screen = newScreen;
|
||||||
|
contentWindow.screen = newScreen;
|
||||||
|
Qt.callLater(() => {
|
||||||
|
root._windowEnabled = true;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ── Background window: fullscreen, handles darkening + click-to-dismiss ──
|
||||||
PanelWindow {
|
PanelWindow {
|
||||||
id: launcherWindow
|
id: backgroundWindow
|
||||||
visible: spotlightOpen || isClosing
|
visible: false
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
exclusionMode: ExclusionMode.Ignore
|
|
||||||
|
|
||||||
WindowBlur {
|
WlrLayershell.namespace: "dms:spotlight:bg"
|
||||||
targetWindow: launcherWindow
|
WlrLayershell.layer: WlrLayershell.Top
|
||||||
readonly property real s: Math.min(1, modalContainer.scale)
|
WlrLayershell.exclusiveZone: -1
|
||||||
blurX: root.modalX + root.modalWidth * (1 - s) * 0.5
|
WlrLayershell.keyboardFocus: WlrKeyboardFocus.None
|
||||||
blurY: root.modalY + root.modalHeight * (1 - s) * 0.5
|
|
||||||
blurWidth: (contentVisible && modalContainer.opacity > 0) ? root.modalWidth * s : 0
|
|
||||||
blurHeight: (contentVisible && modalContainer.opacity > 0) ? root.modalHeight * s : 0
|
|
||||||
blurRadius: root.cornerRadius
|
|
||||||
}
|
|
||||||
|
|
||||||
WlrLayershell.namespace: "dms:spotlight"
|
WlrLayershell.margins {
|
||||||
WlrLayershell.layer: {
|
top: contentContainer.dockTop ? contentContainer.dockThickness : (typeof SettingsData !== "undefined" && SettingsData.barPosition === 0 ? Theme.px(42, root.dpr) : 0)
|
||||||
switch (Quickshell.env("DMS_MODAL_LAYER")) {
|
bottom: contentContainer.dockBottom ? contentContainer.dockThickness : (typeof SettingsData !== "undefined" && SettingsData.barPosition === 1 ? Theme.px(42, root.dpr) : 0)
|
||||||
case "bottom":
|
left: contentContainer.dockLeft ? contentContainer.dockThickness : (typeof SettingsData !== "undefined" && SettingsData.barPosition === 2 ? Theme.px(42, root.dpr) : 0)
|
||||||
console.error("DankModal: 'bottom' layer is not valid for modals. Defaulting to 'top' layer.");
|
right: contentContainer.dockRight ? contentContainer.dockThickness : (typeof SettingsData !== "undefined" && SettingsData.barPosition === 3 ? Theme.px(42, root.dpr) : 0)
|
||||||
return WlrLayershell.Top;
|
|
||||||
case "background":
|
|
||||||
console.error("DankModal: 'background' layer is not valid for modals. Defaulting to 'top' layer.");
|
|
||||||
return WlrLayershell.Top;
|
|
||||||
case "overlay":
|
|
||||||
return WlrLayershell.Overlay;
|
|
||||||
default:
|
|
||||||
return WlrLayershell.Top;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
WlrLayershell.keyboardFocus: keyboardActive ? (root.useHyprlandFocusGrab ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.Exclusive) : WlrKeyboardFocus.None
|
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
top: true
|
top: true
|
||||||
@@ -344,11 +379,11 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mask: Region {
|
mask: Region {
|
||||||
item: spotlightOpen ? fullScreenMask : null
|
item: (spotlightOpen || isClosing) ? bgFullScreenMask : null
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: fullScreenMask
|
id: bgFullScreenMask
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -356,13 +391,14 @@ Item {
|
|||||||
id: backgroundDarken
|
id: backgroundDarken
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: "black"
|
color: "black"
|
||||||
opacity: contentVisible && SettingsData.modalDarkenBackground ? 0.5 : 0
|
opacity: launcherMotionVisible && SettingsData.modalDarkenBackground ? 0.5 : 0
|
||||||
visible: contentVisible || opacity > 0
|
visible: launcherMotionVisible || opacity > 0
|
||||||
|
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
|
enabled: root.animationsEnabled && (!Theme.isDirectionalEffect || Theme.isConnectedEffect)
|
||||||
DankAnim {
|
DankAnim {
|
||||||
duration: Theme.modalAnimationDuration
|
duration: Math.round(Theme.variantDuration(root.launcherAnimationDuration, launcherMotionVisible) * Theme.variantOpacityDurationScale)
|
||||||
easing.bezierCurve: contentVisible ? Theme.expressiveCurves.expressiveDefaultSpatial : Theme.expressiveCurves.emphasized
|
easing.bezierCurve: launcherMotionVisible ? root.launcherEnterCurve : root.launcherExitCurve
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -370,96 +406,236 @@ Item {
|
|||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
enabled: spotlightOpen
|
enabled: spotlightOpen
|
||||||
onClicked: mouse => {
|
onClicked: root.hide()
|
||||||
var contentX = modalContainer.x;
|
}
|
||||||
var contentY = modalContainer.y;
|
}
|
||||||
var contentW = modalContainer.width;
|
|
||||||
var contentH = modalContainer.height;
|
|
||||||
|
|
||||||
if (mouse.x < contentX || mouse.x > contentX + contentW || mouse.y < contentY || mouse.y > contentY + contentH) {
|
// ── Content window: SMALL, positioned with margins — only renders the modal area ──
|
||||||
root.hide();
|
PanelWindow {
|
||||||
}
|
id: contentWindow
|
||||||
|
visible: false
|
||||||
|
color: "transparent"
|
||||||
|
|
||||||
|
WindowBlur {
|
||||||
|
targetWindow: contentWindow
|
||||||
|
blurEnabled: root.effectiveBlurEnabled
|
||||||
|
readonly property real s: Math.min(1, contentContainer.scaleValue)
|
||||||
|
blurX: root._ccX + root.alignedWidth * (1 - s) * 0.5 + Theme.snap(contentContainer.animX, root.dpr)
|
||||||
|
blurY: root._ccY + root.alignedHeight * (1 - s) * 0.5 + Theme.snap(contentContainer.animY, root.dpr)
|
||||||
|
blurWidth: (root.spotlightOpen || root.isClosing) && contentWrapper.opacity > 0 ? root.alignedWidth * s : 0
|
||||||
|
blurHeight: (root.spotlightOpen || root.isClosing) && contentWrapper.opacity > 0 ? root.alignedHeight * s : 0
|
||||||
|
blurRadius: root.cornerRadius
|
||||||
|
}
|
||||||
|
|
||||||
|
WlrLayershell.namespace: "dms:spotlight"
|
||||||
|
WlrLayershell.layer: {
|
||||||
|
switch (Quickshell.env("DMS_MODAL_LAYER")) {
|
||||||
|
case "bottom":
|
||||||
|
console.error("DankLauncherV2Modal: 'bottom' layer is not valid for modals. Defaulting to 'top' layer.");
|
||||||
|
return WlrLayershell.Top;
|
||||||
|
case "background":
|
||||||
|
console.error("DankLauncherV2Modal: 'background' layer is not valid for modals. Defaulting to 'top' layer.");
|
||||||
|
return WlrLayershell.Top;
|
||||||
|
case "overlay":
|
||||||
|
return WlrLayershell.Overlay;
|
||||||
|
default:
|
||||||
|
return WlrLayershell.Top;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
WlrLayershell.exclusiveZone: -1
|
||||||
|
WlrLayershell.keyboardFocus: keyboardActive ? (root.useHyprlandFocusGrab ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.Exclusive) : WlrKeyboardFocus.None
|
||||||
|
|
||||||
|
anchors {
|
||||||
|
left: true
|
||||||
|
top: true
|
||||||
|
}
|
||||||
|
|
||||||
|
WlrLayershell.margins {
|
||||||
|
left: root._cwMarginLeft
|
||||||
|
top: root._cwMarginTop
|
||||||
|
}
|
||||||
|
|
||||||
|
implicitWidth: root._cwWidth
|
||||||
|
implicitHeight: root._cwHeight
|
||||||
|
|
||||||
|
mask: Region {
|
||||||
|
item: contentInputMask
|
||||||
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: modalContainer
|
id: contentInputMask
|
||||||
x: root.modalX
|
visible: false
|
||||||
y: root.modalY
|
x: contentContainer.x + contentWrapper.x
|
||||||
width: root.modalWidth
|
y: contentContainer.y + contentWrapper.y
|
||||||
height: root.modalHeight
|
width: root.alignedWidth
|
||||||
visible: contentVisible || opacity > 0
|
height: root.alignedHeight
|
||||||
|
|
||||||
opacity: contentVisible ? 1 : 0
|
|
||||||
scale: contentVisible ? 1 : 0.96
|
|
||||||
transformOrigin: Item.Center
|
|
||||||
|
|
||||||
Behavior on opacity {
|
|
||||||
DankAnim {
|
|
||||||
duration: Theme.modalAnimationDuration
|
|
||||||
easing.bezierCurve: contentVisible ? Theme.expressiveCurves.expressiveDefaultSpatial : Theme.expressiveCurves.emphasized
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Behavior on scale {
|
|
||||||
DankAnim {
|
|
||||||
duration: Theme.modalAnimationDuration
|
|
||||||
easing.bezierCurve: contentVisible ? Theme.expressiveCurves.expressiveDefaultSpatial : Theme.expressiveCurves.emphasized
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ElevationShadow {
|
|
||||||
id: launcherShadowLayer
|
|
||||||
anchors.fill: parent
|
|
||||||
level: Theme.elevationLevel3
|
|
||||||
fallbackOffset: 6
|
|
||||||
targetColor: root.backgroundColor
|
|
||||||
borderColor: root.borderColor
|
|
||||||
borderWidth: root.borderWidth
|
|
||||||
targetRadius: root.cornerRadius
|
|
||||||
shadowEnabled: Theme.elevationEnabled && SettingsData.modalElevationEnabled && Quickshell.env("DMS_DISABLE_LAYER") !== "true" && Quickshell.env("DMS_DISABLE_LAYER") !== "1"
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
onPressed: mouse => mouse.accepted = true
|
|
||||||
}
|
|
||||||
|
|
||||||
FocusScope {
|
|
||||||
anchors.fill: parent
|
|
||||||
focus: keyboardActive
|
|
||||||
|
|
||||||
Loader {
|
|
||||||
id: launcherContentLoader
|
|
||||||
anchors.fill: parent
|
|
||||||
active: !root.unloadContentOnClose || root.spotlightOpen || root.isClosing || root.contentVisible || root._pendingInitialize
|
|
||||||
asynchronous: false
|
|
||||||
sourceComponent: LauncherContent {
|
|
||||||
focus: true
|
|
||||||
parentModal: root
|
|
||||||
}
|
|
||||||
|
|
||||||
onLoaded: {
|
|
||||||
if (root._pendingInitialize) {
|
|
||||||
root._initializeAndShow(root._pendingQuery, root._pendingMode);
|
|
||||||
root._pendingInitialize = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Keys.onEscapePressed: event => {
|
|
||||||
root.hide();
|
|
||||||
event.accepted = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
anchors.fill: parent
|
|
||||||
radius: root.cornerRadius
|
|
||||||
color: "transparent"
|
|
||||||
border.color: BlurService.borderColor
|
|
||||||
border.width: BlurService.borderWidth
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
Item {
|
||||||
|
id: contentContainer
|
||||||
|
|
||||||
|
// For directional/depth: contentContainer is at alignedY from window top (window starts at screen top)
|
||||||
|
// For standard: contentContainer is at shadowPad from window top (window starts near modal)
|
||||||
|
x: root._ccX
|
||||||
|
y: root._ccY
|
||||||
|
width: root.alignedWidth
|
||||||
|
height: root.alignedHeight
|
||||||
|
|
||||||
|
readonly property int dockEdge: typeof SettingsData !== "undefined" ? SettingsData.dockPosition : 1
|
||||||
|
readonly property bool dockTop: dockEdge === 0
|
||||||
|
readonly property bool dockBottom: dockEdge === 1
|
||||||
|
readonly property bool dockLeft: dockEdge === 2
|
||||||
|
readonly property bool dockRight: dockEdge === 3
|
||||||
|
|
||||||
|
readonly property real dockThickness: typeof SettingsData !== "undefined" && SettingsData.showDock ? Theme.px(SettingsData.dockIconSize + (SettingsData.dockMargin * 2) + SettingsData.dockSpacing + 8, root.dpr) : Theme.px(60, root.dpr)
|
||||||
|
|
||||||
|
readonly property bool directionalEffect: Theme.isDirectionalEffect
|
||||||
|
readonly property bool depthEffect: Theme.isDepthEffect
|
||||||
|
readonly property real collapsedMotionX: {
|
||||||
|
if (directionalEffect) {
|
||||||
|
if (dockLeft)
|
||||||
|
return -(root._ccX + root.alignedWidth + Theme.effectAnimOffset);
|
||||||
|
if (dockRight)
|
||||||
|
return root.screenWidth - root._ccX + Theme.effectAnimOffset;
|
||||||
|
}
|
||||||
|
if (depthEffect)
|
||||||
|
return Theme.effectAnimOffset * 0.25;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
readonly property real collapsedMotionY: {
|
||||||
|
if (directionalEffect) {
|
||||||
|
if (dockTop)
|
||||||
|
return -(root._ccY + root.alignedHeight + Theme.effectAnimOffset);
|
||||||
|
if (dockBottom)
|
||||||
|
return root.screenHeight - root._ccY + root.shadowPad + Theme.effectAnimOffset;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (depthEffect)
|
||||||
|
return -Math.max(Theme.effectAnimOffset * 0.85, 34);
|
||||||
|
return -Math.max((root.shadowPad || 0) + Theme.effectAnimOffset, 40);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Declarative bindings — snap applied at render layer (contentWrapper x/y)
|
||||||
|
property real animX: root._motionActive ? 0 : root._frozenMotionX
|
||||||
|
property real animY: root._motionActive ? 0 : root._frozenMotionY
|
||||||
|
property real scaleValue: root._motionActive ? 1.0 : (Theme.isDirectionalEffect && typeof SettingsData !== "undefined" && SettingsData.directionalAnimationMode === 2 ? Theme.effectScaleCollapsed : (Theme.isDirectionalEffect ? 1 : Theme.effectScaleCollapsed))
|
||||||
|
|
||||||
|
Behavior on animX {
|
||||||
|
enabled: root.animationsEnabled
|
||||||
|
DankAnim {
|
||||||
|
duration: Theme.variantDuration(root.launcherAnimationDuration, root._motionActive)
|
||||||
|
easing.bezierCurve: root._motionActive ? root.launcherEnterCurve : root.launcherExitCurve
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Behavior on animY {
|
||||||
|
enabled: root.animationsEnabled
|
||||||
|
DankAnim {
|
||||||
|
duration: Theme.variantDuration(root.launcherAnimationDuration, root._motionActive)
|
||||||
|
easing.bezierCurve: root._motionActive ? root.launcherEnterCurve : root.launcherExitCurve
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Behavior on scaleValue {
|
||||||
|
enabled: root.animationsEnabled && (!Theme.isDirectionalEffect || (typeof SettingsData !== "undefined" && SettingsData.directionalAnimationMode === 2))
|
||||||
|
DankAnim {
|
||||||
|
duration: Theme.variantDuration(root.launcherAnimationDuration, root._motionActive)
|
||||||
|
easing.bezierCurve: root._motionActive ? root.launcherEnterCurve : root.launcherExitCurve
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: directionalClipMask
|
||||||
|
readonly property bool shouldClip: Theme.isDirectionalEffect && typeof SettingsData !== "undefined" && SettingsData.directionalAnimationMode > 0
|
||||||
|
readonly property real clipOversize: 2000
|
||||||
|
|
||||||
|
clip: shouldClip
|
||||||
|
|
||||||
|
x: shouldClip ? (contentContainer.dockRight ? -clipOversize : (contentContainer.dockLeft ? contentContainer.dockThickness - root._ccX : -clipOversize)) : 0
|
||||||
|
y: shouldClip ? (contentContainer.dockBottom ? -clipOversize : (contentContainer.dockTop ? contentContainer.dockThickness - root._ccY : -clipOversize)) : 0
|
||||||
|
|
||||||
|
width: shouldClip ? parent.width + clipOversize + (contentContainer.dockRight ? (root.screenWidth - contentContainer.dockThickness - root._ccX - parent.width) : (contentContainer.dockLeft ? clipOversize : clipOversize)) : parent.width
|
||||||
|
height: shouldClip ? parent.height + clipOversize + (contentContainer.dockBottom ? (root.screenHeight - contentContainer.dockThickness - root._ccY - parent.height) : (contentContainer.dockTop ? clipOversize : clipOversize)) : parent.height
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: aligner
|
||||||
|
x: directionalClipMask.x !== 0 ? -directionalClipMask.x : 0
|
||||||
|
y: directionalClipMask.y !== 0 ? -directionalClipMask.y : 0
|
||||||
|
width: contentContainer.width
|
||||||
|
height: contentContainer.height
|
||||||
|
|
||||||
|
// Shadow mirrors contentWrapper position/scale/opacity
|
||||||
|
ElevationShadow {
|
||||||
|
id: launcherShadowLayer
|
||||||
|
width: parent.width
|
||||||
|
height: parent.height
|
||||||
|
opacity: contentWrapper.opacity
|
||||||
|
scale: contentWrapper.scale
|
||||||
|
x: contentWrapper.x
|
||||||
|
y: contentWrapper.y
|
||||||
|
level: root.shadowLevel
|
||||||
|
fallbackOffset: root.shadowFallbackOffset
|
||||||
|
targetColor: root.backgroundColor
|
||||||
|
borderColor: root.effectiveBorderColor
|
||||||
|
borderWidth: root.effectiveBorderWidth
|
||||||
|
targetRadius: root.cornerRadius
|
||||||
|
shadowEnabled: Theme.elevationEnabled && SettingsData.modalElevationEnabled && Quickshell.env("DMS_DISABLE_LAYER") !== "true" && Quickshell.env("DMS_DISABLE_LAYER") !== "1"
|
||||||
|
}
|
||||||
|
|
||||||
|
// contentWrapper moves inside static contentContainer — DankPopout pattern
|
||||||
|
Item {
|
||||||
|
id: contentWrapper
|
||||||
|
width: parent.width
|
||||||
|
height: parent.height
|
||||||
|
opacity: (Theme.isDirectionalEffect && !Theme.isConnectedEffect) ? 1 : (launcherMotionVisible ? 1 : 0)
|
||||||
|
visible: opacity > 0
|
||||||
|
scale: contentContainer.scaleValue
|
||||||
|
x: Theme.snap(contentContainer.animX + (parent.width - width) * (1 - contentContainer.scaleValue) * 0.5, root.dpr)
|
||||||
|
y: Theme.snap(contentContainer.animY + (parent.height - height) * (1 - contentContainer.scaleValue) * 0.5, root.dpr)
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
enabled: root.animationsEnabled && (!Theme.isDirectionalEffect || Theme.isConnectedEffect)
|
||||||
|
DankAnim {
|
||||||
|
duration: Math.round(Theme.variantDuration(root.launcherAnimationDuration, launcherMotionVisible) * Theme.variantOpacityDurationScale)
|
||||||
|
easing.bezierCurve: launcherMotionVisible ? root.launcherEnterCurve : root.launcherExitCurve
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
onPressed: mouse => mouse.accepted = true
|
||||||
|
}
|
||||||
|
|
||||||
|
FocusScope {
|
||||||
|
anchors.fill: parent
|
||||||
|
focus: keyboardActive
|
||||||
|
|
||||||
|
Loader {
|
||||||
|
id: launcherContentLoader
|
||||||
|
anchors.fill: parent
|
||||||
|
active: !root.unloadContentOnClose || root.spotlightOpen || root.isClosing || root.contentVisible || root._pendingInitialize
|
||||||
|
asynchronous: false
|
||||||
|
sourceComponent: LauncherContent {
|
||||||
|
focus: true
|
||||||
|
parentModal: root
|
||||||
|
}
|
||||||
|
|
||||||
|
onLoaded: {
|
||||||
|
if (root._pendingInitialize) {
|
||||||
|
root._initializeAndShow(root._pendingQuery, root._pendingMode);
|
||||||
|
root._pendingInitialize = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Keys.onEscapePressed: event => {
|
||||||
|
root.hide();
|
||||||
|
event.accepted = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} // contentWrapper
|
||||||
|
} // aligner
|
||||||
|
} // directionalClipMask
|
||||||
|
} // contentContainer
|
||||||
|
} // PanelWindow
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ FocusScope {
|
|||||||
editCommentField.text = existing?.comment || "";
|
editCommentField.text = existing?.comment || "";
|
||||||
editEnvVarsField.text = existing?.envVars || "";
|
editEnvVarsField.text = existing?.envVars || "";
|
||||||
editExtraFlagsField.text = existing?.extraFlags || "";
|
editExtraFlagsField.text = existing?.extraFlags || "";
|
||||||
editDgpuToggle.checked = existing?.launchOnDgpu || false;
|
|
||||||
editMode = true;
|
editMode = true;
|
||||||
Qt.callLater(() => editNameField.forceActiveFocus());
|
Qt.callLater(() => editNameField.forceActiveFocus());
|
||||||
}
|
}
|
||||||
@@ -65,8 +64,6 @@ FocusScope {
|
|||||||
override.envVars = editEnvVarsField.text.trim();
|
override.envVars = editEnvVarsField.text.trim();
|
||||||
if (editExtraFlagsField.text.trim())
|
if (editExtraFlagsField.text.trim())
|
||||||
override.extraFlags = editExtraFlagsField.text.trim();
|
override.extraFlags = editExtraFlagsField.text.trim();
|
||||||
if (editDgpuToggle.checked)
|
|
||||||
override.launchOnDgpu = true;
|
|
||||||
SessionData.setAppOverride(editAppId, override);
|
SessionData.setAppOverride(editAppId, override);
|
||||||
closeEditMode();
|
closeEditMode();
|
||||||
}
|
}
|
||||||
@@ -89,7 +86,7 @@ FocusScope {
|
|||||||
|
|
||||||
Controller {
|
Controller {
|
||||||
id: controller
|
id: controller
|
||||||
active: root.parentModal?.spotlightOpen ?? true
|
active: root.parentModal ? (root.parentModal.spotlightOpen || root.parentModal.isClosing) : true
|
||||||
viewModeContext: root.viewModeContext
|
viewModeContext: root.viewModeContext
|
||||||
|
|
||||||
onItemExecuted: {
|
onItemExecuted: {
|
||||||
@@ -149,18 +146,10 @@ FocusScope {
|
|||||||
event.accepted = false;
|
event.accepted = false;
|
||||||
return;
|
return;
|
||||||
case Qt.Key_Down:
|
case Qt.Key_Down:
|
||||||
if (hasCtrl) {
|
controller.selectNext();
|
||||||
controller.navigateHistory("down");
|
|
||||||
} else {
|
|
||||||
controller.selectNext();
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
case Qt.Key_Up:
|
case Qt.Key_Up:
|
||||||
if (hasCtrl) {
|
controller.selectPrevious();
|
||||||
controller.navigateHistory("up");
|
|
||||||
} else {
|
|
||||||
controller.selectPrevious();
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
case Qt.Key_PageDown:
|
case Qt.Key_PageDown:
|
||||||
controller.selectPageDown(8);
|
controller.selectPageDown(8);
|
||||||
@@ -169,10 +158,6 @@ FocusScope {
|
|||||||
controller.selectPageUp(8);
|
controller.selectPageUp(8);
|
||||||
return;
|
return;
|
||||||
case Qt.Key_Right:
|
case Qt.Key_Right:
|
||||||
if (hasCtrl) {
|
|
||||||
controller.cycleMode();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (controller.getCurrentSectionViewMode() !== "list") {
|
if (controller.getCurrentSectionViewMode() !== "list") {
|
||||||
controller.selectRight();
|
controller.selectRight();
|
||||||
return;
|
return;
|
||||||
@@ -180,25 +165,12 @@ FocusScope {
|
|||||||
event.accepted = false;
|
event.accepted = false;
|
||||||
return;
|
return;
|
||||||
case Qt.Key_Left:
|
case Qt.Key_Left:
|
||||||
if (hasCtrl) {
|
|
||||||
const reverse = true;
|
|
||||||
controller.cycleMode(reverse);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (controller.getCurrentSectionViewMode() !== "list") {
|
if (controller.getCurrentSectionViewMode() !== "list") {
|
||||||
controller.selectLeft();
|
controller.selectLeft();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
event.accepted = false;
|
event.accepted = false;
|
||||||
return;
|
return;
|
||||||
case Qt.Key_H:
|
|
||||||
if (hasCtrl) {
|
|
||||||
const reverse = true;
|
|
||||||
controller.cycleMode(reverse);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
event.accepted = false;
|
|
||||||
return;
|
|
||||||
case Qt.Key_J:
|
case Qt.Key_J:
|
||||||
if (hasCtrl) {
|
if (hasCtrl) {
|
||||||
controller.selectNext();
|
controller.selectNext();
|
||||||
@@ -213,13 +185,6 @@ FocusScope {
|
|||||||
}
|
}
|
||||||
event.accepted = false;
|
event.accepted = false;
|
||||||
return;
|
return;
|
||||||
case Qt.Key_L:
|
|
||||||
if (hasCtrl) {
|
|
||||||
controller.cycleMode();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
event.accepted = false;
|
|
||||||
return;
|
|
||||||
case Qt.Key_N:
|
case Qt.Key_N:
|
||||||
if (hasCtrl) {
|
if (hasCtrl) {
|
||||||
controller.selectNextSection();
|
controller.selectNextSection();
|
||||||
@@ -235,19 +200,13 @@ FocusScope {
|
|||||||
event.accepted = false;
|
event.accepted = false;
|
||||||
return;
|
return;
|
||||||
case Qt.Key_Tab:
|
case Qt.Key_Tab:
|
||||||
if (hasCtrl && actionPanel.hasActions) {
|
if (actionPanel.hasActions) {
|
||||||
actionPanel.expanded ? actionPanel.cycleAction() : actionPanel.show();
|
actionPanel.expanded ? actionPanel.cycleAction() : actionPanel.show();
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
controller.selectNext();
|
|
||||||
return;
|
return;
|
||||||
case Qt.Key_Backtab:
|
case Qt.Key_Backtab:
|
||||||
if (hasCtrl && actionPanel.expanded) {
|
if (actionPanel.expanded)
|
||||||
const reverse = true;
|
actionPanel.hide();
|
||||||
actionPanel.expanded ? actionPanel.cycleAction(reverse) : actionPanel.show();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
controller.selectPrevious();
|
|
||||||
return;
|
return;
|
||||||
case Qt.Key_Return:
|
case Qt.Key_Return:
|
||||||
case Qt.Key_Enter:
|
case Qt.Key_Enter:
|
||||||
@@ -429,7 +388,7 @@ FocusScope {
|
|||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
text: "Ctrl-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
|
||||||
@@ -503,7 +462,7 @@ FocusScope {
|
|||||||
showClearButton: true
|
showClearButton: true
|
||||||
textColor: Theme.surfaceText
|
textColor: Theme.surfaceText
|
||||||
font.pixelSize: Theme.fontSizeLarge
|
font.pixelSize: Theme.fontSizeLarge
|
||||||
enabled: root.parentModal ? root.parentModal.spotlightOpen : true
|
enabled: root.parentModal ? (root.parentModal.spotlightOpen || root.parentModal.isClosing) : true
|
||||||
placeholderText: ""
|
placeholderText: ""
|
||||||
ignoreUpDownKeys: true
|
ignoreUpDownKeys: true
|
||||||
ignoreTabKeys: true
|
ignoreTabKeys: true
|
||||||
@@ -737,7 +696,13 @@ FocusScope {
|
|||||||
Item {
|
Item {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: parent.height - searchField.height - categoryRow.height - fileFilterRow.height - actionPanel.height - Theme.spacingXS * ((categoryRow.visible ? 1 : 0) + (fileFilterRow.visible ? 1 : 0) + 2)
|
height: parent.height - searchField.height - categoryRow.height - fileFilterRow.height - actionPanel.height - Theme.spacingXS * ((categoryRow.visible ? 1 : 0) + (fileFilterRow.visible ? 1 : 0) + 2)
|
||||||
opacity: root.parentModal?.isClosing ? 0 : 1
|
opacity: {
|
||||||
|
if (!root.parentModal)
|
||||||
|
return 1;
|
||||||
|
if (Theme.isDirectionalEffect && root.parentModal.isClosing)
|
||||||
|
return 1;
|
||||||
|
return root.parentModal.isClosing ? 0 : 1;
|
||||||
|
}
|
||||||
|
|
||||||
ResultsList {
|
ResultsList {
|
||||||
id: resultsList
|
id: resultsList
|
||||||
@@ -771,7 +736,6 @@ FocusScope {
|
|||||||
}
|
}
|
||||||
function onSearchQueryRequested(query) {
|
function onSearchQueryRequested(query) {
|
||||||
searchField.text = query;
|
searchField.text = query;
|
||||||
searchField.cursorPosition = query.length;
|
|
||||||
}
|
}
|
||||||
function onModeChanged() {
|
function onModeChanged() {
|
||||||
extFilterField.text = "";
|
extFilterField.text = "";
|
||||||
@@ -982,15 +946,6 @@ FocusScope {
|
|||||||
keyNavigationBacktab: editEnvVarsField
|
keyNavigationBacktab: editEnvVarsField
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DankToggle {
|
|
||||||
id: editDgpuToggle
|
|
||||||
width: parent.width
|
|
||||||
text: I18n.tr("Launch on dGPU by default")
|
|
||||||
visible: SessionService.nvidiaCommand.length > 0
|
|
||||||
checked: false
|
|
||||||
onToggled: checked => editDgpuToggle.checked = checked
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -324,6 +324,8 @@ Item {
|
|||||||
height: 24
|
height: 24
|
||||||
z: 100
|
z: 100
|
||||||
visible: {
|
visible: {
|
||||||
|
if (BlurService.enabled)
|
||||||
|
return false;
|
||||||
if (mainListView.contentHeight <= mainListView.height)
|
if (mainListView.contentHeight <= mainListView.height)
|
||||||
return false;
|
return false;
|
||||||
var atBottom = mainListView.contentY >= mainListView.contentHeight - mainListView.height + mainListView.originY - 5;
|
var atBottom = mainListView.contentY >= mainListView.contentHeight - mainListView.height + mainListView.originY - 5;
|
||||||
@@ -449,7 +451,7 @@ Item {
|
|||||||
case "apps":
|
case "apps":
|
||||||
return "apps";
|
return "apps";
|
||||||
default:
|
default:
|
||||||
return root.controller?.searchQuery?.length > 0 ? "search_off" : "search";
|
return "search_off";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -485,9 +487,9 @@ Item {
|
|||||||
case "plugins":
|
case "plugins":
|
||||||
return hasQuery ? I18n.tr("No plugin results") : I18n.tr("Browse or search plugins");
|
return hasQuery ? I18n.tr("No plugin results") : I18n.tr("Browse or search plugins");
|
||||||
case "apps":
|
case "apps":
|
||||||
return hasQuery ? I18n.tr("No apps found") : I18n.tr("Type to search apps");
|
return I18n.tr("No apps found");
|
||||||
default:
|
default:
|
||||||
return hasQuery ? I18n.tr("No results found") : I18n.tr("Type to search");
|
return I18n.tr("No results found");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -518,5 +518,20 @@ FocusScope {
|
|||||||
Qt.callLater(() => item.forceActiveFocus());
|
Qt.callLater(() => item.forceActiveFocus());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loader {
|
||||||
|
id: frameLoader
|
||||||
|
anchors.fill: parent
|
||||||
|
active: root.currentIndex === 33
|
||||||
|
visible: active
|
||||||
|
focus: active
|
||||||
|
|
||||||
|
sourceComponent: FrameTab {}
|
||||||
|
|
||||||
|
onActiveChanged: {
|
||||||
|
if (active && item)
|
||||||
|
Qt.callLater(() => item.forceActiveFocus());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,6 +120,12 @@ Rectangle {
|
|||||||
"text": I18n.tr("Widgets"),
|
"text": I18n.tr("Widgets"),
|
||||||
"icon": "widgets",
|
"icon": "widgets",
|
||||||
"tabIndex": 22
|
"tabIndex": 22
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "frame",
|
||||||
|
"text": I18n.tr("Frame"),
|
||||||
|
"icon": "frame_source",
|
||||||
|
"tabIndex": 33
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -8,9 +8,6 @@ DankPopout {
|
|||||||
|
|
||||||
layerNamespace: "dms:app-launcher"
|
layerNamespace: "dms:app-launcher"
|
||||||
|
|
||||||
readonly property real screenWidth: screen?.width ?? 1920
|
|
||||||
readonly property real screenHeight: screen?.height ?? 1080
|
|
||||||
|
|
||||||
property string _pendingMode: ""
|
property string _pendingMode: ""
|
||||||
property string _pendingQuery: ""
|
property string _pendingQuery: ""
|
||||||
|
|
||||||
@@ -44,35 +41,8 @@ DankPopout {
|
|||||||
openWithQuery(query);
|
openWithQuery(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly property int _baseWidth: {
|
popupWidth: 560
|
||||||
switch (SettingsData.dankLauncherV2Size) {
|
popupHeight: 640
|
||||||
case "micro":
|
|
||||||
return 500;
|
|
||||||
case "medium":
|
|
||||||
return 720;
|
|
||||||
case "large":
|
|
||||||
return 860;
|
|
||||||
default:
|
|
||||||
return 620;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
readonly property int _baseHeight: {
|
|
||||||
switch (SettingsData.dankLauncherV2Size) {
|
|
||||||
case "micro":
|
|
||||||
return 480;
|
|
||||||
case "medium":
|
|
||||||
return 720;
|
|
||||||
case "large":
|
|
||||||
return 860;
|
|
||||||
default:
|
|
||||||
return 600;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
popupWidth: Math.min(_baseWidth, screenWidth - 100)
|
|
||||||
popupHeight: Math.min(_baseHeight, screenHeight - 100)
|
|
||||||
|
|
||||||
triggerWidth: 40
|
triggerWidth: 40
|
||||||
positioning: ""
|
positioning: ""
|
||||||
contentHandlesKeys: contentLoader.item?.launcherContent?.editMode ?? false
|
contentHandlesKeys: contentLoader.item?.launcherContent?.editMode ?? false
|
||||||
@@ -90,7 +60,7 @@ DankPopout {
|
|||||||
if (!lc)
|
if (!lc)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const query = _pendingQuery || (SettingsData.rememberLastQuery ? SessionData.launcherLastQuery : "") || "";
|
const query = _pendingQuery;
|
||||||
const mode = _pendingMode || SessionData.appDrawerLastMode || "apps";
|
const mode = _pendingMode || SessionData.appDrawerLastMode || "apps";
|
||||||
_pendingMode = "";
|
_pendingMode = "";
|
||||||
_pendingQuery = "";
|
_pendingQuery = "";
|
||||||
@@ -102,9 +72,12 @@ DankPopout {
|
|||||||
if (lc.controller) {
|
if (lc.controller) {
|
||||||
lc.controller.searchMode = mode;
|
lc.controller.searchMode = mode;
|
||||||
lc.controller.pluginFilter = "";
|
lc.controller.pluginFilter = "";
|
||||||
lc.controller.searchQuery = query;
|
lc.controller.searchQuery = "";
|
||||||
|
if (query) {
|
||||||
lc.controller.performSearch();
|
lc.controller.setSearchQuery(query);
|
||||||
|
} else {
|
||||||
|
lc.controller.performSearch();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
lc.resetScroll?.();
|
lc.resetScroll?.();
|
||||||
lc.actionPanel?.hide();
|
lc.actionPanel?.hide();
|
||||||
@@ -133,7 +106,7 @@ DankPopout {
|
|||||||
QtObject {
|
QtObject {
|
||||||
id: modalAdapter
|
id: modalAdapter
|
||||||
property bool spotlightOpen: appDrawerPopout.shouldBeVisible
|
property bool spotlightOpen: appDrawerPopout.shouldBeVisible
|
||||||
property bool isClosing: false
|
property bool isClosing: appDrawerPopout.isClosing
|
||||||
|
|
||||||
function hide() {
|
function hide() {
|
||||||
appDrawerPopout.close();
|
appDrawerPopout.close();
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ PluginComponent {
|
|||||||
id: detailRoot
|
id: detailRoot
|
||||||
implicitHeight: detailColumn.implicitHeight + Theme.spacingM * 2
|
implicitHeight: detailColumn.implicitHeight + Theme.spacingM * 2
|
||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
color: Theme.surfaceContainerHigh
|
color: Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency)
|
||||||
|
|
||||||
DankActionButton {
|
DankActionButton {
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
@@ -252,7 +252,7 @@ PluginComponent {
|
|||||||
width: parent ? parent.width : 300
|
width: parent ? parent.width : 300
|
||||||
height: 50
|
height: 50
|
||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
color: Theme.surfaceContainerHighest
|
color: Theme.surfaceLight
|
||||||
border.width: 1
|
border.width: 1
|
||||||
border.color: Theme.outlineLight
|
border.color: Theme.outlineLight
|
||||||
opacity: 1.0
|
opacity: 1.0
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ Row {
|
|||||||
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
color: Theme.surfaceContainer
|
color: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
||||||
border.color: Theme.primarySelected
|
border.color: Theme.primarySelected
|
||||||
border.width: 0
|
border.width: 0
|
||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
|
|||||||
@@ -136,9 +136,11 @@ DankPopout {
|
|||||||
z: 5000
|
z: 5000
|
||||||
|
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
|
enabled: !Theme.isDirectionalEffect
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: 200
|
duration: Theme.shortDuration
|
||||||
easing.type: Easing.OutCubic
|
easing.type: Easing.BezierSpline
|
||||||
|
easing.bezierCurve: root.shouldBeVisible ? Theme.variantPopoutEnterCurve : Theme.variantPopoutExitCurve
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -207,9 +207,9 @@ Rectangle {
|
|||||||
width: parent.width
|
width: parent.width
|
||||||
height: 50
|
height: 50
|
||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
color: deviceMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) : Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency)
|
color: deviceMouseArea.containsMouse ? Theme.primaryHoverLight : Theme.surfaceLight
|
||||||
border.color: modelData === AudioService.source ? Theme.primary : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12)
|
border.color: modelData === AudioService.source ? Theme.primary : Theme.outlineLight
|
||||||
border.width: 0
|
border.width: modelData === AudioService.source ? 2 : 1
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
|
|||||||
@@ -218,9 +218,9 @@ Rectangle {
|
|||||||
width: parent.width
|
width: parent.width
|
||||||
height: 50
|
height: 50
|
||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
color: deviceMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) : Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency)
|
color: deviceMouseArea.containsMouse ? Theme.primaryHoverLight : Theme.surfaceLight
|
||||||
border.color: modelData === AudioService.sink ? Theme.primary : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12)
|
border.color: modelData === AudioService.sink ? Theme.primary : Theme.outlineLight
|
||||||
border.width: 0
|
border.width: modelData === AudioService.sink ? 2 : 1
|
||||||
|
|
||||||
DankRipple {
|
DankRipple {
|
||||||
id: deviceRipple
|
id: deviceRipple
|
||||||
@@ -397,9 +397,9 @@ Rectangle {
|
|||||||
width: parent.width
|
width: parent.width
|
||||||
height: 50
|
height: 50
|
||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
color: Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency)
|
color: Theme.surfaceLight
|
||||||
border.color: modelData === AudioService.sink ? Theme.primary : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12)
|
border.color: modelData === AudioService.sink ? Theme.primary : Theme.outlineLight
|
||||||
border.width: 0
|
border.width: modelData === AudioService.sink ? 2 : 1
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
|
|||||||
@@ -129,8 +129,9 @@ Rectangle {
|
|||||||
width: (parent.width - Theme.spacingM) / 2
|
width: (parent.width - Theme.spacingM) / 2
|
||||||
height: 64
|
height: 64
|
||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
color: Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency)
|
color: Theme.surfaceLight
|
||||||
border.width: 0
|
border.color: Theme.outlineLight
|
||||||
|
border.width: 1
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
@@ -164,8 +165,9 @@ Rectangle {
|
|||||||
width: (parent.width - Theme.spacingM) / 2
|
width: (parent.width - Theme.spacingM) / 2
|
||||||
height: 64
|
height: 64
|
||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
color: Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency)
|
color: Theme.surfaceLight
|
||||||
border.width: 0
|
border.color: Theme.outlineLight
|
||||||
|
border.width: 1
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ Item {
|
|||||||
width: 320
|
width: 320
|
||||||
height: contentColumn.implicitHeight + Theme.spacingL * 2
|
height: contentColumn.implicitHeight + Theme.spacingL * 2
|
||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
color: Theme.surfaceContainer
|
color: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
||||||
border.width: 0
|
border.width: 0
|
||||||
opacity: modalVisible ? 1 : 0
|
opacity: modalVisible ? 1 : 0
|
||||||
|
|||||||
@@ -229,7 +229,6 @@ Rectangle {
|
|||||||
width: parent.width
|
width: parent.width
|
||||||
height: 50
|
height: 50
|
||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
border.width: 0
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
if (!isConnected)
|
if (!isConnected)
|
||||||
@@ -243,8 +242,8 @@ Rectangle {
|
|||||||
if (isConnecting)
|
if (isConnecting)
|
||||||
return Qt.rgba(Theme.warning.r, Theme.warning.g, Theme.warning.b, 0.12);
|
return Qt.rgba(Theme.warning.r, Theme.warning.g, Theme.warning.b, 0.12);
|
||||||
if (deviceMouseArea.containsMouse)
|
if (deviceMouseArea.containsMouse)
|
||||||
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08);
|
return Theme.primaryHoverLight;
|
||||||
return Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency);
|
return Theme.surfaceLight;
|
||||||
}
|
}
|
||||||
|
|
||||||
border.color: {
|
border.color: {
|
||||||
@@ -252,8 +251,9 @@ Rectangle {
|
|||||||
return Theme.warning;
|
return Theme.warning;
|
||||||
if (isConnected)
|
if (isConnected)
|
||||||
return Theme.primary;
|
return Theme.primary;
|
||||||
return Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12);
|
return Theme.outlineLight;
|
||||||
}
|
}
|
||||||
|
border.width: (isConnecting || isConnected) ? 2 : 1
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
@@ -490,9 +490,9 @@ Rectangle {
|
|||||||
width: parent.width
|
width: parent.width
|
||||||
height: 50
|
height: 50
|
||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
color: availableMouseArea.containsMouse && isInteractive ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) : Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency)
|
color: availableMouseArea.containsMouse && isInteractive ? Theme.primaryHoverLight : Theme.surfaceLight
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12)
|
border.color: Theme.outlineLight
|
||||||
border.width: 0
|
border.width: 1
|
||||||
opacity: isInteractive ? 1 : 0.6
|
opacity: isInteractive ? 1 : 0.6
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
|
|||||||
@@ -79,9 +79,9 @@ Rectangle {
|
|||||||
width: parent.width
|
width: parent.width
|
||||||
height: 80
|
height: 80
|
||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
color: Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency)
|
color: Theme.surfaceLight
|
||||||
border.color: modelData.mount === currentMountPath ? Theme.primary : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12)
|
border.color: modelData.mount === currentMountPath ? Theme.primary : Theme.outlineLight
|
||||||
border.width: modelData.mount === currentMountPath ? 2 : 0
|
border.width: modelData.mount === currentMountPath ? 2 : 1
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
|
|||||||
@@ -308,9 +308,9 @@ Rectangle {
|
|||||||
width: parent.width
|
width: parent.width
|
||||||
height: wiredContentRow.implicitHeight + Theme.spacingM * 2
|
height: wiredContentRow.implicitHeight + Theme.spacingM * 2
|
||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
color: wiredNetworkMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) : Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency)
|
color: wiredNetworkMouseArea.containsMouse ? Theme.primaryHoverLight : Theme.surfaceLight
|
||||||
border.color: Theme.primary
|
border.color: isActive ? Theme.primary : Theme.outlineLight
|
||||||
border.width: 0
|
border.width: isActive ? 2 : 1
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
id: wiredContentRow
|
id: wiredContentRow
|
||||||
@@ -565,9 +565,9 @@ Rectangle {
|
|||||||
width: wifiContent.width
|
width: wifiContent.width
|
||||||
height: wifiContentRow.implicitHeight + Theme.spacingM * 2
|
height: wifiContentRow.implicitHeight + Theme.spacingM * 2
|
||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
color: networkMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) : Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency)
|
color: networkMouseArea.containsMouse ? Theme.primaryHoverLight : Theme.surfaceLight
|
||||||
border.color: wifiDelegate.isConnected ? Theme.primary : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.12)
|
border.color: wifiDelegate.isConnected ? Theme.primary : Theme.outlineLight
|
||||||
border.width: 0
|
border.width: wifiDelegate.isConnected ? 2 : 1
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
id: wifiContentRow
|
id: wifiContentRow
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ Item {
|
|||||||
required property var axis
|
required property var axis
|
||||||
required property var barConfig
|
required property var barConfig
|
||||||
|
|
||||||
|
visible: !SettingsData.frameEnabled
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
@@ -37,6 +39,8 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
property real rt: {
|
property real rt: {
|
||||||
|
if (SettingsData.frameEnabled)
|
||||||
|
return SettingsData.frameRounding;
|
||||||
if (barConfig?.squareCorners ?? false)
|
if (barConfig?.squareCorners ?? false)
|
||||||
return 0;
|
return 0;
|
||||||
if (barWindow.hasMaximizedToplevel)
|
if (barWindow.hasMaximizedToplevel)
|
||||||
@@ -255,11 +259,12 @@ Item {
|
|||||||
h = h - wing;
|
h = h - wing;
|
||||||
const r = wing;
|
const r = wing;
|
||||||
const cr = rt;
|
const cr = rt;
|
||||||
|
const crE = SettingsData.frameEnabled ? 0 : cr;
|
||||||
|
|
||||||
let d = `M ${cr} 0`;
|
let d = `M ${crE} 0`;
|
||||||
d += ` L ${w - cr} 0`;
|
d += ` L ${w - crE} 0`;
|
||||||
if (cr > 0)
|
if (crE > 0)
|
||||||
d += ` A ${cr} ${cr} 0 0 1 ${w} ${cr}`;
|
d += ` A ${crE} ${crE} 0 0 1 ${w} ${crE}`;
|
||||||
if (r > 0) {
|
if (r > 0) {
|
||||||
d += ` L ${w} ${h + r}`;
|
d += ` L ${w} ${h + r}`;
|
||||||
d += ` A ${r} ${r} 0 0 0 ${w - r} ${h}`;
|
d += ` A ${r} ${r} 0 0 0 ${w - r} ${h}`;
|
||||||
@@ -273,9 +278,9 @@ Item {
|
|||||||
if (cr > 0)
|
if (cr > 0)
|
||||||
d += ` A ${cr} ${cr} 0 0 1 0 ${h - cr}`;
|
d += ` A ${cr} ${cr} 0 0 1 0 ${h - cr}`;
|
||||||
}
|
}
|
||||||
d += ` L 0 ${cr}`;
|
d += ` L 0 ${crE}`;
|
||||||
if (cr > 0)
|
if (crE > 0)
|
||||||
d += ` A ${cr} ${cr} 0 0 1 ${cr} 0`;
|
d += ` A ${crE} ${crE} 0 0 1 ${crE} 0`;
|
||||||
d += " Z";
|
d += " Z";
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
@@ -285,11 +290,12 @@ Item {
|
|||||||
h = h - wing;
|
h = h - wing;
|
||||||
const r = wing;
|
const r = wing;
|
||||||
const cr = rt;
|
const cr = rt;
|
||||||
|
const crE = SettingsData.frameEnabled ? 0 : cr;
|
||||||
|
|
||||||
let d = `M ${cr} ${fullH}`;
|
let d = `M ${crE} ${fullH}`;
|
||||||
d += ` L ${w - cr} ${fullH}`;
|
d += ` L ${w - crE} ${fullH}`;
|
||||||
if (cr > 0)
|
if (crE > 0)
|
||||||
d += ` A ${cr} ${cr} 0 0 0 ${w} ${fullH - cr}`;
|
d += ` A ${crE} ${crE} 0 0 0 ${w} ${fullH - crE}`;
|
||||||
if (r > 0) {
|
if (r > 0) {
|
||||||
d += ` L ${w} 0`;
|
d += ` L ${w} 0`;
|
||||||
d += ` A ${r} ${r} 0 0 1 ${w - r} ${r}`;
|
d += ` A ${r} ${r} 0 0 1 ${w - r} ${r}`;
|
||||||
@@ -303,9 +309,9 @@ Item {
|
|||||||
if (cr > 0)
|
if (cr > 0)
|
||||||
d += ` A ${cr} ${cr} 0 0 0 0 ${cr}`;
|
d += ` A ${cr} ${cr} 0 0 0 0 ${cr}`;
|
||||||
}
|
}
|
||||||
d += ` L 0 ${fullH - cr}`;
|
d += ` L 0 ${fullH - crE}`;
|
||||||
if (cr > 0)
|
if (crE > 0)
|
||||||
d += ` A ${cr} ${cr} 0 0 0 ${cr} ${fullH}`;
|
d += ` A ${crE} ${crE} 0 0 0 ${crE} ${fullH}`;
|
||||||
d += " Z";
|
d += " Z";
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
@@ -314,11 +320,12 @@ Item {
|
|||||||
w = w - wing;
|
w = w - wing;
|
||||||
const r = wing;
|
const r = wing;
|
||||||
const cr = rt;
|
const cr = rt;
|
||||||
|
const crE = SettingsData.frameEnabled ? 0 : cr;
|
||||||
|
|
||||||
let d = `M 0 ${cr}`;
|
let d = `M 0 ${crE}`;
|
||||||
d += ` L 0 ${h - cr}`;
|
d += ` L 0 ${h - crE}`;
|
||||||
if (cr > 0)
|
if (crE > 0)
|
||||||
d += ` A ${cr} ${cr} 0 0 0 ${cr} ${h}`;
|
d += ` A ${crE} ${crE} 0 0 0 ${crE} ${h}`;
|
||||||
if (r > 0) {
|
if (r > 0) {
|
||||||
d += ` L ${w + r} ${h}`;
|
d += ` L ${w + r} ${h}`;
|
||||||
d += ` A ${r} ${r} 0 0 1 ${w} ${h - r}`;
|
d += ` A ${r} ${r} 0 0 1 ${w} ${h - r}`;
|
||||||
@@ -332,9 +339,9 @@ Item {
|
|||||||
if (cr > 0)
|
if (cr > 0)
|
||||||
d += ` A ${cr} ${cr} 0 0 0 ${w - cr} 0`;
|
d += ` A ${cr} ${cr} 0 0 0 ${w - cr} 0`;
|
||||||
}
|
}
|
||||||
d += ` L ${cr} 0`;
|
d += ` L ${crE} 0`;
|
||||||
if (cr > 0)
|
if (crE > 0)
|
||||||
d += ` A ${cr} ${cr} 0 0 0 0 ${cr}`;
|
d += ` A ${crE} ${crE} 0 0 0 0 ${crE}`;
|
||||||
d += " Z";
|
d += " Z";
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
@@ -344,11 +351,12 @@ Item {
|
|||||||
w = w - wing;
|
w = w - wing;
|
||||||
const r = wing;
|
const r = wing;
|
||||||
const cr = rt;
|
const cr = rt;
|
||||||
|
const crE = SettingsData.frameEnabled ? 0 : cr;
|
||||||
|
|
||||||
let d = `M ${fullW} ${cr}`;
|
let d = `M ${fullW} ${crE}`;
|
||||||
d += ` L ${fullW} ${h - cr}`;
|
d += ` L ${fullW} ${h - crE}`;
|
||||||
if (cr > 0)
|
if (crE > 0)
|
||||||
d += ` A ${cr} ${cr} 0 0 1 ${fullW - cr} ${h}`;
|
d += ` A ${crE} ${crE} 0 0 1 ${fullW - crE} ${h}`;
|
||||||
if (r > 0) {
|
if (r > 0) {
|
||||||
d += ` L 0 ${h}`;
|
d += ` L 0 ${h}`;
|
||||||
d += ` A ${r} ${r} 0 0 0 ${r} ${h - r}`;
|
d += ` A ${r} ${r} 0 0 0 ${r} ${h - r}`;
|
||||||
@@ -362,9 +370,9 @@ Item {
|
|||||||
if (cr > 0)
|
if (cr > 0)
|
||||||
d += ` A ${cr} ${cr} 0 0 1 ${cr} 0`;
|
d += ` A ${cr} ${cr} 0 0 1 ${cr} 0`;
|
||||||
}
|
}
|
||||||
d += ` L ${fullW - cr} 0`;
|
d += ` L ${fullW - crE} 0`;
|
||||||
if (cr > 0)
|
if (crE > 0)
|
||||||
d += ` A ${cr} ${cr} 0 0 1 ${fullW} ${cr}`;
|
d += ` A ${crE} ${crE} 0 0 1 ${fullW} ${crE}`;
|
||||||
d += " Z";
|
d += " Z";
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,31 @@ Item {
|
|||||||
readonly property real innerPadding: barConfig?.innerPadding ?? 4
|
readonly property real innerPadding: barConfig?.innerPadding ?? 4
|
||||||
readonly property real outlineThickness: (barConfig?.widgetOutlineEnabled ?? false) ? (barConfig?.widgetOutlineThickness ?? 1) : 0
|
readonly property real outlineThickness: (barConfig?.widgetOutlineEnabled ?? false) ? (barConfig?.widgetOutlineThickness ?? 1) : 0
|
||||||
|
|
||||||
|
readonly property real _frameLeftInset: {
|
||||||
|
if (!SettingsData.frameEnabled || barWindow.isVertical) return 0
|
||||||
|
return barWindow.hasAdjacentLeftBar
|
||||||
|
? SettingsData.frameBarSize
|
||||||
|
: 0
|
||||||
|
}
|
||||||
|
readonly property real _frameRightInset: {
|
||||||
|
if (!SettingsData.frameEnabled || barWindow.isVertical) return 0
|
||||||
|
return barWindow.hasAdjacentRightBar
|
||||||
|
? SettingsData.frameBarSize
|
||||||
|
: 0
|
||||||
|
}
|
||||||
|
readonly property real _frameTopInset: {
|
||||||
|
if (!SettingsData.frameEnabled || !barWindow.isVertical) return 0
|
||||||
|
return barWindow.hasAdjacentTopBar
|
||||||
|
? SettingsData.frameThickness
|
||||||
|
: 0
|
||||||
|
}
|
||||||
|
readonly property real _frameBottomInset: {
|
||||||
|
if (!SettingsData.frameEnabled || !barWindow.isVertical) return 0
|
||||||
|
return barWindow.hasAdjacentBottomBar
|
||||||
|
? SettingsData.frameThickness
|
||||||
|
: 0
|
||||||
|
}
|
||||||
|
|
||||||
property alias hLeftSection: hLeftSection
|
property alias hLeftSection: hLeftSection
|
||||||
property alias hCenterSection: hCenterSection
|
property alias hCenterSection: hCenterSection
|
||||||
property alias hRightSection: hRightSection
|
property alias hRightSection: hRightSection
|
||||||
@@ -31,10 +56,14 @@ Item {
|
|||||||
property alias vRightSection: vRightSection
|
property alias vRightSection: vRightSection
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.leftMargin: Math.max(Theme.spacingXS, innerPadding * 0.8)
|
anchors.leftMargin: Math.max(Theme.spacingXS, innerPadding * 0.8) + _frameLeftInset
|
||||||
anchors.rightMargin: Math.max(Theme.spacingXS, innerPadding * 0.8)
|
anchors.rightMargin: Math.max(Theme.spacingXS, innerPadding * 0.8) + _frameRightInset
|
||||||
anchors.topMargin: barWindow.isVertical ? (barWindow.hasAdjacentTopBar ? outlineThickness : Theme.spacingXS) : 0
|
anchors.topMargin: (barWindow.isVertical
|
||||||
anchors.bottomMargin: barWindow.isVertical ? (barWindow.hasAdjacentBottomBar ? outlineThickness : Theme.spacingXS) : 0
|
? (barWindow.hasAdjacentTopBar ? outlineThickness : Theme.spacingXS)
|
||||||
|
: 0) + _frameTopInset
|
||||||
|
anchors.bottomMargin: (barWindow.isVertical
|
||||||
|
? (barWindow.hasAdjacentBottomBar ? outlineThickness : Theme.spacingXS)
|
||||||
|
: 0) + _frameBottomInset
|
||||||
clip: false
|
clip: false
|
||||||
|
|
||||||
property int componentMapRevision: 0
|
property int componentMapRevision: 0
|
||||||
@@ -969,6 +998,7 @@ Item {
|
|||||||
axis: barWindow.axis
|
axis: barWindow.axis
|
||||||
barSpacing: barConfig?.spacing ?? 4
|
barSpacing: barConfig?.spacing ?? 4
|
||||||
barConfig: topBarContent.barConfig
|
barConfig: topBarContent.barConfig
|
||||||
|
widgetData: parent.widgetData
|
||||||
isAutoHideBar: topBarContent.barConfig?.autoHide ?? false
|
isAutoHideBar: topBarContent.barConfig?.autoHide ?? false
|
||||||
isAtBottom: barWindow.axis?.edge === "bottom"
|
isAtBottom: barWindow.axis?.edge === "bottom"
|
||||||
visible: SettingsData.getFilteredScreens("systemTray").includes(barWindow.screen) && SystemTray.items.values.length > 0
|
visible: SettingsData.getFilteredScreens("systemTray").includes(barWindow.screen) && SystemTray.items.values.length > 0
|
||||||
@@ -1155,6 +1185,7 @@ Item {
|
|||||||
if (!notificationCenterLoader.item) {
|
if (!notificationCenterLoader.item) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
notificationCenterLoader.item.triggerScreen = barWindow.screen;
|
||||||
const effectiveBarConfig = topBarContent.barConfig;
|
const effectiveBarConfig = topBarContent.barConfig;
|
||||||
const barPosition = barWindow.axis?.edge === "left" ? 2 : (barWindow.axis?.edge === "right" ? 3 : (barWindow.axis?.edge === "top" ? 0 : 1));
|
const barPosition = barWindow.axis?.edge === "left" ? 2 : (barWindow.axis?.edge === "right" ? 3 : (barWindow.axis?.edge === "top" ? 0 : 1));
|
||||||
if (notificationCenterLoader.item.setBarContext) {
|
if (notificationCenterLoader.item.setBarContext) {
|
||||||
|
|||||||
@@ -133,6 +133,11 @@ PanelWindow {
|
|||||||
teardown();
|
teardown();
|
||||||
if (!BlurService.enabled || !BlurService.available)
|
if (!BlurService.enabled || !BlurService.available)
|
||||||
return;
|
return;
|
||||||
|
// In frame mode, FrameWindow owns the blur region for the entire screen edge
|
||||||
|
// (including the bar area). The bar must not set its own competing blur region
|
||||||
|
// so that frameBlurEnabled acts as the single control for all blur in frame mode.
|
||||||
|
if (SettingsData.frameEnabled)
|
||||||
|
return;
|
||||||
|
|
||||||
const widgets = barWindow._blurWidgetItems.filter(w => w && w.visible && w.width > 0 && w.height > 0);
|
const widgets = barWindow._blurWidgetItems.filter(w => w && w.visible && w.width > 0 && w.height > 0);
|
||||||
const hasBar = barHasTransparency;
|
const hasBar = barHasTransparency;
|
||||||
@@ -187,6 +192,11 @@ PanelWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: SettingsData
|
||||||
|
function onFrameEnabledChanged() { barBlur.rebuild(); }
|
||||||
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: topBarSlide
|
target: topBarSlide
|
||||||
function onXChanged() {
|
function onXChanged() {
|
||||||
@@ -238,7 +248,9 @@ PanelWindow {
|
|||||||
readonly property color _surfaceContainer: Theme.surfaceContainer
|
readonly property color _surfaceContainer: Theme.surfaceContainer
|
||||||
readonly property string _barId: barConfig?.id ?? "default"
|
readonly property string _barId: barConfig?.id ?? "default"
|
||||||
property real _backgroundAlpha: barConfig?.transparency ?? 1.0
|
property real _backgroundAlpha: barConfig?.transparency ?? 1.0
|
||||||
readonly property color _bgColor: Theme.withAlpha(_surfaceContainer, _backgroundAlpha)
|
readonly property color _bgColor: SettingsData.frameEnabled
|
||||||
|
? Qt.rgba(SettingsData.effectiveFrameColor.r, SettingsData.effectiveFrameColor.g, SettingsData.effectiveFrameColor.b, SettingsData.frameOpacity)
|
||||||
|
: Theme.withAlpha(_surfaceContainer, _backgroundAlpha)
|
||||||
|
|
||||||
function _updateBackgroundAlpha() {
|
function _updateBackgroundAlpha() {
|
||||||
const live = SettingsData.barConfigs.find(c => c.id === _barId);
|
const live = SettingsData.barConfigs.find(c => c.id === _barId);
|
||||||
@@ -384,7 +396,7 @@ PanelWindow {
|
|||||||
shouldHideForWindows = filtered.length > 0;
|
shouldHideForWindows = filtered.length > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
property real effectiveSpacing: hasMaximizedToplevel ? 0 : (barConfig?.spacing ?? 4)
|
property real effectiveSpacing: SettingsData.frameEnabled ? 0 : (hasMaximizedToplevel ? 0 : (barConfig?.spacing ?? 4))
|
||||||
|
|
||||||
Behavior on effectiveSpacing {
|
Behavior on effectiveSpacing {
|
||||||
enabled: barWindow.visible
|
enabled: barWindow.visible
|
||||||
@@ -395,7 +407,12 @@ PanelWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
readonly property int notificationCount: NotificationService.notifications.length
|
readonly property int notificationCount: NotificationService.notifications.length
|
||||||
readonly property real effectiveBarThickness: Theme.snap(Math.max(barWindow.widgetThickness + (barConfig?.innerPadding ?? 4) + 4, Theme.barHeight - 4 - (8 - (barConfig?.innerPadding ?? 4))), _dpr)
|
readonly property real effectiveBarThickness: SettingsData.frameEnabled
|
||||||
|
? SettingsData.frameBarSize
|
||||||
|
: Theme.snap(Math.max(barWindow.widgetThickness + (barConfig?.innerPadding ?? 4) + 4, Theme.barHeight - 4 - (8 - (barConfig?.innerPadding ?? 4))), _dpr)
|
||||||
|
readonly property bool effectiveOpenOnOverview: SettingsData.frameEnabled
|
||||||
|
? SettingsData.frameShowOnOverview
|
||||||
|
: (barConfig?.openOnOverview ?? false)
|
||||||
readonly property real widgetThickness: Theme.snap(Math.max(20, 26 + (barConfig?.innerPadding ?? 4) * 0.6), _dpr)
|
readonly property real widgetThickness: Theme.snap(Math.max(20, 26 + (barConfig?.innerPadding ?? 4) * 0.6), _dpr)
|
||||||
|
|
||||||
readonly property bool hasAdjacentTopBar: {
|
readonly property bool hasAdjacentTopBar: {
|
||||||
@@ -644,14 +661,14 @@ PanelWindow {
|
|||||||
anchors.left: !isVertical ? true : (barPos === SettingsData.Position.Left)
|
anchors.left: !isVertical ? true : (barPos === SettingsData.Position.Left)
|
||||||
anchors.right: !isVertical ? true : (barPos === SettingsData.Position.Right)
|
anchors.right: !isVertical ? true : (barPos === SettingsData.Position.Right)
|
||||||
|
|
||||||
exclusiveZone: (!(barConfig?.visible ?? true) || topBarCore.autoHide) ? -1 : (barWindow.effectiveBarThickness + effectiveSpacing + (barConfig?.bottomGap ?? 0))
|
exclusiveZone: (!(barConfig?.visible ?? true) || topBarCore.autoHide) ? -1 : (barWindow.effectiveBarThickness + effectiveSpacing + (Theme.isConnectedEffect ? 0 : (barConfig?.bottomGap ?? 0)))
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: inputMask
|
id: inputMask
|
||||||
|
|
||||||
readonly property int barThickness: Theme.px(barWindow.effectiveBarThickness + barWindow.effectiveSpacing, barWindow._dpr)
|
readonly property int barThickness: Theme.px(barWindow.effectiveBarThickness + barWindow.effectiveSpacing, barWindow._dpr)
|
||||||
|
|
||||||
readonly property bool inOverviewWithShow: CompositorService.isNiri && NiriService.inOverview && (barConfig?.openOnOverview ?? false)
|
readonly property bool inOverviewWithShow: CompositorService.isNiri && NiriService.inOverview && barWindow.effectiveOpenOnOverview
|
||||||
readonly property bool effectiveVisible: (barConfig?.visible ?? true) || inOverviewWithShow
|
readonly property bool effectiveVisible: (barConfig?.visible ?? true) || inOverviewWithShow
|
||||||
readonly property bool showing: effectiveVisible && (topBarCore.reveal || inOverviewWithShow || !topBarCore.autoHide)
|
readonly property bool showing: effectiveVisible && (topBarCore.reveal || inOverviewWithShow || !topBarCore.autoHide)
|
||||||
|
|
||||||
@@ -792,7 +809,7 @@ PanelWindow {
|
|||||||
}
|
}
|
||||||
|
|
||||||
property bool reveal: {
|
property bool reveal: {
|
||||||
const inOverviewWithShow = CompositorService.isNiri && NiriService.inOverview && (barConfig?.openOnOverview ?? false);
|
const inOverviewWithShow = CompositorService.isNiri && NiriService.inOverview && barWindow.effectiveOpenOnOverview;
|
||||||
if (inOverviewWithShow)
|
if (inOverviewWithShow)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@@ -889,7 +906,7 @@ PanelWindow {
|
|||||||
top: barWindow.isVertical ? parent.top : undefined
|
top: barWindow.isVertical ? parent.top : undefined
|
||||||
bottom: barWindow.isVertical ? parent.bottom : undefined
|
bottom: barWindow.isVertical ? parent.bottom : undefined
|
||||||
}
|
}
|
||||||
readonly property bool inOverview: CompositorService.isNiri && NiriService.inOverview && (barConfig?.openOnOverview ?? false)
|
readonly property bool inOverview: CompositorService.isNiri && NiriService.inOverview && barWindow.effectiveOpenOnOverview
|
||||||
hoverEnabled: (barConfig?.autoHide ?? false) && !inOverview && !topBarCore.hasActivePopout
|
hoverEnabled: (barConfig?.autoHide ?? false) && !inOverview && !topBarCore.hasActivePopout
|
||||||
acceptedButtons: Qt.NoButton
|
acceptedButtons: Qt.NoButton
|
||||||
enabled: (barConfig?.autoHide ?? false) && !inOverview
|
enabled: (barConfig?.autoHide ?? false) && !inOverview
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
|
import Quickshell.Services.UPower
|
||||||
import qs.Common
|
import qs.Common
|
||||||
import qs.Modules.Plugins
|
import qs.Modules.Plugins
|
||||||
import qs.Services
|
import qs.Services
|
||||||
@@ -10,6 +11,8 @@ BasePill {
|
|||||||
property bool batteryPopupVisible: false
|
property bool batteryPopupVisible: false
|
||||||
property var popoutTarget: null
|
property var popoutTarget: null
|
||||||
|
|
||||||
|
property real touchpadAccumulator: 0
|
||||||
|
|
||||||
readonly property int barPosition: {
|
readonly property int barPosition: {
|
||||||
switch (axis?.edge) {
|
switch (axis?.edge) {
|
||||||
case "top":
|
case "top":
|
||||||
@@ -119,5 +122,44 @@ BasePill {
|
|||||||
battery.triggerRipple(this, mouse.x, mouse.y);
|
battery.triggerRipple(this, mouse.x, mouse.y);
|
||||||
toggleBatteryPopup();
|
toggleBatteryPopup();
|
||||||
}
|
}
|
||||||
|
onWheel: wheel => {
|
||||||
|
var delta = wheel.angleDelta.y;
|
||||||
|
if (delta === 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Check if this is a touchpad
|
||||||
|
if (delta !== 120 && delta !== -120) {
|
||||||
|
touchpadAccumulator += delta;
|
||||||
|
console.info("Acc: "+touchpadAccumulator);
|
||||||
|
if (Math.abs(touchpadAccumulator) < 500)
|
||||||
|
return;
|
||||||
|
delta = touchpadAccumulator;
|
||||||
|
touchpadAccumulator = 0;
|
||||||
|
}
|
||||||
|
console.info("Trigger! Delta: "+delta)
|
||||||
|
|
||||||
|
// This is after the other delta checks so it only shows on valid Y scroll
|
||||||
|
if (typeof PowerProfiles === "undefined") {
|
||||||
|
ToastService.showError("power-profiles-daemon not available");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get list of profiles, and current index
|
||||||
|
const profiles = [PowerProfile.PowerSaver, PowerProfile.Balanced].concat(PowerProfiles.hasPerformanceProfile ? [PowerProfile.Performance] : []);
|
||||||
|
var index = profiles.findIndex(profile => PowerProfiles.profile === profile);
|
||||||
|
|
||||||
|
// Step once based on mouse wheel direction
|
||||||
|
if (delta > 0) index += 1;
|
||||||
|
else index -= 1;
|
||||||
|
|
||||||
|
// Already at end of list, can't go further
|
||||||
|
if (index < 0 || index >= profiles.length) return;
|
||||||
|
|
||||||
|
// Set new profile
|
||||||
|
PowerProfiles.profile = profiles[index];
|
||||||
|
if (PowerProfiles.profile !== profiles[index]) {
|
||||||
|
ToastService.showError("Failed to set power profile");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ BasePill {
|
|||||||
StyledTextMetrics {
|
StyledTextMetrics {
|
||||||
id: cpuBaseline
|
id: cpuBaseline
|
||||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||||
text: "88%"
|
text: "100%"
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledTextMetrics {
|
StyledTextMetrics {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ BasePill {
|
|||||||
property int availableWidth: 400
|
property int availableWidth: 400
|
||||||
readonly property int maxNormalWidth: 456
|
readonly property int maxNormalWidth: 456
|
||||||
readonly property int maxCompactWidth: 288
|
readonly property int maxCompactWidth: 288
|
||||||
readonly property Toplevel activeWindow: ToplevelManager.activeToplevel
|
property Toplevel activeWindow: null
|
||||||
property var activeDesktopEntry: null
|
property var activeDesktopEntry: null
|
||||||
property bool isHovered: mouseArea.containsMouse
|
property bool isHovered: mouseArea.containsMouse
|
||||||
property bool isAutoHideBar: false
|
property bool isAutoHideBar: false
|
||||||
@@ -38,10 +38,44 @@ BasePill {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateActiveWindow() {
|
||||||
|
const active = ToplevelManager.activeToplevel;
|
||||||
|
|
||||||
|
if (!active) {
|
||||||
|
// Only clear if our tracked window is no longer alive
|
||||||
|
if (activeWindow) {
|
||||||
|
const alive = ToplevelManager.toplevels?.values;
|
||||||
|
if (alive && !Array.from(alive).some(t => t === activeWindow))
|
||||||
|
activeWindow = null;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!parentScreen || CompositorService.filterCurrentDisplay([active], parentScreen?.name)?.length > 0) {
|
||||||
|
activeWindow = active;
|
||||||
|
}
|
||||||
|
// else: active window is on a different screen so keep the previous value
|
||||||
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
|
updateActiveWindow();
|
||||||
updateDesktopEntry();
|
updateDesktopEntry();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: ToplevelManager
|
||||||
|
function onActiveToplevelChanged() {
|
||||||
|
root.updateActiveWindow();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: CompositorService
|
||||||
|
function onToplevelsChanged() {
|
||||||
|
root.updateActiveWindow();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: DesktopEntries
|
target: DesktopEntries
|
||||||
function onApplicationsChanged() {
|
function onApplicationsChanged() {
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ BasePill {
|
|||||||
readonly property bool usePlayerVolume: activePlayer && activePlayer.volumeSupported && !__isChromeBrowser
|
readonly property bool usePlayerVolume: activePlayer && activePlayer.volumeSupported && !__isChromeBrowser
|
||||||
property bool compactMode: false
|
property bool compactMode: false
|
||||||
property var widgetData: null
|
property var widgetData: null
|
||||||
readonly property int textWidth: {
|
readonly property bool adaptiveWidthEnabled: SettingsData.mediaAdaptiveWidthEnabled
|
||||||
|
readonly property int maxTextWidth: {
|
||||||
const size = widgetData?.mediaSize !== undefined ? widgetData.mediaSize : SettingsData.mediaSize;
|
const size = widgetData?.mediaSize !== undefined ? widgetData.mediaSize : SettingsData.mediaSize;
|
||||||
switch (size) {
|
switch (size) {
|
||||||
case 0:
|
case 0:
|
||||||
@@ -36,10 +37,7 @@ BasePill {
|
|||||||
if (isVerticalOrientation) {
|
if (isVerticalOrientation) {
|
||||||
return widgetThickness - horizontalPadding * 2;
|
return widgetThickness - horizontalPadding * 2;
|
||||||
}
|
}
|
||||||
const controlsWidth = 20 + Theme.spacingXS + 24 + Theme.spacingXS + 20;
|
return 0;
|
||||||
const audioVizWidth = 20;
|
|
||||||
const contentWidth = audioVizWidth + Theme.spacingXS + controlsWidth;
|
|
||||||
return contentWidth + (textWidth > 0 ? textWidth + Theme.spacingXS : 0);
|
|
||||||
}
|
}
|
||||||
readonly property int currentContentHeight: {
|
readonly property int currentContentHeight: {
|
||||||
if (!isVerticalOrientation) {
|
if (!isVerticalOrientation) {
|
||||||
@@ -99,7 +97,7 @@ BasePill {
|
|||||||
|
|
||||||
if (isMouseWheelY) {
|
if (isMouseWheelY) {
|
||||||
if (deltaY > 0) {
|
if (deltaY > 0) {
|
||||||
activePlayer.previous();
|
MprisController.previousOrRewind();
|
||||||
} else {
|
} else {
|
||||||
activePlayer.next();
|
activePlayer.next();
|
||||||
}
|
}
|
||||||
@@ -107,7 +105,7 @@ BasePill {
|
|||||||
scrollAccumulatorY += deltaY;
|
scrollAccumulatorY += deltaY;
|
||||||
if (Math.abs(scrollAccumulatorY) >= touchpadThreshold) {
|
if (Math.abs(scrollAccumulatorY) >= touchpadThreshold) {
|
||||||
if (scrollAccumulatorY > 0) {
|
if (scrollAccumulatorY > 0) {
|
||||||
activePlayer.previous();
|
MprisController.previousOrRewind();
|
||||||
} else {
|
} else {
|
||||||
activePlayer.next();
|
activePlayer.next();
|
||||||
}
|
}
|
||||||
@@ -119,7 +117,28 @@ BasePill {
|
|||||||
|
|
||||||
content: Component {
|
content: Component {
|
||||||
Item {
|
Item {
|
||||||
implicitWidth: root.playerAvailable ? root.currentContentWidth : 0
|
id: contentRoot
|
||||||
|
readonly property real measuredTextWidth: {
|
||||||
|
if (!root.playerAvailable || root.maxTextWidth <= 0 || !textContainer.visible)
|
||||||
|
return 0;
|
||||||
|
// Preserve the fixed-width text slot even if metadata is briefly empty.
|
||||||
|
if (!root.adaptiveWidthEnabled)
|
||||||
|
return root.maxTextWidth;
|
||||||
|
if (textContainer.displayText.length === 0)
|
||||||
|
return 0;
|
||||||
|
const rawWidth = mediaText.contentWidth;
|
||||||
|
if (!isFinite(rawWidth) || rawWidth <= 0)
|
||||||
|
return 0;
|
||||||
|
return Math.min(root.maxTextWidth, Math.ceil(rawWidth));
|
||||||
|
}
|
||||||
|
readonly property int horizontalContentWidth: {
|
||||||
|
const controlsWidth = 20 + Theme.spacingXS + 24 + Theme.spacingXS + 20;
|
||||||
|
const audioVizWidth = 20;
|
||||||
|
const baseWidth = audioVizWidth + Theme.spacingXS + controlsWidth;
|
||||||
|
return baseWidth + (measuredTextWidth > 0 ? measuredTextWidth + Theme.spacingXS : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
implicitWidth: root.playerAvailable ? (root.isVerticalOrientation ? root.currentContentWidth : horizontalContentWidth) : 0
|
||||||
implicitHeight: root.playerAvailable ? root.currentContentHeight : 0
|
implicitHeight: root.playerAvailable ? root.currentContentHeight : 0
|
||||||
opacity: root.playerAvailable ? 1 : 0
|
opacity: root.playerAvailable ? 1 : 0
|
||||||
|
|
||||||
@@ -132,8 +151,9 @@ BasePill {
|
|||||||
|
|
||||||
Behavior on implicitWidth {
|
Behavior on implicitWidth {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Theme.shortDuration
|
duration: Theme.mediumDuration
|
||||||
easing.type: Theme.standardEasing
|
easing.type: Easing.BezierSpline
|
||||||
|
easing.bezierCurve: Theme.expressiveCurves.emphasizedDecel
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,7 +234,7 @@ BasePill {
|
|||||||
if (mouse.button === Qt.LeftButton) {
|
if (mouse.button === Qt.LeftButton) {
|
||||||
activePlayer.togglePlaying();
|
activePlayer.togglePlaying();
|
||||||
} else if (mouse.button === Qt.MiddleButton) {
|
} else if (mouse.button === Qt.MiddleButton) {
|
||||||
activePlayer.previous();
|
MprisController.previousOrRewind();
|
||||||
} else if (mouse.button === Qt.RightButton) {
|
} else if (mouse.button === Qt.RightButton) {
|
||||||
activePlayer.next();
|
activePlayer.next();
|
||||||
}
|
}
|
||||||
@@ -269,7 +289,7 @@ BasePill {
|
|||||||
}
|
}
|
||||||
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
width: textWidth
|
width: contentRoot.measuredTextWidth
|
||||||
height: root.widgetThickness
|
height: root.widgetThickness
|
||||||
visible: {
|
visible: {
|
||||||
const size = widgetData?.mediaSize !== undefined ? widgetData.mediaSize : SettingsData.mediaSize;
|
const size = widgetData?.mediaSize !== undefined ? widgetData.mediaSize : SettingsData.mediaSize;
|
||||||
@@ -278,50 +298,95 @@ BasePill {
|
|||||||
clip: true
|
clip: true
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|
||||||
StyledText {
|
Behavior on width {
|
||||||
id: mediaText
|
NumberAnimation {
|
||||||
property bool needsScrolling: implicitWidth > textContainer.width && SettingsData.scrollTitleEnabled
|
duration: Theme.mediumDuration
|
||||||
property real scrollOffset: 0
|
easing.type: Easing.BezierSpline
|
||||||
|
easing.bezierCurve: Theme.expressiveCurves.emphasizedDecel
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
text: textContainer.displayText
|
|
||||||
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
|
||||||
color: Theme.widgetTextColor
|
|
||||||
wrapMode: Text.NoWrap
|
|
||||||
x: needsScrolling ? -scrollOffset : 0
|
|
||||||
onTextChanged: {
|
|
||||||
scrollOffset = 0;
|
|
||||||
scrollAnimation.restart();
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SequentialAnimation {
|
Item {
|
||||||
id: scrollAnimation
|
id: textClip
|
||||||
running: mediaText.needsScrolling && textContainer.visible
|
anchors.fill: parent
|
||||||
loops: Animation.Infinite
|
clip: true
|
||||||
|
|
||||||
PauseAnimation {
|
StyledText {
|
||||||
duration: 2000
|
id: mediaText
|
||||||
|
property bool needsScrolling: implicitWidth > textContainer.width && SettingsData.scrollTitleEnabled
|
||||||
|
property real scrollOffset: 0
|
||||||
|
property real textShift: 0
|
||||||
|
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
text: textContainer.displayText
|
||||||
|
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
|
||||||
|
color: Theme.widgetTextColor
|
||||||
|
wrapMode: Text.NoWrap
|
||||||
|
x: (needsScrolling ? -scrollOffset : 0) + textShift
|
||||||
|
opacity: 1
|
||||||
|
|
||||||
|
onTextChanged: {
|
||||||
|
scrollOffset = 0;
|
||||||
|
textShift = 0;
|
||||||
|
scrollAnimation.restart();
|
||||||
|
textChangeAnimation.restart();
|
||||||
}
|
}
|
||||||
|
|
||||||
NumberAnimation {
|
SequentialAnimation {
|
||||||
target: mediaText
|
id: scrollAnimation
|
||||||
property: "scrollOffset"
|
running: mediaText.needsScrolling && textContainer.visible
|
||||||
from: 0
|
loops: Animation.Infinite
|
||||||
to: mediaText.implicitWidth - textContainer.width + 5
|
|
||||||
duration: Math.max(1000, (mediaText.implicitWidth - textContainer.width + 5) * 60)
|
PauseAnimation {
|
||||||
easing.type: Easing.Linear
|
duration: 2000
|
||||||
|
}
|
||||||
|
|
||||||
|
NumberAnimation {
|
||||||
|
target: mediaText
|
||||||
|
property: "scrollOffset"
|
||||||
|
from: 0
|
||||||
|
to: mediaText.implicitWidth - textContainer.width + 5
|
||||||
|
duration: Math.max(1000, (mediaText.implicitWidth - textContainer.width + 5) * 60)
|
||||||
|
easing.type: Easing.Linear
|
||||||
|
}
|
||||||
|
|
||||||
|
PauseAnimation {
|
||||||
|
duration: 2000
|
||||||
|
}
|
||||||
|
|
||||||
|
NumberAnimation {
|
||||||
|
target: mediaText
|
||||||
|
property: "scrollOffset"
|
||||||
|
to: 0
|
||||||
|
duration: Math.max(1000, (mediaText.implicitWidth - textContainer.width + 5) * 60)
|
||||||
|
easing.type: Easing.Linear
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PauseAnimation {
|
SequentialAnimation {
|
||||||
duration: 2000
|
id: textChangeAnimation
|
||||||
}
|
|
||||||
|
|
||||||
NumberAnimation {
|
ParallelAnimation {
|
||||||
target: mediaText
|
NumberAnimation {
|
||||||
property: "scrollOffset"
|
target: mediaText
|
||||||
to: 0
|
property: "opacity"
|
||||||
duration: Math.max(1000, (mediaText.implicitWidth - textContainer.width + 5) * 60)
|
from: 0.7
|
||||||
easing.type: Easing.Linear
|
to: 1
|
||||||
|
duration: Theme.shortDuration
|
||||||
|
easing.type: Easing.BezierSpline
|
||||||
|
easing.bezierCurve: Theme.expressiveCurves.emphasizedDecel
|
||||||
|
}
|
||||||
|
|
||||||
|
NumberAnimation {
|
||||||
|
target: mediaText
|
||||||
|
property: "textShift"
|
||||||
|
from: 4
|
||||||
|
to: 0
|
||||||
|
duration: Theme.shortDuration
|
||||||
|
easing.type: Easing.BezierSpline
|
||||||
|
easing.bezierCurve: Theme.expressiveCurves.emphasizedDecel
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -370,11 +435,7 @@ BasePill {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
enabled: root.playerAvailable
|
enabled: root.playerAvailable
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: MprisController.previousOrRewind()
|
||||||
if (activePlayer) {
|
|
||||||
activePlayer.previous();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,8 +16,11 @@ BasePill {
|
|||||||
enableCursor: false
|
enableCursor: false
|
||||||
|
|
||||||
property var parentWindow: null
|
property var parentWindow: null
|
||||||
|
property var widgetData: null
|
||||||
|
property string section: "right"
|
||||||
property bool isAtBottom: false
|
property bool isAtBottom: false
|
||||||
property bool isAutoHideBar: false
|
property bool isAutoHideBar: false
|
||||||
|
property bool useOverflowPopup: !widgetData?.trayUseInlineExpansion
|
||||||
readonly property var hiddenTrayIds: {
|
readonly property var hiddenTrayIds: {
|
||||||
const envValue = Quickshell.env("DMS_HIDE_TRAYIDS") || "";
|
const envValue = Quickshell.env("DMS_HIDE_TRAYIDS") || "";
|
||||||
return envValue ? envValue.split(",").map(id => id.trim().toLowerCase()) : [];
|
return envValue ? envValue.split(",").map(id => id.trim().toLowerCase()) : [];
|
||||||
@@ -40,6 +43,76 @@ BasePill {
|
|||||||
return `${id}::${tooltipTitle}`;
|
return `${id}::${tooltipTitle}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function trayIconSourceFor(trayItem) {
|
||||||
|
let icon = trayItem && trayItem.icon;
|
||||||
|
if (typeof icon === 'string' || icon instanceof String) {
|
||||||
|
if (icon === "")
|
||||||
|
return "";
|
||||||
|
if (icon.includes("?path=")) {
|
||||||
|
const split = icon.split("?path=");
|
||||||
|
if (split.length !== 2)
|
||||||
|
return icon;
|
||||||
|
const name = split[0];
|
||||||
|
const path = split[1];
|
||||||
|
let fileName = name.substring(name.lastIndexOf("/") + 1);
|
||||||
|
if (fileName.startsWith("dropboxstatus")) {
|
||||||
|
fileName = `hicolor/16x16/status/${fileName}`;
|
||||||
|
}
|
||||||
|
return `file://${path}/${fileName}`;
|
||||||
|
}
|
||||||
|
if (icon.startsWith("/") && !icon.startsWith("file://"))
|
||||||
|
return `file://${icon}`;
|
||||||
|
return icon;
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
function activateInlineTrayItem(trayItem, anchorItem) {
|
||||||
|
if (!trayItem)
|
||||||
|
return;
|
||||||
|
if (!trayItem.onlyMenu) {
|
||||||
|
trayItem.activate();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!trayItem.hasMenu)
|
||||||
|
return;
|
||||||
|
root.showForTrayItem(trayItem, anchorItem, parentScreen, root.isAtBottom, root.isVerticalOrientation, root.axis);
|
||||||
|
}
|
||||||
|
|
||||||
|
function openInlineTrayContextMenu(trayItem, areaItem, mouse, anchorItem) {
|
||||||
|
if (!trayItem) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!trayItem.hasMenu) {
|
||||||
|
const gp = areaItem.mapToGlobal(mouse.x, mouse.y);
|
||||||
|
root.callContextMenuFallback(trayItem.id, Math.round(gp.x), Math.round(gp.y));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
root.showForTrayItem(trayItem, anchorItem, parentScreen, root.isAtBottom, root.isVerticalOrientation, root.axis);
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleIconName() {
|
||||||
|
const edge = root.axis?.edge;
|
||||||
|
if (root.useOverflowPopup) {
|
||||||
|
switch (edge) {
|
||||||
|
case "left":
|
||||||
|
return root.menuOpen ? "keyboard_arrow_left" : "keyboard_arrow_right";
|
||||||
|
case "right":
|
||||||
|
return root.menuOpen ? "keyboard_arrow_right" : "keyboard_arrow_left";
|
||||||
|
case "bottom":
|
||||||
|
return root.menuOpen ? "keyboard_arrow_down" : "keyboard_arrow_up";
|
||||||
|
case "top":
|
||||||
|
return root.menuOpen ? "keyboard_arrow_up" : "keyboard_arrow_down";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (edge === "left" || edge === "right") {
|
||||||
|
return root.menuOpen == (root.section !== "right") ? "keyboard_arrow_up" : "keyboard_arrow_down";
|
||||||
|
}
|
||||||
|
|
||||||
|
return root.menuOpen != (root.section === "right") ? "keyboard_arrow_left" : "keyboard_arrow_right";
|
||||||
|
}
|
||||||
|
|
||||||
// ! TODO - replace with either native dbus client (like plugins use) or just a DMS cli or something
|
// ! TODO - replace with either native dbus client (like plugins use) or just a DMS cli or something
|
||||||
function callContextMenuFallback(trayItemId, globalX, globalY) {
|
function callContextMenuFallback(trayItemId, globalX, globalY) {
|
||||||
const script = ['ITEMS=$(dbus-send --session --print-reply --dest=org.kde.StatusNotifierWatcher /StatusNotifierWatcher org.freedesktop.DBus.Properties.Get string:org.kde.StatusNotifierWatcher string:RegisteredStatusNotifierItems 2>/dev/null)', 'while IFS= read -r line; do', ' line="${line#*\\\"}"', ' line="${line%\\\"*}"', ' [ -z "$line" ] && continue', ' BUS="${line%%/*}"', ' OBJ="/${line#*/}"', ' ID=$(dbus-send --session --print-reply --dest="$BUS" "$OBJ" org.freedesktop.DBus.Properties.Get string:org.kde.StatusNotifierItem string:Id 2>/dev/null | grep -oP "(?<=\\\")(.*?)(?=\\\")" | tail -1)', ' if [ "$ID" = "$1" ]; then', ' dbus-send --session --type=method_call --dest="$BUS" "$OBJ" org.kde.StatusNotifierItem.ContextMenu int32:"$2" int32:"$3"', ' exit 0', ' fi', 'done <<< "$ITEMS"',].join("\n");
|
const script = ['ITEMS=$(dbus-send --session --print-reply --dest=org.kde.StatusNotifierWatcher /StatusNotifierWatcher org.freedesktop.DBus.Properties.Get string:org.kde.StatusNotifierWatcher string:RegisteredStatusNotifierItems 2>/dev/null)', 'while IFS= read -r line; do', ' line="${line#*\\\"}"', ' line="${line%\\\"*}"', ' [ -z "$line" ] && continue', ' BUS="${line%%/*}"', ' OBJ="/${line#*/}"', ' ID=$(dbus-send --session --print-reply --dest="$BUS" "$OBJ" org.freedesktop.DBus.Properties.Get string:org.kde.StatusNotifierItem string:Id 2>/dev/null | grep -oP "(?<=\\\")(.*?)(?=\\\")" | tail -1)', ' if [ "$ID" = "$1" ]; then', ' dbus-send --session --type=method_call --dest="$BUS" "$OBJ" org.kde.StatusNotifierItem.ContextMenu int32:"$2" int32:"$3"', ' exit 0', ' fi', 'done <<< "$ITEMS"',].join("\n");
|
||||||
@@ -78,6 +151,13 @@ BasePill {
|
|||||||
item: item
|
item: item
|
||||||
}))
|
}))
|
||||||
readonly property var hiddenBarItems: allSortedTrayItems.filter(item => SessionData.isHiddenTrayId(root.getTrayItemKey(item)))
|
readonly property var hiddenBarItems: allSortedTrayItems.filter(item => SessionData.isHiddenTrayId(root.getTrayItemKey(item)))
|
||||||
|
readonly property bool reverseInlineHorizontal: !useOverflowPopup && !isVerticalOrientation && section === "right"
|
||||||
|
readonly property bool reverseInlineVertical: !useOverflowPopup && isVerticalOrientation && section === "right"
|
||||||
|
readonly property var displayedMainBarItems: reverseInlineHorizontal ? [...mainBarItems].reverse() : mainBarItems
|
||||||
|
readonly property var displayedInlineExpandedItems: (reverseInlineHorizontal ? [...hiddenBarItems].reverse() : hiddenBarItems).map(item => ({
|
||||||
|
key: getTrayItemKey(item),
|
||||||
|
item: item
|
||||||
|
}))
|
||||||
|
|
||||||
function moveTrayItemInFullOrder(visibleFromIndex, visibleToIndex) {
|
function moveTrayItemInFullOrder(visibleFromIndex, visibleToIndex) {
|
||||||
if (visibleFromIndex === visibleToIndex || visibleFromIndex < 0 || visibleToIndex < 0)
|
if (visibleFromIndex === visibleToIndex || visibleFromIndex < 0 || visibleToIndex < 0)
|
||||||
@@ -103,6 +183,7 @@ BasePill {
|
|||||||
property int dropTargetIndex: -1
|
property int dropTargetIndex: -1
|
||||||
property bool suppressShiftAnimation: false
|
property bool suppressShiftAnimation: false
|
||||||
readonly property bool hasHiddenItems: allTrayItems.length > mainBarItems.length
|
readonly property bool hasHiddenItems: allTrayItems.length > mainBarItems.length
|
||||||
|
readonly property bool inlineExpanded: hasHiddenItems && !useOverflowPopup && menuOpen
|
||||||
visible: allTrayItems.length > 0
|
visible: allTrayItems.length > 0
|
||||||
opacity: allTrayItems.length > 0 ? 1 : 0
|
opacity: allTrayItems.length > 0 ? 1 : 0
|
||||||
|
|
||||||
@@ -198,10 +279,11 @@ BasePill {
|
|||||||
id: rowComp
|
id: rowComp
|
||||||
Row {
|
Row {
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
layoutDirection: root.reverseInlineHorizontal ? Qt.RightToLeft : Qt.LeftToRight
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
model: ScriptModel {
|
model: ScriptModel {
|
||||||
values: root.mainBarItems
|
values: root.displayedMainBarItems
|
||||||
objectProp: "key"
|
objectProp: "key"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -209,29 +291,7 @@ BasePill {
|
|||||||
id: delegateRoot
|
id: delegateRoot
|
||||||
property var trayItem: modelData.item
|
property var trayItem: modelData.item
|
||||||
property string itemKey: modelData.key
|
property string itemKey: modelData.key
|
||||||
property string iconSource: {
|
property string iconSource: root.trayIconSourceFor(trayItem)
|
||||||
let icon = trayItem && trayItem.icon;
|
|
||||||
if (typeof icon === 'string' || icon instanceof String) {
|
|
||||||
if (icon === "")
|
|
||||||
return "";
|
|
||||||
if (icon.includes("?path=")) {
|
|
||||||
const split = icon.split("?path=");
|
|
||||||
if (split.length !== 2)
|
|
||||||
return icon;
|
|
||||||
const name = split[0];
|
|
||||||
const path = split[1];
|
|
||||||
let fileName = name.substring(name.lastIndexOf("/") + 1);
|
|
||||||
if (fileName.startsWith("dropboxstatus")) {
|
|
||||||
fileName = `hicolor/16x16/status/${fileName}`;
|
|
||||||
}
|
|
||||||
return `file://${path}/${fileName}`;
|
|
||||||
}
|
|
||||||
if (icon.startsWith("/") && !icon.startsWith("file://"))
|
|
||||||
return `file://${icon}`;
|
|
||||||
return icon;
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
width: root.trayItemSize
|
width: root.trayItemSize
|
||||||
height: root.barThickness
|
height: root.barThickness
|
||||||
@@ -371,7 +431,8 @@ BasePill {
|
|||||||
}
|
}
|
||||||
if (!delegateRoot.trayItem.hasMenu)
|
if (!delegateRoot.trayItem.hasMenu)
|
||||||
return;
|
return;
|
||||||
root.menuOpen = false;
|
if (root.useOverflowPopup)
|
||||||
|
root.menuOpen = false;
|
||||||
root.showForTrayItem(delegateRoot.trayItem, visualContent, parentScreen, root.isAtBottom, root.isVerticalOrientation, root.axis);
|
root.showForTrayItem(delegateRoot.trayItem, visualContent, parentScreen, root.isAtBottom, root.isVerticalOrientation, root.axis);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -380,8 +441,8 @@ BasePill {
|
|||||||
const distance = Math.abs(mouse.x - dragHandler.dragStartPos.x);
|
const distance = Math.abs(mouse.x - dragHandler.dragStartPos.x);
|
||||||
if (distance > 5) {
|
if (distance > 5) {
|
||||||
dragHandler.dragging = true;
|
dragHandler.dragging = true;
|
||||||
root.draggedIndex = index;
|
root.draggedIndex = root.reverseInlineHorizontal ? (root.mainBarItems.length - 1 - index) : index;
|
||||||
root.dropTargetIndex = index;
|
root.dropTargetIndex = root.draggedIndex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!dragHandler.dragging)
|
if (!dragHandler.dragging)
|
||||||
@@ -391,7 +452,8 @@ BasePill {
|
|||||||
dragHandler.dragAxisOffset = axisOffset;
|
dragHandler.dragAxisOffset = axisOffset;
|
||||||
const itemSize = root.trayItemSize;
|
const itemSize = root.trayItemSize;
|
||||||
const slotOffset = Math.round(axisOffset / itemSize);
|
const slotOffset = Math.round(axisOffset / itemSize);
|
||||||
const newTargetIndex = Math.max(0, Math.min(root.mainBarItems.length - 1, index + slotOffset));
|
const visualTargetIndex = Math.max(0, Math.min(root.mainBarItems.length - 1, index + slotOffset));
|
||||||
|
const newTargetIndex = root.reverseInlineHorizontal ? (root.mainBarItems.length - 1 - visualTargetIndex) : visualTargetIndex;
|
||||||
if (newTargetIndex !== root.dropTargetIndex) {
|
if (newTargetIndex !== root.dropTargetIndex) {
|
||||||
root.dropTargetIndex = newTargetIndex;
|
root.dropTargetIndex = newTargetIndex;
|
||||||
}
|
}
|
||||||
@@ -407,7 +469,8 @@ BasePill {
|
|||||||
root.callContextMenuFallback(delegateRoot.trayItem.id, Math.round(gp.x), Math.round(gp.y));
|
root.callContextMenuFallback(delegateRoot.trayItem.id, Math.round(gp.x), Math.round(gp.y));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
root.menuOpen = false;
|
if (root.useOverflowPopup)
|
||||||
|
root.menuOpen = false;
|
||||||
root.showForTrayItem(delegateRoot.trayItem, visualContent, parentScreen, root.isAtBottom, root.isVerticalOrientation, root.axis);
|
root.showForTrayItem(delegateRoot.trayItem, visualContent, parentScreen, root.isAtBottom, root.isVerticalOrientation, root.axis);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -429,7 +492,7 @@ BasePill {
|
|||||||
|
|
||||||
DankIcon {
|
DankIcon {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
name: root.menuOpen ? "expand_less" : "expand_more"
|
name: root.toggleIconName()
|
||||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||||
color: Theme.widgetTextColor
|
color: Theme.widgetTextColor
|
||||||
}
|
}
|
||||||
@@ -451,6 +514,301 @@ BasePill {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Repeater {
|
||||||
|
model: ScriptModel {
|
||||||
|
values: root.displayedInlineExpandedItems
|
||||||
|
objectProp: "key"
|
||||||
|
}
|
||||||
|
|
||||||
|
delegate: inlineExpandedTrayItemDelegate
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: inlineExpandedTrayItemDelegate
|
||||||
|
|
||||||
|
Item {
|
||||||
|
property var trayItem: modelData.item
|
||||||
|
property string itemKey: modelData.key
|
||||||
|
property string iconSource: root.trayIconSourceFor(trayItem)
|
||||||
|
|
||||||
|
width: root.isVerticalOrientation ? root.barThickness : (root.inlineExpanded ? root.trayItemSize : 0)
|
||||||
|
height: root.isVerticalOrientation ? (root.inlineExpanded ? root.trayItemSize : 0) : root.barThickness
|
||||||
|
visible: width > 0 || height > 0
|
||||||
|
|
||||||
|
Behavior on width {
|
||||||
|
enabled: !root.isVerticalOrientation
|
||||||
|
NumberAnimation {
|
||||||
|
duration: Theme.shortDuration
|
||||||
|
easing.type: Theme.standardEasing
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Behavior on height {
|
||||||
|
enabled: root.isVerticalOrientation
|
||||||
|
NumberAnimation {
|
||||||
|
duration: Theme.shortDuration
|
||||||
|
easing.type: Theme.standardEasing
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: inlineVisualContent
|
||||||
|
width: root.trayItemSize
|
||||||
|
height: root.trayItemSize
|
||||||
|
x: root.isVerticalOrientation ? Math.round((parent.width - width) / 2) : (root.reverseInlineHorizontal ? parent.width - width : 0)
|
||||||
|
y: root.isVerticalOrientation ? (root.reverseInlineVertical ? parent.height - height : 0) : Math.round((parent.height - height) / 2)
|
||||||
|
radius: Theme.cornerRadius
|
||||||
|
color: inlineTrayItemArea.containsMouse ? BlurService.hoverColor(Theme.widgetBaseHoverColor) : "transparent"
|
||||||
|
opacity: root.inlineExpanded ? 1 : 0
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
NumberAnimation {
|
||||||
|
duration: Theme.shortDuration
|
||||||
|
easing.type: Theme.standardEasing
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
IconImage {
|
||||||
|
id: inlineIconImg
|
||||||
|
anchors.centerIn: parent
|
||||||
|
width: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||||
|
height: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||||
|
source: iconSource
|
||||||
|
asynchronous: true
|
||||||
|
smooth: true
|
||||||
|
mipmap: true
|
||||||
|
visible: status === Image.Ready
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
visible: !inlineIconImg.visible
|
||||||
|
text: {
|
||||||
|
const itemId = trayItem?.id || "";
|
||||||
|
if (!itemId)
|
||||||
|
return "?";
|
||||||
|
return itemId.charAt(0).toUpperCase();
|
||||||
|
}
|
||||||
|
font.pixelSize: 10
|
||||||
|
color: Theme.widgetTextColor
|
||||||
|
}
|
||||||
|
|
||||||
|
DankRipple {
|
||||||
|
id: inlineItemRipple
|
||||||
|
cornerRadius: Theme.cornerRadius
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: inlineTrayItemArea
|
||||||
|
anchors.fill: parent
|
||||||
|
hoverEnabled: true
|
||||||
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
enabled: root.inlineExpanded
|
||||||
|
|
||||||
|
onPressed: mouse => {
|
||||||
|
const pos = mapToItem(inlineVisualContent, mouse.x, mouse.y);
|
||||||
|
inlineItemRipple.trigger(pos.x, pos.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
onClicked: mouse => {
|
||||||
|
if (mouse.button === Qt.LeftButton) {
|
||||||
|
root.activateInlineTrayItem(trayItem, inlineVisualContent);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (mouse.button !== Qt.RightButton)
|
||||||
|
return;
|
||||||
|
root.openInlineTrayContextMenu(trayItem, inlineTrayItemArea, mouse, inlineVisualContent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component {
|
||||||
|
id: verticalMainTrayItemDelegate
|
||||||
|
|
||||||
|
Item {
|
||||||
|
property var trayItem: modelData.item
|
||||||
|
property string itemKey: modelData.key
|
||||||
|
property string iconSource: root.trayIconSourceFor(trayItem)
|
||||||
|
|
||||||
|
width: root.barThickness
|
||||||
|
height: root.trayItemSize
|
||||||
|
z: dragHandler.dragging ? 100 : 0
|
||||||
|
|
||||||
|
property real shiftOffset: {
|
||||||
|
if (root.draggedIndex < 0)
|
||||||
|
return 0;
|
||||||
|
if (index === root.draggedIndex)
|
||||||
|
return 0;
|
||||||
|
const dragIdx = root.draggedIndex;
|
||||||
|
const dropIdx = root.dropTargetIndex;
|
||||||
|
const shiftAmount = root.trayItemSize;
|
||||||
|
if (dropIdx < 0)
|
||||||
|
return 0;
|
||||||
|
if (dragIdx < dropIdx && index > dragIdx && index <= dropIdx)
|
||||||
|
return -shiftAmount;
|
||||||
|
if (dragIdx > dropIdx && index >= dropIdx && index < dragIdx)
|
||||||
|
return shiftAmount;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
transform: Translate {
|
||||||
|
y: shiftOffset
|
||||||
|
Behavior on y {
|
||||||
|
enabled: !root.suppressShiftAnimation
|
||||||
|
NumberAnimation {
|
||||||
|
duration: 150
|
||||||
|
easing.type: Easing.OutCubic
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: dragHandler
|
||||||
|
anchors.fill: parent
|
||||||
|
property bool dragging: false
|
||||||
|
property point dragStartPos: Qt.point(0, 0)
|
||||||
|
property real dragAxisOffset: 0
|
||||||
|
property bool longPressing: false
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: longPressTimer
|
||||||
|
interval: 400
|
||||||
|
repeat: false
|
||||||
|
onTriggered: dragHandler.longPressing = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: visualContent
|
||||||
|
width: root.trayItemSize
|
||||||
|
height: root.trayItemSize
|
||||||
|
anchors.centerIn: parent
|
||||||
|
radius: Theme.cornerRadius
|
||||||
|
color: trayItemArea.containsMouse ? BlurService.hoverColor(Theme.widgetBaseHoverColor) : "transparent"
|
||||||
|
border.width: dragHandler.dragging ? 2 : 0
|
||||||
|
border.color: Theme.primary
|
||||||
|
opacity: dragHandler.dragging ? 0.8 : 1.0
|
||||||
|
|
||||||
|
transform: Translate {
|
||||||
|
y: dragHandler.dragging ? dragHandler.dragAxisOffset : 0
|
||||||
|
}
|
||||||
|
|
||||||
|
IconImage {
|
||||||
|
id: iconImg
|
||||||
|
anchors.centerIn: parent
|
||||||
|
width: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||||
|
height: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||||
|
source: iconSource
|
||||||
|
asynchronous: true
|
||||||
|
smooth: true
|
||||||
|
mipmap: true
|
||||||
|
visible: status === Image.Ready
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
visible: !iconImg.visible
|
||||||
|
text: {
|
||||||
|
const itemId = trayItem?.id || "";
|
||||||
|
if (!itemId)
|
||||||
|
return "?";
|
||||||
|
return itemId.charAt(0).toUpperCase();
|
||||||
|
}
|
||||||
|
font.pixelSize: 10
|
||||||
|
color: Theme.widgetTextColor
|
||||||
|
}
|
||||||
|
|
||||||
|
DankRipple {
|
||||||
|
id: itemRipple
|
||||||
|
cornerRadius: Theme.cornerRadius
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: trayItemArea
|
||||||
|
anchors.fill: parent
|
||||||
|
hoverEnabled: true
|
||||||
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||||
|
cursorShape: dragHandler.longPressing ? Qt.DragMoveCursor : Qt.PointingHandCursor
|
||||||
|
|
||||||
|
onPressed: mouse => {
|
||||||
|
const pos = mapToItem(visualContent, mouse.x, mouse.y);
|
||||||
|
itemRipple.trigger(pos.x, pos.y);
|
||||||
|
if (mouse.button === Qt.LeftButton) {
|
||||||
|
dragHandler.dragStartPos = Qt.point(mouse.x, mouse.y);
|
||||||
|
longPressTimer.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onReleased: mouse => {
|
||||||
|
longPressTimer.stop();
|
||||||
|
const wasDragging = dragHandler.dragging;
|
||||||
|
const didReorder = wasDragging && root.dropTargetIndex >= 0 && root.dropTargetIndex !== root.draggedIndex;
|
||||||
|
|
||||||
|
if (didReorder) {
|
||||||
|
root.suppressShiftAnimation = true;
|
||||||
|
root.moveTrayItemInFullOrder(root.draggedIndex, root.dropTargetIndex);
|
||||||
|
Qt.callLater(() => root.suppressShiftAnimation = false);
|
||||||
|
}
|
||||||
|
|
||||||
|
dragHandler.longPressing = false;
|
||||||
|
dragHandler.dragging = false;
|
||||||
|
dragHandler.dragAxisOffset = 0;
|
||||||
|
root.draggedIndex = -1;
|
||||||
|
root.dropTargetIndex = -1;
|
||||||
|
|
||||||
|
if (wasDragging || mouse.button !== Qt.LeftButton)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!trayItem)
|
||||||
|
return;
|
||||||
|
if (!trayItem.onlyMenu) {
|
||||||
|
trayItem.activate();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!trayItem.hasMenu)
|
||||||
|
return;
|
||||||
|
if (root.useOverflowPopup)
|
||||||
|
root.menuOpen = false;
|
||||||
|
root.showForTrayItem(trayItem, visualContent, parentScreen, root.isAtBottom, root.isVerticalOrientation, root.axis);
|
||||||
|
}
|
||||||
|
|
||||||
|
onPositionChanged: mouse => {
|
||||||
|
if (dragHandler.longPressing && !dragHandler.dragging) {
|
||||||
|
const distance = Math.abs(mouse.y - dragHandler.dragStartPos.y);
|
||||||
|
if (distance > 5) {
|
||||||
|
dragHandler.dragging = true;
|
||||||
|
root.draggedIndex = index;
|
||||||
|
root.dropTargetIndex = root.draggedIndex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!dragHandler.dragging)
|
||||||
|
return;
|
||||||
|
|
||||||
|
const axisOffset = mouse.y - dragHandler.dragStartPos.y;
|
||||||
|
dragHandler.dragAxisOffset = axisOffset;
|
||||||
|
const itemSize = root.trayItemSize;
|
||||||
|
const slotOffset = Math.round(axisOffset / itemSize);
|
||||||
|
const newTargetIndex = Math.max(0, Math.min(root.mainBarItems.length - 1, index + slotOffset));
|
||||||
|
if (newTargetIndex !== root.dropTargetIndex) {
|
||||||
|
root.dropTargetIndex = newTargetIndex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onClicked: mouse => {
|
||||||
|
if (dragHandler.dragging)
|
||||||
|
return;
|
||||||
|
if (mouse.button !== Qt.RightButton)
|
||||||
|
return;
|
||||||
|
root.openInlineTrayContextMenu(trayItem, trayItemArea, mouse, visualContent);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -459,219 +817,23 @@ BasePill {
|
|||||||
Column {
|
Column {
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
|
// Column lacks layoutDirection, so we use four repeaters with mutually exclusive models to control whether main items or expanded items appear above/ below the toggle button.
|
||||||
|
// When reverseInlineVertical is true the first and third repeaters are empty and the second and fourth are active, and vice-versa.
|
||||||
|
// Because items are swapped between repeaters rather than reversed within a single list, vertical drag-and-drop indices don't need remapping (unlike the horizontal RightToLeft case).
|
||||||
Repeater {
|
Repeater {
|
||||||
model: ScriptModel {
|
model: ScriptModel {
|
||||||
values: root.mainBarItems
|
values: root.reverseInlineVertical ? [] : root.displayedMainBarItems
|
||||||
objectProp: "key"
|
objectProp: "key"
|
||||||
}
|
}
|
||||||
|
delegate: verticalMainTrayItemDelegate
|
||||||
|
}
|
||||||
|
|
||||||
delegate: Item {
|
Repeater {
|
||||||
id: delegateRoot
|
model: ScriptModel {
|
||||||
property var trayItem: modelData.item
|
values: root.reverseInlineVertical ? root.displayedInlineExpandedItems : []
|
||||||
property string itemKey: modelData.key
|
objectProp: "key"
|
||||||
property string iconSource: {
|
|
||||||
let icon = trayItem && trayItem.icon;
|
|
||||||
if (typeof icon === 'string' || icon instanceof String) {
|
|
||||||
if (icon === "")
|
|
||||||
return "";
|
|
||||||
if (icon.includes("?path=")) {
|
|
||||||
const split = icon.split("?path=");
|
|
||||||
if (split.length !== 2)
|
|
||||||
return icon;
|
|
||||||
const name = split[0];
|
|
||||||
const path = split[1];
|
|
||||||
let fileName = name.substring(name.lastIndexOf("/") + 1);
|
|
||||||
if (fileName.startsWith("dropboxstatus")) {
|
|
||||||
fileName = `hicolor/16x16/status/${fileName}`;
|
|
||||||
}
|
|
||||||
return `file://${path}/${fileName}`;
|
|
||||||
}
|
|
||||||
if (icon.startsWith("/") && !icon.startsWith("file://"))
|
|
||||||
return `file://${icon}`;
|
|
||||||
return icon;
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
width: root.barThickness
|
|
||||||
height: root.trayItemSize
|
|
||||||
z: dragHandler.dragging ? 100 : 0
|
|
||||||
|
|
||||||
property real shiftOffset: {
|
|
||||||
if (root.draggedIndex < 0)
|
|
||||||
return 0;
|
|
||||||
if (index === root.draggedIndex)
|
|
||||||
return 0;
|
|
||||||
const dragIdx = root.draggedIndex;
|
|
||||||
const dropIdx = root.dropTargetIndex;
|
|
||||||
const shiftAmount = root.trayItemSize;
|
|
||||||
if (dropIdx < 0)
|
|
||||||
return 0;
|
|
||||||
if (dragIdx < dropIdx && index > dragIdx && index <= dropIdx)
|
|
||||||
return -shiftAmount;
|
|
||||||
if (dragIdx > dropIdx && index >= dropIdx && index < dragIdx)
|
|
||||||
return shiftAmount;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
transform: Translate {
|
|
||||||
y: delegateRoot.shiftOffset
|
|
||||||
Behavior on y {
|
|
||||||
enabled: !root.suppressShiftAnimation
|
|
||||||
NumberAnimation {
|
|
||||||
duration: 150
|
|
||||||
easing.type: Easing.OutCubic
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: dragHandler
|
|
||||||
anchors.fill: parent
|
|
||||||
property bool dragging: false
|
|
||||||
property point dragStartPos: Qt.point(0, 0)
|
|
||||||
property real dragAxisOffset: 0
|
|
||||||
property bool longPressing: false
|
|
||||||
|
|
||||||
Timer {
|
|
||||||
id: longPressTimer
|
|
||||||
interval: 400
|
|
||||||
repeat: false
|
|
||||||
onTriggered: dragHandler.longPressing = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: visualContent
|
|
||||||
width: root.trayItemSize
|
|
||||||
height: root.trayItemSize
|
|
||||||
anchors.centerIn: parent
|
|
||||||
radius: Theme.cornerRadius
|
|
||||||
color: trayItemArea.containsMouse ? BlurService.hoverColor(Theme.widgetBaseHoverColor) : "transparent"
|
|
||||||
border.width: dragHandler.dragging ? 2 : 0
|
|
||||||
border.color: Theme.primary
|
|
||||||
opacity: dragHandler.dragging ? 0.8 : 1.0
|
|
||||||
|
|
||||||
transform: Translate {
|
|
||||||
y: dragHandler.dragging ? dragHandler.dragAxisOffset : 0
|
|
||||||
}
|
|
||||||
|
|
||||||
IconImage {
|
|
||||||
id: iconImg
|
|
||||||
anchors.centerIn: parent
|
|
||||||
width: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
|
||||||
height: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
|
||||||
source: delegateRoot.iconSource
|
|
||||||
asynchronous: true
|
|
||||||
smooth: true
|
|
||||||
mipmap: true
|
|
||||||
visible: status === Image.Ready
|
|
||||||
}
|
|
||||||
|
|
||||||
Text {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
visible: !iconImg.visible
|
|
||||||
text: {
|
|
||||||
const itemId = trayItem?.id || "";
|
|
||||||
if (!itemId)
|
|
||||||
return "?";
|
|
||||||
return itemId.charAt(0).toUpperCase();
|
|
||||||
}
|
|
||||||
font.pixelSize: 10
|
|
||||||
color: Theme.widgetTextColor
|
|
||||||
}
|
|
||||||
|
|
||||||
DankRipple {
|
|
||||||
id: itemRipple
|
|
||||||
cornerRadius: Theme.cornerRadius
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: trayItemArea
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
|
||||||
cursorShape: dragHandler.longPressing ? Qt.DragMoveCursor : Qt.PointingHandCursor
|
|
||||||
|
|
||||||
onPressed: mouse => {
|
|
||||||
const pos = mapToItem(visualContent, mouse.x, mouse.y);
|
|
||||||
itemRipple.trigger(pos.x, pos.y);
|
|
||||||
if (mouse.button === Qt.LeftButton) {
|
|
||||||
dragHandler.dragStartPos = Qt.point(mouse.x, mouse.y);
|
|
||||||
longPressTimer.start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onReleased: mouse => {
|
|
||||||
longPressTimer.stop();
|
|
||||||
const wasDragging = dragHandler.dragging;
|
|
||||||
const didReorder = wasDragging && root.dropTargetIndex >= 0 && root.dropTargetIndex !== root.draggedIndex;
|
|
||||||
|
|
||||||
if (didReorder) {
|
|
||||||
root.suppressShiftAnimation = true;
|
|
||||||
root.moveTrayItemInFullOrder(root.draggedIndex, root.dropTargetIndex);
|
|
||||||
Qt.callLater(() => root.suppressShiftAnimation = false);
|
|
||||||
}
|
|
||||||
|
|
||||||
dragHandler.longPressing = false;
|
|
||||||
dragHandler.dragging = false;
|
|
||||||
dragHandler.dragAxisOffset = 0;
|
|
||||||
root.draggedIndex = -1;
|
|
||||||
root.dropTargetIndex = -1;
|
|
||||||
|
|
||||||
if (wasDragging || mouse.button !== Qt.LeftButton)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!delegateRoot.trayItem)
|
|
||||||
return;
|
|
||||||
if (!delegateRoot.trayItem.onlyMenu) {
|
|
||||||
delegateRoot.trayItem.activate();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!delegateRoot.trayItem.hasMenu)
|
|
||||||
return;
|
|
||||||
root.menuOpen = false;
|
|
||||||
root.showForTrayItem(delegateRoot.trayItem, visualContent, parentScreen, root.isAtBottom, root.isVerticalOrientation, root.axis);
|
|
||||||
}
|
|
||||||
|
|
||||||
onPositionChanged: mouse => {
|
|
||||||
if (dragHandler.longPressing && !dragHandler.dragging) {
|
|
||||||
const distance = Math.abs(mouse.y - dragHandler.dragStartPos.y);
|
|
||||||
if (distance > 5) {
|
|
||||||
dragHandler.dragging = true;
|
|
||||||
root.draggedIndex = index;
|
|
||||||
root.dropTargetIndex = index;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!dragHandler.dragging)
|
|
||||||
return;
|
|
||||||
|
|
||||||
const axisOffset = mouse.y - dragHandler.dragStartPos.y;
|
|
||||||
dragHandler.dragAxisOffset = axisOffset;
|
|
||||||
const itemSize = root.trayItemSize;
|
|
||||||
const slotOffset = Math.round(axisOffset / itemSize);
|
|
||||||
const newTargetIndex = Math.max(0, Math.min(root.mainBarItems.length - 1, index + slotOffset));
|
|
||||||
if (newTargetIndex !== root.dropTargetIndex) {
|
|
||||||
root.dropTargetIndex = newTargetIndex;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onClicked: mouse => {
|
|
||||||
if (dragHandler.dragging)
|
|
||||||
return;
|
|
||||||
if (mouse.button !== Qt.RightButton)
|
|
||||||
return;
|
|
||||||
if (!delegateRoot.trayItem?.hasMenu) {
|
|
||||||
const gp = trayItemArea.mapToGlobal(mouse.x, mouse.y);
|
|
||||||
root.callContextMenuFallback(delegateRoot.trayItem.id, Math.round(gp.x), Math.round(gp.y));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
root.menuOpen = false;
|
|
||||||
root.showForTrayItem(delegateRoot.trayItem, visualContent, parentScreen, root.isAtBottom, root.isVerticalOrientation, root.axis);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
delegate: inlineExpandedTrayItemDelegate
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
@@ -689,14 +851,7 @@ BasePill {
|
|||||||
|
|
||||||
DankIcon {
|
DankIcon {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
name: {
|
name: root.toggleIconName()
|
||||||
const edge = root.axis?.edge;
|
|
||||||
if (edge === "left") {
|
|
||||||
return root.menuOpen ? "chevron_left" : "chevron_right";
|
|
||||||
} else {
|
|
||||||
return root.menuOpen ? "chevron_right" : "chevron_left";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale)
|
||||||
color: Theme.widgetTextColor
|
color: Theme.widgetTextColor
|
||||||
}
|
}
|
||||||
@@ -718,6 +873,22 @@ BasePill {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Repeater {
|
||||||
|
model: ScriptModel {
|
||||||
|
values: root.reverseInlineVertical ? [] : root.displayedInlineExpandedItems
|
||||||
|
objectProp: "key"
|
||||||
|
}
|
||||||
|
delegate: inlineExpandedTrayItemDelegate
|
||||||
|
}
|
||||||
|
|
||||||
|
Repeater {
|
||||||
|
model: ScriptModel {
|
||||||
|
values: root.reverseInlineVertical ? root.displayedMainBarItems : []
|
||||||
|
objectProp: "key"
|
||||||
|
}
|
||||||
|
delegate: verticalMainTrayItemDelegate
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -733,7 +904,7 @@ BasePill {
|
|||||||
blurRadius: Theme.cornerRadius
|
blurRadius: Theme.cornerRadius
|
||||||
}
|
}
|
||||||
|
|
||||||
visible: root.menuOpen
|
visible: root.useOverflowPopup && root.menuOpen
|
||||||
screen: root.parentScreen
|
screen: root.parentScreen
|
||||||
WlrLayershell.layer: WlrLayershell.Top
|
WlrLayershell.layer: WlrLayershell.Top
|
||||||
WlrLayershell.exclusiveZone: -1
|
WlrLayershell.exclusiveZone: -1
|
||||||
@@ -749,13 +920,14 @@ BasePill {
|
|||||||
|
|
||||||
HyprlandFocusGrab {
|
HyprlandFocusGrab {
|
||||||
windows: [overflowMenu]
|
windows: [overflowMenu]
|
||||||
active: CompositorService.useHyprlandFocusGrab && root.menuOpen
|
active: CompositorService.useHyprlandFocusGrab && root.useOverflowPopup && root.menuOpen
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: PopoutManager
|
target: PopoutManager
|
||||||
function onPopoutOpening() {
|
function onPopoutOpening() {
|
||||||
root.menuOpen = false;
|
if (root.useOverflowPopup)
|
||||||
|
root.menuOpen = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1021,30 +1193,7 @@ BasePill {
|
|||||||
|
|
||||||
delegate: Rectangle {
|
delegate: Rectangle {
|
||||||
property var trayItem: modelData
|
property var trayItem: modelData
|
||||||
property string iconSource: {
|
property string iconSource: root.trayIconSourceFor(trayItem)
|
||||||
let icon = trayItem?.icon;
|
|
||||||
if (typeof icon === 'string' || icon instanceof String) {
|
|
||||||
if (icon === "")
|
|
||||||
return "";
|
|
||||||
if (icon.includes("?path=")) {
|
|
||||||
const split = icon.split("?path=");
|
|
||||||
if (split.length !== 2)
|
|
||||||
return icon;
|
|
||||||
const name = split[0];
|
|
||||||
const path = split[1];
|
|
||||||
let fileName = name.substring(name.lastIndexOf("/") + 1);
|
|
||||||
if (fileName.startsWith("dropboxstatus")) {
|
|
||||||
fileName = `hicolor/16x16/status/${fileName}`;
|
|
||||||
}
|
|
||||||
return `file://${path}/${fileName}`;
|
|
||||||
}
|
|
||||||
if (icon.startsWith("/") && !icon.startsWith("file://")) {
|
|
||||||
return `file://${icon}`;
|
|
||||||
}
|
|
||||||
return icon;
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
width: root.trayItemSize + 4
|
width: root.trayItemSize + 4
|
||||||
height: root.trayItemSize + 4
|
height: root.trayItemSize + 4
|
||||||
@@ -1313,7 +1462,8 @@ BasePill {
|
|||||||
onVisibleChanged: {
|
onVisibleChanged: {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
updatePosition();
|
updatePosition();
|
||||||
root.menuOpen = false;
|
if (root.useOverflowPopup)
|
||||||
|
root.menuOpen = false;
|
||||||
PopoutManager.closeAllPopouts();
|
PopoutManager.closeAllPopouts();
|
||||||
ModalManager.closeAllModalsExcept(null);
|
ModalManager.closeAllModalsExcept(null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,46 @@ Item {
|
|||||||
property var blurBarWindow: null
|
property var blurBarWindow: null
|
||||||
property var hyprlandOverviewLoader: null
|
property var hyprlandOverviewLoader: null
|
||||||
property var parentScreen: null
|
property var parentScreen: null
|
||||||
|
|
||||||
|
readonly property real _leftMargin: {
|
||||||
|
if (isVertical)
|
||||||
|
return 0;
|
||||||
|
root.x;
|
||||||
|
if (!root.parent)
|
||||||
|
return 0;
|
||||||
|
const gap = root.mapToItem(null, 0, 0).x;
|
||||||
|
return (gap > 0 && gap < 30) ? gap + 5 : 0;
|
||||||
|
}
|
||||||
|
readonly property real _rightMargin: {
|
||||||
|
if (isVertical)
|
||||||
|
return 0;
|
||||||
|
root.x;
|
||||||
|
root.width;
|
||||||
|
if (!root.parent || !blurBarWindow)
|
||||||
|
return 0;
|
||||||
|
const gap = blurBarWindow.width - root.mapToItem(null, root.width, 0).x;
|
||||||
|
return (gap > 0 && gap < 30) ? gap + 5 : 0;
|
||||||
|
}
|
||||||
|
readonly property real _topMargin: {
|
||||||
|
if (!isVertical)
|
||||||
|
return 0;
|
||||||
|
root.y;
|
||||||
|
if (!root.parent)
|
||||||
|
return 0;
|
||||||
|
const gap = root.mapToItem(null, 0, 0).y;
|
||||||
|
return (gap > 0 && gap < 30) ? gap + 5 : 0;
|
||||||
|
}
|
||||||
|
readonly property real _bottomMargin: {
|
||||||
|
if (!isVertical)
|
||||||
|
return 0;
|
||||||
|
root.y;
|
||||||
|
root.height;
|
||||||
|
if (!root.parent || !blurBarWindow)
|
||||||
|
return 0;
|
||||||
|
const gap = blurBarWindow.height - root.mapToItem(null, 0, root.height).y;
|
||||||
|
return (gap > 0 && gap < 30) ? gap + 5 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
property int _desktopEntriesUpdateTrigger: 0
|
property int _desktopEntriesUpdateTrigger: 0
|
||||||
readonly property var sortedToplevels: {
|
readonly property var sortedToplevels: {
|
||||||
return CompositorService.filterCurrentWorkspace(CompositorService.sortedToplevels, screenName);
|
return CompositorService.filterCurrentWorkspace(CompositorService.sortedToplevels, screenName);
|
||||||
@@ -539,6 +579,60 @@ Item {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function switchToWorkspaceByModelData(data) {
|
||||||
|
if (!data)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (root.useExtWorkspace && (data.id || data.name)) {
|
||||||
|
ExtWorkspaceService.activateWorkspace(data.id || data.name, data.groupID || "");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (CompositorService.compositor) {
|
||||||
|
case "niri":
|
||||||
|
if (data.idx !== undefined)
|
||||||
|
NiriService.switchToWorkspace(data.idx);
|
||||||
|
break;
|
||||||
|
case "hyprland":
|
||||||
|
if (data.id)
|
||||||
|
Hyprland.dispatch(`workspace ${data.id}`);
|
||||||
|
break;
|
||||||
|
case "dwl":
|
||||||
|
if (data.tag !== undefined)
|
||||||
|
DwlService.switchToTag(root.screenName, data.tag);
|
||||||
|
break;
|
||||||
|
case "sway":
|
||||||
|
case "scroll":
|
||||||
|
case "miracle":
|
||||||
|
if (data.num)
|
||||||
|
try {
|
||||||
|
I3.dispatch(`workspace number ${data.num}`);
|
||||||
|
} catch (_) {}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function findClosestWorkspaceIndex(localX, localY) {
|
||||||
|
if (workspaceRepeater.count === 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
let closestIdx = -1;
|
||||||
|
let closestDist = Infinity;
|
||||||
|
|
||||||
|
for (let i = 0; i < workspaceRepeater.count; i++) {
|
||||||
|
const item = workspaceRepeater.itemAt(i);
|
||||||
|
if (!item)
|
||||||
|
continue;
|
||||||
|
const center = item.mapToItem(root, item.width / 2, item.height / 2);
|
||||||
|
const dist = isVertical ? Math.abs(localY - center.y) : Math.abs(localX - center.x);
|
||||||
|
if (dist < closestDist) {
|
||||||
|
closestDist = dist;
|
||||||
|
closestIdx = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return closestIdx;
|
||||||
|
}
|
||||||
|
|
||||||
function switchWorkspace(direction) {
|
function switchWorkspace(direction) {
|
||||||
if (useExtWorkspace) {
|
if (useExtWorkspace) {
|
||||||
const realWorkspaces = getRealWorkspaces();
|
const realWorkspaces = getRealWorkspaces();
|
||||||
@@ -752,8 +846,15 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
id: edgeMouseArea
|
||||||
acceptedButtons: Qt.RightButton
|
z: -1
|
||||||
|
x: -root._leftMargin
|
||||||
|
y: -root._topMargin
|
||||||
|
width: root.width + root._leftMargin + root._rightMargin
|
||||||
|
height: root.height + root._topMargin + root._bottomMargin
|
||||||
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||||
|
hoverEnabled: true
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
|
||||||
property real touchpadAccumulator: 0
|
property real touchpadAccumulator: 0
|
||||||
property real mouseAccumulator: 0
|
property real mouseAccumulator: 0
|
||||||
@@ -766,12 +867,20 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onClicked: mouse => {
|
onClicked: mouse => {
|
||||||
if (mouse.button === Qt.RightButton) {
|
const rootPos = edgeMouseArea.mapToItem(root, mouse.x, mouse.y);
|
||||||
|
switch (mouse.button) {
|
||||||
|
case Qt.RightButton:
|
||||||
if (CompositorService.isNiri) {
|
if (CompositorService.isNiri) {
|
||||||
NiriService.toggleOverview();
|
NiriService.toggleOverview();
|
||||||
} else if (CompositorService.isHyprland && root.hyprlandOverviewLoader?.item) {
|
} else if (CompositorService.isHyprland && root.hyprlandOverviewLoader?.item) {
|
||||||
root.hyprlandOverviewLoader.item.overviewOpen = !root.hyprlandOverviewLoader.item.overviewOpen;
|
root.hyprlandOverviewLoader.item.overviewOpen = !root.hyprlandOverviewLoader.item.overviewOpen;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
case Qt.LeftButton:
|
||||||
|
const idx = root.findClosestWorkspaceIndex(rootPos.x, rootPos.y);
|
||||||
|
if (idx >= 0)
|
||||||
|
root.switchToWorkspaceByModelData(root.workspaceList[idx]);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ DankPopout {
|
|||||||
popupHeight: contentLoader.item ? contentLoader.item.implicitHeight : 500
|
popupHeight: contentLoader.item ? contentLoader.item.implicitHeight : 500
|
||||||
triggerWidth: 80
|
triggerWidth: 80
|
||||||
screen: triggerScreen
|
screen: triggerScreen
|
||||||
shouldBeVisible: dashVisible
|
|
||||||
|
|
||||||
property bool __focusArmed: false
|
property bool __focusArmed: false
|
||||||
property bool __contentReady: false
|
property bool __contentReady: false
|
||||||
|
|||||||
@@ -44,6 +44,43 @@ Item {
|
|||||||
|
|
||||||
property int __volumeHoverCount: 0
|
property int __volumeHoverCount: 0
|
||||||
|
|
||||||
|
readonly property bool directionalEffect: Theme.isDirectionalEffect
|
||||||
|
readonly property bool depthEffect: Theme.isDepthEffect
|
||||||
|
|
||||||
|
function panelMotionX(panelWidth, active) {
|
||||||
|
if (active)
|
||||||
|
return 0;
|
||||||
|
if (directionalEffect) {
|
||||||
|
const travel = Math.max(Theme.effectAnimOffset, panelWidth * 0.85);
|
||||||
|
return isRightEdge ? -travel : travel;
|
||||||
|
}
|
||||||
|
if (depthEffect) {
|
||||||
|
const travel = Math.max(Theme.effectAnimOffset * 0.7, panelWidth * 0.32);
|
||||||
|
return isRightEdge ? -travel : travel;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
function panelMotionY(panelType, panelHeight, active) {
|
||||||
|
if (active)
|
||||||
|
return 0;
|
||||||
|
if (directionalEffect) {
|
||||||
|
if (panelType === 2)
|
||||||
|
return panelHeight * 0.08;
|
||||||
|
if (panelType === 3)
|
||||||
|
return -panelHeight * 0.08;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (depthEffect) {
|
||||||
|
if (panelType === 2)
|
||||||
|
return panelHeight * 0.04;
|
||||||
|
if (panelType === 3)
|
||||||
|
return -panelHeight * 0.04;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
function volumeAreaEntered() {
|
function volumeAreaEntered() {
|
||||||
__volumeHoverCount++;
|
__volumeHoverCount++;
|
||||||
panelEntered();
|
panelEntered();
|
||||||
@@ -62,30 +99,47 @@ Item {
|
|||||||
visible: dropdownType === 1 && volumeAvailable
|
visible: dropdownType === 1 && volumeAvailable
|
||||||
width: 60
|
width: 60
|
||||||
height: 180
|
height: 180
|
||||||
x: isRightEdge ? anchorPos.x : anchorPos.x - width
|
x: (isRightEdge ? anchorPos.x : anchorPos.x - width) + panelMotionX(width, dropdownType === 1)
|
||||||
y: anchorPos.y - height / 2
|
y: anchorPos.y - height / 2 + panelMotionY(1, height, dropdownType === 1)
|
||||||
radius: Theme.cornerRadius * 2
|
radius: Theme.cornerRadius * 2
|
||||||
color: Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g, Theme.surfaceContainer.b, 0.95)
|
color: Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g, Theme.surfaceContainer.b, 0.95)
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.3)
|
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.3)
|
||||||
border.width: 1
|
border.width: 1
|
||||||
|
|
||||||
opacity: dropdownType === 1 ? 1 : 0
|
opacity: Theme.isDirectionalEffect ? 1 : (dropdownType === 1 ? 1 : 0)
|
||||||
scale: dropdownType === 1 ? 1 : 0.96
|
scale: Theme.isDirectionalEffect ? 1 : (dropdownType === 1 ? 1 : Theme.effectScaleCollapsed)
|
||||||
transformOrigin: isRightEdge ? Item.Left : Item.Right
|
transformOrigin: isRightEdge ? Item.Left : Item.Right
|
||||||
|
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
NumberAnimation {
|
enabled: !Theme.isDirectionalEffect
|
||||||
duration: Theme.expressiveDurations.expressiveDefaultSpatial
|
DankAnim {
|
||||||
easing.type: Easing.BezierSpline
|
duration: Math.round(Theme.variantDuration(Theme.expressiveDurations.expressiveDefaultSpatial, dropdownType === 1) * Theme.variantOpacityDurationScale)
|
||||||
easing.bezierCurve: Theme.expressiveCurves.expressiveDefaultSpatial
|
easing.bezierCurve: dropdownType === 1 ? Theme.variantPopoutEnterCurve : Theme.variantPopoutExitCurve
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on scale {
|
Behavior on scale {
|
||||||
|
enabled: !Theme.isDirectionalEffect
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Theme.expressiveDurations.expressiveDefaultSpatial
|
duration: Theme.variantDuration(Theme.expressiveDurations.expressiveDefaultSpatial, dropdownType === 1)
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: Theme.expressiveCurves.expressiveDefaultSpatial
|
easing.bezierCurve: dropdownType === 1 ? Theme.variantPopoutEnterCurve : Theme.variantPopoutExitCurve
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Behavior on x {
|
||||||
|
NumberAnimation {
|
||||||
|
duration: Theme.variantDuration(Theme.expressiveDurations.expressiveDefaultSpatial, dropdownType === 1)
|
||||||
|
easing.type: Easing.BezierSpline
|
||||||
|
easing.bezierCurve: dropdownType === 1 ? Theme.variantPopoutEnterCurve : Theme.variantPopoutExitCurve
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Behavior on y {
|
||||||
|
NumberAnimation {
|
||||||
|
duration: Theme.variantDuration(Theme.expressiveDurations.expressiveDefaultSpatial, dropdownType === 1)
|
||||||
|
easing.type: Easing.BezierSpline
|
||||||
|
easing.bezierCurve: dropdownType === 1 ? Theme.variantPopoutEnterCurve : Theme.variantPopoutExitCurve
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -197,33 +251,50 @@ Item {
|
|||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: audioDevicesPanel
|
id: audioDevicesPanel
|
||||||
visible: dropdownType === 2
|
visible: dropdownType === 2 && activePlayer !== null
|
||||||
width: 280
|
width: 280
|
||||||
height: Math.max(200, Math.min(280, availableDevices.length * 50 + 100))
|
height: Math.max(200, Math.min(280, availableDevices.length * 50 + 100))
|
||||||
x: isRightEdge ? anchorPos.x : anchorPos.x - width
|
x: (isRightEdge ? anchorPos.x : anchorPos.x - width) + panelMotionX(width, dropdownType === 2)
|
||||||
y: anchorPos.y - height / 2
|
y: anchorPos.y - height / 2 + panelMotionY(2, height, dropdownType === 2)
|
||||||
radius: Theme.cornerRadius * 2
|
radius: Theme.cornerRadius * 2
|
||||||
color: Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g, Theme.surfaceContainer.b, 0.98)
|
color: Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g, Theme.surfaceContainer.b, 0.98)
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.6)
|
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.6)
|
||||||
border.width: 2
|
border.width: 2
|
||||||
|
|
||||||
opacity: dropdownType === 2 ? 1 : 0
|
opacity: Theme.isDirectionalEffect ? 1 : (dropdownType === 2 ? 1 : 0)
|
||||||
scale: dropdownType === 2 ? 1 : 0.96
|
scale: Theme.isDirectionalEffect ? 1 : (dropdownType === 2 ? 1 : Theme.effectScaleCollapsed)
|
||||||
transformOrigin: isRightEdge ? Item.Left : Item.Right
|
transformOrigin: isRightEdge ? Item.Left : Item.Right
|
||||||
|
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
NumberAnimation {
|
enabled: !Theme.isDirectionalEffect
|
||||||
duration: Theme.expressiveDurations.expressiveDefaultSpatial
|
DankAnim {
|
||||||
easing.type: Easing.BezierSpline
|
duration: Math.round(Theme.variantDuration(Theme.expressiveDurations.expressiveDefaultSpatial, dropdownType === 2) * Theme.variantOpacityDurationScale)
|
||||||
easing.bezierCurve: Theme.expressiveCurves.expressiveDefaultSpatial
|
easing.bezierCurve: dropdownType === 2 ? Theme.variantPopoutEnterCurve : Theme.variantPopoutExitCurve
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on scale {
|
Behavior on scale {
|
||||||
|
enabled: !Theme.isDirectionalEffect
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Theme.expressiveDurations.expressiveDefaultSpatial
|
duration: Theme.variantDuration(Theme.expressiveDurations.expressiveDefaultSpatial, dropdownType === 2)
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: Theme.expressiveCurves.expressiveDefaultSpatial
|
easing.bezierCurve: dropdownType === 2 ? Theme.variantPopoutEnterCurve : Theme.variantPopoutExitCurve
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Behavior on x {
|
||||||
|
NumberAnimation {
|
||||||
|
duration: Theme.variantDuration(Theme.expressiveDurations.expressiveDefaultSpatial, dropdownType === 2)
|
||||||
|
easing.type: Easing.BezierSpline
|
||||||
|
easing.bezierCurve: dropdownType === 2 ? Theme.variantPopoutEnterCurve : Theme.variantPopoutExitCurve
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Behavior on y {
|
||||||
|
NumberAnimation {
|
||||||
|
duration: Theme.variantDuration(Theme.expressiveDurations.expressiveDefaultSpatial, dropdownType === 2)
|
||||||
|
easing.type: Easing.BezierSpline
|
||||||
|
easing.bezierCurve: dropdownType === 2 ? Theme.variantPopoutEnterCurve : Theme.variantPopoutExitCurve
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -354,30 +425,47 @@ Item {
|
|||||||
visible: dropdownType === 3
|
visible: dropdownType === 3
|
||||||
width: 240
|
width: 240
|
||||||
height: Math.max(180, Math.min(240, (allPlayers?.length || 0) * 50 + 80))
|
height: Math.max(180, Math.min(240, (allPlayers?.length || 0) * 50 + 80))
|
||||||
x: isRightEdge ? anchorPos.x : anchorPos.x - width
|
x: (isRightEdge ? anchorPos.x : anchorPos.x - width) + panelMotionX(width, dropdownType === 3)
|
||||||
y: anchorPos.y - height / 2
|
y: anchorPos.y - height / 2 + panelMotionY(3, height, dropdownType === 3)
|
||||||
radius: Theme.cornerRadius * 2
|
radius: Theme.cornerRadius * 2
|
||||||
color: Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g, Theme.surfaceContainer.b, 0.98)
|
color: Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g, Theme.surfaceContainer.b, 0.98)
|
||||||
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.6)
|
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.6)
|
||||||
border.width: 2
|
border.width: 2
|
||||||
|
|
||||||
opacity: dropdownType === 3 ? 1 : 0
|
opacity: Theme.isDirectionalEffect ? 1 : (dropdownType === 3 ? 1 : 0)
|
||||||
scale: dropdownType === 3 ? 1 : 0.96
|
scale: Theme.isDirectionalEffect ? 1 : (dropdownType === 3 ? 1 : Theme.effectScaleCollapsed)
|
||||||
transformOrigin: isRightEdge ? Item.Left : Item.Right
|
transformOrigin: isRightEdge ? Item.Left : Item.Right
|
||||||
|
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
NumberAnimation {
|
enabled: !Theme.isDirectionalEffect
|
||||||
duration: Theme.expressiveDurations.expressiveDefaultSpatial
|
DankAnim {
|
||||||
easing.type: Easing.BezierSpline
|
duration: Math.round(Theme.variantDuration(Theme.expressiveDurations.expressiveDefaultSpatial, dropdownType === 3) * Theme.variantOpacityDurationScale)
|
||||||
easing.bezierCurve: Theme.expressiveCurves.expressiveDefaultSpatial
|
easing.bezierCurve: dropdownType === 3 ? Theme.variantPopoutEnterCurve : Theme.variantPopoutExitCurve
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on scale {
|
Behavior on scale {
|
||||||
|
enabled: !Theme.isDirectionalEffect
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Theme.expressiveDurations.expressiveDefaultSpatial
|
duration: Theme.variantDuration(Theme.expressiveDurations.expressiveDefaultSpatial, dropdownType === 3)
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: Theme.expressiveCurves.expressiveDefaultSpatial
|
easing.bezierCurve: dropdownType === 3 ? Theme.variantPopoutEnterCurve : Theme.variantPopoutExitCurve
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Behavior on x {
|
||||||
|
NumberAnimation {
|
||||||
|
duration: Theme.variantDuration(Theme.expressiveDurations.expressiveDefaultSpatial, dropdownType === 3)
|
||||||
|
easing.type: Easing.BezierSpline
|
||||||
|
easing.bezierCurve: dropdownType === 3 ? Theme.variantPopoutEnterCurve : Theme.variantPopoutExitCurve
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Behavior on y {
|
||||||
|
NumberAnimation {
|
||||||
|
duration: Theme.variantDuration(Theme.expressiveDurations.expressiveDefaultSpatial, dropdownType === 3)
|
||||||
|
easing.type: Easing.BezierSpline
|
||||||
|
easing.bezierCurve: dropdownType === 3 ? Theme.variantPopoutEnterCurve : Theme.variantPopoutExitCurve
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -487,17 +487,7 @@ Item {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: MprisController.previousOrRewind()
|
||||||
if (!activePlayer) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (activePlayer.position > 8 && activePlayer.canSeek) {
|
|
||||||
activePlayer.position = 0;
|
|
||||||
} else {
|
|
||||||
activePlayer.previous();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -145,14 +145,7 @@ Card {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: MprisController.previousOrRewind()
|
||||||
if (!activePlayer) return
|
|
||||||
if (activePlayer.position > 8 && activePlayer.canSeek) {
|
|
||||||
activePlayer.position = 0
|
|
||||||
} else {
|
|
||||||
activePlayer.previous()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,11 +19,12 @@ Variants {
|
|||||||
|
|
||||||
WindowBlur {
|
WindowBlur {
|
||||||
targetWindow: dock
|
targetWindow: dock
|
||||||
|
blurEnabled: dock.effectiveBlurEnabled && !SettingsData.connectedFrameModeActive
|
||||||
blurX: dockBackground.x + dockContainer.x + dockMouseArea.x + dockCore.x + dockSlide.x
|
blurX: dockBackground.x + dockContainer.x + dockMouseArea.x + dockCore.x + dockSlide.x
|
||||||
blurY: dockBackground.y + dockContainer.y + dockMouseArea.y + dockCore.y + dockSlide.y
|
blurY: dockBackground.y + dockContainer.y + dockMouseArea.y + dockCore.y + dockSlide.y
|
||||||
blurWidth: dock.hasApps && dock.reveal ? dockBackground.width : 0
|
blurWidth: dock.hasApps && dock.reveal ? dockBackground.width : 0
|
||||||
blurHeight: dock.hasApps && dock.reveal ? dockBackground.height : 0
|
blurHeight: dock.hasApps && dock.reveal ? dockBackground.height : 0
|
||||||
blurRadius: Theme.cornerRadius
|
blurRadius: Theme.isConnectedEffect ? Theme.connectedCornerRadius : dock.surfaceRadius
|
||||||
}
|
}
|
||||||
|
|
||||||
WlrLayershell.namespace: "dms:dock"
|
WlrLayershell.namespace: "dms:dock"
|
||||||
@@ -42,6 +43,23 @@ Variants {
|
|||||||
property real backgroundTransparency: SettingsData.dockTransparency
|
property real backgroundTransparency: SettingsData.dockTransparency
|
||||||
property bool groupByApp: SettingsData.dockGroupByApp
|
property bool groupByApp: SettingsData.dockGroupByApp
|
||||||
readonly property int borderThickness: SettingsData.dockBorderEnabled ? SettingsData.dockBorderThickness : 0
|
readonly property int borderThickness: SettingsData.dockBorderEnabled ? SettingsData.dockBorderThickness : 0
|
||||||
|
readonly property string connectedBarSide: SettingsData.dockPosition === SettingsData.Position.Top ? "top" : SettingsData.dockPosition === SettingsData.Position.Bottom ? "bottom" : SettingsData.dockPosition === SettingsData.Position.Left ? "left" : "right"
|
||||||
|
readonly property bool connectedBarActiveOnEdge: Theme.isConnectedEffect && !!(dock.screen || modelData) && SettingsData.getActiveBarEdgesForScreen(dock.screen || modelData).includes(connectedBarSide)
|
||||||
|
readonly property real connectedJoinInset: {
|
||||||
|
if (!Theme.isConnectedEffect)
|
||||||
|
return 0;
|
||||||
|
return connectedBarActiveOnEdge ? SettingsData.frameBarSize : SettingsData.frameThickness;
|
||||||
|
}
|
||||||
|
readonly property real surfaceRadius: Theme.connectedSurfaceRadius
|
||||||
|
readonly property color surfaceColor: Theme.isConnectedEffect ? Theme.connectedSurfaceColor : Theme.withAlpha(Theme.surfaceContainer, backgroundTransparency)
|
||||||
|
readonly property color surfaceBorderColor: Theme.isConnectedEffect ? "transparent" : BlurService.borderColor
|
||||||
|
readonly property real surfaceBorderWidth: Theme.isConnectedEffect ? 0 : BlurService.borderWidth
|
||||||
|
readonly property real surfaceTopLeftRadius: Theme.isConnectedEffect && (SettingsData.dockPosition === SettingsData.Position.Top || SettingsData.dockPosition === SettingsData.Position.Left) ? 0 : surfaceRadius
|
||||||
|
readonly property real surfaceTopRightRadius: Theme.isConnectedEffect && (SettingsData.dockPosition === SettingsData.Position.Top || SettingsData.dockPosition === SettingsData.Position.Right) ? 0 : surfaceRadius
|
||||||
|
readonly property real surfaceBottomLeftRadius: Theme.isConnectedEffect && (SettingsData.dockPosition === SettingsData.Position.Bottom || SettingsData.dockPosition === SettingsData.Position.Left) ? 0 : surfaceRadius
|
||||||
|
readonly property real surfaceBottomRightRadius: Theme.isConnectedEffect && (SettingsData.dockPosition === SettingsData.Position.Bottom || SettingsData.dockPosition === SettingsData.Position.Right) ? 0 : surfaceRadius
|
||||||
|
readonly property real horizontalConnectorExtent: Theme.isConnectedEffect && !isVertical ? Theme.connectedCornerRadius : 0
|
||||||
|
readonly property real verticalConnectorExtent: Theme.isConnectedEffect && isVertical ? Theme.connectedCornerRadius : 0
|
||||||
|
|
||||||
readonly property int hasApps: dockApps.implicitWidth > 0 || dockApps.implicitHeight > 0
|
readonly property int hasApps: dockApps.implicitWidth > 0 || dockApps.implicitHeight > 0
|
||||||
|
|
||||||
@@ -113,13 +131,102 @@ Variants {
|
|||||||
return getBarHeight(leftBar);
|
return getBarHeight(leftBar);
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly property real dockMargin: SettingsData.dockSpacing
|
readonly property real dockMargin: SettingsData.dockMargin
|
||||||
readonly property real positionSpacing: barSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin
|
readonly property bool effectiveBlurEnabled: Theme.connectedSurfaceBlurEnabled
|
||||||
|
readonly property real effectiveDockBottomGap: Theme.isConnectedEffect ? 0 : SettingsData.dockBottomGap
|
||||||
|
readonly property real effectiveDockMargin: Theme.isConnectedEffect ? 0 : SettingsData.dockMargin
|
||||||
|
readonly property real positionSpacing: barSpacing + effectiveDockBottomGap + effectiveDockMargin
|
||||||
|
readonly property real joinedEdgeMargin: Theme.isConnectedEffect ? 0 : (barSpacing + effectiveDockMargin + 1 + dock.borderThickness)
|
||||||
readonly property real _dpr: (dock.screen && dock.screen.devicePixelRatio) ? dock.screen.devicePixelRatio : 1
|
readonly property real _dpr: (dock.screen && dock.screen.devicePixelRatio) ? dock.screen.devicePixelRatio : 1
|
||||||
function px(v) {
|
function px(v) {
|
||||||
return Math.round(v * _dpr) / _dpr;
|
return Math.round(v * _dpr) / _dpr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function connectorWidth(spacing) {
|
||||||
|
return dock.isVertical ? (spacing + Theme.connectedCornerRadius) : Theme.connectedCornerRadius;
|
||||||
|
}
|
||||||
|
|
||||||
|
function connectorHeight(spacing) {
|
||||||
|
return dock.isVertical ? Theme.connectedCornerRadius : (spacing + Theme.connectedCornerRadius);
|
||||||
|
}
|
||||||
|
|
||||||
|
function connectorSeamX(baseX, bodyWidth, placement) {
|
||||||
|
if (!dock.isVertical)
|
||||||
|
return placement === "left" ? baseX : baseX + bodyWidth;
|
||||||
|
return SettingsData.dockPosition === SettingsData.Position.Left ? baseX : baseX + bodyWidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
function connectorSeamY(baseY, bodyHeight, placement) {
|
||||||
|
if (SettingsData.dockPosition === SettingsData.Position.Top)
|
||||||
|
return baseY;
|
||||||
|
if (SettingsData.dockPosition === SettingsData.Position.Bottom)
|
||||||
|
return baseY + bodyHeight;
|
||||||
|
return placement === "left" ? baseY : baseY + bodyHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
function connectorX(baseX, bodyWidth, placement, spacing) {
|
||||||
|
const seamX = connectorSeamX(baseX, bodyWidth, placement);
|
||||||
|
const width = connectorWidth(spacing);
|
||||||
|
if (!dock.isVertical)
|
||||||
|
return placement === "left" ? seamX - width : seamX;
|
||||||
|
return SettingsData.dockPosition === SettingsData.Position.Left ? seamX : seamX - width;
|
||||||
|
}
|
||||||
|
|
||||||
|
function connectorY(baseY, bodyHeight, placement, spacing) {
|
||||||
|
const seamY = connectorSeamY(baseY, bodyHeight, placement);
|
||||||
|
const height = connectorHeight(spacing);
|
||||||
|
if (SettingsData.dockPosition === SettingsData.Position.Top)
|
||||||
|
return seamY;
|
||||||
|
if (SettingsData.dockPosition === SettingsData.Position.Bottom)
|
||||||
|
return seamY - height;
|
||||||
|
return placement === "left" ? seamY - height : seamY;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── ConnectedModeState sync ────────────────────────────────────────
|
||||||
|
// Dock window origin in screen-relative coordinates (FrameWindow space).
|
||||||
|
function _dockWindowOriginX() {
|
||||||
|
if (!dock.isVertical)
|
||||||
|
return 0;
|
||||||
|
if (SettingsData.dockPosition === SettingsData.Position.Right)
|
||||||
|
return (dock.screen ? dock.screen.width : 0) - dock.width;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
function _dockWindowOriginY() {
|
||||||
|
if (dock.isVertical)
|
||||||
|
return 0;
|
||||||
|
if (SettingsData.dockPosition === SettingsData.Position.Bottom)
|
||||||
|
return (dock.screen ? dock.screen.height : 0) - dock.height;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
readonly property string _dockScreenName: dock.modelData ? dock.modelData.name : (dock.screen ? dock.screen.name : "")
|
||||||
|
|
||||||
|
function _syncDockChromeState() {
|
||||||
|
if (!dock._dockScreenName)
|
||||||
|
return;
|
||||||
|
if (!SettingsData.connectedFrameModeActive) {
|
||||||
|
ConnectedModeState.clearDockState(dock._dockScreenName);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ConnectedModeState.setDockState(dock._dockScreenName, {
|
||||||
|
"reveal": dock.visible && (dock.reveal || slideXAnimation.running || slideYAnimation.running) && dock.hasApps,
|
||||||
|
"barSide": dock.connectedBarSide,
|
||||||
|
"bodyX": dock._dockWindowOriginX() + dockBackground.x + dockContainer.x + dockMouseArea.x + dockCore.x,
|
||||||
|
"bodyY": dock._dockWindowOriginY() + dockBackground.y + dockContainer.y + dockMouseArea.y + dockCore.y,
|
||||||
|
"bodyW": dock.hasApps ? dockBackground.width : 0,
|
||||||
|
"bodyH": dock.hasApps ? dockBackground.height : 0,
|
||||||
|
"slideX": dockSlide.x,
|
||||||
|
"slideY": dockSlide.y
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function _syncDockSlide() {
|
||||||
|
if (!dock._dockScreenName || !SettingsData.connectedFrameModeActive)
|
||||||
|
return;
|
||||||
|
ConnectedModeState.setDockSlide(dock._dockScreenName, dockSlide.x, dockSlide.y);
|
||||||
|
}
|
||||||
|
|
||||||
property bool contextMenuOpen: (dockVariants.contextMenu && dockVariants.contextMenu.visible && dockVariants.contextMenu.screen === modelData)
|
property bool contextMenuOpen: (dockVariants.contextMenu && dockVariants.contextMenu.visible && dockVariants.contextMenu.screen === modelData)
|
||||||
property bool revealSticky: false
|
property bool revealSticky: false
|
||||||
|
|
||||||
@@ -130,7 +237,7 @@ Variants {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
const screenName = dock.modelData?.name ?? "";
|
const screenName = dock.modelData?.name ?? "";
|
||||||
const dockThickness = effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin;
|
const dockThickness = dock.connectedJoinInset + effectiveBarHeight + SettingsData.dockSpacing + dock.effectiveDockBottomGap + dock.effectiveDockMargin;
|
||||||
const screenWidth = dock.screen?.width ?? 0;
|
const screenWidth = dock.screen?.width ?? 0;
|
||||||
const screenHeight = dock.screen?.height ?? 0;
|
const screenHeight = dock.screen?.height ?? 0;
|
||||||
|
|
||||||
@@ -281,6 +388,23 @@ Variants {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: Qt.callLater(() => dock._syncDockChromeState())
|
||||||
|
Component.onDestruction: ConnectedModeState.clearDockState(dock._dockScreenName)
|
||||||
|
|
||||||
|
onRevealChanged: dock._syncDockChromeState()
|
||||||
|
onWidthChanged: dock._syncDockChromeState()
|
||||||
|
onHeightChanged: dock._syncDockChromeState()
|
||||||
|
onVisibleChanged: dock._syncDockChromeState()
|
||||||
|
onHasAppsChanged: dock._syncDockChromeState()
|
||||||
|
onConnectedBarSideChanged: dock._syncDockChromeState()
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: SettingsData
|
||||||
|
function onConnectedFrameModeActiveChanged() {
|
||||||
|
dock._syncDockChromeState();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: SettingsData
|
target: SettingsData
|
||||||
function onDockTransparencyChanged() {
|
function onDockTransparencyChanged() {
|
||||||
@@ -302,13 +426,13 @@ Variants {
|
|||||||
return -1;
|
return -1;
|
||||||
if (barSpacing > 0)
|
if (barSpacing > 0)
|
||||||
return -1;
|
return -1;
|
||||||
return px(effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin);
|
return px(connectedJoinInset + effectiveBarHeight + SettingsData.dockSpacing + effectiveDockBottomGap + effectiveDockMargin);
|
||||||
}
|
}
|
||||||
|
|
||||||
property real animationHeadroom: Math.ceil(SettingsData.dockIconSize * 0.35)
|
property real animationHeadroom: Math.ceil(SettingsData.dockIconSize * 0.35)
|
||||||
|
|
||||||
implicitWidth: isVertical ? (px(effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockMargin + SettingsData.dockIconSize * 0.3) + animationHeadroom) : 0
|
implicitWidth: isVertical ? (px(connectedJoinInset + effectiveBarHeight + SettingsData.dockSpacing + effectiveDockMargin + SettingsData.dockIconSize * 0.3) + animationHeadroom) : 0
|
||||||
implicitHeight: !isVertical ? (px(effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockMargin + SettingsData.dockIconSize * 0.3) + animationHeadroom) : 0
|
implicitHeight: !isVertical ? (px(connectedJoinInset + effectiveBarHeight + SettingsData.dockSpacing + effectiveDockMargin + SettingsData.dockIconSize * 0.3) + animationHeadroom) : 0
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: maskItem
|
id: maskItem
|
||||||
@@ -318,17 +442,17 @@ Variants {
|
|||||||
x: {
|
x: {
|
||||||
const baseX = dockCore.x + dockMouseArea.x;
|
const baseX = dockCore.x + dockMouseArea.x;
|
||||||
if (isVertical && SettingsData.dockPosition === SettingsData.Position.Right)
|
if (isVertical && SettingsData.dockPosition === SettingsData.Position.Right)
|
||||||
return baseX - (expanded ? animationHeadroom + borderThickness : 0);
|
return baseX - (expanded ? animationHeadroom + borderThickness + dock.horizontalConnectorExtent : 0);
|
||||||
return baseX - (expanded ? borderThickness : 0);
|
return baseX - (expanded ? borderThickness + dock.horizontalConnectorExtent : 0);
|
||||||
}
|
}
|
||||||
y: {
|
y: {
|
||||||
const baseY = dockCore.y + dockMouseArea.y;
|
const baseY = dockCore.y + dockMouseArea.y;
|
||||||
if (!isVertical && SettingsData.dockPosition === SettingsData.Position.Bottom)
|
if (!isVertical && SettingsData.dockPosition === SettingsData.Position.Bottom)
|
||||||
return baseY - (expanded ? animationHeadroom + borderThickness : 0);
|
return baseY - (expanded ? animationHeadroom + borderThickness + dock.verticalConnectorExtent : 0);
|
||||||
return baseY - (expanded ? borderThickness : 0);
|
return baseY - (expanded ? borderThickness + dock.verticalConnectorExtent : 0);
|
||||||
}
|
}
|
||||||
width: dockMouseArea.width + (isVertical && expanded ? animationHeadroom : 0) + (expanded ? borderThickness * 2 : 0)
|
width: dockMouseArea.width + (isVertical && expanded ? animationHeadroom : 0) + (expanded ? borderThickness * 2 + dock.horizontalConnectorExtent * 2 : 0)
|
||||||
height: dockMouseArea.height + (!isVertical && expanded ? animationHeadroom : 0) + (expanded ? borderThickness * 2 : 0)
|
height: dockMouseArea.height + (!isVertical && expanded ? animationHeadroom : 0) + (expanded ? borderThickness * 2 + dock.verticalConnectorExtent * 2 : 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
mask: Region {
|
mask: Region {
|
||||||
@@ -388,7 +512,7 @@ Variants {
|
|||||||
const screenHeight = dock.screen ? dock.screen.height : 0;
|
const screenHeight = dock.screen ? dock.screen.height : 0;
|
||||||
|
|
||||||
const gap = Theme.spacingS;
|
const gap = Theme.spacingS;
|
||||||
const bgMargin = barSpacing + SettingsData.dockMargin + 1 + dock.borderThickness;
|
const bgMargin = dock.joinedEdgeMargin + dock.connectedJoinInset;
|
||||||
const btnW = dock.hoveredButton.width;
|
const btnW = dock.hoveredButton.width;
|
||||||
const btnH = dock.hoveredButton.height;
|
const btnH = dock.hoveredButton.height;
|
||||||
|
|
||||||
@@ -459,11 +583,11 @@ Variants {
|
|||||||
// Keep the taller hit area regardless of the reveal state to prevent shrinking loop
|
// Keep the taller hit area regardless of the reveal state to prevent shrinking loop
|
||||||
return Math.min(Math.max(dockBackground.height + 64, 200), maxDockHeight);
|
return Math.min(Math.max(dockBackground.height + 64, 200), maxDockHeight);
|
||||||
}
|
}
|
||||||
return dock.reveal ? px(dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin) : 1;
|
return dock.reveal ? px(dock.connectedJoinInset + dock.effectiveBarHeight + SettingsData.dockSpacing + dock.effectiveDockBottomGap + dock.effectiveDockMargin) : 1;
|
||||||
}
|
}
|
||||||
width: {
|
width: {
|
||||||
if (dock.isVertical) {
|
if (dock.isVertical) {
|
||||||
return dock.reveal ? px(dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin) : 1;
|
return dock.reveal ? px(dock.connectedJoinInset + dock.effectiveBarHeight + SettingsData.dockSpacing + dock.effectiveDockBottomGap + dock.effectiveDockMargin) : 1;
|
||||||
}
|
}
|
||||||
// Keep the wider hit area regardless of the reveal state to prevent shrinking loop
|
// Keep the wider hit area regardless of the reveal state to prevent shrinking loop
|
||||||
return Math.min(dockBackground.width + 8 + dock.borderThickness, maxDockWidth);
|
return Math.min(dockBackground.width + 8 + dock.borderThickness, maxDockWidth);
|
||||||
@@ -505,7 +629,11 @@ Variants {
|
|||||||
return 0;
|
return 0;
|
||||||
if (dock.reveal)
|
if (dock.reveal)
|
||||||
return 0;
|
return 0;
|
||||||
const hideDistance = dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin + 10;
|
if (Theme.isConnectedEffect) {
|
||||||
|
const retractDist = dockBackground.width + SettingsData.dockSpacing + 10;
|
||||||
|
return SettingsData.dockPosition === SettingsData.Position.Right ? retractDist : -retractDist;
|
||||||
|
}
|
||||||
|
const hideDistance = dock.connectedJoinInset + dock.effectiveBarHeight + SettingsData.dockSpacing + dock.effectiveDockBottomGap + dock.effectiveDockMargin + 10;
|
||||||
if (SettingsData.dockPosition === SettingsData.Position.Right) {
|
if (SettingsData.dockPosition === SettingsData.Position.Right) {
|
||||||
return hideDistance;
|
return hideDistance;
|
||||||
} else {
|
} else {
|
||||||
@@ -517,7 +645,11 @@ Variants {
|
|||||||
return 0;
|
return 0;
|
||||||
if (dock.reveal)
|
if (dock.reveal)
|
||||||
return 0;
|
return 0;
|
||||||
const hideDistance = dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin + 10;
|
if (Theme.isConnectedEffect) {
|
||||||
|
const retractDist = dockBackground.height + SettingsData.dockSpacing + 10;
|
||||||
|
return SettingsData.dockPosition === SettingsData.Position.Bottom ? retractDist : -retractDist;
|
||||||
|
}
|
||||||
|
const hideDistance = dock.connectedJoinInset + dock.effectiveBarHeight + SettingsData.dockSpacing + dock.effectiveDockBottomGap + dock.effectiveDockMargin + 10;
|
||||||
if (SettingsData.dockPosition === SettingsData.Position.Bottom) {
|
if (SettingsData.dockPosition === SettingsData.Position.Bottom) {
|
||||||
return hideDistance;
|
return hideDistance;
|
||||||
} else {
|
} else {
|
||||||
@@ -528,18 +660,29 @@ Variants {
|
|||||||
Behavior on x {
|
Behavior on x {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
id: slideXAnimation
|
id: slideXAnimation
|
||||||
duration: Theme.shortDuration
|
duration: Theme.isConnectedEffect ? Theme.variantDuration(Theme.popoutAnimationDuration, dock.reveal) : Theme.shortDuration
|
||||||
easing.type: Easing.OutCubic
|
easing.type: Theme.isConnectedEffect ? Easing.BezierSpline : Easing.OutCubic
|
||||||
|
easing.bezierCurve: Theme.isConnectedEffect ? (dock.reveal ? Theme.variantPopoutEnterCurve : Theme.variantPopoutExitCurve) : []
|
||||||
|
onRunningChanged: if (!running) dock._syncDockChromeState()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on y {
|
Behavior on y {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
id: slideYAnimation
|
id: slideYAnimation
|
||||||
duration: Theme.shortDuration
|
duration: Theme.isConnectedEffect ? Theme.variantDuration(Theme.popoutAnimationDuration, dock.reveal) : Theme.shortDuration
|
||||||
easing.type: Easing.OutCubic
|
easing.type: Theme.isConnectedEffect ? Easing.BezierSpline : Easing.OutCubic
|
||||||
|
easing.bezierCurve: Theme.isConnectedEffect ? (dock.reveal ? Theme.variantPopoutEnterCurve : Theme.variantPopoutExitCurve) : []
|
||||||
|
onRunningChanged: if (!running) dock._syncDockChromeState()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onXChanged: {
|
||||||
|
dock._syncDockSlide();
|
||||||
|
}
|
||||||
|
onYChanged: {
|
||||||
|
dock._syncDockSlide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
@@ -553,33 +696,72 @@ Variants {
|
|||||||
right: dock.isVertical ? (SettingsData.dockPosition === SettingsData.Position.Right ? parent.right : undefined) : undefined
|
right: dock.isVertical ? (SettingsData.dockPosition === SettingsData.Position.Right ? parent.right : undefined) : undefined
|
||||||
verticalCenter: dock.isVertical ? parent.verticalCenter : undefined
|
verticalCenter: dock.isVertical ? parent.verticalCenter : undefined
|
||||||
}
|
}
|
||||||
anchors.topMargin: !dock.isVertical && SettingsData.dockPosition === SettingsData.Position.Top ? barSpacing + SettingsData.dockMargin + 1 + dock.borderThickness : 0
|
anchors.topMargin: !dock.isVertical && SettingsData.dockPosition === SettingsData.Position.Top ? (dock.connectedJoinInset + dock.joinedEdgeMargin) : 0
|
||||||
anchors.bottomMargin: !dock.isVertical && SettingsData.dockPosition === SettingsData.Position.Bottom ? barSpacing + SettingsData.dockMargin + 1 + dock.borderThickness : 0
|
anchors.bottomMargin: !dock.isVertical && SettingsData.dockPosition === SettingsData.Position.Bottom ? (dock.connectedJoinInset + dock.joinedEdgeMargin) : 0
|
||||||
anchors.leftMargin: dock.isVertical && SettingsData.dockPosition === SettingsData.Position.Left ? barSpacing + SettingsData.dockMargin + 1 + dock.borderThickness : 0
|
anchors.leftMargin: dock.isVertical && SettingsData.dockPosition === SettingsData.Position.Left ? (dock.connectedJoinInset + dock.joinedEdgeMargin) : 0
|
||||||
anchors.rightMargin: dock.isVertical && SettingsData.dockPosition === SettingsData.Position.Right ? barSpacing + SettingsData.dockMargin + 1 + dock.borderThickness : 0
|
anchors.rightMargin: dock.isVertical && SettingsData.dockPosition === SettingsData.Position.Right ? (dock.connectedJoinInset + dock.joinedEdgeMargin) : 0
|
||||||
|
|
||||||
implicitWidth: dock.isVertical ? (dockApps.implicitHeight + SettingsData.dockSpacing * 2) : (dockApps.implicitWidth + SettingsData.dockSpacing * 2)
|
implicitWidth: dock.isVertical ? (dockApps.implicitHeight + SettingsData.dockSpacing * 2) : (dockApps.implicitWidth + SettingsData.dockSpacing * 2)
|
||||||
implicitHeight: dock.isVertical ? (dockApps.implicitWidth + SettingsData.dockSpacing * 2) : (dockApps.implicitHeight + SettingsData.dockSpacing * 2)
|
implicitHeight: dock.isVertical ? (dockApps.implicitWidth + SettingsData.dockSpacing * 2) : (dockApps.implicitHeight + SettingsData.dockSpacing * 2)
|
||||||
width: implicitWidth
|
width: implicitWidth
|
||||||
height: implicitHeight
|
height: implicitHeight
|
||||||
|
|
||||||
layer.enabled: true
|
// Avoid an offscreen texture seam where the connected dock meets the frame.
|
||||||
|
layer.enabled: !Theme.isConnectedEffect
|
||||||
clip: false
|
clip: false
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: Theme.withAlpha(Theme.surfaceContainer, backgroundTransparency)
|
visible: !SettingsData.connectedFrameModeActive
|
||||||
radius: Theme.cornerRadius
|
color: dock.surfaceColor
|
||||||
|
topLeftRadius: dock.surfaceTopLeftRadius
|
||||||
|
topRightRadius: dock.surfaceTopRightRadius
|
||||||
|
bottomLeftRadius: dock.surfaceBottomLeftRadius
|
||||||
|
bottomRightRadius: dock.surfaceBottomRightRadius
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
visible: !SettingsData.connectedFrameModeActive
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
radius: Theme.cornerRadius
|
topLeftRadius: dock.surfaceTopLeftRadius
|
||||||
border.color: BlurService.borderColor
|
topRightRadius: dock.surfaceTopRightRadius
|
||||||
border.width: BlurService.borderWidth
|
bottomLeftRadius: dock.surfaceBottomLeftRadius
|
||||||
|
bottomRightRadius: dock.surfaceBottomRightRadius
|
||||||
|
border.color: dock.surfaceBorderColor
|
||||||
|
border.width: dock.surfaceBorderWidth
|
||||||
z: 100
|
z: 100
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Sync dockBackground geometry to ConnectedModeState
|
||||||
|
onXChanged: dock._syncDockChromeState()
|
||||||
|
onYChanged: dock._syncDockChromeState()
|
||||||
|
onWidthChanged: dock._syncDockChromeState()
|
||||||
|
onHeightChanged: dock._syncDockChromeState()
|
||||||
|
}
|
||||||
|
|
||||||
|
ConnectedCorner {
|
||||||
|
visible: Theme.isConnectedEffect && dock.reveal && !SettingsData.connectedFrameModeActive
|
||||||
|
barSide: dock.connectedBarSide
|
||||||
|
placement: "left"
|
||||||
|
spacing: 0
|
||||||
|
connectorRadius: Theme.connectedCornerRadius
|
||||||
|
color: dock.surfaceColor
|
||||||
|
dpr: dock._dpr
|
||||||
|
x: Theme.snap(dock.connectorX(dockBackground.x, dockBackground.width, placement, spacing), dock._dpr)
|
||||||
|
y: Theme.snap(dock.connectorY(dockBackground.y, dockBackground.height, placement, spacing), dock._dpr)
|
||||||
|
}
|
||||||
|
|
||||||
|
ConnectedCorner {
|
||||||
|
visible: Theme.isConnectedEffect && dock.reveal && !SettingsData.connectedFrameModeActive
|
||||||
|
barSide: dock.connectedBarSide
|
||||||
|
placement: "right"
|
||||||
|
spacing: 0
|
||||||
|
connectorRadius: Theme.connectedCornerRadius
|
||||||
|
color: dock.surfaceColor
|
||||||
|
dpr: dock._dpr
|
||||||
|
x: Theme.snap(dock.connectorX(dockBackground.x, dockBackground.width, placement, spacing), dock._dpr)
|
||||||
|
y: Theme.snap(dock.connectorY(dockBackground.y, dockBackground.height, placement, spacing), dock._dpr)
|
||||||
}
|
}
|
||||||
|
|
||||||
Shape {
|
Shape {
|
||||||
@@ -588,12 +770,12 @@ Variants {
|
|||||||
y: dockBackground.y - borderThickness
|
y: dockBackground.y - borderThickness
|
||||||
width: dockBackground.width + borderThickness * 2
|
width: dockBackground.width + borderThickness * 2
|
||||||
height: dockBackground.height + borderThickness * 2
|
height: dockBackground.height + borderThickness * 2
|
||||||
visible: SettingsData.dockBorderEnabled && dock.hasApps
|
visible: SettingsData.dockBorderEnabled && dock.hasApps && !Theme.isConnectedEffect
|
||||||
preferredRendererType: Shape.CurveRenderer
|
preferredRendererType: Shape.CurveRenderer
|
||||||
|
|
||||||
readonly property real borderThickness: Math.max(1, dock.borderThickness)
|
readonly property real borderThickness: Math.max(1, dock.borderThickness)
|
||||||
readonly property real i: borderThickness / 2
|
readonly property real i: borderThickness / 2
|
||||||
readonly property real cr: Theme.cornerRadius
|
readonly property real cr: dock.surfaceRadius
|
||||||
readonly property real w: dockBackground.width
|
readonly property real w: dockBackground.width
|
||||||
readonly property real h: dockBackground.height
|
readonly property real h: dockBackground.height
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
import Quickshell
|
||||||
|
import qs.Common
|
||||||
|
|
||||||
|
Variants {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
model: Quickshell.screens
|
||||||
|
|
||||||
|
FrameInstance {
|
||||||
|
required property var modelData
|
||||||
|
|
||||||
|
screen: modelData
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Effects
|
||||||
|
import qs.Common
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
|
required property real cutoutTopInset
|
||||||
|
required property real cutoutBottomInset
|
||||||
|
required property real cutoutLeftInset
|
||||||
|
required property real cutoutRightInset
|
||||||
|
required property real cutoutRadius
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: borderRect
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
// Bake frameOpacity into the color alpha rather than using the `opacity` property.
|
||||||
|
// Qt Quick can skip layer.effect processing on items with opacity < 1 as an
|
||||||
|
// optimization, causing the MultiEffect inverted mask to stop working and the
|
||||||
|
// Rectangle to render as a plain square at low opacity values.
|
||||||
|
color: Qt.rgba(SettingsData.effectiveFrameColor.r,
|
||||||
|
SettingsData.effectiveFrameColor.g,
|
||||||
|
SettingsData.effectiveFrameColor.b,
|
||||||
|
SettingsData.frameOpacity)
|
||||||
|
|
||||||
|
layer.enabled: true
|
||||||
|
layer.effect: MultiEffect {
|
||||||
|
maskSource: cutoutMask
|
||||||
|
maskEnabled: true
|
||||||
|
maskInverted: true
|
||||||
|
maskThresholdMin: 0.5
|
||||||
|
maskSpreadAtMin: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: cutoutMask
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
layer.enabled: true
|
||||||
|
visible: false
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
anchors {
|
||||||
|
fill: parent
|
||||||
|
topMargin: root.cutoutTopInset
|
||||||
|
bottomMargin: root.cutoutBottomInset
|
||||||
|
leftMargin: root.cutoutLeftInset
|
||||||
|
rightMargin: root.cutoutRightInset
|
||||||
|
}
|
||||||
|
radius: root.cutoutRadius
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
import Quickshell
|
||||||
|
import Quickshell.Wayland
|
||||||
|
import qs.Common
|
||||||
|
|
||||||
|
Scope {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
required property var screen
|
||||||
|
|
||||||
|
readonly property var barEdges: {
|
||||||
|
SettingsData.barConfigs; // force re-eval when bar configs change
|
||||||
|
return SettingsData.getActiveBarEdgesForScreen(screen);
|
||||||
|
}
|
||||||
|
|
||||||
|
// One thin invisible PanelWindow per edge.
|
||||||
|
// Skips any edge where a bar already provides its own exclusiveZone.
|
||||||
|
|
||||||
|
readonly property bool screenEnabled: SettingsData.frameEnabled && SettingsData.isScreenInPreferences(root.screen, SettingsData.frameScreenPreferences)
|
||||||
|
|
||||||
|
Loader {
|
||||||
|
active: root.screenEnabled && !root.barEdges.includes("top")
|
||||||
|
sourceComponent: EdgeExclusion {
|
||||||
|
targetScreen: root.screen
|
||||||
|
anchorTop: true
|
||||||
|
anchorLeft: true
|
||||||
|
anchorRight: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Loader {
|
||||||
|
active: root.screenEnabled && !root.barEdges.includes("bottom")
|
||||||
|
sourceComponent: EdgeExclusion {
|
||||||
|
targetScreen: root.screen
|
||||||
|
anchorBottom: true
|
||||||
|
anchorLeft: true
|
||||||
|
anchorRight: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Loader {
|
||||||
|
active: root.screenEnabled && !root.barEdges.includes("left")
|
||||||
|
sourceComponent: EdgeExclusion {
|
||||||
|
targetScreen: root.screen
|
||||||
|
anchorLeft: true
|
||||||
|
anchorTop: true
|
||||||
|
anchorBottom: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Loader {
|
||||||
|
active: root.screenEnabled && !root.barEdges.includes("right")
|
||||||
|
sourceComponent: EdgeExclusion {
|
||||||
|
targetScreen: root.screen
|
||||||
|
anchorRight: true
|
||||||
|
anchorTop: true
|
||||||
|
anchorBottom: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
component EdgeExclusion: PanelWindow {
|
||||||
|
required property var targetScreen
|
||||||
|
|
||||||
|
screen: targetScreen
|
||||||
|
property bool anchorTop: false
|
||||||
|
property bool anchorBottom: false
|
||||||
|
property bool anchorLeft: false
|
||||||
|
property bool anchorRight: false
|
||||||
|
|
||||||
|
WlrLayershell.namespace: "dms:frame-exclusion"
|
||||||
|
WlrLayershell.layer: WlrLayer.Top
|
||||||
|
exclusiveZone: SettingsData.frameThickness
|
||||||
|
color: "transparent"
|
||||||
|
mask: Region {}
|
||||||
|
implicitWidth: 1
|
||||||
|
implicitHeight: 1
|
||||||
|
|
||||||
|
anchors {
|
||||||
|
top: anchorTop
|
||||||
|
bottom: anchorBottom
|
||||||
|
left: anchorLeft
|
||||||
|
right: anchorRight
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
import Quickshell
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
required property var screen
|
||||||
|
|
||||||
|
FrameWindow {
|
||||||
|
targetScreen: root.screen
|
||||||
|
}
|
||||||
|
|
||||||
|
FrameExclusions {
|
||||||
|
screen: root.screen
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,637 @@
|
|||||||
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
import Quickshell
|
||||||
|
import Quickshell.Wayland
|
||||||
|
import qs.Common
|
||||||
|
import qs.Services
|
||||||
|
import qs.Widgets
|
||||||
|
|
||||||
|
PanelWindow {
|
||||||
|
id: win
|
||||||
|
|
||||||
|
required property var targetScreen
|
||||||
|
|
||||||
|
screen: targetScreen
|
||||||
|
visible: true
|
||||||
|
|
||||||
|
WlrLayershell.namespace: "dms:frame"
|
||||||
|
WlrLayershell.layer: WlrLayer.Top
|
||||||
|
WlrLayershell.exclusionMode: ExclusionMode.Ignore
|
||||||
|
|
||||||
|
anchors {
|
||||||
|
top: true
|
||||||
|
bottom: true
|
||||||
|
left: true
|
||||||
|
right: true
|
||||||
|
}
|
||||||
|
|
||||||
|
color: "transparent"
|
||||||
|
mask: Region {}
|
||||||
|
|
||||||
|
readonly property var barEdges: {
|
||||||
|
SettingsData.barConfigs;
|
||||||
|
return SettingsData.getActiveBarEdgesForScreen(win.screen);
|
||||||
|
}
|
||||||
|
|
||||||
|
readonly property real _dpr: CompositorService.getScreenScale(win.screen)
|
||||||
|
readonly property bool _frameActive: SettingsData.frameEnabled && SettingsData.isScreenInPreferences(win.screen, SettingsData.frameScreenPreferences)
|
||||||
|
readonly property int _windowRegionWidth: win._regionInt(win.width)
|
||||||
|
readonly property int _windowRegionHeight: win._regionInt(win.height)
|
||||||
|
readonly property string _screenName: win.screen ? win.screen.name : ""
|
||||||
|
readonly property var _dockState: ConnectedModeState.dockStates[win._screenName] || ConnectedModeState.emptyDockState
|
||||||
|
readonly property var _dockSlide: ConnectedModeState.dockSlides[win._screenName] || ({
|
||||||
|
"x": 0,
|
||||||
|
"y": 0
|
||||||
|
})
|
||||||
|
|
||||||
|
// ─── Connected chrome convenience properties ──────────────────────────────
|
||||||
|
readonly property bool _connectedActive: win._frameActive && SettingsData.connectedFrameModeActive
|
||||||
|
readonly property string _barSide: {
|
||||||
|
const edges = win.barEdges;
|
||||||
|
if (edges.includes("top"))
|
||||||
|
return "top";
|
||||||
|
if (edges.includes("bottom"))
|
||||||
|
return "bottom";
|
||||||
|
if (edges.includes("left"))
|
||||||
|
return "left";
|
||||||
|
return "right";
|
||||||
|
}
|
||||||
|
readonly property real _ccr: Theme.connectedCornerRadius
|
||||||
|
readonly property real _effectivePopoutCcr: {
|
||||||
|
const extent = win._popoutArcExtent();
|
||||||
|
const isHoriz = ConnectedModeState.popoutBarSide === "top" || ConnectedModeState.popoutBarSide === "bottom";
|
||||||
|
const crossSize = isHoriz ? _popoutBodyBlurAnchor.width : _popoutBodyBlurAnchor.height;
|
||||||
|
return Math.max(0, Math.min(win._ccr, extent, crossSize / 2));
|
||||||
|
}
|
||||||
|
readonly property color _surfaceColor: Theme.connectedSurfaceColor
|
||||||
|
readonly property real _surfaceOpacity: _surfaceColor.a
|
||||||
|
readonly property color _opaqueSurfaceColor: Qt.rgba(_surfaceColor.r, _surfaceColor.g, _surfaceColor.b, 1)
|
||||||
|
readonly property real _surfaceRadius: Theme.connectedSurfaceRadius
|
||||||
|
readonly property real _seamOverlap: Theme.hairline(win._dpr)
|
||||||
|
|
||||||
|
function _regionInt(value) {
|
||||||
|
return Math.max(0, Math.round(Theme.px(value, win._dpr)));
|
||||||
|
}
|
||||||
|
|
||||||
|
readonly property int cutoutTopInset: win._regionInt(barEdges.includes("top") ? SettingsData.frameBarSize : SettingsData.frameThickness)
|
||||||
|
readonly property int cutoutBottomInset: win._regionInt(barEdges.includes("bottom") ? SettingsData.frameBarSize : SettingsData.frameThickness)
|
||||||
|
readonly property int cutoutLeftInset: win._regionInt(barEdges.includes("left") ? SettingsData.frameBarSize : SettingsData.frameThickness)
|
||||||
|
readonly property int cutoutRightInset: win._regionInt(barEdges.includes("right") ? SettingsData.frameBarSize : SettingsData.frameThickness)
|
||||||
|
readonly property int cutoutWidth: Math.max(0, win._windowRegionWidth - win.cutoutLeftInset - win.cutoutRightInset)
|
||||||
|
readonly property int cutoutHeight: Math.max(0, win._windowRegionHeight - win.cutoutTopInset - win.cutoutBottomInset)
|
||||||
|
readonly property int cutoutRadius: {
|
||||||
|
const requested = win._regionInt(SettingsData.frameRounding);
|
||||||
|
const maxRadius = Math.floor(Math.min(win.cutoutWidth, win.cutoutHeight) / 2);
|
||||||
|
return Math.max(0, Math.min(requested, maxRadius));
|
||||||
|
}
|
||||||
|
|
||||||
|
readonly property int _blurCutoutCompensation: SettingsData.frameOpacity <= 0.2 ? 1 : 0
|
||||||
|
readonly property int _blurCutoutLeft: Math.max(0, win.cutoutLeftInset - win._blurCutoutCompensation)
|
||||||
|
readonly property int _blurCutoutTop: Math.max(0, win.cutoutTopInset - win._blurCutoutCompensation)
|
||||||
|
readonly property int _blurCutoutRight: Math.min(win._windowRegionWidth, win._windowRegionWidth - win.cutoutRightInset + win._blurCutoutCompensation)
|
||||||
|
readonly property int _blurCutoutBottom: Math.min(win._windowRegionHeight, win._windowRegionHeight - win.cutoutBottomInset + win._blurCutoutCompensation)
|
||||||
|
readonly property int _blurCutoutRadius: {
|
||||||
|
const requested = win.cutoutRadius + win._blurCutoutCompensation;
|
||||||
|
const maxRadius = Math.floor(Math.min(_blurCutout.width, _blurCutout.height) / 2);
|
||||||
|
return Math.max(0, Math.min(requested, maxRadius));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Invisible items providing scene coordinates for blur Region anchors
|
||||||
|
Item {
|
||||||
|
id: _blurCutout
|
||||||
|
x: win._blurCutoutLeft
|
||||||
|
y: win._blurCutoutTop
|
||||||
|
width: Math.max(0, win._blurCutoutRight - win._blurCutoutLeft)
|
||||||
|
height: Math.max(0, win._blurCutoutBottom - win._blurCutoutTop)
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: _popoutBodyBlurAnchor
|
||||||
|
visible: false
|
||||||
|
|
||||||
|
readonly property bool _active: ConnectedModeState.popoutVisible && ConnectedModeState.popoutScreen === win._screenName
|
||||||
|
|
||||||
|
readonly property real _dyClamp: (ConnectedModeState.popoutBarSide === "top" || ConnectedModeState.popoutBarSide === "bottom") ? Math.max(-ConnectedModeState.popoutBodyH, Math.min(ConnectedModeState.popoutAnimY * 1.02, ConnectedModeState.popoutBodyH)) : 0
|
||||||
|
readonly property real _dxClamp: (ConnectedModeState.popoutBarSide === "left" || ConnectedModeState.popoutBarSide === "right") ? Math.max(-ConnectedModeState.popoutBodyW, Math.min(ConnectedModeState.popoutAnimX * 1.02, ConnectedModeState.popoutBodyW)) : 0
|
||||||
|
|
||||||
|
x: _active ? ConnectedModeState.popoutBodyX + (ConnectedModeState.popoutBarSide === "right" ? _dxClamp : 0) : 0
|
||||||
|
y: _active ? ConnectedModeState.popoutBodyY + (ConnectedModeState.popoutBarSide === "bottom" ? _dyClamp : 0) : 0
|
||||||
|
width: _active ? Math.max(0, ConnectedModeState.popoutBodyW - Math.abs(_dxClamp)) : 0
|
||||||
|
height: _active ? Math.max(0, ConnectedModeState.popoutBodyH - Math.abs(_dyClamp)) : 0
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: _dockBodyBlurAnchor
|
||||||
|
visible: false
|
||||||
|
|
||||||
|
readonly property bool _active: win._dockState.reveal && win._dockState.bodyW > 0 && win._dockState.bodyH > 0
|
||||||
|
|
||||||
|
x: _active ? win._dockState.bodyX + (win._dockSlide.x || 0) : 0
|
||||||
|
y: _active ? win._dockState.bodyY + (win._dockSlide.y || 0) : 0
|
||||||
|
width: _active ? win._dockState.bodyW : 0
|
||||||
|
height: _active ? win._dockState.bodyH : 0
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: _popoutBodyBlurCap
|
||||||
|
opacity: 0
|
||||||
|
|
||||||
|
readonly property string _side: ConnectedModeState.popoutBarSide
|
||||||
|
readonly property real _capThickness: win._popoutBlurCapThickness()
|
||||||
|
readonly property bool _active: _popoutBodyBlurAnchor._active && _capThickness > 0 && _popoutBodyBlurAnchor.width > 0 && _popoutBodyBlurAnchor.height > 0
|
||||||
|
readonly property real _capWidth: (_side === "left" || _side === "right") ? Math.min(_capThickness, _popoutBodyBlurAnchor.width) : _popoutBodyBlurAnchor.width
|
||||||
|
readonly property real _capHeight: (_side === "top" || _side === "bottom") ? Math.min(_capThickness, _popoutBodyBlurAnchor.height) : _popoutBodyBlurAnchor.height
|
||||||
|
|
||||||
|
x: !_active ? 0 : (_side === "right" ? _popoutBodyBlurAnchor.x + _popoutBodyBlurAnchor.width - _capWidth : _popoutBodyBlurAnchor.x)
|
||||||
|
y: !_active ? 0 : (_side === "bottom" ? _popoutBodyBlurAnchor.y + _popoutBodyBlurAnchor.height - _capHeight : _popoutBodyBlurAnchor.y)
|
||||||
|
width: _active ? _capWidth : 0
|
||||||
|
height: _active ? _capHeight : 0
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: _dockBodyBlurCap
|
||||||
|
opacity: 0
|
||||||
|
|
||||||
|
readonly property string _side: win._dockState.barSide
|
||||||
|
readonly property bool _active: _dockBodyBlurAnchor._active && _dockBodyBlurAnchor.width > 0 && _dockBodyBlurAnchor.height > 0
|
||||||
|
readonly property real _capWidth: (_side === "left" || _side === "right") ? Math.min(win._dockConnectorRadius(), _dockBodyBlurAnchor.width) : _dockBodyBlurAnchor.width
|
||||||
|
readonly property real _capHeight: (_side === "top" || _side === "bottom") ? Math.min(win._dockConnectorRadius(), _dockBodyBlurAnchor.height) : _dockBodyBlurAnchor.height
|
||||||
|
|
||||||
|
x: !_active ? 0 : (_side === "right" ? _dockBodyBlurAnchor.x + _dockBodyBlurAnchor.width - _capWidth : _dockBodyBlurAnchor.x)
|
||||||
|
y: !_active ? 0 : (_side === "bottom" ? _dockBodyBlurAnchor.y + _dockBodyBlurAnchor.height - _capHeight : _dockBodyBlurAnchor.y)
|
||||||
|
width: _active ? _capWidth : 0
|
||||||
|
height: _active ? _capHeight : 0
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: _dockLeftConnectorBlurAnchor
|
||||||
|
opacity: 0
|
||||||
|
|
||||||
|
readonly property bool _active: _dockBodyBlurAnchor._active && win._dockConnectorRadius() > 0
|
||||||
|
readonly property real _w: win._dockConnectorWidth(0)
|
||||||
|
readonly property real _h: win._dockConnectorHeight(0)
|
||||||
|
|
||||||
|
x: _active ? Theme.snap(win._dockConnectorX(_dockBodyBlurAnchor.x, _dockBodyBlurAnchor.width, "left", 0), win._dpr) : 0
|
||||||
|
y: _active ? Theme.snap(win._dockConnectorY(_dockBodyBlurAnchor.y, _dockBodyBlurAnchor.height, "left", 0), win._dpr) : 0
|
||||||
|
width: _active ? _w : 0
|
||||||
|
height: _active ? _h : 0
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: _dockRightConnectorBlurAnchor
|
||||||
|
opacity: 0
|
||||||
|
|
||||||
|
readonly property bool _active: _dockBodyBlurAnchor._active && win._dockConnectorRadius() > 0
|
||||||
|
readonly property real _w: win._dockConnectorWidth(0)
|
||||||
|
readonly property real _h: win._dockConnectorHeight(0)
|
||||||
|
|
||||||
|
x: _active ? Theme.snap(win._dockConnectorX(_dockBodyBlurAnchor.x, _dockBodyBlurAnchor.width, "right", 0), win._dpr) : 0
|
||||||
|
y: _active ? Theme.snap(win._dockConnectorY(_dockBodyBlurAnchor.y, _dockBodyBlurAnchor.height, "right", 0), win._dpr) : 0
|
||||||
|
width: _active ? _w : 0
|
||||||
|
height: _active ? _h : 0
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: _dockLeftConnectorCutout
|
||||||
|
opacity: 0
|
||||||
|
|
||||||
|
readonly property bool _active: _dockLeftConnectorBlurAnchor.width > 0 && _dockLeftConnectorBlurAnchor.height > 0
|
||||||
|
readonly property string _arcCorner: win._connectorArcCorner(win._dockState.barSide, "left")
|
||||||
|
|
||||||
|
x: _active ? win._connectorCutoutX(_dockLeftConnectorBlurAnchor.x, _dockLeftConnectorBlurAnchor.width, _arcCorner, win._dockConnectorRadius()) : 0
|
||||||
|
y: _active ? win._connectorCutoutY(_dockLeftConnectorBlurAnchor.y, _dockLeftConnectorBlurAnchor.height, _arcCorner, win._dockConnectorRadius()) : 0
|
||||||
|
width: _active ? win._dockConnectorRadius() * 2 : 0
|
||||||
|
height: _active ? win._dockConnectorRadius() * 2 : 0
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: _dockRightConnectorCutout
|
||||||
|
opacity: 0
|
||||||
|
|
||||||
|
readonly property bool _active: _dockRightConnectorBlurAnchor.width > 0 && _dockRightConnectorBlurAnchor.height > 0
|
||||||
|
readonly property string _arcCorner: win._connectorArcCorner(win._dockState.barSide, "right")
|
||||||
|
|
||||||
|
x: _active ? win._connectorCutoutX(_dockRightConnectorBlurAnchor.x, _dockRightConnectorBlurAnchor.width, _arcCorner, win._dockConnectorRadius()) : 0
|
||||||
|
y: _active ? win._connectorCutoutY(_dockRightConnectorBlurAnchor.y, _dockRightConnectorBlurAnchor.height, _arcCorner, win._dockConnectorRadius()) : 0
|
||||||
|
width: _active ? win._dockConnectorRadius() * 2 : 0
|
||||||
|
height: _active ? win._dockConnectorRadius() * 2 : 0
|
||||||
|
}
|
||||||
|
|
||||||
|
Region {
|
||||||
|
id: _staticBlurRegion
|
||||||
|
x: 0
|
||||||
|
y: 0
|
||||||
|
width: win._windowRegionWidth
|
||||||
|
height: win._windowRegionHeight
|
||||||
|
|
||||||
|
// Frame cutout (always active when frame is on)
|
||||||
|
Region {
|
||||||
|
item: _blurCutout
|
||||||
|
intersection: Intersection.Subtract
|
||||||
|
radius: win._blurCutoutRadius
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── Connected popout blur regions ──
|
||||||
|
Region {
|
||||||
|
item: _popoutBodyBlurAnchor
|
||||||
|
radius: win._surfaceRadius
|
||||||
|
}
|
||||||
|
Region {
|
||||||
|
item: _popoutBodyBlurCap
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── Connected dock blur regions ──
|
||||||
|
Region {
|
||||||
|
item: _dockBodyBlurAnchor
|
||||||
|
radius: win._dockBodyBlurRadius()
|
||||||
|
}
|
||||||
|
Region {
|
||||||
|
item: _dockBodyBlurCap
|
||||||
|
}
|
||||||
|
Region {
|
||||||
|
item: _dockLeftConnectorBlurAnchor
|
||||||
|
radius: win._dockConnectorRadius()
|
||||||
|
Region {
|
||||||
|
item: _dockLeftConnectorCutout
|
||||||
|
intersection: Intersection.Subtract
|
||||||
|
radius: win._dockConnectorRadius()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Region {
|
||||||
|
item: _dockRightConnectorBlurAnchor
|
||||||
|
radius: win._dockConnectorRadius()
|
||||||
|
Region {
|
||||||
|
item: _dockRightConnectorCutout
|
||||||
|
intersection: Intersection.Subtract
|
||||||
|
radius: win._dockConnectorRadius()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── Connector position helpers (dock) ─────────────────────────────────
|
||||||
|
|
||||||
|
function _dockBodyBlurRadius() {
|
||||||
|
return _dockBodyBlurAnchor._active ? Math.max(0, Math.min(win._surfaceRadius, _dockBodyBlurAnchor.width / 2, _dockBodyBlurAnchor.height / 2)) : win._surfaceRadius;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _dockConnectorRadius() {
|
||||||
|
if (!_dockBodyBlurAnchor._active)
|
||||||
|
return win._ccr;
|
||||||
|
const dockSide = win._dockState.barSide;
|
||||||
|
const thickness = (dockSide === "left" || dockSide === "right") ? _dockBodyBlurAnchor.width : _dockBodyBlurAnchor.height;
|
||||||
|
const bodyRadius = win._dockBodyBlurRadius();
|
||||||
|
const maxConnectorRadius = Math.max(0, thickness - bodyRadius - win._seamOverlap);
|
||||||
|
return Math.max(0, Math.min(win._ccr, bodyRadius, maxConnectorRadius));
|
||||||
|
}
|
||||||
|
|
||||||
|
function _dockConnectorWidth(spacing) {
|
||||||
|
const isVert = win._dockState.barSide === "left" || win._dockState.barSide === "right";
|
||||||
|
const radius = win._dockConnectorRadius();
|
||||||
|
return isVert ? (spacing + radius) : radius;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _dockConnectorHeight(spacing) {
|
||||||
|
const isVert = win._dockState.barSide === "left" || win._dockState.barSide === "right";
|
||||||
|
const radius = win._dockConnectorRadius();
|
||||||
|
return isVert ? radius : (spacing + radius);
|
||||||
|
}
|
||||||
|
|
||||||
|
function _dockConnectorX(baseX, bodyWidth, placement, spacing) {
|
||||||
|
const dockSide = win._dockState.barSide;
|
||||||
|
const isVert = dockSide === "left" || dockSide === "right";
|
||||||
|
const seamX = !isVert ? (placement === "left" ? baseX : baseX + bodyWidth) : (dockSide === "left" ? baseX : baseX + bodyWidth);
|
||||||
|
const w = _dockConnectorWidth(spacing);
|
||||||
|
if (!isVert)
|
||||||
|
return placement === "left" ? seamX - w : seamX;
|
||||||
|
return dockSide === "left" ? seamX : seamX - w;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _dockConnectorY(baseY, bodyHeight, placement, spacing) {
|
||||||
|
const dockSide = win._dockState.barSide;
|
||||||
|
const seamY = dockSide === "top" ? baseY : dockSide === "bottom" ? baseY + bodyHeight : (placement === "left" ? baseY : baseY + bodyHeight);
|
||||||
|
const h = _dockConnectorHeight(spacing);
|
||||||
|
if (dockSide === "top")
|
||||||
|
return seamY;
|
||||||
|
if (dockSide === "bottom")
|
||||||
|
return seamY - h;
|
||||||
|
return placement === "left" ? seamY - h : seamY;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _popoutFillOverlapX() {
|
||||||
|
return (ConnectedModeState.popoutBarSide === "top" || ConnectedModeState.popoutBarSide === "bottom") ? win._seamOverlap : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _popoutFillOverlapY() {
|
||||||
|
return (ConnectedModeState.popoutBarSide === "left" || ConnectedModeState.popoutBarSide === "right") ? win._seamOverlap : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _dockFillOverlapX() {
|
||||||
|
return (win._dockState.barSide === "top" || win._dockState.barSide === "bottom") ? win._seamOverlap : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _dockFillOverlapY() {
|
||||||
|
return (win._dockState.barSide === "left" || win._dockState.barSide === "right") ? win._seamOverlap : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _popoutArcExtent() {
|
||||||
|
return (ConnectedModeState.popoutBarSide === "top" || ConnectedModeState.popoutBarSide === "bottom") ? _popoutBodyBlurAnchor.height : _popoutBodyBlurAnchor.width;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _popoutArcVisible() {
|
||||||
|
if (!_popoutBodyBlurAnchor._active || _popoutBodyBlurAnchor.width <= 0 || _popoutBodyBlurAnchor.height <= 0)
|
||||||
|
return false;
|
||||||
|
return win._popoutArcExtent() >= win._ccr * (1 + win._ccr * 0.02);
|
||||||
|
}
|
||||||
|
|
||||||
|
function _popoutBlurCapThickness() {
|
||||||
|
const extent = win._popoutArcExtent();
|
||||||
|
return Math.max(0, Math.min(win._effectivePopoutCcr, extent - win._surfaceRadius));
|
||||||
|
}
|
||||||
|
|
||||||
|
function _popoutChromeX() {
|
||||||
|
const barSide = ConnectedModeState.popoutBarSide;
|
||||||
|
return ConnectedModeState.popoutBodyX - ((barSide === "top" || barSide === "bottom") ? win._effectivePopoutCcr : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
function _popoutChromeY() {
|
||||||
|
const barSide = ConnectedModeState.popoutBarSide;
|
||||||
|
return ConnectedModeState.popoutBodyY - ((barSide === "left" || barSide === "right") ? win._effectivePopoutCcr : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
function _popoutChromeWidth() {
|
||||||
|
const barSide = ConnectedModeState.popoutBarSide;
|
||||||
|
return ConnectedModeState.popoutBodyW + ((barSide === "top" || barSide === "bottom") ? win._effectivePopoutCcr * 2 : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
function _popoutChromeHeight() {
|
||||||
|
const barSide = ConnectedModeState.popoutBarSide;
|
||||||
|
return ConnectedModeState.popoutBodyH + ((barSide === "left" || barSide === "right") ? win._effectivePopoutCcr * 2 : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
function _popoutClipX() {
|
||||||
|
return _popoutBodyBlurAnchor.x - win._popoutChromeX() - win._popoutFillOverlapX();
|
||||||
|
}
|
||||||
|
|
||||||
|
function _popoutClipY() {
|
||||||
|
return _popoutBodyBlurAnchor.y - win._popoutChromeY() - win._popoutFillOverlapY();
|
||||||
|
}
|
||||||
|
|
||||||
|
function _popoutClipWidth() {
|
||||||
|
return _popoutBodyBlurAnchor.width + win._popoutFillOverlapX() * 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _popoutClipHeight() {
|
||||||
|
return _popoutBodyBlurAnchor.height + win._popoutFillOverlapY() * 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _popoutBodyXInClip() {
|
||||||
|
return (ConnectedModeState.popoutBarSide === "left" ? _popoutBodyBlurAnchor._dxClamp : 0) - win._popoutFillOverlapX();
|
||||||
|
}
|
||||||
|
|
||||||
|
function _popoutBodyYInClip() {
|
||||||
|
return (ConnectedModeState.popoutBarSide === "top" ? _popoutBodyBlurAnchor._dyClamp : 0) - win._popoutFillOverlapY();
|
||||||
|
}
|
||||||
|
|
||||||
|
function _popoutBodyFullWidth() {
|
||||||
|
return ConnectedModeState.popoutBodyW + win._popoutFillOverlapX() * 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _popoutBodyFullHeight() {
|
||||||
|
return ConnectedModeState.popoutBodyH + win._popoutFillOverlapY() * 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _dockChromeX() {
|
||||||
|
const dockSide = win._dockState.barSide;
|
||||||
|
return _dockBodyBlurAnchor.x - ((dockSide === "top" || dockSide === "bottom") ? win._dockConnectorRadius() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
function _dockChromeY() {
|
||||||
|
const dockSide = win._dockState.barSide;
|
||||||
|
return _dockBodyBlurAnchor.y - ((dockSide === "left" || dockSide === "right") ? win._dockConnectorRadius() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
function _dockChromeWidth() {
|
||||||
|
const dockSide = win._dockState.barSide;
|
||||||
|
return _dockBodyBlurAnchor.width + ((dockSide === "top" || dockSide === "bottom") ? win._dockConnectorRadius() * 2 : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
function _dockChromeHeight() {
|
||||||
|
const dockSide = win._dockState.barSide;
|
||||||
|
return _dockBodyBlurAnchor.height + ((dockSide === "left" || dockSide === "right") ? win._dockConnectorRadius() * 2 : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
function _dockBodyXInChrome() {
|
||||||
|
return ((win._dockState.barSide === "top" || win._dockState.barSide === "bottom") ? win._dockConnectorRadius() : 0) - win._dockFillOverlapX();
|
||||||
|
}
|
||||||
|
|
||||||
|
function _dockBodyYInChrome() {
|
||||||
|
return ((win._dockState.barSide === "left" || win._dockState.barSide === "right") ? win._dockConnectorRadius() : 0) - win._dockFillOverlapY();
|
||||||
|
}
|
||||||
|
|
||||||
|
function _connectorArcCorner(barSide, placement) {
|
||||||
|
if (barSide === "top")
|
||||||
|
return placement === "left" ? "bottomLeft" : "bottomRight";
|
||||||
|
if (barSide === "bottom")
|
||||||
|
return placement === "left" ? "topLeft" : "topRight";
|
||||||
|
if (barSide === "left")
|
||||||
|
return placement === "left" ? "topRight" : "bottomRight";
|
||||||
|
return placement === "left" ? "topLeft" : "bottomLeft";
|
||||||
|
}
|
||||||
|
|
||||||
|
function _connectorCutoutX(connectorX, connectorWidth, arcCorner, radius) {
|
||||||
|
const r = radius === undefined ? win._effectivePopoutCcr : radius;
|
||||||
|
return (arcCorner === "topLeft" || arcCorner === "bottomLeft") ? connectorX - r : connectorX + connectorWidth - r;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _connectorCutoutY(connectorY, connectorHeight, arcCorner, radius) {
|
||||||
|
const r = radius === undefined ? win._effectivePopoutCcr : radius;
|
||||||
|
return (arcCorner === "topLeft" || arcCorner === "topRight") ? connectorY - r : connectorY + connectorHeight - r;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── Blur build / teardown ────────────────────────────────────────────────
|
||||||
|
|
||||||
|
function _buildBlur() {
|
||||||
|
try {
|
||||||
|
if (!BlurService.enabled || !SettingsData.frameBlurEnabled || !win._frameActive || !win.visible) {
|
||||||
|
win.BackgroundEffect.blurRegion = null;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
win.BackgroundEffect.blurRegion = _staticBlurRegion;
|
||||||
|
} catch (e) {
|
||||||
|
console.warn("FrameWindow: Failed to set blur region:", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function _teardownBlur() {
|
||||||
|
try {
|
||||||
|
win.BackgroundEffect.blurRegion = null;
|
||||||
|
} catch (e) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: _blurRebuildTimer
|
||||||
|
interval: 1
|
||||||
|
onTriggered: win._buildBlur()
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: SettingsData
|
||||||
|
function onFrameBlurEnabledChanged() {
|
||||||
|
_blurRebuildTimer.restart();
|
||||||
|
}
|
||||||
|
function onFrameEnabledChanged() {
|
||||||
|
_blurRebuildTimer.restart();
|
||||||
|
}
|
||||||
|
function onFrameThicknessChanged() {
|
||||||
|
_blurRebuildTimer.restart();
|
||||||
|
}
|
||||||
|
function onFrameBarSizeChanged() {
|
||||||
|
_blurRebuildTimer.restart();
|
||||||
|
}
|
||||||
|
function onFrameOpacityChanged() {
|
||||||
|
_blurRebuildTimer.restart();
|
||||||
|
}
|
||||||
|
function onFrameRoundingChanged() {
|
||||||
|
_blurRebuildTimer.restart();
|
||||||
|
}
|
||||||
|
function onFrameScreenPreferencesChanged() {
|
||||||
|
_blurRebuildTimer.restart();
|
||||||
|
}
|
||||||
|
function onBarConfigsChanged() {
|
||||||
|
_blurRebuildTimer.restart();
|
||||||
|
}
|
||||||
|
function onConnectedFrameModeActiveChanged() {
|
||||||
|
_blurRebuildTimer.restart();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: BlurService
|
||||||
|
function onEnabledChanged() {
|
||||||
|
_blurRebuildTimer.restart();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onVisibleChanged: {
|
||||||
|
if (visible) {
|
||||||
|
_blurRebuildTimer.restart();
|
||||||
|
} else {
|
||||||
|
_teardownBlur();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: Qt.callLater(() => win._buildBlur())
|
||||||
|
Component.onDestruction: win._teardownBlur()
|
||||||
|
|
||||||
|
// ─── Frame border ─────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
FrameBorder {
|
||||||
|
anchors.fill: parent
|
||||||
|
visible: win._frameActive
|
||||||
|
cutoutTopInset: win.cutoutTopInset
|
||||||
|
cutoutBottomInset: win.cutoutBottomInset
|
||||||
|
cutoutLeftInset: win.cutoutLeftInset
|
||||||
|
cutoutRightInset: win.cutoutRightInset
|
||||||
|
cutoutRadius: win.cutoutRadius
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── Connected chrome fills ───────────────────────────────────────────────
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: _connectedChrome
|
||||||
|
anchors.fill: parent
|
||||||
|
visible: win._connectedActive
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: _popoutChrome
|
||||||
|
visible: ConnectedModeState.popoutVisible && ConnectedModeState.popoutScreen === win._screenName
|
||||||
|
x: win._popoutChromeX()
|
||||||
|
y: win._popoutChromeY()
|
||||||
|
width: win._popoutChromeWidth()
|
||||||
|
height: win._popoutChromeHeight()
|
||||||
|
opacity: win._surfaceOpacity
|
||||||
|
layer.enabled: opacity < 1
|
||||||
|
layer.smooth: false
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: _popoutClip
|
||||||
|
readonly property bool _barHoriz: ConnectedModeState.popoutBarSide === "top" || ConnectedModeState.popoutBarSide === "bottom"
|
||||||
|
// Expand clip by ccr on bar axis to include arc columns
|
||||||
|
x: win._popoutClipX() - (_barHoriz ? win._effectivePopoutCcr : 0)
|
||||||
|
y: win._popoutClipY() - (_barHoriz ? 0 : win._effectivePopoutCcr)
|
||||||
|
width: win._popoutClipWidth() + (_barHoriz ? win._effectivePopoutCcr * 2 : 0)
|
||||||
|
height: win._popoutClipHeight() + (_barHoriz ? 0 : win._effectivePopoutCcr * 2)
|
||||||
|
clip: true
|
||||||
|
|
||||||
|
ConnectedShape {
|
||||||
|
id: _popoutShape
|
||||||
|
visible: _popoutBodyBlurAnchor._active && _popoutBodyBlurAnchor.width > 0 && _popoutBodyBlurAnchor.height > 0
|
||||||
|
barSide: ConnectedModeState.popoutBarSide
|
||||||
|
bodyWidth: win._popoutClipWidth()
|
||||||
|
bodyHeight: win._popoutClipHeight()
|
||||||
|
connectorRadius: win._effectivePopoutCcr
|
||||||
|
surfaceRadius: win._surfaceRadius
|
||||||
|
fillColor: win._opaqueSurfaceColor
|
||||||
|
x: 0
|
||||||
|
y: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: _dockChrome
|
||||||
|
visible: _dockBodyBlurAnchor._active
|
||||||
|
x: win._dockChromeX()
|
||||||
|
y: win._dockChromeY()
|
||||||
|
width: win._dockChromeWidth()
|
||||||
|
height: win._dockChromeHeight()
|
||||||
|
opacity: win._surfaceOpacity
|
||||||
|
layer.enabled: opacity < 1
|
||||||
|
layer.smooth: false
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: _dockFill
|
||||||
|
x: win._dockBodyXInChrome()
|
||||||
|
y: win._dockBodyYInChrome()
|
||||||
|
width: _dockBodyBlurAnchor.width + win._dockFillOverlapX() * 2
|
||||||
|
height: _dockBodyBlurAnchor.height + win._dockFillOverlapY() * 2
|
||||||
|
color: win._opaqueSurfaceColor
|
||||||
|
z: 1
|
||||||
|
|
||||||
|
readonly property string _dockSide: win._dockState.barSide
|
||||||
|
readonly property real _dockRadius: win._dockBodyBlurRadius()
|
||||||
|
topLeftRadius: (_dockSide === "top" || _dockSide === "left") ? 0 : _dockRadius
|
||||||
|
topRightRadius: (_dockSide === "top" || _dockSide === "right") ? 0 : _dockRadius
|
||||||
|
bottomLeftRadius: (_dockSide === "bottom" || _dockSide === "left") ? 0 : _dockRadius
|
||||||
|
bottomRightRadius: (_dockSide === "bottom" || _dockSide === "right") ? 0 : _dockRadius
|
||||||
|
}
|
||||||
|
|
||||||
|
ConnectedCorner {
|
||||||
|
id: _connDockLeft
|
||||||
|
visible: _dockBodyBlurAnchor._active
|
||||||
|
barSide: win._dockState.barSide
|
||||||
|
placement: "left"
|
||||||
|
spacing: 0
|
||||||
|
connectorRadius: win._dockConnectorRadius()
|
||||||
|
color: win._opaqueSurfaceColor
|
||||||
|
dpr: win._dpr
|
||||||
|
x: Theme.snap(win._dockConnectorX(_dockBodyBlurAnchor.x, _dockBodyBlurAnchor.width, "left", 0) - _dockChrome.x, win._dpr)
|
||||||
|
y: Theme.snap(win._dockConnectorY(_dockBodyBlurAnchor.y, _dockBodyBlurAnchor.height, "left", 0) - _dockChrome.y, win._dpr)
|
||||||
|
}
|
||||||
|
|
||||||
|
ConnectedCorner {
|
||||||
|
id: _connDockRight
|
||||||
|
visible: _dockBodyBlurAnchor._active
|
||||||
|
barSide: win._dockState.barSide
|
||||||
|
placement: "right"
|
||||||
|
spacing: 0
|
||||||
|
connectorRadius: win._dockConnectorRadius()
|
||||||
|
color: win._opaqueSurfaceColor
|
||||||
|
dpr: win._dpr
|
||||||
|
x: Theme.snap(win._dockConnectorX(_dockBodyBlurAnchor.x, _dockBodyBlurAnchor.width, "right", 0) - _dockChrome.x, win._dpr)
|
||||||
|
y: Theme.snap(win._dockConnectorY(_dockBodyBlurAnchor.y, _dockBodyBlurAnchor.height, "right", 0) - _dockChrome.y, win._dpr)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1338,7 +1338,7 @@ Item {
|
|||||||
enabled: MprisController.activePlayer?.canGoPrevious ?? false
|
enabled: MprisController.activePlayer?.canGoPrevious ?? false
|
||||||
hoverEnabled: enabled
|
hoverEnabled: enabled
|
||||||
cursorShape: enabled ? Qt.PointingHandCursor : Qt.ArrowCursor
|
cursorShape: enabled ? Qt.PointingHandCursor : Qt.ArrowCursor
|
||||||
onClicked: MprisController.activePlayer?.previous()
|
onClicked: MprisController.previousOrRewind()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,11 +34,12 @@ Rectangle {
|
|||||||
readonly property real actionButtonHeight: compactMode ? 20 : 24
|
readonly property real actionButtonHeight: compactMode ? 20 : 24
|
||||||
readonly property real collapsedContentHeight: Math.max(iconSize, Theme.fontSizeSmall * 1.2 + Theme.fontSizeMedium * 1.2 + Theme.fontSizeSmall * 1.2 * (compactMode ? 1 : 2))
|
readonly property real collapsedContentHeight: Math.max(iconSize, Theme.fontSizeSmall * 1.2 + Theme.fontSizeMedium * 1.2 + Theme.fontSizeSmall * 1.2 * (compactMode ? 1 : 2))
|
||||||
readonly property real baseCardHeight: cardPadding * 2 + collapsedContentHeight + actionButtonHeight + contentSpacing
|
readonly property real baseCardHeight: cardPadding * 2 + collapsedContentHeight + actionButtonHeight + contentSpacing
|
||||||
|
readonly property bool connectedFrameMode: SettingsData.connectedFrameModeActive
|
||||||
|
|
||||||
width: parent ? parent.width : 400
|
width: parent ? parent.width : 400
|
||||||
height: expanded ? (expandedContent.height + cardPadding * 2) : (baseCardHeight + collapsedContent.extraHeight)
|
height: expanded ? (expandedContent.height + cardPadding * 2) : (baseCardHeight + collapsedContent.extraHeight)
|
||||||
readonly property real targetHeight: expanded ? (expandedContent.height + cardPadding * 2) : (baseCardHeight + collapsedContent.extraHeight)
|
readonly property real targetHeight: expanded ? (expandedContent.height + cardPadding * 2) : (baseCardHeight + collapsedContent.extraHeight)
|
||||||
radius: Theme.cornerRadius
|
radius: connectedFrameMode ? Theme.connectedSurfaceRadius : Theme.cornerRadius
|
||||||
scale: (cardHoverHandler.hovered ? 1.004 : 1.0) * listLevelAdjacentScaleInfluence
|
scale: (cardHoverHandler.hovered ? 1.004 : 1.0) * listLevelAdjacentScaleInfluence
|
||||||
readonly property bool shadowsAllowed: Theme.elevationEnabled && Quickshell.env("DMS_DISABLE_LAYER") !== "true" && Quickshell.env("DMS_DISABLE_LAYER") !== "1"
|
readonly property bool shadowsAllowed: Theme.elevationEnabled && Quickshell.env("DMS_DISABLE_LAYER") !== "true" && Quickshell.env("DMS_DISABLE_LAYER") !== "1"
|
||||||
readonly property var shadowElevation: Theme.elevationLevel1
|
readonly property var shadowElevation: Theme.elevationLevel1
|
||||||
@@ -100,6 +101,8 @@ Rectangle {
|
|||||||
if (keyboardNavigationActive && expanded && selectedNotificationIndex >= 0) {
|
if (keyboardNavigationActive && expanded && selectedNotificationIndex >= 0) {
|
||||||
return Theme.primaryHoverLight;
|
return Theme.primaryHoverLight;
|
||||||
}
|
}
|
||||||
|
if (connectedFrameMode)
|
||||||
|
return Theme.popupLayerColor(Theme.surfaceContainerHigh);
|
||||||
return Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency);
|
return Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency);
|
||||||
}
|
}
|
||||||
border.color: {
|
border.color: {
|
||||||
@@ -959,9 +962,9 @@ Rectangle {
|
|||||||
Behavior on height {
|
Behavior on height {
|
||||||
enabled: root.__initialized && root.userInitiatedExpansion && root.animateExpansion
|
enabled: root.__initialized && root.userInitiatedExpansion && root.animateExpansion
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: root.expanded ? Theme.notificationExpandDuration : Theme.notificationCollapseDuration
|
duration: root.connectedFrameMode ? Theme.variantDuration(Theme.popoutAnimationDuration, root.expanded) : (root.expanded ? Theme.notificationExpandDuration : Theme.notificationCollapseDuration)
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: Theme.expressiveCurves.emphasized
|
easing.bezierCurve: root.connectedFrameMode ? (root.expanded ? Theme.variantPopoutEnterCurve : Theme.variantPopoutExitCurve) : Theme.expressiveCurves.emphasized
|
||||||
onRunningChanged: {
|
onRunningChanged: {
|
||||||
if (running) {
|
if (running) {
|
||||||
root.isAnimating = true;
|
root.isAnimating = true;
|
||||||
|
|||||||
@@ -39,11 +39,9 @@ DankPopout {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
popupWidth: triggerScreen ? Math.min(500, Math.max(380, triggerScreen.width - 48)) : 400
|
popupWidth: 400
|
||||||
popupHeight: stablePopupHeight
|
popupHeight: stablePopupHeight
|
||||||
positioning: ""
|
positioning: ""
|
||||||
animationScaleCollapsed: 0.94
|
|
||||||
animationOffset: 0
|
|
||||||
suspendShadowWhileResizing: false
|
suspendShadowWhileResizing: false
|
||||||
|
|
||||||
screen: triggerScreen
|
screen: triggerScreen
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ PanelWindow {
|
|||||||
blurY: content.y + content.cardInset + swipeTx.y + tx.y
|
blurY: content.y + content.cardInset + swipeTx.y + tx.y
|
||||||
blurWidth: !win._finalized ? Math.max(0, content.width - content.cardInset * 2) : 0
|
blurWidth: !win._finalized ? Math.max(0, content.width - content.cardInset * 2) : 0
|
||||||
blurHeight: !win._finalized ? Math.max(0, content.height - content.cardInset * 2) : 0
|
blurHeight: !win._finalized ? Math.max(0, content.height - content.cardInset * 2) : 0
|
||||||
blurRadius: Theme.cornerRadius
|
blurRadius: SettingsData.connectedFrameModeActive ? Theme.connectedSurfaceRadius : Theme.cornerRadius
|
||||||
}
|
}
|
||||||
|
|
||||||
WlrLayershell.namespace: "dms:notification-popup"
|
WlrLayershell.namespace: "dms:notification-popup"
|
||||||
@@ -32,6 +32,29 @@ PanelWindow {
|
|||||||
property real _lastReportedAlignedHeight: -1
|
property real _lastReportedAlignedHeight: -1
|
||||||
property real _storedTopMargin: 0
|
property real _storedTopMargin: 0
|
||||||
property real _storedBottomMargin: 0
|
property real _storedBottomMargin: 0
|
||||||
|
readonly property bool directionalEffect: Theme.isDirectionalEffect
|
||||||
|
readonly property bool depthEffect: Theme.isDepthEffect
|
||||||
|
readonly property real entryTravel: {
|
||||||
|
const base = Math.abs(Theme.effectAnimOffset);
|
||||||
|
if (directionalEffect) {
|
||||||
|
if (isCenterPosition)
|
||||||
|
return Math.max(base, Math.round(content.height * 1.1));
|
||||||
|
return Math.max(base, Math.round(content.width * 0.95));
|
||||||
|
}
|
||||||
|
if (depthEffect)
|
||||||
|
return Math.max(base, 44);
|
||||||
|
return base;
|
||||||
|
}
|
||||||
|
readonly property real exitTravel: {
|
||||||
|
if (directionalEffect) {
|
||||||
|
if (isCenterPosition)
|
||||||
|
return content.height + entryTravel;
|
||||||
|
return content.width + entryTravel;
|
||||||
|
}
|
||||||
|
if (depthEffect)
|
||||||
|
return Math.round(entryTravel * 1.35);
|
||||||
|
return Anims.slidePx;
|
||||||
|
}
|
||||||
readonly property string clearText: I18n.tr("Dismiss")
|
readonly property string clearText: I18n.tr("Dismiss")
|
||||||
property bool descriptionExpanded: false
|
property bool descriptionExpanded: false
|
||||||
readonly property bool hasExpandableBody: (notificationData?.htmlBody || "").replace(/<[^>]*>/g, "").trim().length > 0
|
readonly property bool hasExpandableBody: (notificationData?.htmlBody || "").replace(/<[^>]*>/g, "").trim().length > 0
|
||||||
@@ -145,9 +168,9 @@ PanelWindow {
|
|||||||
enabled: !exiting && !_isDestroying
|
enabled: !exiting && !_isDestroying
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
id: implicitHeightAnim
|
id: implicitHeightAnim
|
||||||
duration: descriptionExpanded ? Theme.notificationExpandDuration : Theme.notificationCollapseDuration
|
duration: Theme.variantDuration(descriptionExpanded ? Theme.notificationExpandDuration : Theme.notificationCollapseDuration, descriptionExpanded)
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: Theme.expressiveCurves.emphasized
|
easing.bezierCurve: descriptionExpanded ? Theme.variantPopoutEnterCurve : Theme.variantPopoutExitCurve
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -929,9 +952,9 @@ PanelWindow {
|
|||||||
if (isCenterPosition)
|
if (isCenterPosition)
|
||||||
return 0;
|
return 0;
|
||||||
const isLeft = SettingsData.notificationPopupPosition === SettingsData.Position.Left || SettingsData.notificationPopupPosition === SettingsData.Position.Bottom;
|
const isLeft = SettingsData.notificationPopupPosition === SettingsData.Position.Left || SettingsData.notificationPopupPosition === SettingsData.Position.Bottom;
|
||||||
return isLeft ? -Anims.slidePx : Anims.slidePx;
|
return isLeft ? -entryTravel : entryTravel;
|
||||||
}
|
}
|
||||||
y: isTopCenter ? -Anims.slidePx : isBottomCenter ? Anims.slidePx : 0
|
y: isTopCenter ? -entryTravel : isBottomCenter ? entryTravel : 0
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -943,16 +966,16 @@ PanelWindow {
|
|||||||
property: isCenterPosition ? "y" : "x"
|
property: isCenterPosition ? "y" : "x"
|
||||||
from: {
|
from: {
|
||||||
if (isTopCenter)
|
if (isTopCenter)
|
||||||
return -Anims.slidePx;
|
return -entryTravel;
|
||||||
if (isBottomCenter)
|
if (isBottomCenter)
|
||||||
return Anims.slidePx;
|
return entryTravel;
|
||||||
const isLeft = SettingsData.notificationPopupPosition === SettingsData.Position.Left || SettingsData.notificationPopupPosition === SettingsData.Position.Bottom;
|
const isLeft = SettingsData.notificationPopupPosition === SettingsData.Position.Left || SettingsData.notificationPopupPosition === SettingsData.Position.Bottom;
|
||||||
return isLeft ? -Anims.slidePx : Anims.slidePx;
|
return isLeft ? -entryTravel : entryTravel;
|
||||||
}
|
}
|
||||||
to: 0
|
to: 0
|
||||||
duration: Theme.notificationEnterDuration
|
duration: Theme.variantDuration(Theme.notificationEnterDuration, true)
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: isCenterPosition ? Theme.expressiveCurves.standardDecel : Theme.expressiveCurves.emphasizedDecel
|
easing.bezierCurve: Theme.variantPopoutEnterCurve
|
||||||
onStopped: {
|
onStopped: {
|
||||||
if (!win.exiting && !win._isDestroying) {
|
if (!win.exiting && !win._isDestroying) {
|
||||||
if (isCenterPosition) {
|
if (isCenterPosition) {
|
||||||
@@ -977,35 +1000,35 @@ PanelWindow {
|
|||||||
from: 0
|
from: 0
|
||||||
to: {
|
to: {
|
||||||
if (isTopCenter)
|
if (isTopCenter)
|
||||||
return -Anims.slidePx;
|
return -exitTravel;
|
||||||
if (isBottomCenter)
|
if (isBottomCenter)
|
||||||
return Anims.slidePx;
|
return exitTravel;
|
||||||
const isLeft = SettingsData.notificationPopupPosition === SettingsData.Position.Left || SettingsData.notificationPopupPosition === SettingsData.Position.Bottom;
|
const isLeft = SettingsData.notificationPopupPosition === SettingsData.Position.Left || SettingsData.notificationPopupPosition === SettingsData.Position.Bottom;
|
||||||
return isLeft ? -Anims.slidePx : Anims.slidePx;
|
return isLeft ? -exitTravel : exitTravel;
|
||||||
}
|
}
|
||||||
duration: Theme.notificationExitDuration
|
duration: Theme.variantDuration(Theme.notificationExitDuration, false)
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: Theme.expressiveCurves.emphasizedAccel
|
easing.bezierCurve: Theme.variantPopoutExitCurve
|
||||||
}
|
}
|
||||||
|
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
target: content
|
target: content
|
||||||
property: "opacity"
|
property: "opacity"
|
||||||
from: 1
|
from: 1
|
||||||
to: 0
|
to: Theme.isDirectionalEffect ? 1 : 0
|
||||||
duration: Theme.notificationExitDuration
|
duration: Theme.variantDuration(Theme.notificationExitDuration, false)
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: Theme.expressiveCurves.standardAccel
|
easing.bezierCurve: Theme.variantPopoutExitCurve
|
||||||
}
|
}
|
||||||
|
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
target: content
|
target: content
|
||||||
property: "scale"
|
property: "scale"
|
||||||
from: 1
|
from: 1
|
||||||
to: 0.98
|
to: Theme.isDirectionalEffect ? 1 : Theme.effectScaleCollapsed
|
||||||
duration: Theme.notificationExitDuration
|
duration: Theme.variantDuration(Theme.notificationExitDuration, false)
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: Theme.expressiveCurves.emphasizedAccel
|
easing.bezierCurve: Theme.variantPopoutExitCurve
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,11 +8,12 @@ QtObject {
|
|||||||
property var modelData
|
property var modelData
|
||||||
property int topMargin: 0
|
property int topMargin: 0
|
||||||
readonly property bool compactMode: SettingsData.notificationCompactMode
|
readonly property bool compactMode: SettingsData.notificationCompactMode
|
||||||
|
readonly property bool connectedFrameMode: SettingsData.connectedFrameModeActive
|
||||||
readonly property real cardPadding: compactMode ? Theme.notificationCardPaddingCompact : Theme.notificationCardPadding
|
readonly property real cardPadding: compactMode ? Theme.notificationCardPaddingCompact : Theme.notificationCardPadding
|
||||||
readonly property real popupIconSize: compactMode ? Theme.notificationIconSizeCompact : Theme.notificationIconSizeNormal
|
readonly property real popupIconSize: compactMode ? Theme.notificationIconSizeCompact : Theme.notificationIconSizeNormal
|
||||||
readonly property real actionButtonHeight: compactMode ? 20 : 24
|
readonly property real actionButtonHeight: compactMode ? 20 : 24
|
||||||
readonly property real contentSpacing: compactMode ? Theme.spacingXS : Theme.spacingS
|
readonly property real contentSpacing: compactMode ? Theme.spacingXS : Theme.spacingS
|
||||||
readonly property real popupSpacing: compactMode ? 0 : Theme.spacingXS
|
readonly property real popupSpacing: connectedFrameMode ? 0 : (compactMode ? 0 : Theme.spacingXS)
|
||||||
readonly property real collapsedContentHeight: Math.max(popupIconSize, Theme.fontSizeSmall * 1.2 + Theme.fontSizeMedium * 1.2 + Theme.fontSizeSmall * 1.2 * (compactMode ? 1 : 2))
|
readonly property real collapsedContentHeight: Math.max(popupIconSize, Theme.fontSizeSmall * 1.2 + Theme.fontSizeMedium * 1.2 + Theme.fontSizeSmall * 1.2 * (compactMode ? 1 : 2))
|
||||||
readonly property int baseNotificationHeight: cardPadding * 2 + collapsedContentHeight + actionButtonHeight + contentSpacing + popupSpacing
|
readonly property int baseNotificationHeight: cardPadding * 2 + collapsedContentHeight + actionButtonHeight + contentSpacing + popupSpacing
|
||||||
property var popupWindows: []
|
property var popupWindows: []
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ Item {
|
|||||||
const pos = selectedBarConfig?.position ?? SettingsData.Position.Top;
|
const pos = selectedBarConfig?.position ?? SettingsData.Position.Top;
|
||||||
return pos === SettingsData.Position.Left || pos === SettingsData.Position.Right;
|
return pos === SettingsData.Position.Left || pos === SettingsData.Position.Right;
|
||||||
}
|
}
|
||||||
|
readonly property bool connectedFrameModeActive: SettingsData.connectedFrameModeActive
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
id: horizontalBarChangeDebounce
|
id: horizontalBarChangeDebounce
|
||||||
@@ -693,6 +694,8 @@ Item {
|
|||||||
|
|
||||||
SettingsToggleRow {
|
SettingsToggleRow {
|
||||||
visible: CompositorService.isNiri
|
visible: CompositorService.isNiri
|
||||||
|
enabled: !SettingsData.frameEnabled
|
||||||
|
opacity: SettingsData.frameEnabled ? 0.5 : 1.0
|
||||||
text: I18n.tr("Show on Overview")
|
text: I18n.tr("Show on Overview")
|
||||||
checked: selectedBarConfig?.openOnOverview ?? false
|
checked: selectedBarConfig?.openOnOverview ?? false
|
||||||
onToggled: toggled => {
|
onToggled: toggled => {
|
||||||
@@ -798,11 +801,42 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
visible: SettingsData.frameEnabled
|
||||||
|
width: parent.width
|
||||||
|
implicitHeight: frameNote.implicitHeight + Theme.spacingS * 2
|
||||||
|
|
||||||
|
Row {
|
||||||
|
id: frameNote
|
||||||
|
x: Theme.spacingM
|
||||||
|
width: parent.width - Theme.spacingM * 2
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
spacing: Theme.spacingS
|
||||||
|
|
||||||
|
DankIcon {
|
||||||
|
name: "frame_source"
|
||||||
|
size: Theme.fontSizeMedium
|
||||||
|
color: Theme.primary
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: I18n.tr("Spacing and size are managed by Frame mode")
|
||||||
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
|
color: Theme.surfaceVariantText
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
width: parent.width - Theme.fontSizeMedium - Theme.spacingS
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SettingsCard {
|
SettingsCard {
|
||||||
iconName: "space_bar"
|
iconName: "space_bar"
|
||||||
title: I18n.tr("Spacing")
|
title: I18n.tr("Spacing")
|
||||||
settingKey: "barSpacing"
|
settingKey: "barSpacing"
|
||||||
visible: selectedBarConfig?.enabled
|
visible: selectedBarConfig?.enabled
|
||||||
|
enabled: !SettingsData.frameEnabled
|
||||||
|
opacity: SettingsData.frameEnabled ? 0.5 : 1.0
|
||||||
|
|
||||||
SettingsSliderRow {
|
SettingsSliderRow {
|
||||||
id: edgeSpacingSlider
|
id: edgeSpacingSlider
|
||||||
@@ -1003,6 +1037,8 @@ Item {
|
|||||||
|
|
||||||
SettingsSliderRow {
|
SettingsSliderRow {
|
||||||
id: barTransparencySlider
|
id: barTransparencySlider
|
||||||
|
enabled: !SettingsData.frameEnabled
|
||||||
|
opacity: SettingsData.frameEnabled ? 0.5 : 1.0
|
||||||
text: I18n.tr("Bar Transparency")
|
text: I18n.tr("Bar Transparency")
|
||||||
value: (selectedBarConfig?.transparency ?? 1.0) * 100
|
value: (selectedBarConfig?.transparency ?? 1.0) * 100
|
||||||
minimum: 0
|
minimum: 0
|
||||||
@@ -1044,6 +1080,64 @@ Item {
|
|||||||
restoreMode: Binding.RestoreBinding
|
restoreMode: Binding.RestoreBinding
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
visible: SettingsData.frameEnabled
|
||||||
|
width: parent.width
|
||||||
|
implicitHeight: transparencyFrameNote.implicitHeight + Theme.spacingS * 2
|
||||||
|
|
||||||
|
Row {
|
||||||
|
id: transparencyFrameNote
|
||||||
|
x: Theme.spacingM
|
||||||
|
width: parent.width - Theme.spacingM * 2
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
spacing: Theme.spacingS
|
||||||
|
|
||||||
|
DankIcon {
|
||||||
|
name: "frame_source"
|
||||||
|
size: Theme.fontSizeMedium
|
||||||
|
color: Theme.primary
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: I18n.tr("Opacity is controlled by Frame Border Opacity in Frame settings")
|
||||||
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
|
color: Theme.surfaceVariantText
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
width: parent.width - Theme.fontSizeMedium - Theme.spacingS
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
visible: dankBarTab.connectedFrameModeActive
|
||||||
|
width: parent.width
|
||||||
|
implicitHeight: connectedFrameStyleNote.implicitHeight + Theme.spacingS * 2
|
||||||
|
|
||||||
|
Row {
|
||||||
|
id: connectedFrameStyleNote
|
||||||
|
x: Theme.spacingM
|
||||||
|
width: parent.width - Theme.spacingM * 2
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
spacing: Theme.spacingS
|
||||||
|
|
||||||
|
DankIcon {
|
||||||
|
name: "frame_source"
|
||||||
|
size: Theme.fontSizeMedium
|
||||||
|
color: Theme.primary
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: I18n.tr("Connected Frame mode keeps bar shadow override, border, and corner overrides off while active")
|
||||||
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
|
color: Theme.surfaceVariantText
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
width: parent.width - Theme.fontSizeMedium - Theme.spacingS
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsCard {
|
SettingsCard {
|
||||||
@@ -1054,6 +1148,8 @@ Item {
|
|||||||
collapsible: true
|
collapsible: true
|
||||||
expanded: true
|
expanded: true
|
||||||
visible: selectedBarConfig?.enabled
|
visible: selectedBarConfig?.enabled
|
||||||
|
enabled: !dankBarTab.connectedFrameModeActive
|
||||||
|
opacity: dankBarTab.connectedFrameModeActive ? 0.5 : 1.0
|
||||||
|
|
||||||
readonly property bool shadowActive: (selectedBarConfig?.shadowIntensity ?? 0) > 0
|
readonly property bool shadowActive: (selectedBarConfig?.shadowIntensity ?? 0) > 0
|
||||||
readonly property bool isCustomColor: (selectedBarConfig?.shadowColorMode ?? "default") === "custom"
|
readonly property bool isCustomColor: (selectedBarConfig?.shadowColorMode ?? "default") === "custom"
|
||||||
@@ -1287,6 +1383,8 @@ Item {
|
|||||||
|
|
||||||
SettingsToggleRow {
|
SettingsToggleRow {
|
||||||
text: I18n.tr("Square Corners")
|
text: I18n.tr("Square Corners")
|
||||||
|
enabled: !SettingsData.frameEnabled
|
||||||
|
opacity: SettingsData.frameEnabled ? 0.5 : 1.0
|
||||||
checked: selectedBarConfig?.squareCorners ?? false
|
checked: selectedBarConfig?.squareCorners ?? false
|
||||||
onToggled: checked => SettingsData.updateBarConfig(selectedBarId, {
|
onToggled: checked => SettingsData.updateBarConfig(selectedBarId, {
|
||||||
squareCorners: checked
|
squareCorners: checked
|
||||||
@@ -1334,6 +1432,8 @@ Item {
|
|||||||
|
|
||||||
SettingsToggleRow {
|
SettingsToggleRow {
|
||||||
text: I18n.tr("Goth Corners")
|
text: I18n.tr("Goth Corners")
|
||||||
|
enabled: !SettingsData.frameEnabled
|
||||||
|
opacity: SettingsData.frameEnabled ? 0.5 : 1.0
|
||||||
checked: selectedBarConfig?.gothCornersEnabled ?? false
|
checked: selectedBarConfig?.gothCornersEnabled ?? false
|
||||||
onToggled: checked => SettingsData.updateBarConfig(selectedBarId, {
|
onToggled: checked => SettingsData.updateBarConfig(selectedBarId, {
|
||||||
gothCornersEnabled: checked
|
gothCornersEnabled: checked
|
||||||
@@ -1383,6 +1483,8 @@ Item {
|
|||||||
iconName: "border_style"
|
iconName: "border_style"
|
||||||
title: I18n.tr("Border")
|
title: I18n.tr("Border")
|
||||||
visible: selectedBarConfig?.enabled
|
visible: selectedBarConfig?.enabled
|
||||||
|
enabled: !dankBarTab.connectedFrameModeActive
|
||||||
|
opacity: dankBarTab.connectedFrameModeActive ? 0.5 : 1.0
|
||||||
checked: selectedBarConfig?.borderEnabled ?? false
|
checked: selectedBarConfig?.borderEnabled ?? false
|
||||||
onToggled: checked => SettingsData.updateBarConfig(selectedBarId, {
|
onToggled: checked => SettingsData.updateBarConfig(selectedBarId, {
|
||||||
borderEnabled: checked
|
borderEnabled: checked
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ import qs.Modules.Settings.Widgets
|
|||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
|
readonly property bool connectedFrameModeActive: SettingsData.frameEnabled
|
||||||
|
&& SettingsData.motionEffect === 1
|
||||||
|
&& SettingsData.directionalAnimationMode === 3
|
||||||
|
|
||||||
FileBrowserModal {
|
FileBrowserModal {
|
||||||
id: dockLogoFileBrowser
|
id: dockLogoFileBrowser
|
||||||
@@ -544,6 +547,8 @@ Item {
|
|||||||
|
|
||||||
SettingsSliderRow {
|
SettingsSliderRow {
|
||||||
text: I18n.tr("Exclusive Zone Offset")
|
text: I18n.tr("Exclusive Zone Offset")
|
||||||
|
enabled: !root.connectedFrameModeActive
|
||||||
|
opacity: root.connectedFrameModeActive ? 0.5 : 1.0
|
||||||
value: SettingsData.dockBottomGap
|
value: SettingsData.dockBottomGap
|
||||||
minimum: -100
|
minimum: -100
|
||||||
maximum: 100
|
maximum: 100
|
||||||
@@ -553,6 +558,8 @@ Item {
|
|||||||
|
|
||||||
SettingsSliderRow {
|
SettingsSliderRow {
|
||||||
text: I18n.tr("Margin")
|
text: I18n.tr("Margin")
|
||||||
|
enabled: !root.connectedFrameModeActive
|
||||||
|
opacity: root.connectedFrameModeActive ? 0.5 : 1.0
|
||||||
value: SettingsData.dockMargin
|
value: SettingsData.dockMargin
|
||||||
minimum: 0
|
minimum: 0
|
||||||
maximum: 100
|
maximum: 100
|
||||||
@@ -561,11 +568,42 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
visible: root.connectedFrameModeActive
|
||||||
|
width: parent.width
|
||||||
|
implicitHeight: dockConnectedNote.implicitHeight + Theme.spacingS * 2
|
||||||
|
|
||||||
|
Row {
|
||||||
|
id: dockConnectedNote
|
||||||
|
x: Theme.spacingM
|
||||||
|
width: parent.width - Theme.spacingM * 2
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
spacing: Theme.spacingS
|
||||||
|
|
||||||
|
DankIcon {
|
||||||
|
name: "frame_source"
|
||||||
|
size: Theme.fontSizeMedium
|
||||||
|
color: Theme.primary
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: I18n.tr("Connected Frame mode manages dock edge offset, transparency, blur, and border styling")
|
||||||
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
|
color: Theme.surfaceVariantText
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
width: parent.width - Theme.fontSizeMedium - Theme.spacingS
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SettingsCard {
|
SettingsCard {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
iconName: "opacity"
|
iconName: "opacity"
|
||||||
title: I18n.tr("Transparency")
|
title: I18n.tr("Transparency")
|
||||||
settingKey: "dockTransparency"
|
settingKey: "dockTransparency"
|
||||||
|
enabled: !root.connectedFrameModeActive
|
||||||
|
opacity: root.connectedFrameModeActive ? 0.5 : 1.0
|
||||||
|
|
||||||
SettingsSliderRow {
|
SettingsSliderRow {
|
||||||
text: I18n.tr("Dock Transparency")
|
text: I18n.tr("Dock Transparency")
|
||||||
@@ -585,6 +623,8 @@ Item {
|
|||||||
settingKey: "dockBorder"
|
settingKey: "dockBorder"
|
||||||
collapsible: true
|
collapsible: true
|
||||||
expanded: false
|
expanded: false
|
||||||
|
enabled: !root.connectedFrameModeActive
|
||||||
|
opacity: root.connectedFrameModeActive ? 0.5 : 1.0
|
||||||
|
|
||||||
SettingsToggleRow {
|
SettingsToggleRow {
|
||||||
text: I18n.tr("Border")
|
text: I18n.tr("Border")
|
||||||
|
|||||||
@@ -0,0 +1,324 @@
|
|||||||
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
import qs.Common
|
||||||
|
import qs.Services
|
||||||
|
import qs.Widgets
|
||||||
|
import qs.Modules.Settings.Widgets
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
LayoutMirroring.enabled: I18n.isRtl
|
||||||
|
LayoutMirroring.childrenInherit: true
|
||||||
|
|
||||||
|
DankFlickable {
|
||||||
|
anchors.fill: parent
|
||||||
|
clip: true
|
||||||
|
contentHeight: mainColumn.height + Theme.spacingXL
|
||||||
|
contentWidth: width
|
||||||
|
|
||||||
|
Column {
|
||||||
|
id: mainColumn
|
||||||
|
topPadding: 4
|
||||||
|
width: Math.min(550, parent.width - Theme.spacingL * 2)
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
spacing: Theme.spacingXL
|
||||||
|
|
||||||
|
// ── Enable Frame ──────────────────────────────────────────────────
|
||||||
|
SettingsCard {
|
||||||
|
width: parent.width
|
||||||
|
iconName: "frame_source"
|
||||||
|
title: I18n.tr("Frame")
|
||||||
|
settingKey: "frameEnabled"
|
||||||
|
|
||||||
|
SettingsToggleRow {
|
||||||
|
settingKey: "frameEnable"
|
||||||
|
tags: ["frame", "border", "outline", "display"]
|
||||||
|
text: I18n.tr("Enable Frame")
|
||||||
|
description: I18n.tr("Draw a connected picture-frame border around the entire display")
|
||||||
|
checked: SettingsData.frameEnabled
|
||||||
|
onToggled: checked => SettingsData.set("frameEnabled", checked)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── Border ────────────────────────────────────────────────────────
|
||||||
|
SettingsCard {
|
||||||
|
width: parent.width
|
||||||
|
iconName: "border_outer"
|
||||||
|
title: I18n.tr("Border")
|
||||||
|
settingKey: "frameBorder"
|
||||||
|
collapsible: true
|
||||||
|
visible: SettingsData.frameEnabled
|
||||||
|
|
||||||
|
SettingsSliderRow {
|
||||||
|
id: roundingSlider
|
||||||
|
settingKey: "frameRounding"
|
||||||
|
tags: ["frame", "border", "rounding", "radius", "corner"]
|
||||||
|
text: I18n.tr("Border Radius")
|
||||||
|
description: SettingsData.connectedFrameModeActive
|
||||||
|
? I18n.tr("Controls the radius of the frame and all connected popout, dock, and modal surfaces while Connected Mode is active")
|
||||||
|
: I18n.tr("Controls the frame border radius. This also becomes the connected surface radius whenever Connected Mode is active")
|
||||||
|
unit: "px"
|
||||||
|
minimum: 0
|
||||||
|
maximum: 100
|
||||||
|
step: 1
|
||||||
|
defaultValue: 23
|
||||||
|
value: SettingsData.frameRounding
|
||||||
|
onSliderDragFinished: v => SettingsData.set("frameRounding", v)
|
||||||
|
|
||||||
|
Binding {
|
||||||
|
target: roundingSlider
|
||||||
|
property: "value"
|
||||||
|
value: SettingsData.frameRounding
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsSliderRow {
|
||||||
|
id: thicknessSlider
|
||||||
|
settingKey: "frameThickness"
|
||||||
|
tags: ["frame", "border", "thickness", "size", "width"]
|
||||||
|
text: I18n.tr("Border Width")
|
||||||
|
unit: "px"
|
||||||
|
minimum: 2
|
||||||
|
maximum: 100
|
||||||
|
step: 1
|
||||||
|
defaultValue: 16
|
||||||
|
value: SettingsData.frameThickness
|
||||||
|
onSliderDragFinished: v => SettingsData.set("frameThickness", v)
|
||||||
|
|
||||||
|
Binding {
|
||||||
|
target: thicknessSlider
|
||||||
|
property: "value"
|
||||||
|
value: SettingsData.frameThickness
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsSliderRow {
|
||||||
|
id: barThicknessSlider
|
||||||
|
settingKey: "frameBarSize"
|
||||||
|
tags: ["frame", "bar", "thickness", "size", "height", "width"]
|
||||||
|
text: I18n.tr("Size")
|
||||||
|
description: I18n.tr("Height of horizontal bars / width of vertical bars in frame mode")
|
||||||
|
unit: "px"
|
||||||
|
minimum: 24
|
||||||
|
maximum: 100
|
||||||
|
step: 1
|
||||||
|
defaultValue: 40
|
||||||
|
value: SettingsData.frameBarSize
|
||||||
|
onSliderDragFinished: v => SettingsData.set("frameBarSize", v)
|
||||||
|
|
||||||
|
Binding {
|
||||||
|
target: barThicknessSlider
|
||||||
|
property: "value"
|
||||||
|
value: SettingsData.frameBarSize
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsSliderRow {
|
||||||
|
id: opacitySlider
|
||||||
|
settingKey: "frameOpacity"
|
||||||
|
tags: ["frame", "border", "surface", "popup", "opacity", "transparency"]
|
||||||
|
text: I18n.tr("Surface Opacity")
|
||||||
|
description: I18n.tr("Frame border opacity. Controls all surface opacity globally when Connected Mode is active")
|
||||||
|
unit: "%"
|
||||||
|
minimum: 0
|
||||||
|
maximum: 100
|
||||||
|
defaultValue: 100
|
||||||
|
value: SettingsData.frameOpacity * 100
|
||||||
|
onSliderDragFinished: v => SettingsData.set("frameOpacity", v / 100)
|
||||||
|
|
||||||
|
Binding {
|
||||||
|
target: opacitySlider
|
||||||
|
property: "value"
|
||||||
|
value: SettingsData.frameOpacity * 100
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsToggleRow {
|
||||||
|
id: frameBlurToggle
|
||||||
|
settingKey: "frameBlurEnabled"
|
||||||
|
tags: ["frame", "blur", "background", "glass", "transparency", "frosted"]
|
||||||
|
text: I18n.tr("Frame Blur")
|
||||||
|
description: !BlurService.available
|
||||||
|
? I18n.tr("Requires a newer version of Quickshell")
|
||||||
|
: I18n.tr("Apply compositor blur behind the frame border")
|
||||||
|
checked: SettingsData.frameBlurEnabled
|
||||||
|
onToggled: checked => SettingsData.set("frameBlurEnabled", checked)
|
||||||
|
enabled: BlurService.available && SettingsData.blurEnabled
|
||||||
|
opacity: enabled ? 1.0 : 0.5
|
||||||
|
visible: BlurService.available
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
visible: BlurService.available && !SettingsData.blurEnabled
|
||||||
|
width: parent.width
|
||||||
|
height: blurToggleNote.height + Theme.spacingM * 2
|
||||||
|
|
||||||
|
Row {
|
||||||
|
id: blurToggleNote
|
||||||
|
x: Theme.spacingM
|
||||||
|
width: parent.width - Theme.spacingM * 2
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
spacing: Theme.spacingS
|
||||||
|
|
||||||
|
DankIcon {
|
||||||
|
name: "blur_on"
|
||||||
|
size: Theme.fontSizeMedium
|
||||||
|
color: Theme.primary
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: I18n.tr("Frame Blur is controlled by Background Blur in Theme & Colors")
|
||||||
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
|
color: Theme.surfaceVariantText
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
width: parent.width - Theme.fontSizeMedium - Theme.spacingS
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Color mode buttons
|
||||||
|
SettingsButtonGroupRow {
|
||||||
|
settingKey: "frameColor"
|
||||||
|
tags: ["frame", "border", "color", "theme", "primary", "surface", "default"]
|
||||||
|
text: I18n.tr("Border color")
|
||||||
|
model: [I18n.tr("Default"), I18n.tr("Primary"), I18n.tr("Surface"), I18n.tr("Custom")]
|
||||||
|
currentIndex: {
|
||||||
|
const fc = SettingsData.frameColor;
|
||||||
|
if (!fc || fc === "default") return 0;
|
||||||
|
if (fc === "primary") return 1;
|
||||||
|
if (fc === "surface") return 2;
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
onSelectionChanged: (index, selected) => {
|
||||||
|
if (!selected) return;
|
||||||
|
switch (index) {
|
||||||
|
case 0: SettingsData.set("frameColor", ""); break;
|
||||||
|
case 1: SettingsData.set("frameColor", "primary"); break;
|
||||||
|
case 2: SettingsData.set("frameColor", "surface"); break;
|
||||||
|
case 3:
|
||||||
|
const cur = SettingsData.frameColor;
|
||||||
|
const isPreset = !cur || cur === "primary" || cur === "surface";
|
||||||
|
if (isPreset) SettingsData.set("frameColor", "#2a2a2a");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Custom color swatch — only visible when a hex color is stored (Custom mode)
|
||||||
|
Item {
|
||||||
|
visible: {
|
||||||
|
const fc = SettingsData.frameColor;
|
||||||
|
return !!(fc && fc !== "primary" && fc !== "surface");
|
||||||
|
}
|
||||||
|
width: parent.width
|
||||||
|
height: customColorRow.height + Theme.spacingM * 2
|
||||||
|
|
||||||
|
Row {
|
||||||
|
id: customColorRow
|
||||||
|
width: parent.width - Theme.spacingM * 2
|
||||||
|
x: Theme.spacingM
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
spacing: Theme.spacingM
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
text: I18n.tr("Custom color")
|
||||||
|
font.pixelSize: Theme.fontSizeMedium
|
||||||
|
font.weight: Font.Medium
|
||||||
|
color: Theme.surfaceText
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: colorSwatch
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
width: 32
|
||||||
|
height: 32
|
||||||
|
radius: 16
|
||||||
|
color: SettingsData.effectiveFrameColor
|
||||||
|
border.color: Theme.outline
|
||||||
|
border.width: 1
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
onClicked: {
|
||||||
|
PopoutService.colorPickerModal.selectedColor = SettingsData.effectiveFrameColor;
|
||||||
|
PopoutService.colorPickerModal.pickerTitle = I18n.tr("Frame Border Color");
|
||||||
|
PopoutService.colorPickerModal.onColorSelectedCallback = function (color) {
|
||||||
|
SettingsData.set("frameColor", color.toString());
|
||||||
|
};
|
||||||
|
PopoutService.colorPickerModal.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── Bar Integration ───────────────────────────────────────────────
|
||||||
|
SettingsCard {
|
||||||
|
width: parent.width
|
||||||
|
iconName: "toolbar"
|
||||||
|
title: I18n.tr("Bar Integration")
|
||||||
|
settingKey: "frameBarIntegration"
|
||||||
|
collapsible: true
|
||||||
|
expanded: true
|
||||||
|
visible: SettingsData.frameEnabled
|
||||||
|
|
||||||
|
SettingsToggleRow {
|
||||||
|
visible: CompositorService.isNiri
|
||||||
|
settingKey: "frameShowOnOverview"
|
||||||
|
tags: ["frame", "overview", "show", "hide", "niri"]
|
||||||
|
text: I18n.tr("Show on Overview")
|
||||||
|
description: I18n.tr("Show the bar and frame during Niri overview mode")
|
||||||
|
checked: SettingsData.frameShowOnOverview
|
||||||
|
onToggled: checked => SettingsData.set("frameShowOnOverview", checked)
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsToggleRow {
|
||||||
|
visible: SettingsData.frameEnabled
|
||||||
|
settingKey: "directionalAnimationMode"
|
||||||
|
tags: ["frame", "connected", "popout", "corner", "animation"]
|
||||||
|
text: I18n.tr("Connected Mode")
|
||||||
|
description: I18n.tr("Popouts emerge flush from the bar edge as one continuous piece (based on Slide)")
|
||||||
|
checked: SettingsData.connectedFrameModeActive
|
||||||
|
onToggled: checked => {
|
||||||
|
if (checked) {
|
||||||
|
if (SettingsData.directionalAnimationMode !== 3)
|
||||||
|
SettingsData.set("previousDirectionalMode", SettingsData.directionalAnimationMode);
|
||||||
|
SettingsData.set("motionEffect", 1);
|
||||||
|
SettingsData.set("directionalAnimationMode", 3);
|
||||||
|
} else {
|
||||||
|
SettingsData.set("directionalAnimationMode", SettingsData.previousDirectionalMode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: SettingsData
|
||||||
|
function onDirectionalAnimationModeChanged() {}
|
||||||
|
function onMotionEffectChanged() {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ── Display Assignment ────────────────────────────────────────────
|
||||||
|
SettingsCard {
|
||||||
|
width: parent.width
|
||||||
|
iconName: "monitor"
|
||||||
|
title: I18n.tr("Display Assignment")
|
||||||
|
settingKey: "frameDisplays"
|
||||||
|
collapsible: true
|
||||||
|
expanded: false
|
||||||
|
visible: SettingsData.frameEnabled
|
||||||
|
|
||||||
|
SettingsDisplayPicker {
|
||||||
|
displayPreferences: SettingsData.frameScreenPreferences
|
||||||
|
onPreferencesChanged: prefs => SettingsData.set("frameScreenPreferences", prefs)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -46,6 +46,13 @@ Item {
|
|||||||
onToggled: checked => SettingsData.set("audioVisualizerEnabled", checked)
|
onToggled: checked => SettingsData.set("audioVisualizerEnabled", checked)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SettingsToggleRow {
|
||||||
|
text: I18n.tr("Adaptive Media Width")
|
||||||
|
description: I18n.tr("Shrink the media widget to fit shorter song titles while still respecting the configured maximum size")
|
||||||
|
checked: SettingsData.mediaAdaptiveWidthEnabled
|
||||||
|
onToggled: checked => SettingsData.set("mediaAdaptiveWidthEnabled", checked)
|
||||||
|
}
|
||||||
|
|
||||||
SettingsDropdownRow {
|
SettingsDropdownRow {
|
||||||
property var scrollOptsInternal: ["volume", "song", "nothing"]
|
property var scrollOptsInternal: ["volume", "song", "nothing"]
|
||||||
property var scrollOptsDisplay: [I18n.tr("Change Volume", "media scroll wheel option"), I18n.tr("Change Song", "media scroll wheel option"), I18n.tr("Nothing", "media scroll wheel option")]
|
property var scrollOptsDisplay: [I18n.tr("Change Volume", "media scroll wheel option"), I18n.tr("Change Song", "media scroll wheel option"), I18n.tr("Nothing", "media scroll wheel option")]
|
||||||
|
|||||||
@@ -91,6 +91,16 @@ Item {
|
|||||||
visible: AudioService.gsettingsAvailable
|
visible: AudioService.gsettingsAvailable
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SettingsToggleRow {
|
||||||
|
tab: "sounds"
|
||||||
|
tags: ["sound", "login", "startup", "boot"]
|
||||||
|
settingKey: "soundLogin"
|
||||||
|
text: I18n.tr("Login")
|
||||||
|
description: I18n.tr("Play sound after logging in")
|
||||||
|
checked: SettingsData.soundLogin
|
||||||
|
onToggled: checked => SettingsData.set("soundLogin", checked)
|
||||||
|
}
|
||||||
|
|
||||||
SettingsToggleRow {
|
SettingsToggleRow {
|
||||||
tab: "sounds"
|
tab: "sounds"
|
||||||
tags: ["sound", "notification", "new"]
|
tags: ["sound", "notification", "new"]
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import qs.Modules.Settings.Widgets
|
|||||||
Item {
|
Item {
|
||||||
id: themeColorsTab
|
id: themeColorsTab
|
||||||
|
|
||||||
|
readonly property bool connectedFrameModeActive: SettingsData.connectedFrameModeActive
|
||||||
property var cachedIconThemes: SettingsData.availableIconThemes
|
property var cachedIconThemes: SettingsData.availableIconThemes
|
||||||
property var cachedCursorThemes: SettingsData.availableCursorThemes
|
property var cachedCursorThemes: SettingsData.availableCursorThemes
|
||||||
property var cachedMatugenSchemes: Theme.availableMatugenSchemes.map(option => option.label)
|
property var cachedMatugenSchemes: Theme.availableMatugenSchemes.map(option => option.label)
|
||||||
@@ -1615,10 +1616,14 @@ Item {
|
|||||||
|
|
||||||
SettingsSliderRow {
|
SettingsSliderRow {
|
||||||
tab: "theme"
|
tab: "theme"
|
||||||
tags: ["popup", "transparency", "opacity", "modal"]
|
tags: ["surface", "popup", "transparency", "opacity", "modal"]
|
||||||
settingKey: "popupTransparency"
|
settingKey: "popupTransparency"
|
||||||
text: I18n.tr("Popup Transparency")
|
text: I18n.tr("Surface Opacity")
|
||||||
description: I18n.tr("Controls opacity of all popouts, modals, and their content layers")
|
description: themeColorsTab.connectedFrameModeActive
|
||||||
|
? I18n.tr("Connected Frame mode follows Surface Opacity from the Frame tab for connected popouts, docks, and modal surfaces")
|
||||||
|
: I18n.tr("Controls opacity of all popouts, modals, and their content layers")
|
||||||
|
enabled: !themeColorsTab.connectedFrameModeActive
|
||||||
|
opacity: themeColorsTab.connectedFrameModeActive ? 0.5 : 1.0
|
||||||
value: Math.round(SettingsData.popupTransparency * 100)
|
value: Math.round(SettingsData.popupTransparency * 100)
|
||||||
minimum: 0
|
minimum: 0
|
||||||
maximum: 100
|
maximum: 100
|
||||||
@@ -1632,7 +1637,9 @@ Item {
|
|||||||
tags: ["corner", "radius", "rounded", "square"]
|
tags: ["corner", "radius", "rounded", "square"]
|
||||||
settingKey: "cornerRadius"
|
settingKey: "cornerRadius"
|
||||||
text: I18n.tr("Corner Radius")
|
text: I18n.tr("Corner Radius")
|
||||||
description: I18n.tr("0 = square corners")
|
description: themeColorsTab.connectedFrameModeActive
|
||||||
|
? I18n.tr("Controls general UI rounding. Connected frame popouts, docks, and modal surfaces follow Border Radius in the Frame tab while Connected Frame mode is active")
|
||||||
|
: I18n.tr("0 = square corners")
|
||||||
value: SettingsData.cornerRadius
|
value: SettingsData.cornerRadius
|
||||||
minimum: 0
|
minimum: 0
|
||||||
maximum: 32
|
maximum: 32
|
||||||
@@ -1837,7 +1844,11 @@ Item {
|
|||||||
tags: ["blur", "background", "transparency", "glass", "frosted"]
|
tags: ["blur", "background", "transparency", "glass", "frosted"]
|
||||||
settingKey: "blurEnabled"
|
settingKey: "blurEnabled"
|
||||||
text: I18n.tr("Background Blur")
|
text: I18n.tr("Background Blur")
|
||||||
description: BlurService.available ? I18n.tr("Blur the background behind bars, popouts, modals, and notifications. Requires compositor support and configuration.") : I18n.tr("Requires a newer version of Quickshell")
|
description: !BlurService.available
|
||||||
|
? I18n.tr("Requires a newer version of Quickshell")
|
||||||
|
: (themeColorsTab.connectedFrameModeActive
|
||||||
|
? I18n.tr("Connected Frame mode follows Frame Blur for connected surfaces while this remains the master blur availability toggle")
|
||||||
|
: I18n.tr("Blur the background behind bars, popouts, modals, and notifications. Requires compositor support and configuration."))
|
||||||
checked: SettingsData.blurEnabled ?? false
|
checked: SettingsData.blurEnabled ?? false
|
||||||
enabled: BlurService.available
|
enabled: BlurService.available
|
||||||
onToggled: checked => SettingsData.set("blurEnabled", checked)
|
onToggled: checked => SettingsData.set("blurEnabled", checked)
|
||||||
|
|||||||
@@ -55,6 +55,192 @@ Item {
|
|||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
spacing: Theme.spacingXL
|
spacing: Theme.spacingXL
|
||||||
|
|
||||||
|
SettingsCard {
|
||||||
|
tab: "typography"
|
||||||
|
tags: ["animation", "variant", "style", "slide", "fluent", "dynamic", "motion"]
|
||||||
|
title: I18n.tr("Animation Style")
|
||||||
|
settingKey: "animationVariant"
|
||||||
|
iconName: "auto_awesome_motion"
|
||||||
|
|
||||||
|
Item {
|
||||||
|
width: parent.width
|
||||||
|
height: animVariantGroup.implicitHeight
|
||||||
|
clip: true
|
||||||
|
|
||||||
|
DankButtonGroup {
|
||||||
|
id: animVariantGroup
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
buttonPadding: parent.width < 480 ? Theme.spacingS : Theme.spacingL
|
||||||
|
minButtonWidth: parent.width < 480 ? 64 : 96
|
||||||
|
textSize: parent.width < 480 ? Theme.fontSizeSmall : Theme.fontSizeMedium
|
||||||
|
model: [I18n.tr("Material"), I18n.tr("Fluent"), I18n.tr("Dynamic")]
|
||||||
|
selectionMode: "single"
|
||||||
|
currentIndex: SettingsData.animationVariant
|
||||||
|
onSelectionChanged: (index, selected) => {
|
||||||
|
if (!selected)
|
||||||
|
return;
|
||||||
|
SettingsData.set("animationVariant", index);
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: SettingsData
|
||||||
|
function onAnimationVariantChanged() {
|
||||||
|
animVariantGroup.currentIndex = SettingsData.animationVariant;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
width: parent.width
|
||||||
|
height: 1
|
||||||
|
color: Theme.outline
|
||||||
|
opacity: 0.15
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
width: parent.width
|
||||||
|
height: variantDescription.implicitHeight + Theme.spacingS * 2
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
id: variantDescription
|
||||||
|
x: Theme.spacingM
|
||||||
|
y: Theme.spacingS
|
||||||
|
width: parent.width - Theme.spacingM * 2
|
||||||
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
|
color: Theme.surfaceVariantText
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
text: {
|
||||||
|
switch (SettingsData.animationVariant) {
|
||||||
|
case 1:
|
||||||
|
return I18n.tr("Fluent: Smooth cubic deceleration in, quick snap out — clean, elegant curves.");
|
||||||
|
case 2:
|
||||||
|
return I18n.tr("Dynamic: Spring bezier with overshoot — entry briefly exceeds its target then settles. Expressive and alive.");
|
||||||
|
default:
|
||||||
|
return I18n.tr("Material: Material Design 3 Expressive bezier curves. The DMS default feel.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsCard {
|
||||||
|
tab: "typography"
|
||||||
|
tags: ["animation", "motion", "effect", "slide", "directional", "depth", "spring", "physics"]
|
||||||
|
title: I18n.tr("Motion Effects")
|
||||||
|
settingKey: "motionEffect"
|
||||||
|
iconName: "motion_photos_on"
|
||||||
|
|
||||||
|
Item {
|
||||||
|
width: parent.width
|
||||||
|
height: motionEffectGroup.implicitHeight
|
||||||
|
clip: true
|
||||||
|
|
||||||
|
DankButtonGroup {
|
||||||
|
id: motionEffectGroup
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
buttonPadding: parent.width < 480 ? Theme.spacingS : Theme.spacingL
|
||||||
|
minButtonWidth: parent.width < 480 ? 64 : 96
|
||||||
|
textSize: parent.width < 480 ? Theme.fontSizeSmall : Theme.fontSizeMedium
|
||||||
|
model: [I18n.tr("Standard"), I18n.tr("Directional"), I18n.tr("Depth")]
|
||||||
|
selectionMode: "single"
|
||||||
|
currentIndex: SettingsData.motionEffect
|
||||||
|
onSelectionChanged: (index, selected) => {
|
||||||
|
if (!selected)
|
||||||
|
return;
|
||||||
|
SettingsData.set("motionEffect", index);
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: SettingsData
|
||||||
|
function onMotionEffectChanged() {
|
||||||
|
motionEffectGroup.currentIndex = SettingsData.motionEffect;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
width: parent.width
|
||||||
|
height: 1
|
||||||
|
color: Theme.outline
|
||||||
|
opacity: 0.15
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
width: parent.width
|
||||||
|
height: motionEffectDescription.implicitHeight + Theme.spacingS * 2
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
id: motionEffectDescription
|
||||||
|
x: Theme.spacingM
|
||||||
|
y: Theme.spacingS
|
||||||
|
width: parent.width - Theme.spacingM * 2
|
||||||
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
|
color: Theme.surfaceVariantText
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
text: {
|
||||||
|
switch (SettingsData.motionEffect) {
|
||||||
|
case 1:
|
||||||
|
return I18n.tr("Directional: Panels glide in from a larger distance at full size — no scale change, pure clean motion.");
|
||||||
|
case 2:
|
||||||
|
return I18n.tr("Depth: Panels scale up from small as they slide in — a dramatic pop-forward depth effect.");
|
||||||
|
default:
|
||||||
|
return I18n.tr("Standard: Classic Material Design 3 — panels rise from below with a subtle scale. The DMS default.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
width: parent.width
|
||||||
|
height: 1
|
||||||
|
color: Theme.outline
|
||||||
|
opacity: 0.15
|
||||||
|
visible: SettingsData.motionEffect === 1
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsDropdownRow {
|
||||||
|
visible: SettingsData.motionEffect === 1
|
||||||
|
tab: "typography"
|
||||||
|
tags: ["animation", "directional", "behavior", "overlap", "sticky", "roll", "connected"]
|
||||||
|
settingKey: "directionalAnimationMode"
|
||||||
|
text: I18n.tr("Directional Behavior")
|
||||||
|
description: {
|
||||||
|
if (SettingsData.connectedFrameModeActive)
|
||||||
|
return I18n.tr("Popouts emerge flush from the bar edge as a single continuous piece, with corner connectors bridging the junction");
|
||||||
|
return I18n.tr("How the popout emerges from the DankBar");
|
||||||
|
}
|
||||||
|
options: SettingsData.frameEnabled
|
||||||
|
? [I18n.tr("Overlap"), I18n.tr("Slide"), I18n.tr("Roll"), I18n.tr("Connected")]
|
||||||
|
: [I18n.tr("Overlap"), I18n.tr("Slide"), I18n.tr("Roll")]
|
||||||
|
currentValue: {
|
||||||
|
switch (SettingsData.directionalAnimationMode) {
|
||||||
|
case 1:
|
||||||
|
return I18n.tr("Slide");
|
||||||
|
case 2:
|
||||||
|
return I18n.tr("Roll");
|
||||||
|
case 3:
|
||||||
|
return SettingsData.frameEnabled ? I18n.tr("Connected") : I18n.tr("Slide");
|
||||||
|
default:
|
||||||
|
return I18n.tr("Overlap");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onValueChanged: value => {
|
||||||
|
if (value === I18n.tr("Slide"))
|
||||||
|
SettingsData.set("directionalAnimationMode", 1);
|
||||||
|
else if (value === I18n.tr("Roll"))
|
||||||
|
SettingsData.set("directionalAnimationMode", 2);
|
||||||
|
else if (value === I18n.tr("Connected") && SettingsData.frameEnabled) {
|
||||||
|
if (SettingsData.directionalAnimationMode !== 3)
|
||||||
|
SettingsData.set("previousDirectionalMode", SettingsData.directionalAnimationMode);
|
||||||
|
SettingsData.set("directionalAnimationMode", 3);
|
||||||
|
} else
|
||||||
|
SettingsData.set("directionalAnimationMode", 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SettingsCard {
|
SettingsCard {
|
||||||
tab: "typography"
|
tab: "typography"
|
||||||
tags: ["font", "family", "text", "typography"]
|
tags: ["font", "family", "text", "typography"]
|
||||||
|
|||||||
@@ -83,7 +83,6 @@ Item {
|
|||||||
description: modelData.width + "×" + modelData.height
|
description: modelData.width + "×" + modelData.height
|
||||||
checked: localChecked
|
checked: localChecked
|
||||||
onToggled: isChecked => {
|
onToggled: isChecked => {
|
||||||
localChecked = isChecked;
|
|
||||||
var prefs = JSON.parse(JSON.stringify(root.displayPreferences));
|
var prefs = JSON.parse(JSON.stringify(root.displayPreferences));
|
||||||
if (!Array.isArray(prefs) || prefs.includes("all"))
|
if (!Array.isArray(prefs) || prefs.includes("all"))
|
||||||
prefs = [];
|
prefs = [];
|
||||||
@@ -94,6 +93,11 @@ Item {
|
|||||||
model: modelData.model || ""
|
model: modelData.model || ""
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (prefs.length === 0) {
|
||||||
|
localChecked = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
localChecked = isChecked;
|
||||||
root.preferencesChanged(prefs);
|
root.preferencesChanged(prefs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -430,7 +430,7 @@ Item {
|
|||||||
"id": widget.id,
|
"id": widget.id,
|
||||||
"enabled": widget.enabled
|
"enabled": widget.enabled
|
||||||
};
|
};
|
||||||
var keys = ["size", "selectedGpuIndex", "pciId", "mountPath", "diskUsageMode", "minimumWidth", "showSwap", "showInGb", "mediaSize", "clockCompactMode", "focusedWindowCompactMode", "runningAppsCompactMode", "keyboardLayoutNameCompactMode", "runningAppsGroupByApp", "runningAppsCurrentWorkspace", "runningAppsCurrentMonitor", "showNetworkIcon", "showBluetoothIcon", "showAudioIcon", "showAudioPercent", "showVpnIcon", "showBrightnessIcon", "showBrightnessPercent", "showMicIcon", "showMicPercent", "showBatteryIcon", "showPrinterIcon", "showScreenSharingIcon", "controlCenterGroupOrder", "barMaxVisibleApps", "barMaxVisibleRunningApps", "barShowOverflowBadge"];
|
var keys = ["size", "selectedGpuIndex", "pciId", "mountPath", "diskUsageMode", "minimumWidth", "showSwap", "showInGb", "mediaSize", "clockCompactMode", "focusedWindowCompactMode", "runningAppsCompactMode", "keyboardLayoutNameCompactMode", "runningAppsGroupByApp", "runningAppsCurrentWorkspace", "runningAppsCurrentMonitor", "showNetworkIcon", "showBluetoothIcon", "showAudioIcon", "showAudioPercent", "showVpnIcon", "showBrightnessIcon", "showBrightnessPercent", "showMicIcon", "showMicPercent", "showBatteryIcon", "showPrinterIcon", "showScreenSharingIcon", "controlCenterGroupOrder", "barMaxVisibleApps", "barMaxVisibleRunningApps", "barShowOverflowBadge", "trayUseInlineExpansion"];
|
||||||
for (var i = 0; i < keys.length; i++) {
|
for (var i = 0; i < keys.length; i++) {
|
||||||
if (widget[keys[i]] !== undefined)
|
if (widget[keys[i]] !== undefined)
|
||||||
result[keys[i]] = widget[keys[i]];
|
result[keys[i]] = widget[keys[i]];
|
||||||
@@ -712,6 +712,8 @@ Item {
|
|||||||
item.barMaxVisibleRunningApps = widget.barMaxVisibleRunningApps;
|
item.barMaxVisibleRunningApps = widget.barMaxVisibleRunningApps;
|
||||||
if (widget.barShowOverflowBadge !== undefined)
|
if (widget.barShowOverflowBadge !== undefined)
|
||||||
item.barShowOverflowBadge = widget.barShowOverflowBadge;
|
item.barShowOverflowBadge = widget.barShowOverflowBadge;
|
||||||
|
if (widget.trayUseInlineExpansion !== undefined)
|
||||||
|
item.trayUseInlineExpansion = widget.trayUseInlineExpansion;
|
||||||
}
|
}
|
||||||
widgets.push(item);
|
widgets.push(item);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
|
||||||
import qs.Common
|
import qs.Common
|
||||||
import qs.Widgets
|
import qs.Widgets
|
||||||
import qs.Services
|
import qs.Services
|
||||||
@@ -40,7 +39,7 @@ Column {
|
|||||||
"id": widget.id,
|
"id": widget.id,
|
||||||
"enabled": widget.enabled
|
"enabled": widget.enabled
|
||||||
};
|
};
|
||||||
var keys = ["size", "selectedGpuIndex", "pciId", "mountPath", "diskUsageMode", "minimumWidth", "showSwap", "showInGb", "mediaSize", "clockCompactMode", "focusedWindowCompactMode", "runningAppsCompactMode", "keyboardLayoutNameCompactMode", "runningAppsGroupByApp", "runningAppsCurrentWorkspace", "runningAppsCurrentMonitor", "showNetworkIcon", "showBluetoothIcon", "showAudioIcon", "showAudioPercent", "showVpnIcon", "showBrightnessIcon", "showBrightnessPercent", "showMicIcon", "showMicPercent", "showBatteryIcon", "showPrinterIcon", "showScreenSharingIcon", "controlCenterGroupOrder", "barMaxVisibleApps", "barMaxVisibleRunningApps", "barShowOverflowBadge"];
|
var keys = ["size", "selectedGpuIndex", "pciId", "mountPath", "diskUsageMode", "minimumWidth", "showSwap", "showInGb", "mediaSize", "clockCompactMode", "focusedWindowCompactMode", "runningAppsCompactMode", "keyboardLayoutNameCompactMode", "runningAppsGroupByApp", "runningAppsCurrentWorkspace", "runningAppsCurrentMonitor", "showNetworkIcon", "showBluetoothIcon", "showAudioIcon", "showAudioPercent", "showVpnIcon", "showBrightnessIcon", "showBrightnessPercent", "showMicIcon", "showMicPercent", "showBatteryIcon", "showPrinterIcon", "showScreenSharingIcon", "controlCenterGroupOrder", "barMaxVisibleApps", "barMaxVisibleRunningApps", "barShowOverflowBadge", "trayUseInlineExpansion"];
|
||||||
for (var i = 0; i < keys.length; i++) {
|
for (var i = 0; i < keys.length; i++) {
|
||||||
if (widget[keys[i]] !== undefined)
|
if (widget[keys[i]] !== undefined)
|
||||||
result[keys[i]] = widget[keys[i]];
|
result[keys[i]] = widget[keys[i]];
|
||||||
@@ -52,15 +51,14 @@ Column {
|
|||||||
height: implicitHeight
|
height: implicitHeight
|
||||||
spacing: Theme.spacingM
|
spacing: Theme.spacingM
|
||||||
|
|
||||||
RowLayout {
|
Row {
|
||||||
width: parent.width
|
|
||||||
spacing: Theme.spacingM
|
spacing: Theme.spacingM
|
||||||
|
|
||||||
DankIcon {
|
DankIcon {
|
||||||
name: root.titleIcon
|
name: root.titleIcon
|
||||||
size: Theme.iconSize
|
size: Theme.iconSize
|
||||||
color: Theme.primary
|
color: Theme.primary
|
||||||
Layout.alignment: Qt.AlignVCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
@@ -68,7 +66,7 @@ Column {
|
|||||||
font.pixelSize: Theme.fontSizeLarge
|
font.pixelSize: Theme.fontSizeLarge
|
||||||
font.weight: Font.Medium
|
font.weight: Font.Medium
|
||||||
color: Theme.surfaceText
|
color: Theme.surfaceText
|
||||||
Layout.alignment: Qt.AlignVCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -439,7 +437,7 @@ Column {
|
|||||||
|
|
||||||
Row {
|
Row {
|
||||||
spacing: Theme.spacingXS
|
spacing: Theme.spacingXS
|
||||||
visible: modelData.id === "clock" || modelData.id === "focusedWindow" || modelData.id === "keyboard_layout_name" || modelData.id === "appsDock"
|
visible: modelData.id === "clock" || modelData.id === "focusedWindow" || modelData.id === "keyboard_layout_name" || modelData.id === "appsDock" || modelData.id === "systemTray"
|
||||||
|
|
||||||
DankActionButton {
|
DankActionButton {
|
||||||
id: compactModeButton
|
id: compactModeButton
|
||||||
@@ -545,6 +543,39 @@ Column {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DankActionButton {
|
||||||
|
id: trayMenuButton
|
||||||
|
buttonSize: 32
|
||||||
|
visible: modelData.id === "systemTray"
|
||||||
|
iconName: "more_vert"
|
||||||
|
iconSize: 18
|
||||||
|
iconColor: Theme.outline
|
||||||
|
onClicked: {
|
||||||
|
trayContextMenu.widgetData = modelData;
|
||||||
|
trayContextMenu.sectionId = root.sectionId;
|
||||||
|
trayContextMenu.widgetIndex = index;
|
||||||
|
|
||||||
|
var buttonPos = trayMenuButton.mapToItem(root, 0, 0);
|
||||||
|
var popupWidth = trayContextMenu.width;
|
||||||
|
var popupHeight = trayContextMenu.height;
|
||||||
|
|
||||||
|
var xPos = buttonPos.x - popupWidth - Theme.spacingS;
|
||||||
|
if (xPos < 0)
|
||||||
|
xPos = buttonPos.x + trayMenuButton.width + Theme.spacingS;
|
||||||
|
|
||||||
|
var yPos = buttonPos.y - popupHeight / 2 + trayMenuButton.height / 2;
|
||||||
|
if (yPos < 0) {
|
||||||
|
yPos = Theme.spacingS;
|
||||||
|
} else if (yPos + popupHeight > root.height) {
|
||||||
|
yPos = root.height - popupHeight - Theme.spacingS;
|
||||||
|
}
|
||||||
|
|
||||||
|
trayContextMenu.x = xPos;
|
||||||
|
trayContextMenu.y = yPos;
|
||||||
|
trayContextMenu.open();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: compactModeTooltip
|
id: compactModeTooltip
|
||||||
width: tooltipText.contentWidth + Theme.spacingM * 2
|
width: tooltipText.contentWidth + Theme.spacingM * 2
|
||||||
@@ -933,6 +964,88 @@ Column {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Popup {
|
||||||
|
id: trayContextMenu
|
||||||
|
|
||||||
|
property var widgetData: null
|
||||||
|
property string sectionId: ""
|
||||||
|
property int widgetIndex: -1
|
||||||
|
readonly property var currentWidgetData: (widgetIndex >= 0 && widgetIndex < root.items.length) ? root.items[widgetIndex] : widgetData
|
||||||
|
|
||||||
|
width: 220
|
||||||
|
height: contentColumn.implicitHeight + Theme.spacingS * 2
|
||||||
|
padding: 0
|
||||||
|
modal: true
|
||||||
|
focus: true
|
||||||
|
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
||||||
|
|
||||||
|
background: Rectangle {
|
||||||
|
color: Theme.surfaceContainer
|
||||||
|
radius: Theme.cornerRadius
|
||||||
|
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.08)
|
||||||
|
border.width: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
contentItem: Item {
|
||||||
|
Column {
|
||||||
|
id: contentColumn
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.margins: Theme.spacingS
|
||||||
|
spacing: 2
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
width: parent.width
|
||||||
|
height: 32
|
||||||
|
radius: Theme.cornerRadius
|
||||||
|
color: trayOverflowArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : "transparent"
|
||||||
|
|
||||||
|
Row {
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.leftMargin: Theme.spacingS
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
spacing: Theme.spacingS
|
||||||
|
|
||||||
|
DankIcon {
|
||||||
|
name: "arrow_selector_tool"
|
||||||
|
size: 16
|
||||||
|
color: Theme.surfaceText
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: I18n.tr("Use Inline Expansion")
|
||||||
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
|
color: Theme.surfaceText
|
||||||
|
font.weight: Font.Normal
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DankToggle {
|
||||||
|
id: trayOverflowToggle
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.rightMargin: Theme.spacingS
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
width: 40
|
||||||
|
height: 20
|
||||||
|
checked: trayContextMenu.currentWidgetData?.trayUseInlineExpansion ?? false
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: trayOverflowArea
|
||||||
|
anchors.fill: parent
|
||||||
|
hoverEnabled: true
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
onClicked: {
|
||||||
|
const newValue = !(trayContextMenu.currentWidgetData?.trayUseInlineExpansion ?? false);
|
||||||
|
root.overflowSettingChanged(trayContextMenu.sectionId, trayContextMenu.widgetIndex, "trayUseInlineExpansion", newValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Popup {
|
Popup {
|
||||||
id: diskUsageContextMenu
|
id: diskUsageContextMenu
|
||||||
|
|
||||||
@@ -981,10 +1094,26 @@ Column {
|
|||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
model: [
|
model: [
|
||||||
{ label: I18n.tr("Percentage"), mode: 0, icon: "percent" },
|
{
|
||||||
{ label: I18n.tr("Total"), mode: 1, icon: "storage" },
|
label: I18n.tr("Percentage"),
|
||||||
{ label: I18n.tr("Remaining"), mode: 2, icon: "hourglass_empty" },
|
mode: 0,
|
||||||
{ label: I18n.tr("Remaining / Total"), mode: 3, icon: "pie_chart" }
|
icon: "percent"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: I18n.tr("Total"),
|
||||||
|
mode: 1,
|
||||||
|
icon: "storage"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: I18n.tr("Remaining"),
|
||||||
|
mode: 2,
|
||||||
|
icon: "hourglass_empty"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: I18n.tr("Remaining / Total"),
|
||||||
|
mode: 3,
|
||||||
|
icon: "pie_chart"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
delegate: Rectangle {
|
delegate: Rectangle {
|
||||||
@@ -1316,20 +1445,7 @@ Column {
|
|||||||
id: longestControlCenterLabelMetrics
|
id: longestControlCenterLabelMetrics
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
text: {
|
text: {
|
||||||
const labels = [
|
const labels = [I18n.tr("Network"), I18n.tr("VPN"), I18n.tr("Bluetooth"), I18n.tr("Audio"), I18n.tr("Volume"), I18n.tr("Microphone"), I18n.tr("Microphone Volume"), I18n.tr("Brightness"), I18n.tr("Brightness Value"), I18n.tr("Battery"), I18n.tr("Printer"), I18n.tr("Screen Sharing")];
|
||||||
I18n.tr("Network"),
|
|
||||||
I18n.tr("VPN"),
|
|
||||||
I18n.tr("Bluetooth"),
|
|
||||||
I18n.tr("Audio"),
|
|
||||||
I18n.tr("Volume"),
|
|
||||||
I18n.tr("Microphone"),
|
|
||||||
I18n.tr("Microphone Volume"),
|
|
||||||
I18n.tr("Brightness"),
|
|
||||||
I18n.tr("Brightness Value"),
|
|
||||||
I18n.tr("Battery"),
|
|
||||||
I18n.tr("Printer"),
|
|
||||||
I18n.tr("Screen Sharing")
|
|
||||||
];
|
|
||||||
let longest = "";
|
let longest = "";
|
||||||
for (let i = 0; i < labels.length; i++) {
|
for (let i = 0; i < labels.length; i++) {
|
||||||
if (labels[i].length > longest.length)
|
if (labels[i].length > longest.length)
|
||||||
@@ -1340,6 +1456,7 @@ Column {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
|
id: groupRepeater
|
||||||
model: controlCenterContextMenu.controlCenterGroups
|
model: controlCenterContextMenu.controlCenterGroups
|
||||||
|
|
||||||
delegate: Item {
|
delegate: Item {
|
||||||
@@ -1569,8 +1686,6 @@ Column {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
id: groupRepeater
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,9 +121,9 @@ Scope {
|
|||||||
|
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Theme.expressiveDurations.expressiveDefaultSpatial
|
duration: Theme.variantDuration(Theme.expressiveDurations.expressiveDefaultSpatial, overviewScope.overviewOpen)
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: overviewScope.overviewOpen ? Theme.expressiveCurves.expressiveDefaultSpatial : Theme.expressiveCurves.emphasized
|
easing.bezierCurve: overviewScope.overviewOpen ? Theme.variantModalEnterCurve : Theme.variantModalExitCurve
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -154,45 +154,69 @@ Scope {
|
|||||||
id: scaleTransform
|
id: scaleTransform
|
||||||
origin.x: contentContainer.width / 2
|
origin.x: contentContainer.width / 2
|
||||||
origin.y: contentContainer.height / 2
|
origin.y: contentContainer.height / 2
|
||||||
xScale: overviewScope.overviewOpen ? 1 : 0.96
|
xScale: overviewScope.overviewOpen ? 1 : Theme.effectScaleCollapsed
|
||||||
yScale: overviewScope.overviewOpen ? 1 : 0.96
|
yScale: overviewScope.overviewOpen ? 1 : Theme.effectScaleCollapsed
|
||||||
|
|
||||||
Behavior on xScale {
|
Behavior on xScale {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Theme.expressiveDurations.expressiveDefaultSpatial
|
duration: Theme.variantDuration(Theme.expressiveDurations.expressiveDefaultSpatial, overviewScope.overviewOpen)
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: overviewScope.overviewOpen ? Theme.expressiveCurves.expressiveDefaultSpatial : Theme.expressiveCurves.emphasized
|
easing.bezierCurve: overviewScope.overviewOpen ? Theme.variantModalEnterCurve : Theme.variantModalExitCurve
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on yScale {
|
Behavior on yScale {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Theme.expressiveDurations.expressiveDefaultSpatial
|
duration: Theme.variantDuration(Theme.expressiveDurations.expressiveDefaultSpatial, overviewScope.overviewOpen)
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: overviewScope.overviewOpen ? Theme.expressiveCurves.expressiveDefaultSpatial : Theme.expressiveCurves.emphasized
|
easing.bezierCurve: overviewScope.overviewOpen ? Theme.variantModalEnterCurve : Theme.variantModalExitCurve
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Translate {
|
Translate {
|
||||||
id: motionTransform
|
id: motionTransform
|
||||||
x: 0
|
x: {
|
||||||
y: overviewScope.overviewOpen ? 0 : Theme.spacingL
|
if (overviewScope.overviewOpen)
|
||||||
|
return 0;
|
||||||
|
if (Theme.isDirectionalEffect)
|
||||||
|
return 0;
|
||||||
|
if (Theme.isDepthEffect)
|
||||||
|
return Theme.effectAnimOffset * 0.25;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
y: {
|
||||||
|
if (overviewScope.overviewOpen)
|
||||||
|
return 0;
|
||||||
|
if (Theme.isDirectionalEffect)
|
||||||
|
return -Math.max(contentContainer.height * 0.8, Theme.effectAnimOffset * 1.1);
|
||||||
|
if (Theme.isDepthEffect)
|
||||||
|
return Math.max(Theme.effectAnimOffset * 0.85, 28);
|
||||||
|
return Theme.effectAnimOffset;
|
||||||
|
}
|
||||||
|
|
||||||
|
Behavior on x {
|
||||||
|
NumberAnimation {
|
||||||
|
duration: Theme.variantDuration(Theme.expressiveDurations.expressiveDefaultSpatial, overviewScope.overviewOpen)
|
||||||
|
easing.type: Easing.BezierSpline
|
||||||
|
easing.bezierCurve: overviewScope.overviewOpen ? Theme.variantModalEnterCurve : Theme.variantModalExitCurve
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Behavior on y {
|
Behavior on y {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Theme.expressiveDurations.expressiveDefaultSpatial
|
duration: Theme.variantDuration(Theme.expressiveDurations.expressiveDefaultSpatial, overviewScope.overviewOpen)
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: overviewScope.overviewOpen ? Theme.expressiveCurves.expressiveDefaultSpatial : Theme.expressiveCurves.emphasized
|
easing.bezierCurve: overviewScope.overviewOpen ? Theme.variantModalEnterCurve : Theme.variantModalExitCurve
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Theme.expressiveDurations.expressiveDefaultSpatial
|
duration: Theme.variantDuration(Theme.expressiveDurations.expressiveDefaultSpatial, overviewScope.overviewOpen)
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: overviewScope.overviewOpen ? Theme.expressiveCurves.expressiveDefaultSpatial : Theme.expressiveCurves.emphasized
|
easing.bezierCurve: overviewScope.overviewOpen ? Theme.variantModalEnterCurve : Theme.variantModalExitCurve
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -202,8 +202,18 @@ Scope {
|
|||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: spotlightContainer
|
id: spotlightContainer
|
||||||
x: Theme.snap((parent.width - width) / 2, overlayWindow.dpr)
|
readonly property bool directionalEffect: Theme.isDirectionalEffect
|
||||||
y: Theme.snap((parent.height - height) / 2, overlayWindow.dpr)
|
readonly property bool depthEffect: Theme.isDepthEffect
|
||||||
|
readonly property real collapsedMotionX: depthEffect ? Theme.effectAnimOffset * 0.25 : 0
|
||||||
|
readonly property real collapsedMotionY: {
|
||||||
|
if (directionalEffect)
|
||||||
|
return Math.max(height * 0.85, Theme.effectAnimOffset * 1.1);
|
||||||
|
if (depthEffect)
|
||||||
|
return Math.max(Theme.effectAnimOffset * 0.8, 30);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
x: Theme.snap((parent.width - width) / 2 + (overlayWindow.shouldShowSpotlight ? 0 : collapsedMotionX), overlayWindow.dpr)
|
||||||
|
y: Theme.snap((parent.height - height) / 2 + (overlayWindow.shouldShowSpotlight ? 0 : collapsedMotionY), overlayWindow.dpr)
|
||||||
|
|
||||||
readonly property int baseWidth: {
|
readonly property int baseWidth: {
|
||||||
switch (SettingsData.dankLauncherV2Size) {
|
switch (SettingsData.dankLauncherV2Size) {
|
||||||
@@ -234,8 +244,8 @@ Scope {
|
|||||||
|
|
||||||
readonly property bool animatingOut: niriOverviewScope.isClosing && overlayWindow.isSpotlightScreen
|
readonly property bool animatingOut: niriOverviewScope.isClosing && overlayWindow.isSpotlightScreen
|
||||||
|
|
||||||
scale: overlayWindow.shouldShowSpotlight ? 1.0 : 0.96
|
scale: Theme.isDirectionalEffect ? 1 : (overlayWindow.shouldShowSpotlight ? 1.0 : Theme.effectScaleCollapsed)
|
||||||
opacity: overlayWindow.shouldShowSpotlight ? 1 : 0
|
opacity: Theme.isDirectionalEffect ? 1 : (overlayWindow.shouldShowSpotlight ? 1 : 0)
|
||||||
visible: overlayWindow.shouldShowSpotlight || animatingOut
|
visible: overlayWindow.shouldShowSpotlight || animatingOut
|
||||||
enabled: overlayWindow.shouldShowSpotlight
|
enabled: overlayWindow.shouldShowSpotlight
|
||||||
|
|
||||||
@@ -245,10 +255,11 @@ Scope {
|
|||||||
|
|
||||||
Behavior on scale {
|
Behavior on scale {
|
||||||
id: scaleAnimation
|
id: scaleAnimation
|
||||||
|
enabled: !Theme.isDirectionalEffect
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Theme.expressiveDurations.fast
|
duration: Theme.variantDuration(Theme.expressiveDurations.fast, overlayWindow.shouldShowSpotlight)
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: spotlightContainer.visible ? Theme.expressiveCurves.expressiveFastSpatial : Theme.expressiveCurves.standardAccel
|
easing.bezierCurve: spotlightContainer.visible ? Theme.variantModalEnterCurve : Theme.variantModalExitCurve
|
||||||
onRunningChanged: {
|
onRunningChanged: {
|
||||||
if (running || !spotlightContainer.animatingOut)
|
if (running || !spotlightContainer.animatingOut)
|
||||||
return;
|
return;
|
||||||
@@ -258,10 +269,27 @@ Scope {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
|
enabled: !Theme.isDirectionalEffect
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Theme.expressiveDurations.fast
|
duration: Theme.variantDuration(Theme.expressiveDurations.fast, overlayWindow.shouldShowSpotlight)
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: spotlightContainer.visible ? Theme.expressiveCurves.expressiveFastSpatial : Theme.expressiveCurves.standardAccel
|
easing.bezierCurve: spotlightContainer.visible ? Theme.variantModalEnterCurve : Theme.variantModalExitCurve
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Behavior on x {
|
||||||
|
NumberAnimation {
|
||||||
|
duration: Theme.variantDuration(Theme.expressiveDurations.fast, overlayWindow.shouldShowSpotlight)
|
||||||
|
easing.type: Easing.BezierSpline
|
||||||
|
easing.bezierCurve: spotlightContainer.visible ? Theme.variantModalEnterCurve : Theme.variantModalExitCurve
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Behavior on y {
|
||||||
|
NumberAnimation {
|
||||||
|
duration: Theme.variantDuration(Theme.expressiveDurations.fast, overlayWindow.shouldShowSpotlight)
|
||||||
|
easing.type: Easing.BezierSpline
|
||||||
|
easing.bezierCurve: spotlightContainer.visible ? Theme.variantModalEnterCurve : Theme.variantModalExitCurve
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,30 +62,30 @@ Item {
|
|||||||
|
|
||||||
Behavior on x {
|
Behavior on x {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Theme.expressiveDurations.expressiveDefaultSpatial
|
duration: Theme.variantDuration(Theme.expressiveDurations.expressiveDefaultSpatial, overviewOpen)
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: Theme.expressiveCurves.emphasizedDecel
|
easing.bezierCurve: Theme.variantModalEnterCurve
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Behavior on y {
|
Behavior on y {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Theme.expressiveDurations.expressiveDefaultSpatial
|
duration: Theme.variantDuration(Theme.expressiveDurations.expressiveDefaultSpatial, overviewOpen)
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: Theme.expressiveCurves.emphasizedDecel
|
easing.bezierCurve: Theme.variantModalEnterCurve
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Behavior on width {
|
Behavior on width {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Theme.expressiveDurations.expressiveDefaultSpatial
|
duration: Theme.variantDuration(Theme.expressiveDurations.expressiveDefaultSpatial, overviewOpen)
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: Theme.expressiveCurves.emphasizedDecel
|
easing.bezierCurve: Theme.variantModalEnterCurve
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Behavior on height {
|
Behavior on height {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Theme.expressiveDurations.expressiveDefaultSpatial
|
duration: Theme.variantDuration(Theme.expressiveDurations.expressiveDefaultSpatial, overviewOpen)
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: Theme.expressiveCurves.emphasizedDecel
|
easing.bezierCurve: Theme.variantModalEnterCurve
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,16 +124,16 @@ Item {
|
|||||||
|
|
||||||
Behavior on width {
|
Behavior on width {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Theme.expressiveDurations.expressiveDefaultSpatial
|
duration: Theme.variantDuration(Theme.expressiveDurations.expressiveDefaultSpatial, overviewOpen)
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: Theme.expressiveCurves.emphasizedDecel
|
easing.bezierCurve: Theme.variantModalEnterCurve
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Behavior on height {
|
Behavior on height {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: Theme.expressiveDurations.expressiveDefaultSpatial
|
duration: Theme.variantDuration(Theme.expressiveDurations.expressiveDefaultSpatial, overviewOpen)
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: Theme.expressiveCurves.emphasizedDecel
|
easing.bezierCurve: Theme.variantModalEnterCurve
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ Singleton {
|
|||||||
property var powerUnplugSound: null
|
property var powerUnplugSound: null
|
||||||
property var normalNotificationSound: null
|
property var normalNotificationSound: null
|
||||||
property var criticalNotificationSound: null
|
property var criticalNotificationSound: null
|
||||||
|
property var loginSound: null
|
||||||
property real notificationsVolume: 1.0
|
property real notificationsVolume: 1.0
|
||||||
property bool notificationsAudioMuted: false
|
property bool notificationsAudioMuted: false
|
||||||
|
|
||||||
@@ -67,6 +68,16 @@ Singleton {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Used in playLoginSoundIfApplicable()
|
||||||
|
Process {
|
||||||
|
id: loginSoundChecker
|
||||||
|
onExited: (exitCode) => {
|
||||||
|
if (exitCode === 0) {
|
||||||
|
playLoginSound();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function getAvailableSinks() {
|
function getAvailableSinks() {
|
||||||
const hidden = SessionData.hiddenOutputDeviceNames ?? [];
|
const hidden = SessionData.hiddenOutputDeviceNames ?? [];
|
||||||
return Pipewire.nodes.values.filter(node => node.audio && node.isSink && !node.isStream && !hidden.includes(node.name));
|
return Pipewire.nodes.values.filter(node => node.audio && node.isSink && !node.isStream && !hidden.includes(node.name));
|
||||||
@@ -395,7 +406,7 @@ EOFCONFIG
|
|||||||
const themesToSearch = themeName !== "freedesktop" ? `${themeName} freedesktop` : themeName;
|
const themesToSearch = themeName !== "freedesktop" ? `${themeName} freedesktop` : themeName;
|
||||||
|
|
||||||
const script = `
|
const script = `
|
||||||
for event_key in audio-volume-change power-plug power-unplug message message-new-instant; do
|
for event_key in audio-volume-change power-plug power-unplug message message-new-instant desktop-login; do
|
||||||
found=0
|
found=0
|
||||||
|
|
||||||
case "$event_key" in
|
case "$event_key" in
|
||||||
@@ -457,7 +468,8 @@ EOFCONFIG
|
|||||||
"power-plug": "../assets/sounds/plasma/power-plug.wav",
|
"power-plug": "../assets/sounds/plasma/power-plug.wav",
|
||||||
"power-unplug": "../assets/sounds/plasma/power-unplug.wav",
|
"power-unplug": "../assets/sounds/plasma/power-unplug.wav",
|
||||||
"message": "../assets/sounds/freedesktop/message.wav",
|
"message": "../assets/sounds/freedesktop/message.wav",
|
||||||
"message-new-instant": "../assets/sounds/freedesktop/message-new-instant.wav"
|
"message-new-instant": "../assets/sounds/freedesktop/message-new-instant.wav",
|
||||||
|
"desktop-login": "../assets/sounds/freedesktop/desktop-login.wav"
|
||||||
};
|
};
|
||||||
|
|
||||||
const specialConditions = {
|
const specialConditions = {
|
||||||
@@ -551,6 +563,10 @@ EOFCONFIG
|
|||||||
criticalNotificationSound.destroy();
|
criticalNotificationSound.destroy();
|
||||||
criticalNotificationSound = null;
|
criticalNotificationSound = null;
|
||||||
}
|
}
|
||||||
|
if (loginSound) {
|
||||||
|
loginSound.destroy();
|
||||||
|
loginSound = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function createSoundPlayers() {
|
function createSoundPlayers() {
|
||||||
@@ -622,6 +638,19 @@ EOFCONFIG
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
`, root, "AudioService.CriticalNotificationSound");
|
`, root, "AudioService.CriticalNotificationSound");
|
||||||
|
|
||||||
|
const loginPath = getSoundPath("desktop-login");
|
||||||
|
loginSound = Qt.createQmlObject(`
|
||||||
|
import QtQuick
|
||||||
|
import QtMultimedia
|
||||||
|
MediaPlayer {
|
||||||
|
source: "${loginPath}"
|
||||||
|
audioOutput: AudioOutput {
|
||||||
|
${deviceProperty}volume: notificationsVolume
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`, root, "AudioService.LoginSound");
|
||||||
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn("AudioService: Error creating sound players:", e);
|
console.warn("AudioService: Error creating sound players:", e);
|
||||||
}
|
}
|
||||||
@@ -661,6 +690,31 @@ EOFCONFIG
|
|||||||
criticalNotificationSound.play();
|
criticalNotificationSound.play();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function playLoginSound() {
|
||||||
|
if (!soundsAvailable || !loginSound || notificationsAudioMuted || isMediaPlaying()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
loginSound.play();
|
||||||
|
}
|
||||||
|
|
||||||
|
function playLoginSoundIfApplicable() {
|
||||||
|
if (SettingsData.soundsEnabled && SettingsData.soundLogin && !notificationsAudioMuted) {
|
||||||
|
// plays login sound on session start, but only if a specific file doesn't exist,
|
||||||
|
// to prevent it from playing on every DMS restart during the session
|
||||||
|
const runtimeDir = Quickshell.env("XDG_RUNTIME_DIR");
|
||||||
|
const sessionId = Quickshell.env("XDG_SESSION_ID") || "0";
|
||||||
|
|
||||||
|
if (!runtimeDir) return;
|
||||||
|
|
||||||
|
const loginFile = `${runtimeDir}/danklinux.login-${sessionId}`;
|
||||||
|
|
||||||
|
// if file doesn't exist, touch it (0)
|
||||||
|
// If it exists, do nothing (1)
|
||||||
|
loginSoundChecker.command = ["sh", "-c", `[ ! -f ${loginFile} ] && touch ${loginFile}`];
|
||||||
|
loginSoundChecker.running = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function playVolumeChangeSoundIfEnabled() {
|
function playVolumeChangeSoundIfEnabled() {
|
||||||
if (SettingsData.soundsEnabled && SettingsData.soundVolumeChanged && !notificationsAudioMuted) {
|
if (SettingsData.soundsEnabled && SettingsData.soundVolumeChanged && !notificationsAudioMuted) {
|
||||||
playVolumeChangeSound();
|
playVolumeChangeSound();
|
||||||
|
|||||||
@@ -3,13 +3,16 @@ pragma ComponentBehavior: Bound
|
|||||||
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import Quickshell
|
import Quickshell
|
||||||
|
import Quickshell.Io
|
||||||
import Quickshell.Wayland // ! Import is needed despite what qmlls says
|
import Quickshell.Wayland // ! Import is needed despite what qmlls says
|
||||||
import qs.Common
|
import qs.Common
|
||||||
|
|
||||||
Singleton {
|
Singleton {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property bool available: false
|
property bool quickshellSupported: false
|
||||||
|
property bool compositorSupported: false
|
||||||
|
property bool available: quickshellSupported && compositorSupported
|
||||||
readonly property bool enabled: available && (SettingsData.blurEnabled ?? false)
|
readonly property bool enabled: available && (SettingsData.blurEnabled ?? false)
|
||||||
|
|
||||||
readonly property color borderColor: {
|
readonly property color borderColor: {
|
||||||
@@ -72,6 +75,27 @@ Singleton {
|
|||||||
region.destroy();
|
region.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Process {
|
||||||
|
id: blurProbe
|
||||||
|
running: false
|
||||||
|
command: ["dms", "blur", "check"]
|
||||||
|
|
||||||
|
stdout: StdioCollector {
|
||||||
|
onStreamFinished: {
|
||||||
|
root.compositorSupported = text.trim() === "supported";
|
||||||
|
if (root.compositorSupported)
|
||||||
|
console.info("BlurService: Compositor supports ext-background-effect-v1");
|
||||||
|
else
|
||||||
|
console.info("BlurService: Compositor does not support ext-background-effect-v1");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onExited: exitCode => {
|
||||||
|
if (exitCode !== 0)
|
||||||
|
console.warn("BlurService: blur probe failed with code:", exitCode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
try {
|
try {
|
||||||
const test = Qt.createQmlObject(`
|
const test = Qt.createQmlObject(`
|
||||||
@@ -79,8 +103,9 @@ Singleton {
|
|||||||
Region { radius: 0 }
|
Region { radius: 0 }
|
||||||
`, root, "BlurAvailabilityTest");
|
`, root, "BlurAvailabilityTest");
|
||||||
test.destroy();
|
test.destroy();
|
||||||
available = true;
|
quickshellSupported = true;
|
||||||
console.info("BlurService: Initialized with blur support");
|
console.info("BlurService: Quickshell blur support available");
|
||||||
|
blurProbe.running = true;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.info("BlurService: BackgroundEffect not available - blur disabled. Requires a newer version of Quickshell.");
|
console.info("BlurService: BackgroundEffect not available - blur disabled. Requires a newer version of Quickshell.");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -255,6 +255,12 @@ Singleton {
|
|||||||
return pinnedEntries.some(pinnedEntry => pinnedEntry.hash === entryHash);
|
return pinnedEntries.some(pinnedEntry => pinnedEntry.hash === entryHash);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onClipboardAvailableChanged: {
|
||||||
|
if (!clipboardAvailable || refCount <= 0)
|
||||||
|
return;
|
||||||
|
refresh();
|
||||||
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: DMSService
|
target: DMSService
|
||||||
enabled: root.refCount > 0
|
enabled: root.refCount > 0
|
||||||
|
|||||||
@@ -10,4 +10,20 @@ Singleton {
|
|||||||
|
|
||||||
readonly property list<MprisPlayer> availablePlayers: Mpris.players.values
|
readonly property list<MprisPlayer> availablePlayers: Mpris.players.values
|
||||||
property MprisPlayer activePlayer: availablePlayers.find(p => p.isPlaying) ?? availablePlayers.find(p => p.canControl && p.canPlay) ?? null
|
property MprisPlayer activePlayer: availablePlayers.find(p => p.isPlaying) ?? availablePlayers.find(p => p.canControl && p.canPlay) ?? null
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
interval: 1000
|
||||||
|
running: root.activePlayer?.playbackState === MprisPlaybackState.Playing
|
||||||
|
repeat: true
|
||||||
|
onTriggered: root.activePlayer?.positionChanged()
|
||||||
|
}
|
||||||
|
|
||||||
|
function previousOrRewind(): void {
|
||||||
|
if (!activePlayer)
|
||||||
|
return;
|
||||||
|
if (activePlayer.position > 8 && activePlayer.canSeek)
|
||||||
|
activePlayer.position = 0;
|
||||||
|
else if (activePlayer.canGoPrevious)
|
||||||
|
activePlayer.previous();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,159 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Shapes
|
||||||
|
import qs.Common
|
||||||
|
|
||||||
|
// Concave arc connector filling the gap between a bar corner and an adjacent surface.
|
||||||
|
//
|
||||||
|
// NOTE: FrameWindow now uses ConnectedShape.qml for frame-owned connected chrome
|
||||||
|
// (unified single-path rendering). This component is still used by DankPopout's
|
||||||
|
// own shadow source for non-frame-owned chrome (popouts on non-frame screens).
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
property string barSide: "top"
|
||||||
|
property string placement: "left"
|
||||||
|
property real spacing: 4
|
||||||
|
property real connectorRadius: 12
|
||||||
|
property color color: "transparent"
|
||||||
|
property real edgeStrokeWidth: 0
|
||||||
|
property color edgeStrokeColor: color
|
||||||
|
property real dpr: 1
|
||||||
|
|
||||||
|
readonly property bool isHorizontalBar: barSide === "top" || barSide === "bottom"
|
||||||
|
readonly property bool isPlacementLeft: placement === "left"
|
||||||
|
readonly property real _edgeStrokeWidth: Math.max(0, edgeStrokeWidth)
|
||||||
|
readonly property string arcCorner: {
|
||||||
|
if (barSide === "top")
|
||||||
|
return isPlacementLeft ? "bottomLeft" : "bottomRight";
|
||||||
|
if (barSide === "bottom")
|
||||||
|
return isPlacementLeft ? "topLeft" : "topRight";
|
||||||
|
if (barSide === "left")
|
||||||
|
return isPlacementLeft ? "topRight" : "bottomRight";
|
||||||
|
return isPlacementLeft ? "topLeft" : "bottomLeft";
|
||||||
|
}
|
||||||
|
readonly property real pathStartX: {
|
||||||
|
switch (arcCorner) {
|
||||||
|
case "topLeft":
|
||||||
|
return width;
|
||||||
|
case "topRight":
|
||||||
|
case "bottomLeft":
|
||||||
|
return 0;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
readonly property real pathStartY: {
|
||||||
|
switch (arcCorner) {
|
||||||
|
case "bottomRight":
|
||||||
|
return height;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
readonly property real firstLineX: {
|
||||||
|
switch (arcCorner) {
|
||||||
|
case "topLeft":
|
||||||
|
case "bottomLeft":
|
||||||
|
return width;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
readonly property real firstLineY: {
|
||||||
|
switch (arcCorner) {
|
||||||
|
case "topLeft":
|
||||||
|
case "topRight":
|
||||||
|
return height;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
readonly property real secondLineX: {
|
||||||
|
switch (arcCorner) {
|
||||||
|
case "topRight":
|
||||||
|
case "bottomLeft":
|
||||||
|
case "bottomRight":
|
||||||
|
return width;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
readonly property real secondLineY: {
|
||||||
|
switch (arcCorner) {
|
||||||
|
case "topLeft":
|
||||||
|
case "topRight":
|
||||||
|
case "bottomLeft":
|
||||||
|
return height;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
readonly property real arcCenterX: arcCorner === "topRight" || arcCorner === "bottomRight" ? width : 0
|
||||||
|
readonly property real arcCenterY: arcCorner === "bottomLeft" || arcCorner === "bottomRight" ? height : 0
|
||||||
|
readonly property real arcStartAngle: {
|
||||||
|
switch (arcCorner) {
|
||||||
|
case "topLeft":
|
||||||
|
case "topRight":
|
||||||
|
return 90;
|
||||||
|
case "bottomLeft":
|
||||||
|
return 0;
|
||||||
|
default:
|
||||||
|
return -90;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
readonly property real arcSweepAngle: {
|
||||||
|
switch (arcCorner) {
|
||||||
|
case "topRight":
|
||||||
|
return 90;
|
||||||
|
default:
|
||||||
|
return -90;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
width: isHorizontalBar ? connectorRadius : (spacing + connectorRadius)
|
||||||
|
height: isHorizontalBar ? (spacing + connectorRadius) : connectorRadius
|
||||||
|
|
||||||
|
Shape {
|
||||||
|
x: -root._edgeStrokeWidth
|
||||||
|
y: -root._edgeStrokeWidth
|
||||||
|
width: root.width + root._edgeStrokeWidth * 2
|
||||||
|
height: root.height + root._edgeStrokeWidth * 2
|
||||||
|
asynchronous: false
|
||||||
|
antialiasing: true
|
||||||
|
preferredRendererType: Shape.CurveRenderer
|
||||||
|
layer.enabled: true
|
||||||
|
layer.smooth: true
|
||||||
|
layer.textureSize: root.dpr > 1 ? Qt.size(Math.ceil(width * root.dpr), Math.ceil(height * root.dpr)) : Qt.size(0, 0)
|
||||||
|
|
||||||
|
ShapePath {
|
||||||
|
fillColor: root.color
|
||||||
|
strokeColor: root._edgeStrokeWidth > 0 ? root.edgeStrokeColor : "transparent"
|
||||||
|
strokeWidth: root._edgeStrokeWidth * 2
|
||||||
|
joinStyle: ShapePath.RoundJoin
|
||||||
|
capStyle: ShapePath.RoundCap
|
||||||
|
fillRule: ShapePath.WindingFill
|
||||||
|
startX: root.pathStartX + root._edgeStrokeWidth
|
||||||
|
startY: root.pathStartY + root._edgeStrokeWidth
|
||||||
|
|
||||||
|
PathLine {
|
||||||
|
x: root.firstLineX + root._edgeStrokeWidth
|
||||||
|
y: root.firstLineY + root._edgeStrokeWidth
|
||||||
|
}
|
||||||
|
|
||||||
|
PathLine {
|
||||||
|
x: root.secondLineX + root._edgeStrokeWidth
|
||||||
|
y: root.secondLineY + root._edgeStrokeWidth
|
||||||
|
}
|
||||||
|
|
||||||
|
PathAngleArc {
|
||||||
|
centerX: root.arcCenterX + root._edgeStrokeWidth
|
||||||
|
centerY: root.arcCenterY + root._edgeStrokeWidth
|
||||||
|
radiusX: root.connectorRadius
|
||||||
|
radiusY: root.connectorRadius
|
||||||
|
startAngle: root.arcStartAngle
|
||||||
|
sweepAngle: root.arcSweepAngle
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,286 @@
|
|||||||
|
import QtQuick
|
||||||
|
import QtQuick.Shapes
|
||||||
|
import qs.Common
|
||||||
|
|
||||||
|
// Unified connected silhouette: body + concave arcs as one ShapePath.
|
||||||
|
// PathArc pattern — 4 arcs + 4 lines, no sibling alignment.
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
property string barSide: "top"
|
||||||
|
|
||||||
|
property real bodyWidth: 0
|
||||||
|
property real bodyHeight: 0
|
||||||
|
|
||||||
|
property real connectorRadius: 12
|
||||||
|
|
||||||
|
property real surfaceRadius: 12
|
||||||
|
|
||||||
|
property color fillColor: "transparent"
|
||||||
|
|
||||||
|
// ── Derived layout ──
|
||||||
|
readonly property bool _horiz: barSide === "top" || barSide === "bottom"
|
||||||
|
readonly property real _cr: Math.max(0, connectorRadius)
|
||||||
|
readonly property real _sr: Math.max(0, Math.min(surfaceRadius, (_horiz ? bodyWidth : bodyHeight) / 2, (_horiz ? bodyHeight : bodyWidth) / 2))
|
||||||
|
|
||||||
|
// Root-level aliases — PathArc/PathLine elements can't use `parent`.
|
||||||
|
readonly property real _bw: bodyWidth
|
||||||
|
readonly property real _bh: bodyHeight
|
||||||
|
readonly property real _totalW: _horiz ? _bw + _cr * 2 : _bw
|
||||||
|
readonly property real _totalH: _horiz ? _bh : _bh + _cr * 2
|
||||||
|
|
||||||
|
width: _totalW
|
||||||
|
height: _totalH
|
||||||
|
|
||||||
|
readonly property real bodyX: _horiz ? _cr : 0
|
||||||
|
readonly property real bodyY: _horiz ? 0 : _cr
|
||||||
|
|
||||||
|
Shape {
|
||||||
|
anchors.fill: parent
|
||||||
|
asynchronous: false
|
||||||
|
preferredRendererType: Shape.CurveRenderer
|
||||||
|
|
||||||
|
ShapePath {
|
||||||
|
fillColor: root.fillColor
|
||||||
|
strokeWidth: -1
|
||||||
|
fillRule: ShapePath.WindingFill
|
||||||
|
|
||||||
|
// CW path: bar edge → concave arc → body → convex arc → far edge → convex arc → body → concave arc
|
||||||
|
|
||||||
|
startX: root.barSide === "right" ? root._totalW : 0
|
||||||
|
startY: {
|
||||||
|
switch (root.barSide) {
|
||||||
|
case "bottom":
|
||||||
|
return root._totalH;
|
||||||
|
case "left":
|
||||||
|
return root._totalH;
|
||||||
|
case "right":
|
||||||
|
return 0;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Bar edge
|
||||||
|
PathLine {
|
||||||
|
x: {
|
||||||
|
switch (root.barSide) {
|
||||||
|
case "left":
|
||||||
|
return 0;
|
||||||
|
case "right":
|
||||||
|
return root._totalW;
|
||||||
|
default:
|
||||||
|
return root._totalW;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
y: {
|
||||||
|
switch (root.barSide) {
|
||||||
|
case "bottom":
|
||||||
|
return root._totalH;
|
||||||
|
case "left":
|
||||||
|
return 0;
|
||||||
|
case "right":
|
||||||
|
return root._totalH;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Concave arc 1
|
||||||
|
PathArc {
|
||||||
|
relativeX: {
|
||||||
|
switch (root.barSide) {
|
||||||
|
case "left":
|
||||||
|
return root._cr;
|
||||||
|
case "right":
|
||||||
|
return -root._cr;
|
||||||
|
default:
|
||||||
|
return -root._cr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
relativeY: {
|
||||||
|
switch (root.barSide) {
|
||||||
|
case "bottom":
|
||||||
|
return -root._cr;
|
||||||
|
case "left":
|
||||||
|
return root._cr;
|
||||||
|
case "right":
|
||||||
|
return -root._cr;
|
||||||
|
default:
|
||||||
|
return root._cr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
radiusX: root._cr
|
||||||
|
radiusY: root._cr
|
||||||
|
direction: PathArc.Counterclockwise
|
||||||
|
}
|
||||||
|
|
||||||
|
// Body edge to first convex corner
|
||||||
|
PathLine {
|
||||||
|
x: {
|
||||||
|
switch (root.barSide) {
|
||||||
|
case "left":
|
||||||
|
return root._bw - root._sr;
|
||||||
|
case "right":
|
||||||
|
return root._sr;
|
||||||
|
default:
|
||||||
|
return root._totalW - root._cr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
y: {
|
||||||
|
switch (root.barSide) {
|
||||||
|
case "bottom":
|
||||||
|
return root._sr;
|
||||||
|
case "left":
|
||||||
|
return root._cr;
|
||||||
|
case "right":
|
||||||
|
return root._cr + root._bh;
|
||||||
|
default:
|
||||||
|
return root._totalH - root._sr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convex arc 1
|
||||||
|
PathArc {
|
||||||
|
relativeX: {
|
||||||
|
switch (root.barSide) {
|
||||||
|
case "left":
|
||||||
|
return root._sr;
|
||||||
|
case "right":
|
||||||
|
return -root._sr;
|
||||||
|
default:
|
||||||
|
return -root._sr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
relativeY: {
|
||||||
|
switch (root.barSide) {
|
||||||
|
case "bottom":
|
||||||
|
return -root._sr;
|
||||||
|
case "left":
|
||||||
|
return root._sr;
|
||||||
|
case "right":
|
||||||
|
return -root._sr;
|
||||||
|
default:
|
||||||
|
return root._sr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
radiusX: root._sr
|
||||||
|
radiusY: root._sr
|
||||||
|
direction: PathArc.Clockwise
|
||||||
|
}
|
||||||
|
|
||||||
|
// Far edge
|
||||||
|
PathLine {
|
||||||
|
x: {
|
||||||
|
switch (root.barSide) {
|
||||||
|
case "left":
|
||||||
|
return root._bw;
|
||||||
|
case "right":
|
||||||
|
return 0;
|
||||||
|
default:
|
||||||
|
return root._cr + root._sr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
y: {
|
||||||
|
switch (root.barSide) {
|
||||||
|
case "bottom":
|
||||||
|
return 0;
|
||||||
|
case "left":
|
||||||
|
return root._cr + root._bh - root._sr;
|
||||||
|
case "right":
|
||||||
|
return root._cr + root._sr;
|
||||||
|
default:
|
||||||
|
return root._totalH;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convex arc 2
|
||||||
|
PathArc {
|
||||||
|
relativeX: {
|
||||||
|
switch (root.barSide) {
|
||||||
|
case "left":
|
||||||
|
return -root._sr;
|
||||||
|
case "right":
|
||||||
|
return root._sr;
|
||||||
|
default:
|
||||||
|
return -root._sr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
relativeY: {
|
||||||
|
switch (root.barSide) {
|
||||||
|
case "bottom":
|
||||||
|
return root._sr;
|
||||||
|
case "left":
|
||||||
|
return root._sr;
|
||||||
|
case "right":
|
||||||
|
return -root._sr;
|
||||||
|
default:
|
||||||
|
return -root._sr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
radiusX: root._sr
|
||||||
|
radiusY: root._sr
|
||||||
|
direction: PathArc.Clockwise
|
||||||
|
}
|
||||||
|
|
||||||
|
// Body edge to second concave arc
|
||||||
|
PathLine {
|
||||||
|
x: {
|
||||||
|
switch (root.barSide) {
|
||||||
|
case "left":
|
||||||
|
return root._cr;
|
||||||
|
case "right":
|
||||||
|
return root._bw - root._cr;
|
||||||
|
default:
|
||||||
|
return root._cr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
y: {
|
||||||
|
switch (root.barSide) {
|
||||||
|
case "bottom":
|
||||||
|
return root._totalH - root._cr;
|
||||||
|
case "left":
|
||||||
|
return root._cr + root._bh;
|
||||||
|
case "right":
|
||||||
|
return root._cr;
|
||||||
|
default:
|
||||||
|
return root._cr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Concave arc 2
|
||||||
|
PathArc {
|
||||||
|
relativeX: {
|
||||||
|
switch (root.barSide) {
|
||||||
|
case "left":
|
||||||
|
return -root._cr;
|
||||||
|
case "right":
|
||||||
|
return root._cr;
|
||||||
|
default:
|
||||||
|
return -root._cr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
relativeY: {
|
||||||
|
switch (root.barSide) {
|
||||||
|
case "bottom":
|
||||||
|
return root._cr;
|
||||||
|
case "left":
|
||||||
|
return root._cr;
|
||||||
|
case "right":
|
||||||
|
return -root._cr;
|
||||||
|
default:
|
||||||
|
return -root._cr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
radiusX: root._cr
|
||||||
|
radiusY: root._cr
|
||||||
|
direction: PathArc.Counterclockwise
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -89,7 +89,7 @@ Row {
|
|||||||
width: Math.max(contentItem.implicitWidth + root.buttonPadding * 2, root.minButtonWidth) + (selected ? 4 : 0)
|
width: Math.max(contentItem.implicitWidth + root.buttonPadding * 2, root.minButtonWidth) + (selected ? 4 : 0)
|
||||||
height: root.buttonHeight
|
height: root.buttonHeight
|
||||||
|
|
||||||
color: selected ? Theme.buttonBg : Theme.surfaceVariant
|
color: selected ? Theme.buttonBg : Theme.withAlpha(Theme.surfaceVariant, Theme.popupTransparency)
|
||||||
border.color: "transparent"
|
border.color: "transparent"
|
||||||
border.width: 0
|
border.width: 0
|
||||||
|
|
||||||
|
|||||||
@@ -266,7 +266,7 @@ PanelWindow {
|
|||||||
scale: shouldBeVisible ? 1 : 0.9
|
scale: shouldBeVisible ? 1 : 0.9
|
||||||
|
|
||||||
property bool childHovered: false
|
property bool childHovered: false
|
||||||
readonly property real popupSurfaceAlpha: SettingsData.popupTransparency
|
readonly property real popupSurfaceAlpha: Theme.popupTransparency
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: background
|
id: background
|
||||||
@@ -286,7 +286,7 @@ PanelWindow {
|
|||||||
level: Theme.elevationLevel3
|
level: Theme.elevationLevel3
|
||||||
fallbackOffset: 6
|
fallbackOffset: 6
|
||||||
targetRadius: Theme.cornerRadius
|
targetRadius: Theme.cornerRadius
|
||||||
targetColor: Theme.surfaceContainer
|
targetColor: Theme.withAlpha(Theme.surfaceContainer, osdContainer.popupSurfaceAlpha)
|
||||||
borderColor: Theme.outlineMedium
|
borderColor: Theme.outlineMedium
|
||||||
borderWidth: 1
|
borderWidth: 1
|
||||||
shadowEnabled: Theme.elevationEnabled && SettingsData.popoutElevationEnabled && Quickshell.env("DMS_DISABLE_LAYER") !== "true" && Quickshell.env("DMS_DISABLE_LAYER") !== "1"
|
shadowEnabled: Theme.elevationEnabled && SettingsData.popoutElevationEnabled && Quickshell.env("DMS_DISABLE_LAYER") !== "true" && Quickshell.env("DMS_DISABLE_LAYER") !== "1"
|
||||||
|
|||||||
@@ -20,10 +20,10 @@ Item {
|
|||||||
property string triggerSection: ""
|
property string triggerSection: ""
|
||||||
property string positioning: "center"
|
property string positioning: "center"
|
||||||
property int animationDuration: Theme.popoutAnimationDuration
|
property int animationDuration: Theme.popoutAnimationDuration
|
||||||
property real animationScaleCollapsed: 0.96
|
property real animationScaleCollapsed: Theme.effectScaleCollapsed
|
||||||
property real animationOffset: Theme.spacingL
|
property real animationOffset: Theme.effectAnimOffset
|
||||||
property list<real> animationEnterCurve: Theme.expressiveCurves.expressiveDefaultSpatial
|
property list<real> animationEnterCurve: Theme.variantPopoutEnterCurve
|
||||||
property list<real> animationExitCurve: Theme.expressiveCurves.emphasized
|
property list<real> animationExitCurve: Theme.variantPopoutExitCurve
|
||||||
property bool suspendShadowWhileResizing: false
|
property bool suspendShadowWhileResizing: false
|
||||||
property bool shouldBeVisible: false
|
property bool shouldBeVisible: false
|
||||||
property var customKeyboardFocus: null
|
property var customKeyboardFocus: null
|
||||||
@@ -34,6 +34,8 @@ Item {
|
|||||||
property bool _resizeActive: false
|
property bool _resizeActive: false
|
||||||
property real _surfaceMarginLeft: 0
|
property real _surfaceMarginLeft: 0
|
||||||
property real _surfaceW: 0
|
property real _surfaceW: 0
|
||||||
|
property string _chromeClaimId: ""
|
||||||
|
property int _connectedChromeSerial: 0
|
||||||
|
|
||||||
property real storedBarThickness: Theme.barHeight - 4
|
property real storedBarThickness: Theme.barHeight - 4
|
||||||
property real storedBarSpacing: 4
|
property real storedBarSpacing: 4
|
||||||
@@ -47,6 +49,8 @@ Item {
|
|||||||
property var screen: null
|
property var screen: null
|
||||||
|
|
||||||
readonly property real effectiveBarThickness: {
|
readonly property real effectiveBarThickness: {
|
||||||
|
if (Theme.isConnectedEffect)
|
||||||
|
return Math.max(0, storedBarThickness);
|
||||||
const padding = storedBarConfig ? (storedBarConfig.innerPadding !== undefined ? storedBarConfig.innerPadding : 4) : 4;
|
const padding = storedBarConfig ? (storedBarConfig.innerPadding !== undefined ? storedBarConfig.innerPadding : 4) : 4;
|
||||||
return Math.max(26 + padding * 0.6, Theme.barHeight - 4 - (8 - padding)) + storedBarSpacing;
|
return Math.max(26 + padding * 0.6, Theme.barHeight - 4 - (8 - padding)) + storedBarSpacing;
|
||||||
}
|
}
|
||||||
@@ -68,12 +72,14 @@ Item {
|
|||||||
readonly property real barWidth: barBounds.width
|
readonly property real barWidth: barBounds.width
|
||||||
readonly property real barHeight: barBounds.height
|
readonly property real barHeight: barBounds.height
|
||||||
readonly property real barWingSize: barBounds.wingSize
|
readonly property real barWingSize: barBounds.wingSize
|
||||||
|
readonly property bool effectiveSurfaceBlurEnabled: Theme.connectedSurfaceBlurEnabled
|
||||||
|
|
||||||
signal opened
|
signal opened
|
||||||
signal popoutClosed
|
signal popoutClosed
|
||||||
signal backgroundClicked
|
signal backgroundClicked
|
||||||
|
|
||||||
property var _lastOpenedScreen: null
|
property var _lastOpenedScreen: null
|
||||||
|
property bool isClosing: false
|
||||||
|
|
||||||
property int effectiveBarPosition: 0
|
property int effectiveBarPosition: 0
|
||||||
property real effectiveBarBottomGap: 0
|
property real effectiveBarBottomGap: 0
|
||||||
@@ -147,7 +153,102 @@ Item {
|
|||||||
setBarContext(pos, bottomGap);
|
setBarContext(pos, bottomGap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function _nextChromeClaimId() {
|
||||||
|
_connectedChromeSerial += 1;
|
||||||
|
return layerNamespace + ":" + _connectedChromeSerial + ":" + (new Date()).getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
function _connectedChromeState(visibleOverride) {
|
||||||
|
const visible = visibleOverride !== undefined ? !!visibleOverride : contentWindow.visible;
|
||||||
|
return {
|
||||||
|
"visible": visible,
|
||||||
|
"barSide": contentContainer.connectedBarSide,
|
||||||
|
"bodyX": root.alignedX,
|
||||||
|
"bodyY": root.alignedY,
|
||||||
|
"bodyW": root.alignedWidth,
|
||||||
|
"bodyH": root.alignedHeight,
|
||||||
|
"animX": contentContainer.animX,
|
||||||
|
"animY": contentContainer.animY,
|
||||||
|
"screen": root.screen ? root.screen.name : ""
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function _publishConnectedChromeState(forceClaim, visibleOverride) {
|
||||||
|
if (!root.frameOwnsConnectedChrome || !root.screen || !_chromeClaimId)
|
||||||
|
return;
|
||||||
|
|
||||||
|
const state = _connectedChromeState(visibleOverride);
|
||||||
|
if (forceClaim || !ConnectedModeState.hasPopoutOwner(_chromeClaimId)) {
|
||||||
|
ConnectedModeState.claimPopout(_chromeClaimId, state);
|
||||||
|
} else {
|
||||||
|
ConnectedModeState.updatePopout(_chromeClaimId, state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function _releaseConnectedChromeState() {
|
||||||
|
if (_chromeClaimId)
|
||||||
|
ConnectedModeState.releasePopout(_chromeClaimId);
|
||||||
|
_chromeClaimId = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
// ─── Exposed animation state for ConnectedModeState ────────────────────
|
||||||
|
readonly property real contentAnimX: contentContainer.animX
|
||||||
|
readonly property real contentAnimY: contentContainer.animY
|
||||||
|
|
||||||
|
// ─── ConnectedModeState sync ────────────────────────────────────────────
|
||||||
|
function _syncPopoutChromeState() {
|
||||||
|
if (!root.frameOwnsConnectedChrome) {
|
||||||
|
_releaseConnectedChromeState();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!root.screen) {
|
||||||
|
_releaseConnectedChromeState();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!contentWindow.visible && !shouldBeVisible)
|
||||||
|
return;
|
||||||
|
if (!_chromeClaimId)
|
||||||
|
_chromeClaimId = _nextChromeClaimId();
|
||||||
|
_publishConnectedChromeState(contentWindow.visible && !ConnectedModeState.hasPopoutOwner(_chromeClaimId));
|
||||||
|
}
|
||||||
|
|
||||||
|
onAlignedXChanged: _syncPopoutChromeState()
|
||||||
|
onAlignedYChanged: _syncPopoutChromeState()
|
||||||
|
onAlignedWidthChanged: _syncPopoutChromeState()
|
||||||
|
onContentAnimXChanged: _syncPopoutChromeState()
|
||||||
|
onContentAnimYChanged: _syncPopoutChromeState()
|
||||||
|
onScreenChanged: _syncPopoutChromeState()
|
||||||
|
onEffectiveBarPositionChanged: _syncPopoutChromeState()
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: contentWindow
|
||||||
|
function onVisibleChanged() {
|
||||||
|
if (contentWindow.visible)
|
||||||
|
root._publishConnectedChromeState(true);
|
||||||
|
else
|
||||||
|
root._releaseConnectedChromeState();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: SettingsData
|
||||||
|
function onConnectedFrameModeActiveChanged() {
|
||||||
|
if (root.frameOwnsConnectedChrome) {
|
||||||
|
if (contentWindow.visible || root.shouldBeVisible) {
|
||||||
|
if (!root._chromeClaimId)
|
||||||
|
root._chromeClaimId = root._nextChromeClaimId();
|
||||||
|
root._publishConnectedChromeState(true);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
root._releaseConnectedChromeState();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
readonly property bool useBackgroundWindow: !CompositorService.isHyprland || CompositorService.useHyprlandFocusGrab
|
readonly property bool useBackgroundWindow: !CompositorService.isHyprland || CompositorService.useHyprlandFocusGrab
|
||||||
|
readonly property bool frameOwnsConnectedChrome: SettingsData.connectedFrameModeActive
|
||||||
|
&& !!root.screen
|
||||||
|
&& SettingsData.isScreenInPreferences(root.screen, SettingsData.frameScreenPreferences)
|
||||||
|
|
||||||
function updateSurfacePosition() {
|
function updateSurfacePosition() {
|
||||||
if (useBackgroundWindow && shouldBeVisible) {
|
if (useBackgroundWindow && shouldBeVisible) {
|
||||||
@@ -156,10 +257,14 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
property bool animationsEnabled: true
|
||||||
|
|
||||||
function open() {
|
function open() {
|
||||||
if (!screen)
|
if (!screen)
|
||||||
return;
|
return;
|
||||||
closeTimer.stop();
|
closeTimer.stop();
|
||||||
|
isClosing = false;
|
||||||
|
animationsEnabled = false;
|
||||||
|
|
||||||
// Snapshot mask geometry
|
// Snapshot mask geometry
|
||||||
_frozenMaskX = maskX;
|
_frozenMaskX = maskX;
|
||||||
@@ -174,12 +279,29 @@ Item {
|
|||||||
}
|
}
|
||||||
_lastOpenedScreen = screen;
|
_lastOpenedScreen = screen;
|
||||||
|
|
||||||
shouldBeVisible = true;
|
if (contentContainer) {
|
||||||
|
contentContainer.animX = Theme.snap(contentContainer.offsetX, root.dpr);
|
||||||
|
contentContainer.animY = Theme.snap(contentContainer.offsetY, root.dpr);
|
||||||
|
contentContainer.scaleValue = root.animationScaleCollapsed;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (root.frameOwnsConnectedChrome) {
|
||||||
|
_chromeClaimId = _nextChromeClaimId();
|
||||||
|
_publishConnectedChromeState(true, true);
|
||||||
|
} else {
|
||||||
|
_chromeClaimId = "";
|
||||||
|
}
|
||||||
|
|
||||||
if (useBackgroundWindow) {
|
if (useBackgroundWindow) {
|
||||||
_surfaceMarginLeft = alignedX - shadowBuffer;
|
_surfaceMarginLeft = alignedX - shadowBuffer;
|
||||||
_surfaceW = alignedWidth + shadowBuffer * 2;
|
_surfaceW = alignedWidth + shadowBuffer * 2;
|
||||||
|
backgroundWindow.visible = true;
|
||||||
}
|
}
|
||||||
|
contentWindow.visible = true;
|
||||||
|
|
||||||
Qt.callLater(() => {
|
Qt.callLater(() => {
|
||||||
|
animationsEnabled = true;
|
||||||
|
shouldBeVisible = true;
|
||||||
if (shouldBeVisible && screen) {
|
if (shouldBeVisible && screen) {
|
||||||
if (useBackgroundWindow)
|
if (useBackgroundWindow)
|
||||||
backgroundWindow.visible = true;
|
backgroundWindow.visible = true;
|
||||||
@@ -191,6 +313,7 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function close() {
|
function close() {
|
||||||
|
isClosing = true;
|
||||||
shouldBeVisible = false;
|
shouldBeVisible = false;
|
||||||
_primeContent = false;
|
_primeContent = false;
|
||||||
PopoutManager.popoutChanged();
|
PopoutManager.popoutChanged();
|
||||||
@@ -222,9 +345,10 @@ Item {
|
|||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
id: closeTimer
|
id: closeTimer
|
||||||
interval: animationDuration
|
interval: Theme.variantCloseInterval(animationDuration)
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
if (!shouldBeVisible) {
|
if (!shouldBeVisible) {
|
||||||
|
isClosing = false;
|
||||||
contentWindow.visible = false;
|
contentWindow.visible = false;
|
||||||
if (useBackgroundWindow)
|
if (useBackgroundWindow)
|
||||||
backgroundWindow.visible = false;
|
backgroundWindow.visible = false;
|
||||||
@@ -234,19 +358,80 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component.onDestruction: _releaseConnectedChromeState()
|
||||||
|
|
||||||
readonly property real screenWidth: screen ? screen.width : 0
|
readonly property real screenWidth: screen ? screen.width : 0
|
||||||
readonly property real screenHeight: screen ? screen.height : 0
|
readonly property real screenHeight: screen ? screen.height : 0
|
||||||
readonly property real dpr: screen ? screen.devicePixelRatio : 1
|
readonly property real dpr: screen ? screen.devicePixelRatio : 1
|
||||||
|
readonly property real frameInset: {
|
||||||
|
if (!SettingsData.frameEnabled)
|
||||||
|
return 0;
|
||||||
|
const ft = SettingsData.frameThickness;
|
||||||
|
const fr = SettingsData.frameRounding;
|
||||||
|
const ccr = Theme.connectedCornerRadius;
|
||||||
|
if (Theme.isConnectedEffect)
|
||||||
|
return Math.max(ft * 4, ft + ccr * 2);
|
||||||
|
const useAutoGaps = storedBarConfig?.popupGapsAuto !== undefined ? storedBarConfig.popupGapsAuto : true;
|
||||||
|
const manualGapValue = storedBarConfig?.popupGapsManual !== undefined ? storedBarConfig.popupGapsManual : 6;
|
||||||
|
const gap = useAutoGaps ? Math.max(6, storedBarSpacing) : manualGapValue;
|
||||||
|
return Math.max(ft + gap, fr);
|
||||||
|
}
|
||||||
|
|
||||||
readonly property var shadowLevel: Theme.elevationLevel3
|
readonly property var shadowLevel: Theme.elevationLevel3
|
||||||
readonly property real shadowFallbackOffset: 6
|
readonly property real shadowFallbackOffset: 6
|
||||||
readonly property real shadowRenderPadding: (Theme.elevationEnabled && SettingsData.popoutElevationEnabled) ? Theme.elevationRenderPadding(shadowLevel, effectiveShadowDirection, shadowFallbackOffset, 8, 16) : 0
|
readonly property real shadowRenderPadding: (Theme.elevationEnabled && SettingsData.popoutElevationEnabled) ? Theme.elevationRenderPadding(shadowLevel, effectiveShadowDirection, shadowFallbackOffset, 8, 16) : 0
|
||||||
readonly property real shadowMotionPadding: Math.max(0, animationOffset)
|
readonly property real shadowMotionPadding: {
|
||||||
|
if (Theme.isConnectedEffect)
|
||||||
|
return Math.max(storedBarSpacing + Theme.connectedCornerRadius + 4, 40);
|
||||||
|
if (Theme.isDirectionalEffect) {
|
||||||
|
if (typeof SettingsData !== "undefined" && SettingsData.directionalAnimationMode !== 0)
|
||||||
|
return 16; // Slide Behind and Roll Out do not add animationOffset, enabling strict Wayland clipping.
|
||||||
|
return Math.max(0, animationOffset) + 16;
|
||||||
|
}
|
||||||
|
if (Theme.isDepthEffect)
|
||||||
|
return Math.max(0, animationOffset) + 8;
|
||||||
|
return Math.max(0, animationOffset);
|
||||||
|
}
|
||||||
readonly property real shadowBuffer: Theme.snap(shadowRenderPadding + shadowMotionPadding, dpr)
|
readonly property real shadowBuffer: Theme.snap(shadowRenderPadding + shadowMotionPadding, dpr)
|
||||||
readonly property real alignedWidth: Theme.px(popupWidth, dpr)
|
readonly property real alignedWidth: Theme.px(popupWidth, dpr)
|
||||||
readonly property real alignedHeight: Theme.px(popupHeight, dpr)
|
readonly property real alignedHeight: Theme.px(popupHeight, dpr)
|
||||||
|
readonly property real connectedAnchorX: {
|
||||||
|
if (!Theme.isConnectedEffect)
|
||||||
|
return triggerX;
|
||||||
|
switch (effectiveBarPosition) {
|
||||||
|
case SettingsData.Position.Left:
|
||||||
|
return barX + barWidth;
|
||||||
|
case SettingsData.Position.Right:
|
||||||
|
return barX;
|
||||||
|
default:
|
||||||
|
return triggerX;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
readonly property real connectedAnchorY: {
|
||||||
|
if (!Theme.isConnectedEffect)
|
||||||
|
return triggerY;
|
||||||
|
switch (effectiveBarPosition) {
|
||||||
|
case SettingsData.Position.Top:
|
||||||
|
return barY + barHeight;
|
||||||
|
case SettingsData.Position.Bottom:
|
||||||
|
return barY;
|
||||||
|
default:
|
||||||
|
return triggerY;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function adjacentBarClearance(exclusion) {
|
||||||
|
if (exclusion <= 0)
|
||||||
|
return 0;
|
||||||
|
if (!Theme.isConnectedEffect)
|
||||||
|
return exclusion;
|
||||||
|
// In a shared frame corner, the adjacent connected bar already occupies
|
||||||
|
// one rounded-corner radius before the popout's own connector begins.
|
||||||
|
return exclusion + Theme.connectedCornerRadius * 2;
|
||||||
|
}
|
||||||
|
|
||||||
onAlignedHeightChanged: {
|
onAlignedHeightChanged: {
|
||||||
|
_syncPopoutChromeState();
|
||||||
if (!suspendShadowWhileResizing || !shouldBeVisible)
|
if (!suspendShadowWhileResizing || !shouldBeVisible)
|
||||||
return;
|
return;
|
||||||
_resizeActive = true;
|
_resizeActive = true;
|
||||||
@@ -269,17 +454,22 @@ Item {
|
|||||||
readonly property real alignedX: Theme.snap((() => {
|
readonly property real alignedX: Theme.snap((() => {
|
||||||
const useAutoGaps = storedBarConfig?.popupGapsAuto !== undefined ? storedBarConfig.popupGapsAuto : true;
|
const useAutoGaps = storedBarConfig?.popupGapsAuto !== undefined ? storedBarConfig.popupGapsAuto : true;
|
||||||
const manualGapValue = storedBarConfig?.popupGapsManual !== undefined ? storedBarConfig.popupGapsManual : 4;
|
const manualGapValue = storedBarConfig?.popupGapsManual !== undefined ? storedBarConfig.popupGapsManual : 4;
|
||||||
const popupGap = useAutoGaps ? Math.max(4, storedBarSpacing) : manualGapValue;
|
const rawPopupGap = useAutoGaps ? Math.max(4, storedBarSpacing) : manualGapValue;
|
||||||
|
const popupGap = Theme.isConnectedEffect ? 0 : rawPopupGap;
|
||||||
|
const edgeGap = Math.max(popupGap, frameInset);
|
||||||
|
const anchorX = Theme.isConnectedEffect ? connectedAnchorX : triggerX;
|
||||||
|
|
||||||
switch (effectiveBarPosition) {
|
switch (effectiveBarPosition) {
|
||||||
case SettingsData.Position.Left:
|
case SettingsData.Position.Left:
|
||||||
return Math.max(popupGap, Math.min(screenWidth - popupWidth - popupGap, triggerX));
|
// bar on left: left side is bar-adjacent (popupGap), right side is frame-perpendicular (edgeGap)
|
||||||
|
return Math.max(popupGap, Math.min(screenWidth - popupWidth - edgeGap, anchorX));
|
||||||
case SettingsData.Position.Right:
|
case SettingsData.Position.Right:
|
||||||
return Math.max(popupGap, Math.min(screenWidth - popupWidth - popupGap, triggerX - popupWidth));
|
// bar on right: right side is bar-adjacent (popupGap), left side is frame-perpendicular (edgeGap)
|
||||||
|
return Math.max(edgeGap, Math.min(screenWidth - popupWidth - popupGap, anchorX - popupWidth));
|
||||||
default:
|
default:
|
||||||
const rawX = triggerX + (triggerWidth / 2) - (popupWidth / 2);
|
const rawX = triggerX + (triggerWidth / 2) - (popupWidth / 2);
|
||||||
const minX = adjacentBarInfo.leftBar > 0 ? adjacentBarInfo.leftBar : popupGap;
|
const minX = Math.max(edgeGap, adjacentBarClearance(adjacentBarInfo.leftBar));
|
||||||
const maxX = screenWidth - popupWidth - (adjacentBarInfo.rightBar > 0 ? adjacentBarInfo.rightBar : popupGap);
|
const maxX = screenWidth - popupWidth - Math.max(edgeGap, adjacentBarClearance(adjacentBarInfo.rightBar));
|
||||||
return Math.max(minX, Math.min(maxX, rawX));
|
return Math.max(minX, Math.min(maxX, rawX));
|
||||||
}
|
}
|
||||||
})(), dpr)
|
})(), dpr)
|
||||||
@@ -287,17 +477,22 @@ Item {
|
|||||||
readonly property real alignedY: Theme.snap((() => {
|
readonly property real alignedY: Theme.snap((() => {
|
||||||
const useAutoGaps = storedBarConfig?.popupGapsAuto !== undefined ? storedBarConfig.popupGapsAuto : true;
|
const useAutoGaps = storedBarConfig?.popupGapsAuto !== undefined ? storedBarConfig.popupGapsAuto : true;
|
||||||
const manualGapValue = storedBarConfig?.popupGapsManual !== undefined ? storedBarConfig.popupGapsManual : 4;
|
const manualGapValue = storedBarConfig?.popupGapsManual !== undefined ? storedBarConfig.popupGapsManual : 4;
|
||||||
const popupGap = useAutoGaps ? Math.max(4, storedBarSpacing) : manualGapValue;
|
const rawPopupGap = useAutoGaps ? Math.max(4, storedBarSpacing) : manualGapValue;
|
||||||
|
const popupGap = Theme.isConnectedEffect ? 0 : rawPopupGap;
|
||||||
|
const edgeGap = Math.max(popupGap, frameInset);
|
||||||
|
const anchorY = Theme.isConnectedEffect ? connectedAnchorY : triggerY;
|
||||||
|
|
||||||
switch (effectiveBarPosition) {
|
switch (effectiveBarPosition) {
|
||||||
case SettingsData.Position.Bottom:
|
case SettingsData.Position.Bottom:
|
||||||
return Math.max(popupGap, Math.min(screenHeight - popupHeight - popupGap, triggerY - popupHeight));
|
// bar on bottom: bottom side is bar-adjacent (popupGap), top side is frame-perpendicular (edgeGap)
|
||||||
|
return Math.max(edgeGap, Math.min(screenHeight - popupHeight - popupGap, anchorY - popupHeight));
|
||||||
case SettingsData.Position.Top:
|
case SettingsData.Position.Top:
|
||||||
return Math.max(popupGap, Math.min(screenHeight - popupHeight - popupGap, triggerY));
|
// bar on top: top side is bar-adjacent (popupGap), bottom side is frame-perpendicular (edgeGap)
|
||||||
|
return Math.max(popupGap, Math.min(screenHeight - popupHeight - edgeGap, anchorY));
|
||||||
default:
|
default:
|
||||||
const rawY = triggerY - (popupHeight / 2);
|
const rawY = triggerY - (popupHeight / 2);
|
||||||
const minY = adjacentBarInfo.topBar > 0 ? adjacentBarInfo.topBar : popupGap;
|
const minY = Math.max(edgeGap, adjacentBarClearance(adjacentBarInfo.topBar));
|
||||||
const maxY = screenHeight - popupHeight - (adjacentBarInfo.bottomBar > 0 ? adjacentBarInfo.bottomBar : popupGap);
|
const maxY = screenHeight - popupHeight - Math.max(edgeGap, adjacentBarClearance(adjacentBarInfo.bottomBar));
|
||||||
return Math.max(minY, Math.min(maxY, rawY));
|
return Math.max(minY, Math.min(maxY, rawY));
|
||||||
}
|
}
|
||||||
})(), dpr)
|
})(), dpr)
|
||||||
@@ -353,6 +548,10 @@ Item {
|
|||||||
|
|
||||||
mask: Region {
|
mask: Region {
|
||||||
item: maskRect
|
item: maskRect
|
||||||
|
Region {
|
||||||
|
item: contentExclusionRect
|
||||||
|
intersection: Intersection.Subtract
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
@@ -361,26 +560,70 @@ Item {
|
|||||||
color: "transparent"
|
color: "transparent"
|
||||||
x: root._frozenMaskX
|
x: root._frozenMaskX
|
||||||
y: root._frozenMaskY
|
y: root._frozenMaskY
|
||||||
width: (shouldBeVisible && backgroundInteractive) ? root._frozenMaskWidth : 0
|
width: (backgroundWindow.visible && backgroundInteractive) ? root._frozenMaskWidth : 0
|
||||||
height: (shouldBeVisible && backgroundInteractive) ? root._frozenMaskHeight : 0
|
height: (backgroundWindow.visible && backgroundInteractive) ? root._frozenMaskHeight : 0
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
Item {
|
||||||
|
id: contentExclusionRect
|
||||||
|
visible: false
|
||||||
|
x: root.alignedX
|
||||||
|
y: root.alignedY
|
||||||
|
width: root.alignedWidth
|
||||||
|
height: root.alignedHeight
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: outsideClickCatcher
|
||||||
x: root._frozenMaskX
|
x: root._frozenMaskX
|
||||||
y: root._frozenMaskY
|
y: root._frozenMaskY
|
||||||
width: root._frozenMaskWidth
|
width: root._frozenMaskWidth
|
||||||
height: root._frozenMaskHeight
|
height: root._frozenMaskHeight
|
||||||
hoverEnabled: false
|
enabled: root.shouldBeVisible && root.backgroundInteractive
|
||||||
enabled: shouldBeVisible && backgroundInteractive
|
|
||||||
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
|
|
||||||
onClicked: mouse => {
|
|
||||||
const clickX = mouse.x + root._frozenMaskX;
|
|
||||||
const clickY = mouse.y + root._frozenMaskY;
|
|
||||||
const outsideContent = clickX < root.alignedX || clickX > root.alignedX + root.alignedWidth || clickY < root.alignedY || clickY > root.alignedY + root.alignedHeight;
|
|
||||||
|
|
||||||
if (!outsideContent)
|
readonly property real contentLeft: Math.max(0, root.alignedX - x)
|
||||||
return;
|
readonly property real contentTop: Math.max(0, root.alignedY - y)
|
||||||
backgroundClicked();
|
readonly property real contentRight: Math.min(width, contentLeft + root.alignedWidth)
|
||||||
|
readonly property real contentBottom: Math.min(height, contentTop + root.alignedHeight)
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
x: 0
|
||||||
|
y: 0
|
||||||
|
width: outsideClickCatcher.width
|
||||||
|
height: Math.max(0, outsideClickCatcher.contentTop)
|
||||||
|
enabled: parent.enabled
|
||||||
|
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
|
||||||
|
onClicked: root.backgroundClicked()
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
x: 0
|
||||||
|
y: outsideClickCatcher.contentBottom
|
||||||
|
width: outsideClickCatcher.width
|
||||||
|
height: Math.max(0, outsideClickCatcher.height - outsideClickCatcher.contentBottom)
|
||||||
|
enabled: parent.enabled
|
||||||
|
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
|
||||||
|
onClicked: root.backgroundClicked()
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
x: 0
|
||||||
|
y: outsideClickCatcher.contentTop
|
||||||
|
width: Math.max(0, outsideClickCatcher.contentLeft)
|
||||||
|
height: Math.max(0, outsideClickCatcher.contentBottom - outsideClickCatcher.contentTop)
|
||||||
|
enabled: parent.enabled
|
||||||
|
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
|
||||||
|
onClicked: root.backgroundClicked()
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
x: outsideClickCatcher.contentRight
|
||||||
|
y: outsideClickCatcher.contentTop
|
||||||
|
width: Math.max(0, outsideClickCatcher.width - outsideClickCatcher.contentRight)
|
||||||
|
height: Math.max(0, outsideClickCatcher.contentBottom - outsideClickCatcher.contentTop)
|
||||||
|
enabled: parent.enabled
|
||||||
|
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
|
||||||
|
onClicked: root.backgroundClicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -401,12 +644,21 @@ Item {
|
|||||||
WindowBlur {
|
WindowBlur {
|
||||||
id: popoutBlur
|
id: popoutBlur
|
||||||
targetWindow: contentWindow
|
targetWindow: contentWindow
|
||||||
|
blurEnabled: root.effectiveSurfaceBlurEnabled && !root.frameOwnsConnectedChrome
|
||||||
|
|
||||||
readonly property real s: Math.min(1, contentContainer.scaleValue)
|
readonly property real s: Math.min(1, contentContainer.scaleValue)
|
||||||
blurX: contentContainer.x + contentContainer.width * (1 - s) * 0.5 + Theme.snap(contentContainer.animX, root.dpr)
|
readonly property bool trackBlurFromBarEdge: Theme.isConnectedEffect || (typeof SettingsData !== "undefined" && Theme.isDirectionalEffect && SettingsData.directionalAnimationMode !== 2)
|
||||||
blurY: contentContainer.y + contentContainer.height * (1 - s) * 0.5 + Theme.snap(contentContainer.animY, root.dpr)
|
|
||||||
blurWidth: (shouldBeVisible && contentWrapper.opacity > 0) ? contentContainer.width * s : 0
|
// Directional popouts clip to the bar edge, so the blur needs to grow from
|
||||||
blurHeight: (shouldBeVisible && contentWrapper.opacity > 0) ? contentContainer.height * s : 0
|
// that same edge instead of translating through the bar before settling.
|
||||||
blurRadius: Theme.cornerRadius
|
readonly property real _dyClamp: (contentContainer.barTop || contentContainer.barBottom) ? Math.max(-contentContainer.height, Math.min(contentContainer.animY, contentContainer.height)) : 0
|
||||||
|
readonly property real _dxClamp: (contentContainer.barLeft || contentContainer.barRight) ? Math.max(-contentContainer.width, Math.min(contentContainer.animX, contentContainer.width)) : 0
|
||||||
|
|
||||||
|
blurX: trackBlurFromBarEdge ? contentContainer.x + (contentContainer.barRight ? _dxClamp : 0) : contentContainer.x + contentContainer.width * (1 - s) * 0.5 + Theme.snap(contentContainer.animX, root.dpr) - contentContainer.horizontalConnectorExtent * s
|
||||||
|
blurY: trackBlurFromBarEdge ? contentContainer.y + (contentContainer.barBottom ? _dyClamp : 0) : contentContainer.y + contentContainer.height * (1 - s) * 0.5 + Theme.snap(contentContainer.animY, root.dpr) - contentContainer.verticalConnectorExtent * s
|
||||||
|
blurWidth: (shouldBeVisible && contentWrapper.opacity > 0) ? (trackBlurFromBarEdge ? Math.max(0, contentContainer.width - Math.abs(_dxClamp)) : (contentContainer.width + contentContainer.horizontalConnectorExtent * 2) * s) : 0
|
||||||
|
blurHeight: (shouldBeVisible && contentWrapper.opacity > 0) ? (trackBlurFromBarEdge ? Math.max(0, contentContainer.height - Math.abs(_dyClamp)) : (contentContainer.height + contentContainer.verticalConnectorExtent * 2) * s) : 0
|
||||||
|
blurRadius: Theme.isConnectedEffect ? Theme.connectedCornerRadius : Theme.connectedSurfaceRadius
|
||||||
}
|
}
|
||||||
|
|
||||||
WlrLayershell.namespace: root.layerNamespace
|
WlrLayershell.namespace: root.layerNamespace
|
||||||
@@ -436,7 +688,6 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
readonly property bool _fullHeight: useBackgroundWindow && root.fullHeightSurface
|
readonly property bool _fullHeight: useBackgroundWindow && root.fullHeightSurface
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
left: true
|
left: true
|
||||||
top: true
|
top: true
|
||||||
@@ -462,10 +713,10 @@ Item {
|
|||||||
Item {
|
Item {
|
||||||
id: contentMaskRect
|
id: contentMaskRect
|
||||||
visible: false
|
visible: false
|
||||||
x: contentContainer.x
|
x: contentContainer.x - contentContainer.horizontalConnectorExtent
|
||||||
y: contentContainer.y
|
y: contentContainer.y - contentContainer.verticalConnectorExtent
|
||||||
width: shouldBeVisible ? root.alignedWidth : 0
|
width: root.alignedWidth + contentContainer.horizontalConnectorExtent * 2
|
||||||
height: shouldBeVisible ? root.alignedHeight : 0
|
height: root.alignedHeight + contentContainer.verticalConnectorExtent * 2
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
@@ -494,12 +745,122 @@ Item {
|
|||||||
readonly property bool barBottom: effectiveBarPosition === SettingsData.Position.Bottom
|
readonly property bool barBottom: effectiveBarPosition === SettingsData.Position.Bottom
|
||||||
readonly property bool barLeft: effectiveBarPosition === SettingsData.Position.Left
|
readonly property bool barLeft: effectiveBarPosition === SettingsData.Position.Left
|
||||||
readonly property bool barRight: effectiveBarPosition === SettingsData.Position.Right
|
readonly property bool barRight: effectiveBarPosition === SettingsData.Position.Right
|
||||||
readonly property real offsetX: barLeft ? root.animationOffset : (barRight ? -root.animationOffset : 0)
|
readonly property string connectedBarSide: barTop ? "top" : (barBottom ? "bottom" : (barLeft ? "left" : "right"))
|
||||||
readonly property real offsetY: barBottom ? -root.animationOffset : (barTop ? root.animationOffset : 0)
|
readonly property real surfaceRadius: Theme.connectedSurfaceRadius
|
||||||
|
readonly property color surfaceColor: Theme.popupLayerColor(Theme.surfaceContainer)
|
||||||
|
readonly property color surfaceBorderColor: Theme.isConnectedEffect ? "transparent" : (BlurService.enabled ? BlurService.borderColor : Theme.outlineMedium)
|
||||||
|
readonly property real surfaceBorderWidth: Theme.isConnectedEffect ? 0 : BlurService.borderWidth
|
||||||
|
readonly property real surfaceTopLeftRadius: Theme.isConnectedEffect && (barTop || barLeft) ? 0 : surfaceRadius
|
||||||
|
readonly property real surfaceTopRightRadius: Theme.isConnectedEffect && (barTop || barRight) ? 0 : surfaceRadius
|
||||||
|
readonly property real surfaceBottomLeftRadius: Theme.isConnectedEffect && (barBottom || barLeft) ? 0 : surfaceRadius
|
||||||
|
readonly property real surfaceBottomRightRadius: Theme.isConnectedEffect && (barBottom || barRight) ? 0 : surfaceRadius
|
||||||
|
readonly property bool directionalEffect: Theme.isDirectionalEffect
|
||||||
|
readonly property bool depthEffect: Theme.isDepthEffect
|
||||||
|
readonly property real directionalTravelX: Math.max(root.animationOffset, root.alignedWidth + Theme.spacingL)
|
||||||
|
readonly property real directionalTravelY: Math.max(root.animationOffset, root.alignedHeight + Theme.spacingL)
|
||||||
|
readonly property real depthTravel: Math.max(root.animationOffset * 0.7, 28)
|
||||||
|
readonly property real sectionTilt: (triggerSection === "left" ? -1 : (triggerSection === "right" ? 1 : 0))
|
||||||
|
readonly property real horizontalConnectorExtent: Theme.isConnectedEffect && (barTop || barBottom) ? Theme.connectedCornerRadius : 0
|
||||||
|
readonly property real verticalConnectorExtent: Theme.isConnectedEffect && (barLeft || barRight) ? Theme.connectedCornerRadius : 0
|
||||||
|
|
||||||
|
function connectorWidth(spacing) {
|
||||||
|
return (barTop || barBottom) ? Theme.connectedCornerRadius : (spacing + Theme.connectedCornerRadius);
|
||||||
|
}
|
||||||
|
|
||||||
|
function connectorHeight(spacing) {
|
||||||
|
return (barTop || barBottom) ? (spacing + Theme.connectedCornerRadius) : Theme.connectedCornerRadius;
|
||||||
|
}
|
||||||
|
|
||||||
|
function connectorSeamX(baseX, bodyWidth, placement) {
|
||||||
|
if (barTop || barBottom)
|
||||||
|
return placement === "left" ? baseX : baseX + bodyWidth;
|
||||||
|
return barLeft ? baseX : baseX + bodyWidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
function connectorSeamY(baseY, bodyHeight, placement) {
|
||||||
|
if (barTop)
|
||||||
|
return baseY;
|
||||||
|
if (barBottom)
|
||||||
|
return baseY + bodyHeight;
|
||||||
|
return placement === "left" ? baseY : baseY + bodyHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
function connectorX(baseX, bodyWidth, placement, spacing) {
|
||||||
|
const seamX = connectorSeamX(baseX, bodyWidth, placement);
|
||||||
|
const width = connectorWidth(spacing);
|
||||||
|
if (barTop || barBottom)
|
||||||
|
return placement === "left" ? seamX - width : seamX;
|
||||||
|
return barLeft ? seamX : seamX - width;
|
||||||
|
}
|
||||||
|
|
||||||
|
function connectorY(baseY, bodyHeight, placement, spacing) {
|
||||||
|
const seamY = connectorSeamY(baseY, bodyHeight, placement);
|
||||||
|
const height = connectorHeight(spacing);
|
||||||
|
if (barTop)
|
||||||
|
return seamY;
|
||||||
|
if (barBottom)
|
||||||
|
return seamY - height;
|
||||||
|
return placement === "left" ? seamY - height : seamY;
|
||||||
|
}
|
||||||
|
|
||||||
|
readonly property real offsetX: {
|
||||||
|
if (directionalEffect) {
|
||||||
|
if (typeof SettingsData !== "undefined" && SettingsData.directionalAnimationMode === 2)
|
||||||
|
return 0;
|
||||||
|
if (barLeft)
|
||||||
|
return -directionalTravelX;
|
||||||
|
if (barRight)
|
||||||
|
return directionalTravelX;
|
||||||
|
if (barTop || barBottom)
|
||||||
|
return 0;
|
||||||
|
return sectionTilt * directionalTravelX * 0.2;
|
||||||
|
}
|
||||||
|
if (depthEffect) {
|
||||||
|
if (barLeft)
|
||||||
|
return -depthTravel;
|
||||||
|
if (barRight)
|
||||||
|
return depthTravel;
|
||||||
|
if (barTop || barBottom)
|
||||||
|
return 0;
|
||||||
|
return sectionTilt * depthTravel * 0.2;
|
||||||
|
}
|
||||||
|
return barLeft ? root.animationOffset : (barRight ? -root.animationOffset : 0);
|
||||||
|
}
|
||||||
|
readonly property real offsetY: {
|
||||||
|
if (directionalEffect) {
|
||||||
|
if (typeof SettingsData !== "undefined" && SettingsData.directionalAnimationMode === 2)
|
||||||
|
return 0;
|
||||||
|
if (barBottom)
|
||||||
|
return directionalTravelY;
|
||||||
|
if (barTop)
|
||||||
|
return -directionalTravelY;
|
||||||
|
if (barLeft || barRight)
|
||||||
|
return 0;
|
||||||
|
return directionalTravelY;
|
||||||
|
}
|
||||||
|
if (depthEffect) {
|
||||||
|
if (barBottom)
|
||||||
|
return depthTravel;
|
||||||
|
if (barTop)
|
||||||
|
return -depthTravel;
|
||||||
|
if (barLeft || barRight)
|
||||||
|
return 0;
|
||||||
|
return depthTravel;
|
||||||
|
}
|
||||||
|
return barBottom ? -root.animationOffset : (barTop ? root.animationOffset : 0);
|
||||||
|
}
|
||||||
|
|
||||||
property real animX: 0
|
property real animX: 0
|
||||||
property real animY: 0
|
property real animY: 0
|
||||||
property real scaleValue: root.animationScaleCollapsed
|
|
||||||
|
readonly property real computedScaleCollapsed: (typeof SettingsData !== "undefined" && SettingsData.directionalAnimationMode === 2 && Theme.isDirectionalEffect) ? 0.0 : root.animationScaleCollapsed
|
||||||
|
property real scaleValue: computedScaleCollapsed
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
animX = Theme.snap(root.shouldBeVisible ? 0 : offsetX, root.dpr);
|
||||||
|
animY = Theme.snap(root.shouldBeVisible ? 0 : offsetY, root.dpr);
|
||||||
|
scaleValue = root.shouldBeVisible ? 1.0 : computedScaleCollapsed;
|
||||||
|
}
|
||||||
|
|
||||||
onOffsetXChanged: animX = Theme.snap(root.shouldBeVisible ? 0 : offsetX, root.dpr)
|
onOffsetXChanged: animX = Theme.snap(root.shouldBeVisible ? 0 : offsetX, root.dpr)
|
||||||
onOffsetYChanged: animY = Theme.snap(root.shouldBeVisible ? 0 : offsetY, root.dpr)
|
onOffsetYChanged: animY = Theme.snap(root.shouldBeVisible ? 0 : offsetY, root.dpr)
|
||||||
@@ -509,89 +870,216 @@ Item {
|
|||||||
function onShouldBeVisibleChanged() {
|
function onShouldBeVisibleChanged() {
|
||||||
contentContainer.animX = Theme.snap(root.shouldBeVisible ? 0 : contentContainer.offsetX, root.dpr);
|
contentContainer.animX = Theme.snap(root.shouldBeVisible ? 0 : contentContainer.offsetX, root.dpr);
|
||||||
contentContainer.animY = Theme.snap(root.shouldBeVisible ? 0 : contentContainer.offsetY, root.dpr);
|
contentContainer.animY = Theme.snap(root.shouldBeVisible ? 0 : contentContainer.offsetY, root.dpr);
|
||||||
contentContainer.scaleValue = root.shouldBeVisible ? 1.0 : root.animationScaleCollapsed;
|
contentContainer.scaleValue = root.shouldBeVisible ? 1.0 : contentContainer.computedScaleCollapsed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on animX {
|
Behavior on animX {
|
||||||
|
enabled: root.animationsEnabled
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: root.animationDuration
|
duration: Theme.variantDuration(root.animationDuration, root.shouldBeVisible)
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: root.shouldBeVisible ? root.animationEnterCurve : root.animationExitCurve
|
easing.bezierCurve: root.shouldBeVisible ? root.animationEnterCurve : root.animationExitCurve
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on animY {
|
Behavior on animY {
|
||||||
|
enabled: root.animationsEnabled
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: root.animationDuration
|
duration: Theme.variantDuration(root.animationDuration, root.shouldBeVisible)
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: root.shouldBeVisible ? root.animationEnterCurve : root.animationExitCurve
|
easing.bezierCurve: root.shouldBeVisible ? root.animationEnterCurve : root.animationExitCurve
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on scaleValue {
|
Behavior on scaleValue {
|
||||||
|
enabled: root.animationsEnabled
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
duration: root.animationDuration
|
duration: Theme.variantDuration(root.animationDuration, root.shouldBeVisible)
|
||||||
easing.type: Easing.BezierSpline
|
easing.type: Easing.BezierSpline
|
||||||
easing.bezierCurve: root.shouldBeVisible ? root.animationEnterCurve : root.animationExitCurve
|
easing.bezierCurve: root.shouldBeVisible ? root.animationEnterCurve : root.animationExitCurve
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ElevationShadow {
|
|
||||||
id: shadowSource
|
|
||||||
width: parent.width
|
|
||||||
height: parent.height
|
|
||||||
opacity: contentWrapper.opacity
|
|
||||||
scale: contentWrapper.scale
|
|
||||||
x: contentWrapper.x
|
|
||||||
y: contentWrapper.y
|
|
||||||
level: root.shadowLevel
|
|
||||||
direction: root.effectiveShadowDirection
|
|
||||||
fallbackOffset: root.shadowFallbackOffset
|
|
||||||
targetRadius: Theme.cornerRadius
|
|
||||||
targetColor: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
|
||||||
shadowEnabled: Theme.elevationEnabled && SettingsData.popoutElevationEnabled && Quickshell.env("DMS_DISABLE_LAYER") !== "true" && Quickshell.env("DMS_DISABLE_LAYER") !== "1" && !(root.suspendShadowWhileResizing && root._resizeActive)
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: contentWrapper
|
id: directionalClipMask
|
||||||
anchors.centerIn: parent
|
|
||||||
width: parent.width
|
|
||||||
height: parent.height
|
|
||||||
opacity: shouldBeVisible ? 1 : 0
|
|
||||||
visible: opacity > 0
|
|
||||||
scale: contentContainer.scaleValue
|
|
||||||
x: Theme.snap(contentContainer.animX + (parent.width - width) * (1 - contentContainer.scaleValue) * 0.5, root.dpr)
|
|
||||||
y: Theme.snap(contentContainer.animY + (parent.height - height) * (1 - contentContainer.scaleValue) * 0.5, root.dpr)
|
|
||||||
|
|
||||||
layer.enabled: contentWrapper.opacity < 1
|
readonly property bool shouldClip: Theme.isDirectionalEffect && typeof SettingsData !== "undefined" && SettingsData.directionalAnimationMode > 0
|
||||||
layer.smooth: false
|
readonly property real clipOversize: 1000
|
||||||
layer.textureSize: root.dpr > 1 ? Qt.size(Math.ceil(width * root.dpr), Math.ceil(height * root.dpr)) : Qt.size(0, 0)
|
readonly property real connectedClipAllowance: Theme.isConnectedEffect ? Math.ceil(root.shadowRenderPadding + BlurService.borderWidth + 2) : 0
|
||||||
|
|
||||||
Behavior on opacity {
|
clip: shouldClip
|
||||||
NumberAnimation {
|
|
||||||
duration: animationDuration
|
// Bound the clipping strictly to the bar side, allowing massive overflow on the other 3 sides for shadows
|
||||||
easing.type: Easing.BezierSpline
|
x: shouldClip ? (contentContainer.barLeft ? -connectedClipAllowance : -clipOversize) : 0
|
||||||
easing.bezierCurve: root.shouldBeVisible ? root.animationEnterCurve : root.animationExitCurve
|
y: shouldClip ? (contentContainer.barTop ? -connectedClipAllowance : -clipOversize) : 0
|
||||||
}
|
|
||||||
|
width: {
|
||||||
|
if (!shouldClip)
|
||||||
|
return parent.width;
|
||||||
|
if (contentContainer.barLeft)
|
||||||
|
return parent.width + connectedClipAllowance + clipOversize;
|
||||||
|
if (contentContainer.barRight)
|
||||||
|
return parent.width + clipOversize + connectedClipAllowance;
|
||||||
|
return parent.width + clipOversize * 2;
|
||||||
|
}
|
||||||
|
height: {
|
||||||
|
if (!shouldClip)
|
||||||
|
return parent.height;
|
||||||
|
if (contentContainer.barTop)
|
||||||
|
return parent.height + connectedClipAllowance + clipOversize;
|
||||||
|
if (contentContainer.barBottom)
|
||||||
|
return parent.height + clipOversize + connectedClipAllowance;
|
||||||
|
return parent.height + clipOversize * 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Item {
|
||||||
anchors.fill: parent
|
id: aligner
|
||||||
radius: Theme.cornerRadius
|
readonly property real baseWidth: contentContainer.width
|
||||||
color: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency)
|
readonly property real baseHeight: contentContainer.height
|
||||||
border.color: BlurService.enabled ? BlurService.borderColor : Theme.outlineMedium
|
readonly property bool isRollOut: typeof SettingsData !== "undefined" && SettingsData.directionalAnimationMode === 2 && Theme.isDirectionalEffect
|
||||||
border.width: BlurService.borderWidth
|
|
||||||
}
|
|
||||||
|
|
||||||
Loader {
|
x: (directionalClipMask.x !== 0 ? -directionalClipMask.x : 0) + (isRollOut && contentContainer.barRight ? baseWidth * (1 - contentContainer.scaleValue) : 0)
|
||||||
id: contentLoader
|
y: (directionalClipMask.y !== 0 ? -directionalClipMask.y : 0) + (isRollOut && contentContainer.barBottom ? baseHeight * (1 - contentContainer.scaleValue) : 0)
|
||||||
anchors.fill: parent
|
width: isRollOut && (contentContainer.barLeft || contentContainer.barRight) ? Math.max(0, baseWidth * contentContainer.scaleValue) : baseWidth
|
||||||
active: root._primeContent || shouldBeVisible || contentWindow.visible
|
height: isRollOut && (contentContainer.barTop || contentContainer.barBottom) ? Math.max(0, baseHeight * contentContainer.scaleValue) : baseHeight
|
||||||
asynchronous: false
|
|
||||||
}
|
clip: isRollOut
|
||||||
}
|
|
||||||
}
|
Item {
|
||||||
|
id: unrollCounteract
|
||||||
|
x: aligner.isRollOut && contentContainer.barRight ? -(aligner.baseWidth * (1 - contentContainer.scaleValue)) : 0
|
||||||
|
y: aligner.isRollOut && contentContainer.barBottom ? -(aligner.baseHeight * (1 - contentContainer.scaleValue)) : 0
|
||||||
|
width: aligner.baseWidth
|
||||||
|
height: aligner.baseHeight
|
||||||
|
|
||||||
|
ElevationShadow {
|
||||||
|
id: shadowSource
|
||||||
|
readonly property real connectorExtent: Theme.isConnectedEffect ? Theme.connectedCornerRadius : 0
|
||||||
|
readonly property real extraLeft: Theme.isConnectedEffect && (contentContainer.barTop || contentContainer.barBottom) ? connectorExtent : 0
|
||||||
|
readonly property real extraRight: Theme.isConnectedEffect && (contentContainer.barTop || contentContainer.barBottom) ? connectorExtent : 0
|
||||||
|
readonly property real extraTop: Theme.isConnectedEffect && (contentContainer.barLeft || contentContainer.barRight) ? connectorExtent : 0
|
||||||
|
readonly property real extraBottom: Theme.isConnectedEffect && (contentContainer.barLeft || contentContainer.barRight) ? connectorExtent : 0
|
||||||
|
readonly property real bodyX: extraLeft
|
||||||
|
readonly property real bodyY: extraTop
|
||||||
|
readonly property real bodyWidth: parent.width
|
||||||
|
readonly property real bodyHeight: parent.height
|
||||||
|
|
||||||
|
width: parent.width + extraLeft + extraRight
|
||||||
|
height: parent.height + extraTop + extraBottom
|
||||||
|
opacity: contentWrapper.opacity
|
||||||
|
scale: contentWrapper.scale
|
||||||
|
x: contentWrapper.x - extraLeft
|
||||||
|
y: contentWrapper.y - extraTop
|
||||||
|
level: root.shadowLevel
|
||||||
|
direction: root.effectiveShadowDirection
|
||||||
|
fallbackOffset: root.shadowFallbackOffset
|
||||||
|
targetRadius: contentContainer.surfaceRadius
|
||||||
|
topLeftRadius: contentContainer.surfaceTopLeftRadius
|
||||||
|
topRightRadius: contentContainer.surfaceTopRightRadius
|
||||||
|
bottomLeftRadius: contentContainer.surfaceBottomLeftRadius
|
||||||
|
bottomRightRadius: contentContainer.surfaceBottomRightRadius
|
||||||
|
targetColor: contentContainer.surfaceColor
|
||||||
|
borderColor: contentContainer.surfaceBorderColor
|
||||||
|
borderWidth: contentContainer.surfaceBorderWidth
|
||||||
|
useCustomSource: Theme.isConnectedEffect
|
||||||
|
shadowEnabled: Theme.elevationEnabled && SettingsData.popoutElevationEnabled && Quickshell.env("DMS_DISABLE_LAYER") !== "true" && Quickshell.env("DMS_DISABLE_LAYER") !== "1" && !(root.suspendShadowWhileResizing && root._resizeActive)
|
||||||
|
|
||||||
|
Item {
|
||||||
|
anchors.fill: parent
|
||||||
|
visible: Theme.isConnectedEffect && !root.frameOwnsConnectedChrome
|
||||||
|
clip: false
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
x: shadowSource.bodyX
|
||||||
|
y: shadowSource.bodyY
|
||||||
|
width: shadowSource.bodyWidth
|
||||||
|
height: shadowSource.bodyHeight
|
||||||
|
topLeftRadius: contentContainer.surfaceTopLeftRadius
|
||||||
|
topRightRadius: contentContainer.surfaceTopRightRadius
|
||||||
|
bottomLeftRadius: contentContainer.surfaceBottomLeftRadius
|
||||||
|
bottomRightRadius: contentContainer.surfaceBottomRightRadius
|
||||||
|
color: contentContainer.surfaceColor
|
||||||
|
}
|
||||||
|
|
||||||
|
ConnectedCorner {
|
||||||
|
visible: Theme.isConnectedEffect
|
||||||
|
barSide: contentContainer.connectedBarSide
|
||||||
|
placement: "left"
|
||||||
|
spacing: 0
|
||||||
|
connectorRadius: Theme.connectedCornerRadius
|
||||||
|
color: contentContainer.surfaceColor
|
||||||
|
dpr: root.dpr
|
||||||
|
x: Theme.snap(contentContainer.connectorX(shadowSource.bodyX, shadowSource.bodyWidth, placement, spacing), root.dpr)
|
||||||
|
y: Theme.snap(contentContainer.connectorY(shadowSource.bodyY, shadowSource.bodyHeight, placement, spacing), root.dpr)
|
||||||
|
}
|
||||||
|
|
||||||
|
ConnectedCorner {
|
||||||
|
visible: Theme.isConnectedEffect
|
||||||
|
barSide: contentContainer.connectedBarSide
|
||||||
|
placement: "right"
|
||||||
|
spacing: 0
|
||||||
|
connectorRadius: Theme.connectedCornerRadius
|
||||||
|
color: contentContainer.surfaceColor
|
||||||
|
dpr: root.dpr
|
||||||
|
x: Theme.snap(contentContainer.connectorX(shadowSource.bodyX, shadowSource.bodyWidth, placement, spacing), root.dpr)
|
||||||
|
y: Theme.snap(contentContainer.connectorY(shadowSource.bodyY, shadowSource.bodyHeight, placement, spacing), root.dpr)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: contentWrapper
|
||||||
|
width: parent.width
|
||||||
|
height: parent.height
|
||||||
|
opacity: Theme.isDirectionalEffect ? 1 : (shouldBeVisible ? 1 : 0)
|
||||||
|
visible: opacity > 0
|
||||||
|
|
||||||
|
scale: aligner.isRollOut ? 1.0 : contentContainer.scaleValue
|
||||||
|
x: Theme.snap(contentContainer.animX + (parent.width - width) * (1 - scale) * 0.5, root.dpr)
|
||||||
|
y: Theme.snap(contentContainer.animY + (parent.height - height) * (1 - scale) * 0.5, root.dpr)
|
||||||
|
|
||||||
|
layer.enabled: contentWrapper.opacity < 1
|
||||||
|
layer.smooth: false
|
||||||
|
layer.textureSize: root.dpr > 1 ? Qt.size(Math.ceil(width * root.dpr), Math.ceil(height * root.dpr)) : Qt.size(0, 0)
|
||||||
|
|
||||||
|
Behavior on opacity {
|
||||||
|
enabled: !Theme.isDirectionalEffect
|
||||||
|
NumberAnimation {
|
||||||
|
duration: Math.round(Theme.variantDuration(animationDuration, shouldBeVisible) * Theme.variantOpacityDurationScale)
|
||||||
|
easing.type: Easing.BezierSpline
|
||||||
|
easing.bezierCurve: root.shouldBeVisible ? root.animationEnterCurve : root.animationExitCurve
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
anchors.fill: parent
|
||||||
|
clip: false
|
||||||
|
visible: !Theme.isConnectedEffect
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
anchors.fill: parent
|
||||||
|
topLeftRadius: contentContainer.surfaceTopLeftRadius
|
||||||
|
topRightRadius: contentContainer.surfaceTopRightRadius
|
||||||
|
bottomLeftRadius: contentContainer.surfaceBottomLeftRadius
|
||||||
|
bottomRightRadius: contentContainer.surfaceBottomRightRadius
|
||||||
|
color: contentContainer.surfaceColor
|
||||||
|
border.color: contentContainer.surfaceBorderColor
|
||||||
|
border.width: contentContainer.surfaceBorderWidth
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Loader {
|
||||||
|
id: contentLoader
|
||||||
|
anchors.fill: parent
|
||||||
|
active: root._primeContent || shouldBeVisible || contentWindow.visible
|
||||||
|
asynchronous: false
|
||||||
|
}
|
||||||
|
} // closes contentWrapper
|
||||||
|
} // closes unrollCounteract
|
||||||
|
} // closes aligner
|
||||||
|
} // closes directionalClipMask
|
||||||
|
} // closes contentContainer
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: focusHelper
|
id: focusHelper
|
||||||
|
|||||||
@@ -238,7 +238,7 @@ Rectangle {
|
|||||||
width: fieldContent.width + Theme.spacingM * 2
|
width: fieldContent.width + Theme.spacingM * 2
|
||||||
height: 32
|
height: 32
|
||||||
radius: Theme.cornerRadius - 2
|
radius: Theme.cornerRadius - 2
|
||||||
color: Theme.surfaceContainerHigh
|
color: Theme.surfaceLight
|
||||||
border.width: 1
|
border.width: 1
|
||||||
border.color: Theme.outlineLight
|
border.color: Theme.outlineLight
|
||||||
|
|
||||||
@@ -272,7 +272,9 @@ Rectangle {
|
|||||||
checked: configData ? (configData.autoconnect || false) : false
|
checked: configData ? (configData.autoconnect || false) : false
|
||||||
visible: !VPNService.configLoading && configData !== null
|
visible: !VPNService.configLoading && configData !== null
|
||||||
onToggled: checked => {
|
onToggled: checked => {
|
||||||
VPNService.updateConfig(profile.uuid, {autoconnect: checked});
|
VPNService.updateConfig(profile.uuid, {
|
||||||
|
autoconnect: checked
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
|
import qs.Common
|
||||||
import qs.Services
|
import qs.Services
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
@@ -8,6 +9,7 @@ Item {
|
|||||||
|
|
||||||
required property var targetWindow
|
required property var targetWindow
|
||||||
property var blurItem: null
|
property var blurItem: null
|
||||||
|
property bool blurEnabled: Theme.connectedSurfaceBlurEnabled
|
||||||
property real blurX: 0
|
property real blurX: 0
|
||||||
property real blurY: 0
|
property real blurY: 0
|
||||||
property real blurWidth: 0
|
property real blurWidth: 0
|
||||||
@@ -17,7 +19,7 @@ Item {
|
|||||||
property var _region: null
|
property var _region: null
|
||||||
|
|
||||||
function _apply() {
|
function _apply() {
|
||||||
if (!BlurService.enabled || !targetWindow) {
|
if (!blurEnabled || !BlurService.enabled || !targetWindow) {
|
||||||
_cleanup();
|
_cleanup();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -43,6 +45,8 @@ Item {
|
|||||||
_region = null;
|
_region = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onBlurEnabledChanged: _apply()
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: BlurService
|
target: BlurService
|
||||||
function onEnabledChanged() {
|
function onEnabledChanged() {
|
||||||
|
|||||||
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user