The launcher gains a clipboard mode with the same bar, position and size: the latest five entries show at once and the rest scroll, search filters in recency order, Enter copies, Shift+Delete removes an entry. >clipboard switches in place without closing or animating; glassmxrph clipboard toggles it directly. History stays with the user's cliphist watcher. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
123 lines
3.9 KiB
QML
123 lines
3.9 KiB
QML
pragma Singleton
|
|
import QtQuick
|
|
import Quickshell
|
|
|
|
Singleton {
|
|
property bool wallpaperPickerOpen: false
|
|
property var wallpaperScreen: null
|
|
property var wallpaperWindow: null
|
|
function openWallpaperPicker() {
|
|
settingsOpen=false;launcherOpen=false;controlCenterOpen=false;dashboardOpen=false;
|
|
wallpaperScreen=activeScreen();wallpaperPickerOpen=true;
|
|
}
|
|
property var systemPills: []
|
|
property bool controlCenterOpen: false
|
|
property var controlCenterScreen: null
|
|
property var controlCenterWindow: null
|
|
function openControlCenter() {
|
|
wallpaperPickerOpen=false;
|
|
dashboardOpen = false;
|
|
if (controlCenterOpen)
|
|
return;
|
|
launcherOpen = false;
|
|
settingsOpen = false;
|
|
controlCenterScreen = activeScreen();
|
|
controlCenterOpen = true;
|
|
}
|
|
function toggleControlCenter() {
|
|
if (controlCenterOpen)
|
|
controlCenterOpen = false;
|
|
else
|
|
openControlCenter();
|
|
}
|
|
// Caelestia-style dashboard; `dashboardTab` is a tab id, not an index.
|
|
property bool dashboardOpen: false
|
|
property var dashboardScreen: null
|
|
property var dashboardWindow: null
|
|
property string dashboardTab: ""
|
|
function openDashboard(tab) {
|
|
wallpaperPickerOpen = false;
|
|
controlCenterOpen = false;
|
|
launcherOpen = false;
|
|
settingsOpen = false;
|
|
if (tab)
|
|
dashboardTab = tab;
|
|
if (!dashboardOpen)
|
|
dashboardScreen = activeScreen();
|
|
dashboardOpen = true;
|
|
}
|
|
function toggleDashboard(tab) {
|
|
if (dashboardOpen && (!tab || tab === dashboardTab))
|
|
dashboardOpen = false;
|
|
else
|
|
openDashboard(tab);
|
|
}
|
|
property bool launcherOpen: false
|
|
property var launcherScreen: null
|
|
// "apps" searches applications and commands; "clipboard" is Clipboard History.
|
|
// Changing it on an open launcher switches in place.
|
|
property string launcherMode: "apps"
|
|
function activeScreen() {
|
|
return ScreenService.active;
|
|
}
|
|
function openLauncher(mode) {
|
|
wallpaperPickerOpen=false;
|
|
dashboardOpen = false;
|
|
launcherMode = mode === "clipboard" ? "clipboard" : "apps";
|
|
if (launcherOpen)
|
|
return;
|
|
controlCenterOpen = false;
|
|
settingsOpen = false;
|
|
launcherScreen = activeScreen();
|
|
launcherOpen = true;
|
|
}
|
|
function toggleLauncher() {
|
|
if (launcherOpen)
|
|
launcherOpen = false;
|
|
else
|
|
openLauncher();
|
|
}
|
|
function toggleClipboard() {
|
|
if (launcherOpen && launcherMode === "clipboard")
|
|
launcherOpen = false;
|
|
else
|
|
openLauncher("clipboard");
|
|
}
|
|
property var settingsWindow: null
|
|
property bool settingsOpen: false
|
|
property string settingsPage: "about"
|
|
// Setting title flashed after a settings search jump; the serial re-triggers repeats.
|
|
property string settingsHighlight: ""
|
|
property int settingsHighlightSerial: 0
|
|
function revealSetting(page, title) {
|
|
openSettings(page);
|
|
settingsHighlight = title || "";
|
|
settingsHighlightSerial++;
|
|
}
|
|
property var targetScreen: null
|
|
property var osdWindow: null
|
|
// Raised by Lock buttons when the built-in lock screen is enabled.
|
|
signal lockRequested
|
|
function requestLock() {
|
|
lockRequested();
|
|
}
|
|
function openSettings(page) {
|
|
wallpaperPickerOpen=false;
|
|
dashboardOpen = false;
|
|
controlCenterOpen = false;
|
|
launcherOpen = false;
|
|
const destination = SettingsRegistry.page(page || "about");
|
|
settingsPage = destination ? destination.id : "about";
|
|
if (!settingsOpen) {
|
|
targetScreen = activeScreen();
|
|
}
|
|
settingsOpen = true;
|
|
}
|
|
function toggleSettings() {
|
|
if (settingsOpen)
|
|
settingsOpen = false;
|
|
else
|
|
openSettings("about");
|
|
}
|
|
}
|