1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-31 08:52:49 -05:00

qmlfmt with 4 space

This commit is contained in:
bbedward
2025-08-20 00:05:14 -04:00
parent 6e0977c719
commit b688bbfe83
154 changed files with 28809 additions and 27639 deletions

View File

@@ -56,7 +56,8 @@ Singleton {
currentRanking[appId].lastUsed = Date.now()
currentRanking[appId].icon = app.icon || currentRanking[appId].icon
|| "application-x-executable"
currentRanking[appId].name = app.name || currentRanking[appId].name || ""
currentRanking[appId].name = app.name
|| currentRanking[appId].name || ""
} else {
currentRanking[appId] = {
"name": app.name || "",

View File

@@ -6,7 +6,8 @@ Singleton {
// Clear all image cache
function clearImageCache() {
Quickshell.execDetached(["rm", "-rf", Paths.stringify(Paths.imagecache)])
Quickshell.execDetached(["rm", "-rf", Paths.stringify(
Paths.imagecache)])
Paths.mkdir(Paths.imagecache)
}

View File

@@ -22,7 +22,8 @@ Singleton {
"file://") ? _configUrl.substring(
7) : _configUrl
readonly property string shellDir: Qt.resolvedUrl(".").toString().replace(
"file://", "").replace("/Common/", "")
"file://",
"").replace("/Common/", "")
readonly property string wallpaperPath: SessionData.wallpaperPath
property bool matugenAvailable: false
property bool gtkThemingEnabled: false
@@ -44,7 +45,8 @@ Singleton {
property color surfaceContainer: getMatugenColor("surface_container",
"#1e2023")
property color surfaceContainerHigh: getMatugenColor(
"surface_container_high", "#292b2f")
"surface_container_high",
"#292b2f")
property color surfaceVariant: getMatugenColor("surface_variant", "#44464f")
property color surfaceText: getMatugenColor("on_background", "#e3e8ef")
property color primaryText: getMatugenColor("on_primary", "#ffffff")
@@ -113,7 +115,8 @@ Singleton {
matugenAvailable = (code === 0)
if (!matugenAvailable) {
ToastService.wallpaperErrorStatus = "matugen_missing"
ToastService.showWarning("matugen not found - dynamic theming disabled")
ToastService.showWarning(
"matugen not found - dynamic theming disabled")
return
}
if (extractionRequested) {
@@ -147,13 +150,15 @@ Singleton {
onStreamFinished: {
if (!matugenCollector.text) {
ToastService.wallpaperErrorStatus = "error"
ToastService.showError("Wallpaper Processing Failed: Empty JSON extracted from matugen output.")
ToastService.showError(
"Wallpaper Processing Failed: Empty JSON extracted from matugen output.")
return
}
const extractedJson = extractJsonFromText(matugenCollector.text)
if (!extractedJson) {
ToastService.wallpaperErrorStatus = "error"
ToastService.showError("Wallpaper Processing Failed: Invalid JSON extracted from matugen output.")
ToastService.showError(
"Wallpaper Processing Failed: Invalid JSON extracted from matugen output.")
console.log("Raw matugen output:", matugenCollector.text)
return
}
@@ -164,7 +169,8 @@ Singleton {
ToastService.clearWallpaperError()
} catch (e) {
ToastService.wallpaperErrorStatus = "error"
ToastService.showError("Wallpaper processing failed (JSON parse error after extraction)")
ToastService.showError(
"Wallpaper processing failed (JSON parse error after extraction)")
}
}
}
@@ -172,7 +178,8 @@ Singleton {
onExited: code => {
if (code !== 0) {
ToastService.wallpaperErrorStatus = "error"
ToastService.showError("Matugen command failed with exit code " + code)
ToastService.showError(
"Matugen command failed with exit code " + code)
}
}
}
@@ -328,54 +335,60 @@ Singleton {
// Returns the first complete JSON substring (object or array) or null.
function extractJsonFromText(text) {
if (!text) return null;
if (!text)
return null
const start = text.search(/[{\[]/);
if (start === -1) return null;
const start = text.search(/[{\[]/)
if (start === -1)
return null
const open = text[start];
const pairs = { '{': '}', '[': ']' };
const close = pairs[open];
if (!close) return null;
const open = text[start]
const pairs = {
"{": '}',
"[": ']'
}
const close = pairs[open]
if (!close)
return null
let inString = false;
let escape = false;
const stack = [open];
let inString = false
let escape = false
const stack = [open]
for (let i = start + 1; i < text.length; i++) {
const ch = text[i];
for (var i = start + 1; i < text.length; i++) {
const ch = text[i]
if (inString) {
if (escape) {
escape = false;
escape = false
} else if (ch === '\\') {
escape = true;
escape = true
} else if (ch === '"') {
inString = false;
inString = false
}
continue;
continue
}
if (ch === '"') {
inString = true;
continue;
inString = true
continue
}
if (ch === '{' || ch === '[') {
stack.push(ch);
continue;
stack.push(ch)
continue
}
if (ch === '}' || ch === ']') {
const last = stack.pop();
const last = stack.pop()
if (!last || pairs[last] !== ch) {
return null;
return null
}
if (stack.length === 0) {
return text.slice(start, i + 1);
return text.slice(start, i + 1)
}
}
}
return null;
return null
}
Process {

View File

@@ -46,20 +46,32 @@ Singleton {
wallpaperPath = settings.wallpaperPath !== undefined ? settings.wallpaperPath : ""
wallpaperLastPath = settings.wallpaperLastPath
!== undefined ? settings.wallpaperLastPath : ""
profileLastPath = settings.profileLastPath !== undefined ? settings.profileLastPath : ""
profileLastPath = settings.profileLastPath
!== undefined ? settings.profileLastPath : ""
doNotDisturb = settings.doNotDisturb !== undefined ? settings.doNotDisturb : false
nightModeEnabled = settings.nightModeEnabled !== undefined ? settings.nightModeEnabled : false
nightModeTemperature = settings.nightModeTemperature !== undefined ? settings.nightModeTemperature : 4500
nightModeEnabled = settings.nightModeEnabled
!== undefined ? settings.nightModeEnabled : false
nightModeTemperature = settings.nightModeTemperature
!== undefined ? settings.nightModeTemperature : 4500
pinnedApps = settings.pinnedApps !== undefined ? settings.pinnedApps : []
selectedGpuIndex = settings.selectedGpuIndex !== undefined ? settings.selectedGpuIndex : 0
nvidiaGpuTempEnabled = settings.nvidiaGpuTempEnabled !== undefined ? settings.nvidiaGpuTempEnabled : false
nonNvidiaGpuTempEnabled = settings.nonNvidiaGpuTempEnabled !== undefined ? settings.nonNvidiaGpuTempEnabled : false
enabledGpuPciIds = settings.enabledGpuPciIds !== undefined ? settings.enabledGpuPciIds : []
wallpaperCyclingEnabled = settings.wallpaperCyclingEnabled !== undefined ? settings.wallpaperCyclingEnabled : false
wallpaperCyclingMode = settings.wallpaperCyclingMode !== undefined ? settings.wallpaperCyclingMode : "interval"
wallpaperCyclingInterval = settings.wallpaperCyclingInterval !== undefined ? settings.wallpaperCyclingInterval : 300
wallpaperCyclingTime = settings.wallpaperCyclingTime !== undefined ? settings.wallpaperCyclingTime : "06:00"
lastBrightnessDevice = settings.lastBrightnessDevice !== undefined ? settings.lastBrightnessDevice : ""
selectedGpuIndex = settings.selectedGpuIndex
!== undefined ? settings.selectedGpuIndex : 0
nvidiaGpuTempEnabled = settings.nvidiaGpuTempEnabled
!== undefined ? settings.nvidiaGpuTempEnabled : false
nonNvidiaGpuTempEnabled = settings.nonNvidiaGpuTempEnabled
!== undefined ? settings.nonNvidiaGpuTempEnabled : false
enabledGpuPciIds = settings.enabledGpuPciIds
!== undefined ? settings.enabledGpuPciIds : []
wallpaperCyclingEnabled = settings.wallpaperCyclingEnabled
!== undefined ? settings.wallpaperCyclingEnabled : false
wallpaperCyclingMode = settings.wallpaperCyclingMode
!== undefined ? settings.wallpaperCyclingMode : "interval"
wallpaperCyclingInterval = settings.wallpaperCyclingInterval
!== undefined ? settings.wallpaperCyclingInterval : 300
wallpaperCyclingTime = settings.wallpaperCyclingTime
!== undefined ? settings.wallpaperCyclingTime : "06:00"
lastBrightnessDevice = settings.lastBrightnessDevice
!== undefined ? settings.lastBrightnessDevice : ""
}
} catch (e) {

File diff suppressed because it is too large Load Diff

View File

@@ -376,8 +376,10 @@ Singleton {
property color primaryHover: Qt.rgba(primary.r, primary.g, primary.b, 0.12)
property color primaryHoverLight: Qt.rgba(primary.r, primary.g,
primary.b, 0.08)
property color primaryPressed: Qt.rgba(primary.r, primary.g, primary.b, 0.16)
property color primarySelected: Qt.rgba(primary.r, primary.g, primary.b, 0.3)
property color primaryPressed: Qt.rgba(primary.r, primary.g,
primary.b, 0.16)
property color primarySelected: Qt.rgba(primary.r, primary.g,
primary.b, 0.3)
property color primaryBackground: Qt.rgba(primary.r, primary.g,
primary.b, 0.04)
@@ -409,7 +411,8 @@ Singleton {
property color outlineLight: Qt.rgba(outline.r, outline.g, outline.b, 0.05)
property color outlineMedium: Qt.rgba(outline.r, outline.g, outline.b, 0.08)
property color outlineStrong: Qt.rgba(outline.r, outline.g, outline.b, 0.12)
property color outlineSelected: Qt.rgba(outline.r, outline.g, outline.b, 0.2)
property color outlineSelected: Qt.rgba(outline.r, outline.g,
outline.b, 0.2)
property color outlineHeavy: Qt.rgba(outline.r, outline.g, outline.b, 0.3)
property color outlineButton: Qt.rgba(outline.r, outline.g, outline.b, 0.5)
@@ -500,23 +503,23 @@ Singleton {
}
function popupBackground() {
return Qt.rgba(surfaceContainer.r, surfaceContainer.g, surfaceContainer.b,
popupTransparency)
return Qt.rgba(surfaceContainer.r, surfaceContainer.g,
surfaceContainer.b, popupTransparency)
}
function contentBackground() {
return Qt.rgba(surfaceContainer.r, surfaceContainer.g, surfaceContainer.b,
popupTransparency)
return Qt.rgba(surfaceContainer.r, surfaceContainer.g,
surfaceContainer.b, popupTransparency)
}
function panelBackground() {
return Qt.rgba(surfaceContainer.r, surfaceContainer.g, surfaceContainer.b,
panelTransparency)
return Qt.rgba(surfaceContainer.r, surfaceContainer.g,
surfaceContainer.b, panelTransparency)
}
function widgetBackground() {
return Qt.rgba(surfaceContainer.r, surfaceContainer.g, surfaceContainer.b,
widgetTransparency)
return Qt.rgba(surfaceContainer.r, surfaceContainer.g,
surfaceContainer.b, widgetTransparency)
}
function getBatteryIcon(level, isCharging, batteryAvailable) {

View File

@@ -21,123 +21,124 @@ DankModal {
property Component clipboardContent
function updateFilteredModel() {
filteredClipboardModel.clear();
filteredClipboardModel.clear()
for (var i = 0; i < clipboardModel.count; i++) {
const entry = clipboardModel.get(i).entry;
const entry = clipboardModel.get(i).entry
if (searchText.trim().length === 0) {
filteredClipboardModel.append({
"entry": entry
});
})
} else {
const content = getEntryPreview(entry).toLowerCase();
const content = getEntryPreview(entry).toLowerCase()
if (content.includes(searchText.toLowerCase()))
filteredClipboardModel.append({
"entry": entry
});
})
}
}
clipboardHistoryModal.totalCount = filteredClipboardModel.count;
clipboardHistoryModal.totalCount = filteredClipboardModel.count
// Clamp selectedIndex to valid range
if (filteredClipboardModel.count === 0) {
keyboardNavigationActive = false;
selectedIndex = 0;
keyboardNavigationActive = false
selectedIndex = 0
} else if (selectedIndex >= filteredClipboardModel.count) {
selectedIndex = filteredClipboardModel.count - 1;
selectedIndex = filteredClipboardModel.count - 1
}
}
function toggle() {
if (shouldBeVisible)
hide();
hide()
else
show();
show()
}
function show() {
open();
clipboardHistoryModal.searchText = "";
open()
clipboardHistoryModal.searchText = ""
initializeThumbnailSystem();
refreshClipboard();
keyboardController.reset();
initializeThumbnailSystem()
refreshClipboard()
keyboardController.reset()
Qt.callLater(function () {
if (contentLoader.item && contentLoader.item.searchField) {
contentLoader.item.searchField.text = "";
contentLoader.item.searchField.forceActiveFocus();
contentLoader.item.searchField.text = ""
contentLoader.item.searchField.forceActiveFocus()
}
});
})
}
function hide() {
close();
clipboardHistoryModal.searchText = "";
close()
clipboardHistoryModal.searchText = ""
updateFilteredModel();
keyboardController.reset();
cleanupTempFiles();
updateFilteredModel()
keyboardController.reset()
cleanupTempFiles()
}
function initializeThumbnailSystem() {
}
function initializeThumbnailSystem() {}
function cleanupTempFiles() {
Quickshell.execDetached(["sh", "-c", "rm -f /tmp/clipboard_*.png"]);
Quickshell.execDetached(["sh", "-c", "rm -f /tmp/clipboard_*.png"])
}
function generateThumbnails() {
}
function generateThumbnails() {}
function refreshClipboard() {
clipboardProcess.running = true;
clipboardProcess.running = true
}
function copyEntry(entry) {
const entryId = entry.split('\t')[0];
Quickshell.execDetached(["sh", "-c", `cliphist decode ${entryId} | wl-copy`]);
ToastService.showInfo("Copied to clipboard");
hide();
const entryId = entry.split('\t')[0]
Quickshell.execDetached(
["sh", "-c", `cliphist decode ${entryId} | wl-copy`])
ToastService.showInfo("Copied to clipboard")
hide()
}
function deleteEntry(entry) {
deleteProcess.deletedEntry = entry;
deleteProcess.deletedEntry = entry
deleteProcess.command = ["sh", "-c", `echo '${entry.replace(
/'/g, "'\\''")}' | cliphist delete`];
deleteProcess.running = true;
/'/g, "'\\''")}' | cliphist delete`]
deleteProcess.running = true
}
function clearAll() {
clearProcess.running = true;
clearProcess.running = true
}
function getEntryPreview(entry) {
let content = entry.replace(/^\s*\d+\s+/, "");
if (content.includes("image/") || content.includes("binary data") || /\.(png|jpg|jpeg|gif|bmp|webp)/i.test(content)) {
const dimensionMatch = content.match(/(\d+)x(\d+)/);
let content = entry.replace(/^\s*\d+\s+/, "")
if (content.includes("image/") || content.includes("binary data")
|| /\.(png|jpg|jpeg|gif|bmp|webp)/i.test(content)) {
const dimensionMatch = content.match(/(\d+)x(\d+)/)
if (dimensionMatch)
return `Image ${dimensionMatch[1]}×${dimensionMatch[2]}`;
return `Image ${dimensionMatch[1]}×${dimensionMatch[2]}`
const typeMatch = content.match(/\b(png|jpg|jpeg|gif|bmp|webp)\b/i);
const typeMatch = content.match(/\b(png|jpg|jpeg|gif|bmp|webp)\b/i)
if (typeMatch)
return `Image (${typeMatch[1].toUpperCase()})`;
return `Image (${typeMatch[1].toUpperCase()})`
return "Image";
return "Image"
}
if (content.length > 100)
return content.substring(0, 100) + "...";
return content.substring(0, 100) + "..."
return content;
return content
}
function getEntryType(entry) {
if (entry.includes("image/") || entry.includes("binary data") || /\.(png|jpg|jpeg|gif|bmp|webp)/i.test(entry) || /\b(png|jpg|jpeg|gif|bmp|webp)\b/i.test(entry))
return "image";
if (entry.includes("image/") || entry.includes("binary data")
|| /\.(png|jpg|jpeg|gif|bmp|webp)/i.test(entry)
|| /\b(png|jpg|jpeg|gif|bmp|webp)\b/i.test(entry))
return "image"
if (entry.length > 200)
return "long_text";
return "long_text"
return "text";
return "text"
}
visible: false
@@ -149,10 +150,10 @@ DankModal {
borderWidth: 1
enableShadow: true
onBackgroundClicked: {
hide();
hide()
}
modalFocusScope.Keys.onPressed: function (event) {
keyboardController.handleKey(event);
keyboardController.handleKey(event)
}
content: clipboardContent
@@ -160,107 +161,116 @@ DankModal {
id: keyboardController
function reset() {
selectedIndex = 0;
keyboardNavigationActive = false;
showKeyboardHints = false;
selectedIndex = 0
keyboardNavigationActive = false
showKeyboardHints = false
if (typeof clipboardListView !== 'undefined' && clipboardListView)
clipboardListView.keyboardActive = false;
clipboardListView.keyboardActive = false
}
function selectNext() {
if (filteredClipboardModel.count === 0)
return ;
return
keyboardNavigationActive = true;
selectedIndex = Math.min(selectedIndex + 1, filteredClipboardModel.count - 1);
keyboardNavigationActive = true
selectedIndex = Math.min(selectedIndex + 1,
filteredClipboardModel.count - 1)
}
function selectPrevious() {
if (filteredClipboardModel.count === 0)
return ;
return
keyboardNavigationActive = true;
selectedIndex = Math.max(selectedIndex - 1, 0);
keyboardNavigationActive = true
selectedIndex = Math.max(selectedIndex - 1, 0)
}
function copySelected() {
if (filteredClipboardModel.count === 0 || selectedIndex < 0 || selectedIndex >= filteredClipboardModel.count)
return ;
if (filteredClipboardModel.count === 0 || selectedIndex < 0
|| selectedIndex >= filteredClipboardModel.count)
return
var selectedEntry = filteredClipboardModel.get(selectedIndex).entry;
copyEntry(selectedEntry);
var selectedEntry = filteredClipboardModel.get(selectedIndex).entry
copyEntry(selectedEntry)
}
function deleteSelected() {
if (filteredClipboardModel.count === 0 || selectedIndex < 0 || selectedIndex >= filteredClipboardModel.count)
return ;
if (filteredClipboardModel.count === 0 || selectedIndex < 0
|| selectedIndex >= filteredClipboardModel.count)
return
var selectedEntry = filteredClipboardModel.get(selectedIndex).entry;
deleteEntry(selectedEntry);
var selectedEntry = filteredClipboardModel.get(selectedIndex).entry
deleteEntry(selectedEntry)
}
function handleKey(event) {
if (event.key === Qt.Key_Escape) {
if (keyboardNavigationActive) {
keyboardNavigationActive = false;
if (typeof clipboardListView !== 'undefined' && clipboardListView)
clipboardListView.keyboardActive = false;
keyboardNavigationActive = false
if (typeof clipboardListView !== 'undefined'
&& clipboardListView)
clipboardListView.keyboardActive = false
event.accepted = true;
event.accepted = true
} else {
hide();
event.accepted = true;
hide()
event.accepted = true
}
} else if (event.key === Qt.Key_Down) {
if (!keyboardNavigationActive) {
keyboardNavigationActive = true;
selectedIndex = 0;
if (typeof clipboardListView !== 'undefined' && clipboardListView)
clipboardListView.keyboardActive = true;
keyboardNavigationActive = true
selectedIndex = 0
if (typeof clipboardListView !== 'undefined'
&& clipboardListView)
clipboardListView.keyboardActive = true
event.accepted = true;
event.accepted = true
} else {
selectNext();
event.accepted = true;
selectNext()
event.accepted = true
}
} else if (event.key === Qt.Key_Up) {
if (!keyboardNavigationActive) {
keyboardNavigationActive = true;
selectedIndex = 0;
if (typeof clipboardListView !== 'undefined' && clipboardListView)
clipboardListView.keyboardActive = true;
keyboardNavigationActive = true
selectedIndex = 0
if (typeof clipboardListView !== 'undefined'
&& clipboardListView)
clipboardListView.keyboardActive = true
event.accepted = true;
event.accepted = true
} else if (selectedIndex === 0) {
keyboardNavigationActive = false;
if (typeof clipboardListView !== 'undefined' && clipboardListView)
clipboardListView.keyboardActive = false;
keyboardNavigationActive = false
if (typeof clipboardListView !== 'undefined'
&& clipboardListView)
clipboardListView.keyboardActive = false
event.accepted = true;
event.accepted = true
} else {
selectPrevious();
event.accepted = true;
selectPrevious()
event.accepted = true
}
} else if (event.key === Qt.Key_Delete && (event.modifiers & Qt.ShiftModifier)) {
clearAll();
hide();
event.accepted = true;
} else if (event.key === Qt.Key_Delete
&& (event.modifiers & Qt.ShiftModifier)) {
clearAll()
hide()
event.accepted = true
} else if (keyboardNavigationActive) {
if ((event.key === Qt.Key_C && (event.modifiers & Qt.ControlModifier)) || event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
copySelected();
event.accepted = true;
if ((event.key === Qt.Key_C
&& (event.modifiers & Qt.ControlModifier))
|| event.key === Qt.Key_Return
|| event.key === Qt.Key_Enter) {
copySelected()
event.accepted = true
} else if (event.key === Qt.Key_Delete) {
deleteSelected();
event.accepted = true;
deleteSelected()
event.accepted = true
}
}
if (event.key === Qt.Key_F10) {
showKeyboardHints = !showKeyboardHints;
event.accepted = true;
showKeyboardHints = !showKeyboardHints
event.accepted = true
}
}
}
DankModal {
@@ -270,7 +280,7 @@ DankModal {
width: 350
height: 150
onBackgroundClicked: {
showClearConfirmation = false;
showClearConfirmation = false
}
content: Component {
@@ -326,7 +336,6 @@ DankModal {
cursorShape: Qt.PointingHandCursor
onClicked: showClearConfirmation = false
}
}
Rectangle {
@@ -350,22 +359,16 @@ DankModal {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
clearAll();
showClearConfirmation = false;
hide();
clearAll()
showClearConfirmation = false
hide()
}
}
}
}
}
}
}
}
ListModel {
@@ -384,19 +387,17 @@ DankModal {
stdout: StdioCollector {
onStreamFinished: {
clipboardModel.clear();
const lines = text.trim().split('\n');
clipboardModel.clear()
const lines = text.trim().split('\n')
for (const line of lines) {
if (line.trim().length > 0)
clipboardModel.append({
"entry": line
});
})
}
updateFilteredModel();
updateFilteredModel()
}
}
}
Process {
@@ -405,31 +406,33 @@ DankModal {
property string deletedEntry: ""
running: false
onExited: (exitCode) => {
onExited: exitCode => {
if (exitCode === 0) {
// Just remove the item from models instead of re-fetching everything
for (var i = 0; i < clipboardModel.count; i++) {
if (clipboardModel.get(i).entry === deleteProcess.deletedEntry) {
clipboardModel.remove(i);
break;
if (clipboardModel.get(
i).entry === deleteProcess.deletedEntry) {
clipboardModel.remove(i)
break
}
}
for (var j = 0; j < filteredClipboardModel.count; j++) {
if (filteredClipboardModel.get(j).entry === deleteProcess.deletedEntry) {
filteredClipboardModel.remove(j);
break;
if (filteredClipboardModel.get(
j).entry === deleteProcess.deletedEntry) {
filteredClipboardModel.remove(j)
break
}
}
clipboardHistoryModal.totalCount = filteredClipboardModel.count;
clipboardHistoryModal.totalCount = filteredClipboardModel.count
// Clamp selectedIndex to valid range
if (filteredClipboardModel.count === 0) {
keyboardNavigationActive = false;
selectedIndex = 0;
keyboardNavigationActive = false
selectedIndex = 0
} else if (selectedIndex >= filteredClipboardModel.count) {
selectedIndex = filteredClipboardModel.count - 1;
selectedIndex = filteredClipboardModel.count - 1
}
} else {
console.warn("Failed to delete clipboard entry");
console.warn("Failed to delete clipboard entry")
}
}
}
@@ -439,30 +442,31 @@ DankModal {
command: ["cliphist", "wipe"]
running: false
onExited: (exitCode) => {
onExited: exitCode => {
if (exitCode === 0) {
clipboardModel.clear();
filteredClipboardModel.clear();
totalCount = 0;
clipboardModel.clear()
filteredClipboardModel.clear()
totalCount = 0
} else {
}
}
}
IpcHandler {
function open() {
clipboardHistoryModal.show();
return "CLIPBOARD_OPEN_SUCCESS";
clipboardHistoryModal.show()
return "CLIPBOARD_OPEN_SUCCESS"
}
function close() {
hide();
return "CLIPBOARD_CLOSE_SUCCESS";
hide()
return "CLIPBOARD_CLOSE_SUCCESS"
}
function toggle() {
clipboardHistoryModal.toggle();
return "CLIPBOARD_TOGGLE_SUCCESS";
clipboardHistoryModal.toggle()
return "CLIPBOARD_TOGGLE_SUCCESS"
}
target: "clipboard"
@@ -504,7 +508,6 @@ DankModal {
font.weight: Font.Medium
anchors.verticalCenter: parent.verticalCenter
}
}
Row {
@@ -518,7 +521,7 @@ DankModal {
iconColor: showKeyboardHints ? Theme.primary : Theme.surfaceText
hoverColor: Theme.primaryHover
onClicked: {
showKeyboardHints = !showKeyboardHints;
showKeyboardHints = !showKeyboardHints
}
}
@@ -528,7 +531,7 @@ DankModal {
iconColor: Theme.error
hoverColor: Theme.errorHover
onClicked: {
showClearConfirmation = true;
showClearConfirmation = true
}
}
@@ -539,9 +542,7 @@ DankModal {
hoverColor: Theme.errorHover
onClicked: hide()
}
}
}
DankTextField {
@@ -555,25 +556,25 @@ DankModal {
ignoreLeftRightKeys: true
keyForwardTargets: [modalFocusScope]
onTextChanged: {
clipboardHistoryModal.searchText = text;
updateFilteredModel();
clipboardHistoryModal.searchText = text
updateFilteredModel()
}
Keys.onEscapePressed: function (event) {
hide();
event.accepted = true;
hide()
event.accepted = true
}
Component.onCompleted: {
Qt.callLater(function () {
forceActiveFocus();
});
forceActiveFocus()
})
}
Connections {
target: clipboardHistoryModal
function onOpened() {
Qt.callLater(function () {
searchField.forceActiveFocus();
});
searchField.forceActiveFocus()
})
}
}
}
@@ -592,15 +593,15 @@ DankModal {
function ensureVisible(index) {
if (index < 0 || index >= count)
return ;
return
var itemHeight = 72 + spacing;
var itemY = index * itemHeight;
var itemBottom = itemY + itemHeight;
var itemHeight = 72 + spacing
var itemY = index * itemHeight
var itemBottom = itemY + itemHeight
if (itemY < contentY)
contentY = itemY;
contentY = itemY
else if (itemBottom > contentY + height)
contentY = itemBottom - height;
contentY = itemBottom - height
}
anchors.fill: parent
@@ -618,8 +619,7 @@ DankModal {
flickableDirection: Flickable.VerticalFlick
onCurrentIndexChanged: {
if (keyboardNavigationActive && currentIndex >= 0)
ensureVisible(currentIndex);
ensureVisible(currentIndex)
}
StyledText {
@@ -640,7 +640,8 @@ DankModal {
delegate: Rectangle {
property string entryType: getEntryType(model.entry)
property string entryPreview: getEntryPreview(model.entry)
property string entryPreview: getEntryPreview(
model.entry)
property int entryIndex: index + 1
property string entryData: model.entry
property alias thumbnailImageSource: thumbnailImageSource
@@ -649,18 +650,25 @@ DankModal {
height: 72
radius: Theme.cornerRadius
color: {
if (keyboardNavigationActive && index === selectedIndex)
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.2);
if (keyboardNavigationActive
&& index === selectedIndex)
return Qt.rgba(Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.2)
return mouseArea.containsMouse ? Theme.primaryHover : Theme.primaryBackground;
return mouseArea.containsMouse ? Theme.primaryHover : Theme.primaryBackground
}
border.color: {
if (keyboardNavigationActive && index === selectedIndex)
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.5);
if (keyboardNavigationActive
&& index === selectedIndex)
return Qt.rgba(Theme.primary.r,
Theme.primary.g,
Theme.primary.b, 0.5)
return Theme.outlineStrong;
return Theme.outlineStrong
}
border.width: keyboardNavigationActive && index === selectedIndex ? 1.5 : 1
border.width: keyboardNavigationActive
&& index === selectedIndex ? 1.5 : 1
Row {
anchors.fill: parent
@@ -682,7 +690,6 @@ DankModal {
font.weight: Font.Bold
color: Theme.primary
}
}
Row {
@@ -698,10 +705,12 @@ DankModal {
CachingImage {
id: thumbnailImageSource
property string entryId: model.entry.split('\t')[0]
property string entryId: model.entry.split(
'\t')[0]
anchors.fill: parent
source: entryType === "image" && imageLoader.imageData ? `data:image/png;base64,${imageLoader.imageData}` : ""
source: entryType === "image"
&& imageLoader.imageData ? `data:image/png;base64,${imageLoader.imageData}` : ""
fillMode: Image.PreserveAspectCrop
smooth: true
cache: true
@@ -718,12 +727,10 @@ DankModal {
stdout: StdioCollector {
onStreamFinished: {
imageLoader.imageData = text.trim();
imageLoader.imageData = text.trim()
}
}
}
}
MultiEffect {
@@ -732,7 +739,8 @@ DankModal {
source: thumbnailImageSource
maskEnabled: true
maskSource: clipboardCircularMask
visible: entryType === "image" && thumbnailImageSource.status === Image.Ready
visible: entryType === "image"
&& thumbnailImageSource.status === Image.Ready
maskThresholdMin: 0.5
maskSpreadAtMin: 1
}
@@ -752,25 +760,25 @@ DankModal {
color: "black"
antialiasing: true
}
}
DankIcon {
visible: !(entryType === "image" && thumbnailImageSource.status === Image.Ready)
visible: !(entryType === "image"
&& thumbnailImageSource.status
=== Image.Ready)
name: {
if (entryType === "image")
return "image";
return "image"
if (entryType === "long_text")
return "subject";
return "subject"
return "content_copy";
return "content_copy"
}
size: Theme.iconSize
color: Theme.primary
anchors.centerIn: parent
}
}
Column {
@@ -782,11 +790,11 @@ DankModal {
text: {
switch (entryType) {
case "image":
return "Image • " + entryPreview;
return "Image • " + entryPreview
case "long_text":
return "Long Text";
return "Long Text"
default:
return "Text";
return "Text"
}
}
font.pixelSize: Theme.fontSizeSmall
@@ -807,11 +815,8 @@ DankModal {
maximumLineCount: entryType === "long_text" ? 3 : 1
elide: Text.ElideRight
}
}
}
}
DankActionButton {
@@ -823,7 +828,7 @@ DankModal {
iconColor: Theme.error
hoverColor: Theme.errorHover
onClicked: {
deleteEntry(model.entry);
deleteEntry(model.entry)
}
}
@@ -836,11 +841,8 @@ DankModal {
cursorShape: Qt.PointingHandCursor
onClicked: copyEntry(model.entry)
}
}
}
}
Item {
@@ -852,11 +854,8 @@ DankModal {
duration: Theme.shortDuration
easing.type: Theme.standardEasing
}
}
}
}
Rectangle {
@@ -866,7 +865,9 @@ DankModal {
anchors.margins: Theme.spacingL
height: 80
radius: Theme.cornerRadius
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: Theme.primary
border.width: 2
opacity: showKeyboardHints ? 1 : 0
@@ -889,7 +890,6 @@ DankModal {
color: Theme.surfaceText
anchors.horizontalCenter: parent.horizontalCenter
}
}
Behavior on opacity {
@@ -897,13 +897,8 @@ DankModal {
duration: Theme.shortDuration
easing.type: Theme.standardEasing
}
}
}
}
}
}

View File

@@ -34,9 +34,9 @@ PanelWindow {
property bool allowFocusOverride: false
property bool allowStacking: false
signal opened()
signal dialogClosed()
signal backgroundClicked()
signal opened
signal dialogClosed
signal backgroundClicked
Connections {
target: ModalManager
@@ -49,25 +49,24 @@ PanelWindow {
function open() {
ModalManager.openModal(root)
closeTimer.stop();
shouldBeVisible = true;
visible = true;
focusScope.forceActiveFocus();
closeTimer.stop()
shouldBeVisible = true
visible = true
focusScope.forceActiveFocus()
}
function close() {
shouldBeVisible = false;
closeTimer.restart();
shouldBeVisible = false
closeTimer.restart()
}
function toggle() {
if (shouldBeVisible)
close();
close()
else
open();
open()
}
visible: shouldBeVisible
color: "transparent"
WlrLayershell.layer: WlrLayershell.Overlay
@@ -75,13 +74,13 @@ PanelWindow {
WlrLayershell.keyboardFocus: shouldHaveFocus ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None
onVisibleChanged: {
if (root.visible) {
opened();
opened()
} else {
if (Qt.inputMethod) {
Qt.inputMethod.hide();
Qt.inputMethod.reset();
Qt.inputMethod.hide()
Qt.inputMethod.reset()
}
dialogClosed();
dialogClosed()
}
}
@@ -90,12 +89,10 @@ PanelWindow {
interval: animationDuration + 50
onTriggered: {
visible = false;
visible = false
}
}
anchors {
top: true
left: true
@@ -114,11 +111,14 @@ PanelWindow {
MouseArea {
anchors.fill: parent
enabled: root.closeOnBackgroundClick
onClicked: (mouse) => {
var localPos = mapToItem(contentContainer, mouse.x, mouse.y);
if (localPos.x < 0 || localPos.x > contentContainer.width || localPos.y < 0 || localPos.y > contentContainer.height)
root.backgroundClicked();
onClicked: mouse => {
var localPos = mapToItem(contentContainer,
mouse.x, mouse.y)
if (localPos.x < 0
|| localPos.x > contentContainer.width
|| localPos.y < 0
|| localPos.y > contentContainer.height)
root.backgroundClicked()
}
}
@@ -127,9 +127,7 @@ PanelWindow {
duration: root.animationDuration
easing.type: root.animationEasing
}
}
}
Rectangle {
@@ -140,17 +138,18 @@ PanelWindow {
anchors.centerIn: positioning === "center" ? parent : undefined
x: {
if (positioning === "top-right")
return Math.max(Theme.spacingL, root.screenWidth - width - Theme.spacingL);
return Math.max(Theme.spacingL,
root.screenWidth - width - Theme.spacingL)
else if (positioning === "custom")
return root.customPosition.x;
return 0; // Will be overridden by anchors.centerIn when positioning === "center"
return root.customPosition.x
return 0 // Will be overridden by anchors.centerIn when positioning === "center"
}
y: {
if (positioning === "top-right")
return Theme.barHeight + Theme.spacingXS;
return Theme.barHeight + Theme.spacingXS
else if (positioning === "custom")
return root.customPosition.y;
return 0; // Will be overridden by anchors.centerIn when positioning === "center"
return root.customPosition.y
return 0 // Will be overridden by anchors.centerIn when positioning === "center"
}
color: root.backgroundColor
radius: root.cornerRadius
@@ -160,9 +159,9 @@ PanelWindow {
opacity: root.shouldBeVisible ? 1 : 0
scale: {
if (root.animationType === "scale")
return root.shouldBeVisible ? 1 : 0.9;
return root.shouldBeVisible ? 1 : 0.9
return 1;
return 1
}
transform: root.animationType === "slide" ? slideTransform : null
@@ -186,7 +185,6 @@ PanelWindow {
duration: root.animationDuration
easing.type: root.animationEasing
}
}
Behavior on scale {
@@ -196,7 +194,6 @@ PanelWindow {
duration: root.animationDuration
easing.type: root.animationEasing
}
}
layer.effect: MultiEffect {
@@ -207,7 +204,6 @@ PanelWindow {
shadowColor: Theme.shadowStrong
shadowOpacity: 0.3
}
}
FocusScope {
@@ -217,19 +213,24 @@ PanelWindow {
anchors.fill: parent
visible: root.visible // Only active when the modal is visible
focus: root.visible
Keys.onEscapePressed: (event) => {
console.log("DankModal escape pressed - shouldHaveFocus:", shouldHaveFocus, "closeOnEscapeKey:", root.closeOnEscapeKey, "objectName:", root.objectName || "unnamed");
if (root.closeOnEscapeKey && shouldHaveFocus) {
console.log("DankModal handling escape");
root.close();
event.accepted = true;
Keys.onEscapePressed: event => {
console.log(
"DankModal escape pressed - shouldHaveFocus:",
shouldHaveFocus, "closeOnEscapeKey:",
root.closeOnEscapeKey, "objectName:",
root.objectName || "unnamed")
if (root.closeOnEscapeKey
&& shouldHaveFocus) {
console.log("DankModal handling escape")
root.close()
event.accepted = true
}
}
onVisibleChanged: {
if (visible && shouldHaveFocus)
Qt.callLater(function () {
focusScope.forceActiveFocus();
});
focusScope.forceActiveFocus()
})
}
Connections {
@@ -237,11 +238,10 @@ PanelWindow {
function onShouldHaveFocusChanged() {
if (shouldHaveFocus && visible) {
Qt.callLater(function () {
focusScope.forceActiveFocus();
});
focusScope.forceActiveFocus()
})
}
}
}
}
}

View File

@@ -175,7 +175,8 @@ DankModal {
id: mouseArea
anchors.fill: parent
hoverEnabled: currentPath !== homeDir
cursorShape: currentPath !== homeDir ? Qt.PointingHandCursor : Qt.ArrowCursor
cursorShape: currentPath
!== homeDir ? Qt.PointingHandCursor : Qt.ArrowCursor
enabled: currentPath !== homeDir
onClicked: navigateUp()
}
@@ -251,8 +252,8 @@ DankModal {
name: "description"
size: Theme.iconSizeLarge
color: Theme.primary
visible: !delegateRoot.fileIsDir && !isImageFile(
delegateRoot.fileName)
visible: !delegateRoot.fileIsDir
&& !isImageFile(delegateRoot.fileName)
}
DankIcon {

View File

@@ -110,9 +110,11 @@ DankModal {
acceptedDevices: PointerDevice.Mouse | PointerDevice.TouchPad
onWheel: event => {
let delta = event.pixelDelta.y
!== 0 ? event.pixelDelta.y * 1.8 : event.angleDelta.y / 120 * 60
!== 0 ? event.pixelDelta.y
* 1.8 : event.angleDelta.y / 120 * 60
let newY = parent.contentY - delta
newY = Math.max(0, Math.min(
newY = Math.max(
0, Math.min(
parent.contentHeight - parent.height,
newY))
parent.contentY = newY
@@ -124,7 +126,8 @@ DankModal {
id: detailsRect
width: parent.width
height: Math.max(parent.parent.height,
height: Math.max(
parent.parent.height,
detailsText.contentHeight + Theme.spacingM * 2)
radius: Theme.cornerRadius
color: Theme.surfaceHover
@@ -136,8 +139,9 @@ DankModal {
anchors.fill: parent
anchors.margins: Theme.spacingM
text: NetworkService.networkInfoDetails.replace(/\\n/g, '\n')
|| "No information available"
text: NetworkService.networkInfoDetails.replace(
/\\n/g,
'\n') || "No information available"
font.pixelSize: Theme.fontSizeMedium
color: Theme.surfaceText
wrapMode: Text.WordWrap
@@ -161,10 +165,13 @@ DankModal {
Rectangle {
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
width: Math.max(70, closeText.contentWidth + Theme.spacingM * 2)
width: Math.max(
70,
closeText.contentWidth + Theme.spacingM * 2)
height: 36
radius: Theme.cornerRadius
color: closeArea.containsMouse ? Qt.darker(Theme.primary,
color: closeArea.containsMouse ? Qt.darker(
Theme.primary,
1.1) : Theme.primary
StyledText {

View File

@@ -29,14 +29,14 @@ DankModal {
id: modalKeyboardController
listView: null
isOpen: notificationModal.notificationModalOpen
onClose: function() { notificationModal.hide() }
onClose: function () {
notificationModal.hide()
}
}
property bool notificationModalOpen: false
property var notificationListRef: null
function show() {
notificationModalOpen = true
open()
@@ -61,7 +61,6 @@ DankModal {
show()
}
IpcHandler {
function open() {
notificationModal.show()
@@ -117,7 +116,6 @@ DankModal {
}
}
}
}
NotificationKeyboardHints {
@@ -128,7 +126,6 @@ DankModal {
anchors.margins: Theme.spacingL
showHints: modalKeyboardController.showKeyboardHints
}
}
}

View File

@@ -132,7 +132,8 @@ DankModal {
baseColor = Theme.primary
break
}
return confirmButton.containsMouse ? Qt.rgba(baseColor.r,
return confirmButton.containsMouse ? Qt.rgba(
baseColor.r,
baseColor.g,
baseColor.b,
0.9) : baseColor

View File

@@ -19,29 +19,28 @@ DankModal {
function show() {
if (!DgopService.dgopAvailable) {
console.warn("ProcessListModal: dgop is not available");
return ;
console.warn("ProcessListModal: dgop is not available")
return
}
open();
UserInfoService.getUptime();
open()
UserInfoService.getUptime()
}
function hide() {
close();
close()
if (processContextMenu.visible)
processContextMenu.close();
processContextMenu.close()
}
function toggle() {
if (!DgopService.dgopAvailable) {
console.warn("ProcessListModal: dgop is not available");
return ;
console.warn("ProcessListModal: dgop is not available")
return
}
if (shouldBeVisible)
hide();
hide()
else
show();
show()
}
width: 900
@@ -58,23 +57,18 @@ DankModal {
ProcessesTab {
contextMenu: processContextMenu
}
}
Component {
id: performanceTabComponent
PerformanceTab {
}
PerformanceTab {}
}
Component {
id: systemTabComponent
SystemTab {
}
SystemTab {}
}
ProcessContextMenu {
@@ -87,17 +81,17 @@ DankModal {
focus: true
Keys.onPressed: function (event) {
if (event.key === Qt.Key_Escape) {
processListModal.hide();
event.accepted = true;
processListModal.hide()
event.accepted = true
} else if (event.key === Qt.Key_1) {
currentTab = 0;
event.accepted = true;
currentTab = 0
event.accepted = true
} else if (event.key === Qt.Key_2) {
currentTab = 1;
event.accepted = true;
currentTab = 1
event.accepted = true
} else if (event.key === Qt.Key_3) {
currentTab = 2;
event.accepted = true;
currentTab = 2
event.accepted = true
}
}
@@ -139,9 +133,7 @@ DankModal {
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.WordWrap
}
}
}
ColumnLayout {
@@ -175,7 +167,6 @@ DankModal {
onClicked: processListModal.hide()
Layout.alignment: Qt.AlignVCenter
}
}
Rectangle {
@@ -210,17 +201,18 @@ DankModal {
name: {
switch (index) {
case 0:
return "list_alt";
return "list_alt"
case 1:
return "analytics";
return "analytics"
case 2:
return "settings";
return "settings"
default:
return "tab";
return "tab"
}
}
size: Theme.iconSize - 2
color: currentTab === index ? Theme.primary : Theme.surfaceText
color: currentTab
=== index ? Theme.primary : Theme.surfaceText
opacity: currentTab === index ? 1 : 0.7
anchors.verticalCenter: parent.verticalCenter
@@ -228,16 +220,15 @@ DankModal {
ColorAnimation {
duration: Theme.shortDuration
}
}
}
StyledText {
text: modelData
font.pixelSize: Theme.fontSizeLarge
font.weight: Font.Medium
color: currentTab === index ? Theme.primary : Theme.surfaceText
color: currentTab
=== index ? Theme.primary : Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
anchors.verticalCenterOffset: -1
@@ -245,11 +236,8 @@ DankModal {
ColorAnimation {
duration: Theme.shortDuration
}
}
}
}
MouseArea {
@@ -259,7 +247,7 @@ DankModal {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
currentTab = index;
currentTab = index
}
}
@@ -267,22 +255,16 @@ DankModal {
ColorAnimation {
duration: Theme.shortDuration
}
}
Behavior on border.color {
ColorAnimation {
duration: Theme.shortDuration
}
}
}
}
}
}
Rectangle {
@@ -308,9 +290,7 @@ DankModal {
duration: Theme.mediumDuration
easing.type: Theme.emphasizedEasing
}
}
}
Loader {
@@ -328,9 +308,7 @@ DankModal {
duration: Theme.mediumDuration
easing.type: Theme.emphasizedEasing
}
}
}
Loader {
@@ -348,17 +326,10 @@ DankModal {
duration: Theme.mediumDuration
easing.type: Theme.emphasizedEasing
}
}
}
}
}
}
}
}

View File

@@ -14,21 +14,21 @@ DankModal {
property Component settingsContent
signal closingModal()
signal closingModal
function show() {
open();
open()
}
function hide() {
close();
close()
}
function toggle() {
if (shouldBeVisible)
hide();
hide()
else
show();
show()
}
objectName: "settingsModal"
@@ -40,18 +40,18 @@ DankModal {
IpcHandler {
function open() {
settingsModal.show();
return "SETTINGS_OPEN_SUCCESS";
settingsModal.show()
return "SETTINGS_OPEN_SUCCESS"
}
function close() {
settingsModal.hide();
return "SETTINGS_CLOSE_SUCCESS";
settingsModal.hide()
return "SETTINGS_CLOSE_SUCCESS"
}
function toggle() {
settingsModal.toggle();
return "SETTINGS_TOGGLE_SUCCESS";
settingsModal.toggle()
return "SETTINGS_TOGGLE_SUCCESS"
}
target: "settings"
@@ -103,7 +103,6 @@ DankModal {
hoverColor: Theme.errorHover
onClicked: settingsModal.hide()
}
}
// Main content with side navigation
@@ -153,7 +152,8 @@ DankModal {
height: 80
anchors.verticalCenter: parent.verticalCenter
property bool hasImage: profileImageSource.status === Image.Ready
property bool hasImage: profileImageSource.status
=== Image.Ready
Rectangle {
anchors.fill: parent
@@ -168,10 +168,11 @@ DankModal {
id: profileImageSource
source: {
if (PortalService.profileImage === "")
return "";
if (PortalService.profileImage.startsWith("/"))
return "file://" + PortalService.profileImage;
return PortalService.profileImage;
return ""
if (PortalService.profileImage.startsWith(
"/"))
return "file://" + PortalService.profileImage
return PortalService.profileImage
}
smooth: true
asynchronous: true
@@ -226,7 +227,8 @@ DankModal {
name: "warning"
size: Theme.iconSizeLarge
color: Theme.error
visible: PortalService.profileImage !== "" && profileImageSource.status === Image.Error
visible: PortalService.profileImage !== ""
&& profileImageSource.status === Image.Error
}
// Hover overlay with edit and clear buttons
@@ -244,7 +246,8 @@ DankModal {
width: 28
height: 28
radius: 14
color: Qt.rgba(255, 255, 255, 0.9)
color: Qt.rgba(255, 255,
255, 0.9)
DankIcon {
anchors.centerIn: parent
@@ -257,9 +260,10 @@ DankModal {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
settingsModal.allowFocusOverride = true;
settingsModal.shouldHaveFocus = false;
profileBrowser.open();
settingsModal.allowFocusOverride = true
settingsModal.shouldHaveFocus = false
profileBrowser.open(
)
}
}
}
@@ -268,7 +272,8 @@ DankModal {
width: 28
height: 28
radius: 14
color: Qt.rgba(255, 255, 255, 0.9)
color: Qt.rgba(255, 255,
255, 0.9)
visible: profileImageContainer.hasImage
DankIcon {
@@ -282,7 +287,8 @@ DankModal {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
PortalService.setProfileImage("");
PortalService.setProfileImage(
"")
}
}
}
@@ -306,7 +312,8 @@ DankModal {
spacing: Theme.spacingXS
StyledText {
text: UserInfoService.fullName || "User"
text: UserInfoService.fullName
|| "User"
font.pixelSize: Theme.fontSizeLarge
font.weight: Font.Medium
color: Theme.surfaceText
@@ -315,7 +322,8 @@ DankModal {
}
StyledText {
text: DgopService.distribution || "Linux"
text: DgopService.distribution
|| "Linux"
font.pixelSize: Theme.fontSizeMedium
color: Theme.surfaceVariantText
elide: Text.ElideRight
@@ -397,7 +405,6 @@ DankModal {
font.weight: parent.parent.isActive ? Font.Medium : Font.Normal
anchors.verticalCenter: parent.verticalCenter
}
}
MouseArea {
@@ -407,7 +414,7 @@ DankModal {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
sidebarContainer.currentIndex = index;
sidebarContainer.currentIndex = index
}
}
@@ -416,15 +423,10 @@ DankModal {
duration: Theme.shortDuration
easing.type: Theme.standardEasing
}
}
}
}
}
}
// Main content area
@@ -452,9 +454,7 @@ DankModal {
PersonalizationTab {
parentModal: settingsModal
}
}
}
Loader {
@@ -509,11 +509,8 @@ DankModal {
asynchronous: true
sourceComponent: Component {
DockTab {
DockTab {}
}
}
}
Loader {
@@ -545,11 +542,8 @@ DankModal {
asynchronous: true
sourceComponent: AboutTab {}
}
}
}
}
// Footer
@@ -565,7 +559,10 @@ DankModal {
Image {
anchors.fill: parent
source: Qt.resolvedUrl(".").toString().replace("file://", "").replace("/Modals/", "") + "/assets/dank.svg"
source: Qt.resolvedUrl(".").toString().replace(
"file://",
"").replace("/Modals/",
"") + "/assets/dank.svg"
sourceSize: Qt.size(68, 16)
smooth: true
fillMode: Image.PreserveAspectFit
@@ -580,7 +577,8 @@ DankModal {
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: Qt.openUrlExternally("https://github.com/AvengeMedia/DankMaterialShell")
onClicked: Qt.openUrlExternally(
"https://github.com/AvengeMedia/DankMaterialShell")
}
}
@@ -605,7 +603,10 @@ DankModal {
Image {
anchors.fill: parent
source: Qt.resolvedUrl(".").toString().replace("file://", "").replace("/Modals/", "") + "/assets/niri.svg"
source: Qt.resolvedUrl(".").toString().replace(
"file://",
"").replace("/Modals/",
"") + "/assets/niri.svg"
sourceSize: Qt.size(24, 24)
smooth: true
fillMode: Image.PreserveAspectFit
@@ -614,7 +615,8 @@ DankModal {
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: Qt.openUrlExternally("https://github.com/YaLTeR/niri")
onClicked: Qt.openUrlExternally(
"https://github.com/YaLTeR/niri")
}
}
@@ -645,7 +647,10 @@ DankModal {
Image {
anchors.fill: parent
source: Qt.resolvedUrl(".").toString().replace("file://", "").replace("/Modals/", "") + "/assets/matrix-logo-white.svg"
source: Qt.resolvedUrl(".").toString().replace(
"file://", "").replace(
"/Modals/",
"") + "/assets/matrix-logo-white.svg"
sourceSize: Qt.size(32, 20)
smooth: true
fillMode: Image.PreserveAspectFit
@@ -660,7 +665,8 @@ DankModal {
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: Qt.openUrlExternally("https://matrix.to/#/#niri:matrix.org")
onClicked: Qt.openUrlExternally(
"https://matrix.to/#/#niri:matrix.org")
}
}
@@ -691,7 +697,10 @@ DankModal {
Image {
anchors.fill: parent
source: Qt.resolvedUrl(".").toString().replace("file://", "").replace("/Modals/", "") + "/assets/discord.svg"
source: Qt.resolvedUrl(".").toString().replace(
"file://",
"").replace("/Modals/",
"") + "/assets/discord.svg"
sourceSize: Qt.size(16, 16)
smooth: true
fillMode: Image.PreserveAspectFit
@@ -700,7 +709,8 @@ DankModal {
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: Qt.openUrlExternally("https://discord.gg/vT8Sfjy7sx")
onClicked: Qt.openUrlExternally(
"https://discord.gg/vT8Sfjy7sx")
}
}
@@ -731,7 +741,10 @@ DankModal {
Image {
anchors.fill: parent
source: Qt.resolvedUrl(".").toString().replace("file://", "").replace("/Modals/", "") + "/assets/reddit.svg"
source: Qt.resolvedUrl(".").toString().replace(
"file://",
"").replace("/Modals/",
"") + "/assets/reddit.svg"
sourceSize: Qt.size(18, 18)
smooth: true
fillMode: Image.PreserveAspectFit
@@ -740,15 +753,13 @@ DankModal {
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: Qt.openUrlExternally("https://reddit.com/r/niri")
onClicked: Qt.openUrlExternally(
"https://reddit.com/r/niri")
}
}
}
}
}
}
FileBrowserModal {
@@ -758,18 +769,17 @@ DankModal {
browserIcon: "person"
browserType: "profile"
fileExtensions: ["*.jpg", "*.jpeg", "*.png", "*.bmp", "*.gif", "*.webp"]
onFileSelected: (path) => {
PortalService.setProfileImage(path);
close();
onFileSelected: path => {
PortalService.setProfileImage(path)
close()
}
onDialogClosed: {
if (settingsModal) {
settingsModal.allowFocusOverride = false;
settingsModal.allowFocusOverride = false
settingsModal.shouldHaveFocus = Qt.binding(() => {
return settingsModal.shouldBeVisible;
});
return settingsModal.shouldBeVisible
})
}
}
}
}

View File

@@ -16,33 +16,32 @@ DankModal {
property Component spotlightContent
function show() {
spotlightOpen = true;
open();
spotlightOpen = true
open()
if (contentLoader.item && contentLoader.item.appLauncher)
contentLoader.item.appLauncher.searchQuery = "";
contentLoader.item.appLauncher.searchQuery = ""
Qt.callLater(function () {
if (contentLoader.item && contentLoader.item.searchField)
contentLoader.item.searchField.forceActiveFocus();
});
contentLoader.item.searchField.forceActiveFocus()
})
}
function hide() {
spotlightOpen = false;
close();
spotlightOpen = false
close()
if (contentLoader.item && contentLoader.item.appLauncher) {
contentLoader.item.appLauncher.searchQuery = "";
contentLoader.item.appLauncher.selectedIndex = 0;
contentLoader.item.appLauncher.setCategory("All");
contentLoader.item.appLauncher.searchQuery = ""
contentLoader.item.appLauncher.selectedIndex = 0
contentLoader.item.appLauncher.setCategory("All")
}
}
function toggle() {
if (spotlightOpen)
hide();
hide()
else
show();
show()
}
shouldBeVisible: spotlightOpen
@@ -50,7 +49,8 @@ DankModal {
Connections {
target: ModalManager
function onCloseAllModalsExcept(excludedModal) {
if (excludedModal !== spotlightModal && !allowStacking && spotlightOpen) {
if (excludedModal !== spotlightModal && !allowStacking
&& spotlightOpen) {
spotlightOpen = false
}
}
@@ -64,43 +64,41 @@ DankModal {
enableShadow: true
onVisibleChanged: {
if (visible && !spotlightOpen)
show();
show()
if (visible && contentLoader.item)
Qt.callLater(function () {
if (contentLoader.item.searchField)
contentLoader.item.searchField.forceActiveFocus();
});
contentLoader.item.searchField.forceActiveFocus()
})
}
onBackgroundClicked: {
hide();
hide()
}
Component.onCompleted: {
}
content: spotlightContent
IpcHandler {
function open() {
spotlightModal.show();
return "SPOTLIGHT_OPEN_SUCCESS";
spotlightModal.show()
return "SPOTLIGHT_OPEN_SUCCESS"
}
function close() {
spotlightModal.hide();
return "SPOTLIGHT_CLOSE_SUCCESS";
spotlightModal.hide()
return "SPOTLIGHT_CLOSE_SUCCESS"
}
function toggle() {
spotlightModal.toggle();
return "SPOTLIGHT_TOGGLE_SUCCESS";
spotlightModal.toggle()
return "SPOTLIGHT_TOGGLE_SUCCESS"
}
target: "spotlight"
}
spotlightContent: Component {
Item {
id: spotlightKeyHandler
@@ -112,27 +110,32 @@ DankModal {
focus: true
Keys.onPressed: function (event) {
if (event.key === Qt.Key_Escape) {
hide();
event.accepted = true;
hide()
event.accepted = true
} else if (event.key === Qt.Key_Down) {
appLauncher.selectNext();
event.accepted = true;
appLauncher.selectNext()
event.accepted = true
} else if (event.key === Qt.Key_Up) {
appLauncher.selectPrevious();
event.accepted = true;
} else if (event.key === Qt.Key_Right && appLauncher.viewMode === "grid") {
appLauncher.selectNextInRow();
event.accepted = true;
} else if (event.key === Qt.Key_Left && appLauncher.viewMode === "grid") {
appLauncher.selectPreviousInRow();
event.accepted = true;
} else if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
appLauncher.launchSelected();
event.accepted = true;
} else if (!searchField.activeFocus && event.text && event.text.length > 0 && event.text.match(/[a-zA-Z0-9\\s]/)) {
searchField.forceActiveFocus();
searchField.insertText(event.text);
event.accepted = true;
appLauncher.selectPrevious()
event.accepted = true
} else if (event.key === Qt.Key_Right
&& appLauncher.viewMode === "grid") {
appLauncher.selectNextInRow()
event.accepted = true
} else if (event.key === Qt.Key_Left
&& appLauncher.viewMode === "grid") {
appLauncher.selectPreviousInRow()
event.accepted = true
} else if (event.key === Qt.Key_Return
|| event.key === Qt.Key_Enter) {
appLauncher.launchSelected()
event.accepted = true
} else if (!searchField.activeFocus && event.text
&& event.text.length > 0 && event.text.match(
/[a-zA-Z0-9\\s]/)) {
searchField.forceActiveFocus()
searchField.insertText(event.text)
event.accepted = true
}
}
@@ -143,7 +146,7 @@ DankModal {
gridColumns: 4
onAppLaunched: hide()
onViewModeSelected: function (mode) {
SettingsData.setSpotlightModalViewMode(mode);
SettingsData.setSpotlightModalViewMode(mode)
}
}
@@ -159,7 +162,8 @@ DankModal {
color: Theme.surfaceVariantAlpha
border.color: Theme.outlineMedium
border.width: 1
visible: appLauncher.categories.length > 1 || appLauncher.model.count > 0
visible: appLauncher.categories.length > 1
|| appLauncher.model.count > 0
CategorySelector {
id: categorySelector
@@ -169,11 +173,11 @@ DankModal {
categories: appLauncher.categories
selectedCategory: appLauncher.selectedCategory
compact: false
onCategorySelected: (category) => {
return appLauncher.setCategory(category);
onCategorySelected: category => {
return appLauncher.setCategory(
category)
}
}
}
Row {
@@ -183,10 +187,16 @@ DankModal {
DankTextField {
id: searchField
width: parent.width - 80 - Theme.spacingM // Leave space for view toggle buttons
width: parent.width - 80
- Theme.spacingM // Leave space for view toggle buttons
height: 56
cornerRadius: Theme.cornerRadius
backgroundColor: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, Theme.getContentBackgroundAlpha() * 0.7)
backgroundColor: Qt.rgba(
Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b,
Theme.getContentBackgroundAlpha(
) * 0.7)
normalBorderColor: Theme.outlineMedium
focusedBorderColor: Theme.primary
leftIconName: "search"
@@ -202,20 +212,24 @@ DankModal {
keyForwardTargets: [spotlightKeyHandler]
text: appLauncher.searchQuery
onTextEdited: {
appLauncher.searchQuery = text;
appLauncher.searchQuery = text
}
Keys.onPressed: (event) => {
Keys.onPressed: event => {
if (event.key === Qt.Key_Escape) {
hide();
event.accepted = true;
} else if ((event.key === Qt.Key_Return || event.key === Qt.Key_Enter) && text.length > 0) {
if (appLauncher.keyboardNavigationActive && appLauncher.model.count > 0)
appLauncher.launchSelected();
hide()
event.accepted = true
} else if ((event.key === Qt.Key_Return
|| event.key === Qt.Key_Enter)
&& text.length > 0) {
if (appLauncher.keyboardNavigationActive
&& appLauncher.model.count > 0)
appLauncher.launchSelected()
else if (appLauncher.model.count > 0)
appLauncher.launchApp(appLauncher.model.get(0));
event.accepted = true;
appLauncher.launchApp(
appLauncher.model.get(0))
event.accepted = true
} else if (event.key === Qt.Key_Down || event.key === Qt.Key_Up || event.key === Qt.Key_Left || event.key === Qt.Key_Right || ((event.key === Qt.Key_Return || event.key === Qt.Key_Enter) && text.length === 0)) {
event.accepted = false;
event.accepted = false
}
}
}
@@ -230,14 +244,16 @@ DankModal {
height: 36
radius: Theme.cornerRadius
color: appLauncher.viewMode === "list" ? Theme.primaryHover : listViewArea.containsMouse ? Theme.surfaceHover : "transparent"
border.color: appLauncher.viewMode === "list" ? Theme.primarySelected : "transparent"
border.color: appLauncher.viewMode
=== "list" ? Theme.primarySelected : "transparent"
border.width: 1
DankIcon {
anchors.centerIn: parent
name: "view_list"
size: 18
color: appLauncher.viewMode === "list" ? Theme.primary : Theme.surfaceText
color: appLauncher.viewMode
=== "list" ? Theme.primary : Theme.surfaceText
}
MouseArea {
@@ -247,10 +263,9 @@ DankModal {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
appLauncher.setViewMode("list");
appLauncher.setViewMode("list")
}
}
}
Rectangle {
@@ -258,14 +273,16 @@ DankModal {
height: 36
radius: Theme.cornerRadius
color: appLauncher.viewMode === "grid" ? Theme.primaryHover : gridViewArea.containsMouse ? Theme.surfaceHover : "transparent"
border.color: appLauncher.viewMode === "grid" ? Theme.primarySelected : "transparent"
border.color: appLauncher.viewMode
=== "grid" ? Theme.primarySelected : "transparent"
border.width: 1
DankIcon {
anchors.centerIn: parent
name: "grid_view"
size: 18
color: appLauncher.viewMode === "grid" ? Theme.primary : Theme.surfaceText
color: appLauncher.viewMode
=== "grid" ? Theme.primary : Theme.surfaceText
}
MouseArea {
@@ -275,14 +292,11 @@ DankModal {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
appLauncher.setViewMode("grid");
appLauncher.setViewMode("grid")
}
}
}
}
}
Rectangle {
@@ -305,20 +319,20 @@ DankModal {
property bool hoverUpdatesSelection: false
property bool keyboardNavigationActive: appLauncher.keyboardNavigationActive
signal keyboardNavigationReset()
signal keyboardNavigationReset
signal itemClicked(int index, var modelData)
signal itemRightClicked(int index, var modelData, real mouseX, real mouseY)
function ensureVisible(index) {
if (index < 0 || index >= count)
return ;
return
var itemY = index * (itemHeight + itemSpacing);
var itemBottom = itemY + itemHeight;
var itemY = index * (itemHeight + itemSpacing)
var itemBottom = itemY + itemHeight
if (itemY < contentY)
contentY = itemY;
contentY = itemY
else if (itemBottom > contentY + height)
contentY = itemBottom - height;
contentY = itemBottom - height
}
anchors.fill: parent
@@ -334,17 +348,16 @@ DankModal {
reuseItems: true
onCurrentIndexChanged: {
if (keyboardNavigationActive)
ensureVisible(currentIndex);
ensureVisible(currentIndex)
}
onItemClicked: function (index, modelData) {
appLauncher.launchApp(modelData);
appLauncher.launchApp(modelData)
}
onItemRightClicked: function (index, modelData, mouseX, mouseY) {
contextMenu.show(mouseX, mouseY, modelData);
contextMenu.show(mouseX, mouseY, modelData)
}
onKeyboardNavigationReset: {
appLauncher.keyboardNavigationActive = false;
appLauncher.keyboardNavigationActive = false
}
ScrollBar.vertical: ScrollBar {
@@ -377,7 +390,9 @@ DankModal {
id: listIconImg
anchors.fill: parent
source: (model.icon) ? Quickshell.iconPath(model.icon, SettingsData.iconTheme === "System Default" ? "" : SettingsData.iconTheme) : ""
source: (model.icon) ? Quickshell.iconPath(
model.icon,
SettingsData.iconTheme === "System Default" ? "" : SettingsData.iconTheme) : ""
smooth: true
asynchronous: true
visible: status === Image.Ready
@@ -393,14 +408,16 @@ DankModal {
StyledText {
anchors.centerIn: parent
text: (model.name && model.name.length > 0) ? model.name.charAt(0).toUpperCase() : "A"
text: (model.name
&& model.name.length
> 0) ? model.name.charAt(
0).toUpperCase(
) : "A"
font.pixelSize: resultsList.iconSize * 0.4
color: Theme.primary
font.weight: Font.Bold
}
}
}
Column {
@@ -423,11 +440,11 @@ DankModal {
font.pixelSize: Theme.fontSizeMedium
color: Theme.surfaceVariantText
elide: Text.ElideRight
visible: resultsList.showDescription && model.comment && model.comment.length > 0
visible: resultsList.showDescription
&& model.comment
&& model.comment.length > 0
}
}
}
MouseArea {
@@ -439,25 +456,28 @@ DankModal {
acceptedButtons: Qt.LeftButton | Qt.RightButton
z: 10
onEntered: {
if (resultsList.hoverUpdatesSelection && !resultsList.keyboardNavigationActive)
resultsList.currentIndex = index;
if (resultsList.hoverUpdatesSelection
&& !resultsList.keyboardNavigationActive)
resultsList.currentIndex = index
}
onPositionChanged: {
resultsList.keyboardNavigationReset();
resultsList.keyboardNavigationReset()
}
onClicked: (mouse) => {
onClicked: mouse => {
if (mouse.button === Qt.LeftButton) {
resultsList.itemClicked(index, model);
resultsList.itemClicked(
index, model)
} else if (mouse.button === Qt.RightButton) {
var modalPos = mapToItem(spotlightKeyHandler, mouse.x, mouse.y);
resultsList.itemRightClicked(index, model, modalPos.x, modalPos.y);
var modalPos = mapToItem(
spotlightKeyHandler,
mouse.x, mouse.y)
resultsList.itemRightClicked(
index, model,
modalPos.x, modalPos.y)
}
}
}
}
}
DankGridView {
@@ -474,25 +494,30 @@ DankModal {
property int minIconSize: 32
property bool hoverUpdatesSelection: false
property bool keyboardNavigationActive: appLauncher.keyboardNavigationActive
property int baseCellWidth: adaptiveColumns ? Math.max(minCellWidth, Math.min(maxCellWidth, width / columns)) : (width - Theme.spacingS * 2) / columns
property int baseCellWidth: adaptiveColumns ? Math.max(
minCellWidth,
Math.min(maxCellWidth, width / columns)) : (width - Theme.spacingS * 2) / columns
property int baseCellHeight: baseCellWidth + 20
property int actualColumns: adaptiveColumns ? Math.floor(width / cellWidth) : columns
property int actualColumns: adaptiveColumns ? Math.floor(
width
/ cellWidth) : columns
property int remainingSpace: width - (actualColumns * cellWidth)
signal keyboardNavigationReset()
signal keyboardNavigationReset
signal itemClicked(int index, var modelData)
signal itemRightClicked(int index, var modelData, real mouseX, real mouseY)
function ensureVisible(index) {
if (index < 0 || index >= count)
return ;
return
var itemY = Math.floor(index / actualColumns) * cellHeight;
var itemBottom = itemY + cellHeight;
var itemY = Math.floor(
index / actualColumns) * cellHeight
var itemBottom = itemY + cellHeight
if (itemY < contentY)
contentY = itemY;
contentY = itemY
else if (itemBottom > contentY + height)
contentY = itemBottom - height;
contentY = itemBottom - height
}
anchors.fill: parent
@@ -510,17 +535,16 @@ DankModal {
reuseItems: true
onCurrentIndexChanged: {
if (keyboardNavigationActive)
ensureVisible(currentIndex);
ensureVisible(currentIndex)
}
onItemClicked: function (index, modelData) {
appLauncher.launchApp(modelData);
appLauncher.launchApp(modelData)
}
onItemRightClicked: function (index, modelData, mouseX, mouseY) {
contextMenu.show(mouseX, mouseY, modelData);
contextMenu.show(mouseX, mouseY, modelData)
}
onKeyboardNavigationReset: {
appLauncher.keyboardNavigationActive = false;
appLauncher.keyboardNavigationActive = false
}
ScrollBar.vertical: ScrollBar {
@@ -536,7 +560,8 @@ DankModal {
height: resultsGrid.cellHeight - resultsGrid.cellPadding
radius: Theme.cornerRadius
color: resultsGrid.currentIndex === index ? Theme.primaryPressed : gridMouseArea.containsMouse ? Theme.primaryHoverLight : Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.03)
border.color: resultsGrid.currentIndex === index ? Theme.primarySelected : Theme.outlineMedium
border.color: resultsGrid.currentIndex
=== index ? Theme.primarySelected : Theme.outlineMedium
border.width: resultsGrid.currentIndex === index ? 2 : 1
Column {
@@ -544,7 +569,12 @@ DankModal {
spacing: Theme.spacingS
Item {
property int iconSize: Math.min(resultsGrid.maxIconSize, Math.max(resultsGrid.minIconSize, resultsGrid.cellWidth * resultsGrid.iconSizeRatio))
property int iconSize: Math.min(
resultsGrid.maxIconSize,
Math.max(
resultsGrid.minIconSize,
resultsGrid.cellWidth
* resultsGrid.iconSizeRatio))
width: iconSize
height: iconSize
@@ -554,7 +584,9 @@ DankModal {
id: gridIconImg
anchors.fill: parent
source: (model.icon) ? Quickshell.iconPath(model.icon, SettingsData.iconTheme === "System Default" ? "" : SettingsData.iconTheme) : ""
source: (model.icon) ? Quickshell.iconPath(
model.icon,
SettingsData.iconTheme === "System Default" ? "" : SettingsData.iconTheme) : ""
smooth: true
asynchronous: true
visible: status === Image.Ready
@@ -570,14 +602,18 @@ DankModal {
StyledText {
anchors.centerIn: parent
text: (model.name && model.name.length > 0) ? model.name.charAt(0).toUpperCase() : "A"
font.pixelSize: Math.min(28, parent.width * 0.5)
text: (model.name
&& model.name.length
> 0) ? model.name.charAt(
0).toUpperCase(
) : "A"
font.pixelSize: Math.min(
28,
parent.width * 0.5)
color: Theme.primary
font.weight: Font.Bold
}
}
}
StyledText {
@@ -592,7 +628,6 @@ DankModal {
maximumLineCount: 2
wrapMode: Text.WordWrap
}
}
MouseArea {
@@ -604,29 +639,30 @@ DankModal {
acceptedButtons: Qt.LeftButton | Qt.RightButton
z: 10
onEntered: {
if (resultsGrid.hoverUpdatesSelection && !resultsGrid.keyboardNavigationActive)
resultsGrid.currentIndex = index;
if (resultsGrid.hoverUpdatesSelection
&& !resultsGrid.keyboardNavigationActive)
resultsGrid.currentIndex = index
}
onPositionChanged: {
resultsGrid.keyboardNavigationReset();
resultsGrid.keyboardNavigationReset()
}
onClicked: (mouse) => {
onClicked: mouse => {
if (mouse.button === Qt.LeftButton) {
resultsGrid.itemClicked(index, model);
resultsGrid.itemClicked(
index, model)
} else if (mouse.button === Qt.RightButton) {
var modalPos = mapToItem(spotlightKeyHandler, mouse.x, mouse.y);
resultsGrid.itemRightClicked(index, model, modalPos.x, modalPos.y);
var modalPos = mapToItem(
spotlightKeyHandler,
mouse.x, mouse.y)
resultsGrid.itemRightClicked(
index, model,
modalPos.x, modalPos.y)
}
}
}
}
}
}
}
Rectangle {
@@ -651,8 +687,14 @@ DankModal {
finalY = y - menuHeight - 8
}
finalX = Math.max(8, Math.min(finalX, spotlightKeyHandler.width - menuWidth - 8))
finalY = Math.max(8, Math.min(finalY, spotlightKeyHandler.height - menuHeight - 8))
finalX = Math.max(
8, Math.min(
finalX,
spotlightKeyHandler.width - menuWidth - 8))
finalY = Math.max(
8, Math.min(
finalY,
spotlightKeyHandler.height - menuHeight - 8))
contextMenu.x = finalX
contextMenu.y = finalY
@@ -672,7 +714,8 @@ DankModal {
height: menuColumn.implicitHeight + Theme.spacingS * 2
radius: Theme.cornerRadius
color: Theme.popupBackground()
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: 1
z: 1000
opacity: menuVisible ? 1 : 0
@@ -700,7 +743,11 @@ DankModal {
width: parent.width
height: 32
radius: Theme.cornerRadius
color: pinMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : "transparent"
color: pinMouseArea.containsMouse ? Qt.rgba(
Theme.primary.r,
Theme.primary.g,
Theme.primary.b,
0.12) : "transparent"
Row {
anchors.left: parent.left
@@ -710,11 +757,15 @@ DankModal {
DankIcon {
name: {
if (!contextMenu.currentApp || !contextMenu.currentApp.desktopEntry)
if (!contextMenu.currentApp
|| !contextMenu.currentApp.desktopEntry)
return "push_pin"
var appId = contextMenu.currentApp.desktopEntry.id || contextMenu.currentApp.desktopEntry.execString || ""
return SessionData.isPinnedApp(appId) ? "keep_off" : "push_pin"
var appId = contextMenu.currentApp.desktopEntry.id
|| contextMenu.currentApp.desktopEntry.execString
|| ""
return SessionData.isPinnedApp(
appId) ? "keep_off" : "push_pin"
}
size: Theme.iconSize - 2
color: Theme.surfaceText
@@ -724,11 +775,15 @@ DankModal {
StyledText {
text: {
if (!contextMenu.currentApp || !contextMenu.currentApp.desktopEntry)
if (!contextMenu.currentApp
|| !contextMenu.currentApp.desktopEntry)
return "Pin to Dock"
var appId = contextMenu.currentApp.desktopEntry.id || contextMenu.currentApp.desktopEntry.execString || ""
return SessionData.isPinnedApp(appId) ? "Unpin from Dock" : "Pin to Dock"
var appId = contextMenu.currentApp.desktopEntry.id
|| contextMenu.currentApp.desktopEntry.execString
|| ""
return SessionData.isPinnedApp(
appId) ? "Unpin from Dock" : "Pin to Dock"
}
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceText
@@ -744,10 +799,13 @@ DankModal {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
if (!contextMenu.currentApp || !contextMenu.currentApp.desktopEntry)
if (!contextMenu.currentApp
|| !contextMenu.currentApp.desktopEntry)
return
var appId = contextMenu.currentApp.desktopEntry.id || contextMenu.currentApp.desktopEntry.execString || ""
var appId = contextMenu.currentApp.desktopEntry.id
|| contextMenu.currentApp.desktopEntry.execString
|| ""
if (SessionData.isPinnedApp(appId))
SessionData.removePinnedApp(appId)
else
@@ -767,7 +825,8 @@ DankModal {
anchors.centerIn: parent
width: parent.width
height: 1
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
}
}
@@ -775,7 +834,11 @@ DankModal {
width: parent.width
height: 32
radius: Theme.cornerRadius
color: launchMouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : "transparent"
color: launchMouseArea.containsMouse ? Qt.rgba(
Theme.primary.r,
Theme.primary.g,
Theme.primary.b,
0.12) : "transparent"
Row {
anchors.left: parent.left
@@ -808,7 +871,8 @@ DankModal {
cursorShape: Qt.PointingHandCursor
onClicked: {
if (contextMenu.currentApp)
appLauncher.launchApp(contextMenu.currentApp)
appLauncher.launchApp(
contextMenu.currentApp)
contextMenu.close()
}
@@ -845,13 +909,11 @@ DankModal {
width: contextMenu.width
height: contextMenu.height
onClicked: {
// Prevent closing when clicking on the menu itself
}
}
}
}
}
}

View File

@@ -138,8 +138,8 @@ DankModal {
wifiPasswordInput = text
}
onAccepted: {
NetworkService.connectToWifiWithPassword(wifiPasswordSSID,
passwordInput.text)
NetworkService.connectToWifiWithPassword(
wifiPasswordSSID, passwordInput.text)
close()
wifiPasswordInput = ""
passwordInput.text = ""
@@ -224,7 +224,9 @@ DankModal {
spacing: Theme.spacingM
Rectangle {
width: Math.max(70, cancelText.contentWidth + Theme.spacingM * 2)
width: Math.max(
70,
cancelText.contentWidth + Theme.spacingM * 2)
height: 36
radius: Theme.cornerRadius
color: cancelArea.containsMouse ? Theme.surfaceTextHover : "transparent"
@@ -255,10 +257,13 @@ DankModal {
}
Rectangle {
width: Math.max(80, connectText.contentWidth + Theme.spacingM * 2)
width: Math.max(
80,
connectText.contentWidth + Theme.spacingM * 2)
height: 36
radius: Theme.cornerRadius
color: connectArea.containsMouse ? Qt.darker(Theme.primary,
color: connectArea.containsMouse ? Qt.darker(
Theme.primary,
1.1) : Theme.primary
enabled: passwordInput.text.length > 0
opacity: enabled ? 1 : 0.5
@@ -281,7 +286,8 @@ DankModal {
cursorShape: Qt.PointingHandCursor
enabled: parent.enabled
onClicked: {
NetworkService.connectToWifiWithPassword(wifiPasswordSSID,
NetworkService.connectToWifiWithPassword(
wifiPasswordSSID,
passwordInput.text)
close()
wifiPasswordInput = ""

View File

@@ -173,11 +173,14 @@ DankPopout {
width: parent.width
height: 52
cornerRadius: Theme.cornerRadius
backgroundColor: Qt.rgba(Theme.surfaceVariant.r,
backgroundColor: Qt.rgba(
Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b,
Theme.getContentBackgroundAlpha() * 0.7)
normalBorderColor: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.getContentBackgroundAlpha(
) * 0.7)
normalBorderColor: Qt.rgba(Theme.outline.r,
Theme.outline.g,
Theme.outline.b, 0.3)
focusedBorderColor: Theme.primary
leftIconName: "search"
@@ -196,7 +199,8 @@ DankPopout {
if (event.key === Qt.Key_Escape) {
appDrawerPopout.close()
event.accepted = true
} else if ((event.key === Qt.Key_Return || event.key === Qt.Key_Enter)
} else if ((event.key === Qt.Key_Return
|| event.key === Qt.Key_Enter)
&& text.length > 0) {
if (appLauncher.keyboardNavigationActive
&& appLauncher.model.count > 0) {
@@ -208,8 +212,7 @@ DankPopout {
event.accepted = true
} else if (event.key === Qt.Key_Down || event.key
=== Qt.Key_Up || event.key === Qt.Key_Left || event.key
=== Qt.Key_Right || ((event.key === Qt.Key_Return || event.key
=== Qt.Key_Enter) && text.length === 0)) {
=== Qt.Key_Right || ((event.key === Qt.Key_Return || event.key === Qt.Key_Enter) && text.length === 0)) {
event.accepted = false
}
}
@@ -268,17 +271,21 @@ DankPopout {
circular: false
iconName: "view_list"
iconSize: 20
iconColor: appLauncher.viewMode === "list" ? Theme.primary : Theme.surfaceText
iconColor: appLauncher.viewMode
=== "list" ? Theme.primary : Theme.surfaceText
hoverColor: appLauncher.viewMode
=== "list" ? Qt.rgba(Theme.primary.r,
=== "list" ? Qt.rgba(
Theme.primary.r,
Theme.primary.g,
Theme.primary.b,
0.12) : Qt.rgba(
Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.08)
Theme.surfaceVariant.b,
0.08)
backgroundColor: appLauncher.viewMode
=== "list" ? Qt.rgba(Theme.primary.r,
=== "list" ? Qt.rgba(
Theme.primary.r,
Theme.primary.g,
Theme.primary.b,
0.12) : "transparent"
@@ -292,17 +299,21 @@ DankPopout {
circular: false
iconName: "grid_view"
iconSize: 20
iconColor: appLauncher.viewMode === "grid" ? Theme.primary : Theme.surfaceText
iconColor: appLauncher.viewMode
=== "grid" ? Theme.primary : Theme.surfaceText
hoverColor: appLauncher.viewMode
=== "grid" ? Qt.rgba(Theme.primary.r,
=== "grid" ? Qt.rgba(
Theme.primary.r,
Theme.primary.g,
Theme.primary.b,
0.12) : Qt.rgba(
Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.08)
Theme.surfaceVariant.b,
0.08)
backgroundColor: appLauncher.viewMode
=== "grid" ? Qt.rgba(Theme.primary.r,
=== "grid" ? Qt.rgba(
Theme.primary.r,
Theme.primary.g,
Theme.primary.b,
0.12) : "transparent"
@@ -322,7 +333,8 @@ DankPopout {
return parent.height - usedHeight
}
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
color: Qt.rgba(Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.1)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.05)
@@ -430,7 +442,8 @@ DankPopout {
StyledText {
anchors.centerIn: parent
text: (model.name
&& model.name.length > 0) ? model.name.charAt(
&& model.name.length
> 0) ? model.name.charAt(
0).toUpperCase(
) : "A"
font.pixelSize: appList.iconSize * 0.4
@@ -460,7 +473,8 @@ DankPopout {
font.pixelSize: Theme.fontSizeMedium
color: Theme.surfaceVariantText
elide: Text.ElideRight
visible: appList.showDescription && model.comment
visible: appList.showDescription
&& model.comment
&& model.comment.length > 0
}
}
@@ -484,10 +498,14 @@ DankPopout {
}
onClicked: mouse => {
if (mouse.button === Qt.LeftButton) {
appList.itemClicked(index, model)
appList.itemClicked(
index, model)
} else if (mouse.button === Qt.RightButton) {
var panelPos = mapToItem(contextMenu.parent, mouse.x, mouse.y)
appList.itemRightClicked(index, model,
var panelPos = mapToItem(
contextMenu.parent,
mouse.x, mouse.y)
appList.itemRightClicked(
index, model,
panelPos.x,
panelPos.y)
}
@@ -510,14 +528,9 @@ DankPopout {
property int minIconSize: 32
property bool hoverUpdatesSelection: false
property bool keyboardNavigationActive: appLauncher.keyboardNavigationActive
property int baseCellWidth: adaptiveColumns ? Math.max(
minCellWidth,
Math.min(
maxCellWidth,
width / columns)) : (width - Theme.spacingS * 2) / columns
property int baseCellWidth: adaptiveColumns ? Math.max(minCellWidth, Math.min(maxCellWidth, width / columns)) : (width - Theme.spacingS * 2) / columns
property int baseCellHeight: baseCellWidth + 20
property int actualColumns: adaptiveColumns ? Math.floor(
width / cellWidth) : columns
property int actualColumns: adaptiveColumns ? Math.floor(width / cellWidth) : columns
property int remainingSpace: width - (actualColumns * cellWidth)
signal keyboardNavigationReset
@@ -528,7 +541,8 @@ DankPopout {
if (index < 0 || index >= count)
return
var itemY = Math.floor(index / actualColumns) * cellHeight
var itemY = Math.floor(
index / actualColumns) * cellHeight
var itemBottom = itemY + cellHeight
if (itemY < contentY)
contentY = itemY
@@ -543,7 +557,8 @@ DankPopout {
clip: true
cellWidth: baseCellWidth
cellHeight: baseCellHeight
leftMargin: Math.max(Theme.spacingS, remainingSpace / 2)
leftMargin: Math.max(Theme.spacingS,
remainingSpace / 2)
rightMargin: leftMargin
focus: true
interactive: true
@@ -578,8 +593,7 @@ DankPopout {
height: appGrid.cellHeight - appGrid.cellPadding
radius: Theme.cornerRadius
color: appGrid.currentIndex === index ? Theme.primaryPressed : gridMouseArea.containsMouse ? Theme.primaryHoverLight : Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.03)
border.color: appGrid.currentIndex
=== index ? Theme.primarySelected : Theme.outlineMedium
border.color: appGrid.currentIndex === index ? Theme.primarySelected : Theme.outlineMedium
border.width: appGrid.currentIndex === index ? 2 : 1
Column {
@@ -588,9 +602,11 @@ DankPopout {
Item {
property int iconSize: Math.min(
appGrid.maxIconSize, Math.max(
appGrid.maxIconSize,
Math.max(
appGrid.minIconSize,
appGrid.cellWidth * appGrid.iconSizeRatio))
appGrid.cellWidth
* appGrid.iconSizeRatio))
width: iconSize
height: iconSize
@@ -619,10 +635,13 @@ DankPopout {
StyledText {
anchors.centerIn: parent
text: (model.name
&& model.name.length > 0) ? model.name.charAt(
&& model.name.length
> 0) ? model.name.charAt(
0).toUpperCase(
) : "A"
font.pixelSize: Math.min(28, parent.width * 0.5)
font.pixelSize: Math.min(
28,
parent.width * 0.5)
color: Theme.primary
font.weight: Font.Bold
}
@@ -661,10 +680,14 @@ DankPopout {
}
onClicked: mouse => {
if (mouse.button === Qt.LeftButton) {
appGrid.itemClicked(index, model)
appGrid.itemClicked(
index, model)
} else if (mouse.button === Qt.RightButton) {
var panelPos = mapToItem(contextMenu.parent, mouse.x, mouse.y)
appGrid.itemRightClicked(index, model,
var panelPos = mapToItem(
contextMenu.parent,
mouse.x, mouse.y)
appGrid.itemRightClicked(
index, model,
panelPos.x,
panelPos.y)
}
@@ -701,8 +724,12 @@ DankPopout {
finalY = y - menuHeight - 8
}
finalX = Math.max(8, Math.min(finalX, appDrawerPopout.popupWidth - menuWidth - 8))
finalY = Math.max(8, Math.min(finalY, appDrawerPopout.popupHeight - menuHeight - 8))
finalX = Math.max(
8, Math.min(finalX,
appDrawerPopout.popupWidth - menuWidth - 8))
finalY = Math.max(8, Math.min(
finalY,
appDrawerPopout.popupHeight - menuHeight - 8))
contextMenu.x = finalX
contextMenu.y = finalY
@@ -722,7 +749,8 @@ DankPopout {
height: menuColumn.implicitHeight + Theme.spacingS * 2
radius: Theme.cornerRadius
color: Theme.popupBackground()
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: 1
z: 1000
opacity: menuVisible ? 1 : 0
@@ -750,7 +778,8 @@ DankPopout {
width: parent.width
height: 32
radius: Theme.cornerRadius
color: pinMouseArea.containsMouse ? Qt.rgba(Theme.primary.r,
color: pinMouseArea.containsMouse ? Qt.rgba(
Theme.primary.r,
Theme.primary.g,
Theme.primary.b,
0.12) : "transparent"
@@ -768,8 +797,10 @@ DankPopout {
return "push_pin"
var appId = contextMenu.currentApp.desktopEntry.id
|| contextMenu.currentApp.desktopEntry.execString || ""
return SessionData.isPinnedApp(appId) ? "keep_off" : "push_pin"
|| contextMenu.currentApp.desktopEntry.execString
|| ""
return SessionData.isPinnedApp(
appId) ? "keep_off" : "push_pin"
}
size: Theme.iconSize - 2
color: Theme.surfaceText
@@ -784,7 +815,8 @@ DankPopout {
return "Pin to Dock"
var appId = contextMenu.currentApp.desktopEntry.id
|| contextMenu.currentApp.desktopEntry.execString || ""
|| contextMenu.currentApp.desktopEntry.execString
|| ""
return SessionData.isPinnedApp(
appId) ? "Unpin from Dock" : "Pin to Dock"
}
@@ -807,7 +839,8 @@ DankPopout {
return
var appId = contextMenu.currentApp.desktopEntry.id
|| contextMenu.currentApp.desktopEntry.execString || ""
|| contextMenu.currentApp.desktopEntry.execString
|| ""
if (SessionData.isPinnedApp(appId))
SessionData.removePinnedApp(appId)
else
@@ -827,7 +860,8 @@ DankPopout {
anchors.centerIn: parent
width: parent.width
height: 1
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
}
}
@@ -835,7 +869,8 @@ DankPopout {
width: parent.width
height: 32
radius: Theme.cornerRadius
color: launchMouseArea.containsMouse ? Qt.rgba(Theme.primary.r,
color: launchMouseArea.containsMouse ? Qt.rgba(
Theme.primary.r,
Theme.primary.g,
Theme.primary.b,
0.12) : "transparent"
@@ -908,6 +943,7 @@ DankPopout {
width: contextMenu.width
height: contextMenu.height
onClicked: {
// Prevent closing when clicking on the menu itself
}
}

View File

@@ -46,16 +46,19 @@ Item {
var apps = []
if (searchQuery.length === 0) {
if (selectedCategory === "All") {
apps = AppSearchService.getAppsInCategory("All") // HACK: Use function call instead of property
apps = AppSearchService.getAppsInCategory(
"All") // HACK: Use function call instead of property
} else {
var categoryApps = AppSearchService.getAppsInCategory(selectedCategory)
var categoryApps = AppSearchService.getAppsInCategory(
selectedCategory)
apps = categoryApps.slice(0, maxResults)
}
} else {
if (selectedCategory === "All") {
apps = AppSearchService.searchApplications(searchQuery)
} else {
var categoryApps = AppSearchService.getAppsInCategory(selectedCategory)
var categoryApps = AppSearchService.getAppsInCategory(
selectedCategory)
if (categoryApps.length > 0) {
var allSearchResults = AppSearchService.searchApplications(
searchQuery)
@@ -91,7 +94,8 @@ Item {
"icon": app.icon
|| "application-x-executable",
"comment": app.comment || "",
"categories": app.categories || [],
"categories": app.categories
|| [],
"desktopEntry": app
})
})
@@ -105,7 +109,8 @@ Item {
filteredModel.count - 1)
selectedIndex = newIndex
} else {
selectedIndex = Math.min(selectedIndex + 1, filteredModel.count - 1)
selectedIndex = Math.min(selectedIndex + 1,
filteredModel.count - 1)
}
}
}

View File

@@ -25,7 +25,8 @@ Item {
Rectangle {
height: 36
width: (parent.width - (Math.min(categories.length,
width: (parent.width - (Math.min(
categories.length,
8) - 1) * Theme.spacingS) / Math.min(
categories.length, 8)
radius: Theme.cornerRadius
@@ -33,7 +34,8 @@ Item {
border.color: selectedCategory === modelData ? "transparent" : Qt.rgba(
Theme.outline.r,
Theme.outline.g,
Theme.outline.b, 0.3)
Theme.outline.b,
0.3)
StyledText {
anchors.centerIn: parent
@@ -63,7 +65,9 @@ Item {
spacing: Theme.spacingS
Row {
property var firstRowCategories: categories.slice(0, Math.min(4, categories.length))
property var firstRowCategories: categories.slice(
0, Math.min(4,
categories.length))
width: parent.width
spacing: Theme.spacingS
@@ -73,10 +77,12 @@ Item {
Rectangle {
height: 36
width: (parent.width - (parent.firstRowCategories.length - 1) * Theme.spacingS) / parent.firstRowCategories.length
width: (parent.width - (parent.firstRowCategories.length - 1)
* Theme.spacingS) / parent.firstRowCategories.length
radius: Theme.cornerRadius
color: selectedCategory === modelData ? Theme.primary : "transparent"
border.color: selectedCategory === modelData ? "transparent" : Qt.rgba(
border.color: selectedCategory
=== modelData ? "transparent" : Qt.rgba(
Theme.outline.r,
Theme.outline.g,
Theme.outline.b, 0.3)
@@ -104,7 +110,8 @@ Item {
}
Row {
property var secondRowCategories: categories.slice(4, categories.length)
property var secondRowCategories: categories.slice(
4, categories.length)
width: parent.width
spacing: Theme.spacingS
@@ -115,10 +122,12 @@ Item {
Rectangle {
height: 36
width: (parent.width - (parent.secondRowCategories.length - 1) * Theme.spacingS) / parent.secondRowCategories.length
width: (parent.width - (parent.secondRowCategories.length - 1)
* Theme.spacingS) / parent.secondRowCategories.length
radius: Theme.cornerRadius
color: selectedCategory === modelData ? Theme.primary : "transparent"
border.color: selectedCategory === modelData ? "transparent" : Qt.rgba(
border.color: selectedCategory
=== modelData ? "transparent" : Qt.rgba(
Theme.outline.r,
Theme.outline.g,
Theme.outline.b, 0.3)

View File

@@ -20,7 +20,8 @@ PanelWindow {
interval: BrightnessService.ddcAvailable ? 500 : 50
repeat: false
onTriggered: {
BrightnessService.setBrightnessInternal(pendingValue, BrightnessService.lastIpcDevice)
BrightnessService.setBrightnessInternal(
pendingValue, BrightnessService.lastIpcDevice)
}
}
@@ -116,14 +117,15 @@ PanelWindow {
DankIcon {
anchors.centerIn: parent
name: {
const deviceInfo = BrightnessService.getCurrentDeviceInfo();
const deviceInfo = BrightnessService.getCurrentDeviceInfo()
if (!deviceInfo || deviceInfo.class === "backlight" || deviceInfo.class === "ddc") {
return "brightness_medium";
if (!deviceInfo || deviceInfo.class === "backlight"
|| deviceInfo.class === "ddc") {
return "brightness_medium"
} else if (deviceInfo.name.includes("kbd")) {
return "keyboard";
return "keyboard"
} else {
return "lightbulb";
return "lightbulb"
}
}
size: Theme.iconSize
@@ -157,7 +159,9 @@ PanelWindow {
onSliderDragFinished: function (finalValue) {
if (BrightnessService.brightnessAvailable) {
brightnessDebounceTimer.stop()
BrightnessService.setBrightnessInternal(finalValue, BrightnessService.lastIpcDevice)
BrightnessService.setBrightnessInternal(
finalValue,
BrightnessService.lastIpcDevice)
}
}

View File

@@ -19,7 +19,8 @@ Column {
displayDate.getMonth(), 1)
let dayOfWeek = firstDay.getDay()
let startDate = new Date(firstDay)
startDate.setDate(startDate.getDate() - dayOfWeek - 7) // Extra week padding
startDate.setDate(startDate.getDate(
) - dayOfWeek - 7) // Extra week padding
let lastDay = new Date(displayDate.getFullYear(),
displayDate.getMonth() + 1, 0)
let endDate = new Date(lastDay)
@@ -148,7 +149,8 @@ Column {
Grid {
property date firstDay: {
let date = new Date(displayDate.getFullYear(), displayDate.getMonth(), 1)
let date = new Date(displayDate.getFullYear(),
displayDate.getMonth(), 1)
let dayOfWeek = date.getDay()
date.setDate(date.getDate() - dayOfWeek)
return date
@@ -197,7 +199,8 @@ Column {
text: dayDate.getDate()
font.pixelSize: Theme.fontSizeMedium
color: isSelected ? Theme.surface : isToday ? Theme.primary : isCurrentMonth ? Theme.surfaceText : Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.4)
font.weight: isToday || isSelected ? Font.Medium : Font.Normal
font.weight: isToday
|| isSelected ? Font.Medium : Font.Normal
}
Rectangle {
@@ -205,7 +208,8 @@ Column {
anchors.fill: parent
radius: parent.radius
visible: CalendarService && CalendarService.khalAvailable
visible: CalendarService
&& CalendarService.khalAvailable
&& CalendarService.hasEventsForDate(dayDate)
opacity: {
if (isSelected)

View File

@@ -76,8 +76,8 @@ PanelWindow {
id: mainContainer
readonly property real targetWidth: Math.min(
(root.screen ? root.screen.width : Screen.width) * 0.9,
600)
(root.screen ? root.screen.width : Screen.width)
* 0.9, 600)
function calculateWidth() {
let baseWidth = 320
@@ -232,7 +232,8 @@ PanelWindow {
property bool hasAnyWidgets: true
width: hasAnyWidgets ? parent.width * 0.42 : 0 // Slightly narrower for better proportions
width: hasAnyWidgets ? parent.width
* 0.42 : 0 // Slightly narrower for better proportions
height: childrenRect.height
spacing: Theme.spacingM
visible: hasAnyWidgets
@@ -261,7 +262,8 @@ PanelWindow {
- Theme.spacingM : parent.width
height: parent.height
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
color: Qt.rgba(Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.2)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.08)
@@ -316,8 +318,8 @@ PanelWindow {
enabled: shouldBeVisible
onClicked: function (mouse) {
var localPos = mapToItem(mainContainer, mouse.x, mouse.y)
if (localPos.x < 0 || localPos.x > mainContainer.width || localPos.y < 0
|| localPos.y > mainContainer.height)
if (localPos.x < 0 || localPos.x > mainContainer.width
|| localPos.y < 0 || localPos.y > mainContainer.height)
calendarVisible = false
}
}

View File

@@ -32,7 +32,8 @@ Rectangle {
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.12)
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: 1
visible: shouldShow
layer.enabled: true
@@ -73,9 +74,8 @@ Rectangle {
}
StyledText {
text: hasEvents ? (Qt.formatDate(
selectedDate,
"MMM d") + " • " + (selectedDateEvents.length
text: hasEvents ? (Qt.formatDate(selectedDate, "MMM d") + " • "
+ (selectedDateEvents.length
=== 1 ? "1 event" : selectedDateEvents.length
+ " events")) : Qt.formatDate(
selectedDate, "MMM d")
@@ -142,12 +142,13 @@ Rectangle {
momentum = event.pixelDelta.y * 1.8
} else {
// Mouse wheel with angle delta
momentum = (event.angleDelta.y / 120) * (60 * 2.5) // ~2.5 items per wheel step
momentum = (event.angleDelta.y / 120)
* (60 * 2.5) // ~2.5 items per wheel step
}
let newY = parent.contentY - momentum
newY = Math.max(0,
Math.min(parent.contentHeight - parent.height,
newY = Math.max(
0, Math.min(parent.contentHeight - parent.height,
newY))
parent.contentY = newY
momentum *= 0.92 // Decay for smooth momentum
@@ -183,7 +184,8 @@ Rectangle {
}
border.color: {
if (modelData.url && eventMouseArea.containsMouse)
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.3)
return Qt.rgba(Theme.primary.r, Theme.primary.g,
Theme.primary.b, 0.3)
else if (eventMouseArea.containsMouse)
return Qt.rgba(Theme.primary.r, Theme.primary.g,
Theme.primary.b, 0.15)
@@ -237,7 +239,8 @@ Rectangle {
DankIcon {
name: "schedule"
size: Theme.fontSizeSmall
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
color: Qt.rgba(Theme.surfaceText.r,
Theme.surfaceText.g,
Theme.surfaceText.b, 0.7)
anchors.verticalCenter: parent.verticalCenter
}
@@ -248,18 +251,21 @@ Rectangle {
return "All day"
} else {
let timeFormat = SettingsData.use24HourClock ? "H:mm" : "h:mm AP"
let startTime = Qt.formatTime(modelData.start, timeFormat)
let startTime = Qt.formatTime(
modelData.start, timeFormat)
if (modelData.start.toDateString(
) !== modelData.end.toDateString()
|| modelData.start.getTime() !== modelData.end.getTime())
return startTime + " " + Qt.formatTime(modelData.end,
timeFormat)
) !== modelData.end.toDateString(
) || modelData.start.getTime(
) !== modelData.end.getTime())
return startTime + " " + Qt.formatTime(
modelData.end, timeFormat)
return startTime
}
}
font.pixelSize: Theme.fontSizeSmall
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
color: Qt.rgba(Theme.surfaceText.r,
Theme.surfaceText.g,
Theme.surfaceText.b, 0.7)
font.weight: Font.Normal
anchors.verticalCenter: parent.verticalCenter
@@ -277,7 +283,8 @@ Rectangle {
DankIcon {
name: "location_on"
size: Theme.fontSizeSmall
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
color: Qt.rgba(Theme.surfaceText.r,
Theme.surfaceText.g,
Theme.surfaceText.b, 0.7)
anchors.verticalCenter: parent.verticalCenter
}
@@ -285,7 +292,8 @@ Rectangle {
StyledText {
text: modelData.location
font.pixelSize: Theme.fontSizeSmall
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
color: Qt.rgba(Theme.surfaceText.r,
Theme.surfaceText.g,
Theme.surfaceText.b, 0.7)
elide: Text.ElideRight
anchors.verticalCenter: parent.verticalCenter

View File

@@ -15,7 +15,8 @@ Rectangle {
property string lastValidArtist: ""
property string lastValidAlbum: ""
property string lastValidArtUrl: ""
property real currentPosition: activePlayer && activePlayer.positionSupported ? activePlayer.position : 0
property real currentPosition: activePlayer
&& activePlayer.positionSupported ? activePlayer.position : 0
function ratio() {
if (!activePlayer || activePlayer.length <= 0) {
@@ -35,7 +36,8 @@ Rectangle {
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g,
Theme.surfaceContainer.b, 0.4)
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: 1
layer.enabled: true
@@ -43,7 +45,8 @@ Rectangle {
id: positionTimer
interval: 500
running: activePlayer && activePlayer.playbackState === MprisPlaybackState.Playing
running: activePlayer
&& activePlayer.playbackState === MprisPlaybackState.Playing
&& !progressMouseArea.isSeeking
repeat: true
onTriggered: {
@@ -121,7 +124,8 @@ Rectangle {
width: 60
height: 60
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
color: Qt.rgba(Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.3)
Item {
@@ -164,8 +168,8 @@ Rectangle {
spacing: Theme.spacingXS
StyledText {
text: activePlayer && activePlayer.trackTitle || lastValidTitle
|| "Unknown Track"
text: activePlayer && activePlayer.trackTitle
|| lastValidTitle || "Unknown Track"
onTextChanged: {
if (activePlayer && activePlayer.trackTitle)
lastValidTitle = activePlayer.trackTitle
@@ -180,14 +184,15 @@ Rectangle {
}
StyledText {
text: activePlayer && activePlayer.trackArtist || lastValidArtist
|| "Unknown Artist"
text: activePlayer && activePlayer.trackArtist
|| lastValidArtist || "Unknown Artist"
onTextChanged: {
if (activePlayer && activePlayer.trackArtist)
lastValidArtist = activePlayer.trackArtist
}
font.pixelSize: Theme.fontSizeSmall
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
color: Qt.rgba(Theme.surfaceText.r,
Theme.surfaceText.g,
Theme.surfaceText.b, 0.8)
width: parent.width
elide: Text.ElideRight
@@ -203,7 +208,8 @@ Rectangle {
lastValidAlbum = activePlayer.trackAlbum
}
font.pixelSize: Theme.fontSizeSmall
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
color: Qt.rgba(Theme.surfaceText.r,
Theme.surfaceText.g,
Theme.surfaceText.b, 0.6)
width: parent.width
elide: Text.ElideRight
@@ -226,7 +232,8 @@ Rectangle {
width: parent.width
height: 6
radius: 3
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
color: Qt.rgba(Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.3)
visible: activePlayer !== null
anchors.verticalCenter: parent.verticalCenter
@@ -237,7 +244,8 @@ Rectangle {
height: parent.height
radius: parent.radius
color: Theme.primary
width: Math.max(0, Math.min(parent.width, parent.width * ratio()))
width: Math.max(0, Math.min(parent.width,
parent.width * ratio()))
Behavior on width {
NumberAnimation {
@@ -283,9 +291,12 @@ Rectangle {
preventStealing: true
onPressed: function (mouse) {
isSeeking = true
if (activePlayer && activePlayer.length > 0 && activePlayer.canSeek) {
let ratio = Math.max(0, Math.min(
1, mouse.x / progressBarBackground.width))
if (activePlayer && activePlayer.length > 0
&& activePlayer.canSeek) {
let ratio = Math.max(
0, Math.min(
1,
mouse.x / progressBarBackground.width))
let seekPosition = ratio * activePlayer.length
activePlayer.position = seekPosition
}
@@ -295,17 +306,23 @@ Rectangle {
}
onPositionChanged: function (mouse) {
if (pressed && isSeeking && activePlayer
&& activePlayer.length > 0 && activePlayer.canSeek) {
let ratio = Math.max(0, Math.min(
1, mouse.x / progressBarBackground.width))
&& activePlayer.length > 0
&& activePlayer.canSeek) {
let ratio = Math.max(
0, Math.min(
1,
mouse.x / progressBarBackground.width))
let seekPosition = ratio * activePlayer.length
activePlayer.position = seekPosition
}
}
onClicked: function (mouse) {
if (activePlayer && activePlayer.length > 0 && activePlayer.canSeek) {
let ratio = Math.max(0, Math.min(
1, mouse.x / progressBarBackground.width))
if (activePlayer && activePlayer.length > 0
&& activePlayer.canSeek) {
let ratio = Math.max(
0, Math.min(
1,
mouse.x / progressBarBackground.width))
let seekPosition = ratio * activePlayer.length
activePlayer.position = seekPosition
}
@@ -324,10 +341,14 @@ Rectangle {
preventStealing: true
onPositionChanged: function (mouse) {
if (progressMouseArea.isSeeking && activePlayer
&& activePlayer.length > 0 && activePlayer.canSeek) {
let globalPos = mapToItem(progressBarBackground, mouse.x, mouse.y)
&& activePlayer.length > 0
&& activePlayer.canSeek) {
let globalPos = mapToItem(progressBarBackground,
mouse.x, mouse.y)
let ratio = Math.max(
0, Math.min(1, globalPos.x / progressBarBackground.width))
0, Math.min(
1,
globalPos.x / progressBarBackground.width))
let seekPosition = ratio * activePlayer.length
activePlayer.position = seekPosition
}
@@ -352,7 +373,8 @@ Rectangle {
width: 28
height: 28
radius: 14
color: prevBtnArea.containsMouse ? Qt.rgba(Theme.surfaceVariant.r,
color: prevBtnArea.containsMouse ? Qt.rgba(
Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b,
0.12) : "transparent"
@@ -374,7 +396,8 @@ Rectangle {
if (!activePlayer)
return
if (activePlayer.position > 8 && activePlayer.canSeek) {
if (activePlayer.position > 8
&& activePlayer.canSeek) {
activePlayer.position = 0
} else {
activePlayer.previous()
@@ -401,7 +424,8 @@ Rectangle {
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: activePlayer && activePlayer.togglePlaying()
onClicked: activePlayer
&& activePlayer.togglePlaying()
}
}
@@ -409,7 +433,8 @@ Rectangle {
width: 28
height: 28
radius: 14
color: nextBtnArea.containsMouse ? Qt.rgba(Theme.surfaceVariant.r,
color: nextBtnArea.containsMouse ? Qt.rgba(
Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b,
0.12) : "transparent"

View File

@@ -9,7 +9,8 @@ Rectangle {
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g,
Theme.surfaceContainer.b, 0.4)
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: 1
Ref {
@@ -58,7 +59,8 @@ Rectangle {
Rectangle {
width: parent.width
height: 1
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.1)
color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.1)
}
Column {
@@ -82,8 +84,7 @@ Rectangle {
}
StyledText {
text: DgopService.processCount + " proc, "
+ DgopService.threadCount + " threads"
text: DgopService.processCount + " proc, " + DgopService.threadCount + " threads"
font.pixelSize: Theme.fontSizeSmall
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
Theme.surfaceText.b, 0.8)
@@ -130,6 +131,7 @@ Rectangle {
}
// Fallback - return as is but truncated
return uptimeStr.length > 8 ? uptimeStr.substring(0, 8) + "…" : uptimeStr
return uptimeStr.length > 8 ? uptimeStr.substring(0,
8) + "…" : uptimeStr
}
}

View File

@@ -13,7 +13,8 @@ Rectangle {
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g,
Theme.surfaceContainer.b, 0.4)
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: 1
layer.enabled: true
@@ -59,7 +60,8 @@ Rectangle {
id: refreshButton
name: "refresh"
size: Theme.iconSize - 6
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.3)
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
Theme.surfaceText.b, 0.3)
anchors.right: parent.right
anchors.top: parent.top
anchors.rightMargin: -Theme.spacingS
@@ -100,7 +102,8 @@ Rectangle {
spacing: Theme.spacingL
DankIcon {
name: WeatherService.getWeatherIcon(WeatherService.weather.wCode)
name: WeatherService.getWeatherIcon(
WeatherService.weather.wCode)
size: Theme.iconSize + 8
color: Theme.primary
anchors.verticalCenter: parent.verticalCenter
@@ -123,7 +126,8 @@ Rectangle {
cursorShape: Qt.PointingHandCursor
onClicked: {
if (WeatherService.weather.available)
SettingsData.setTemperatureUnit(!SettingsData.useFahrenheit)
SettingsData.setTemperatureUnit(
!SettingsData.useFahrenheit)
}
enabled: WeatherService.weather.available
}
@@ -132,7 +136,8 @@ Rectangle {
StyledText {
text: WeatherService.weather.city || ""
font.pixelSize: Theme.fontSizeMedium
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
color: Qt.rgba(Theme.surfaceText.r,
Theme.surfaceText.g,
Theme.surfaceText.b, 0.7)
visible: text.length > 0
}
@@ -156,7 +161,8 @@ Rectangle {
}
StyledText {
text: WeatherService.weather.humidity ? WeatherService.weather.humidity + "%" : "--"
text: WeatherService.weather.humidity ? WeatherService.weather.humidity
+ "%" : "--"
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter

View File

@@ -118,14 +118,16 @@ Column {
StyledText {
text: {
if (AudioService.subtitle(modelData.name)
&& AudioService.subtitle(modelData.name) !== "")
return AudioService.subtitle(
modelData.name) + (modelData === AudioService.sink ? " • Selected" : "")
&& AudioService.subtitle(
modelData.name) !== "")
return AudioService.subtitle(modelData.name)
+ (modelData === AudioService.sink ? " • Selected" : "")
else
return modelData === AudioService.sink ? "Selected" : ""
}
font.pixelSize: Theme.fontSizeSmall
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
color: Qt.rgba(Theme.surfaceText.r,
Theme.surfaceText.g,
Theme.surfaceText.b, 0.7)
visible: text !== ""
}

View File

@@ -117,14 +117,16 @@ Column {
StyledText {
text: {
if (AudioService.subtitle(modelData.name)
&& AudioService.subtitle(modelData.name) !== "")
return AudioService.subtitle(
modelData.name) + (modelData === AudioService.source ? " • Selected" : "")
&& AudioService.subtitle(
modelData.name) !== "")
return AudioService.subtitle(modelData.name)
+ (modelData === AudioService.source ? " • Selected" : "")
else
return modelData === AudioService.source ? "Selected" : ""
}
font.pixelSize: Theme.fontSizeSmall
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
color: Qt.rgba(Theme.surfaceText.r,
Theme.surfaceText.g,
Theme.surfaceText.b, 0.7)
visible: text !== ""
}

View File

@@ -10,10 +10,11 @@ import qs.Widgets
Column {
id: root
property real micLevel: Math.min(
100,
(AudioService.source && AudioService.source.audio
&& AudioService.source.audio.volume * 100) || 0)
property real micLevel: Math.min(100,
(AudioService.source
&& AudioService.source.audio
&& AudioService.source.audio.volume * 100)
|| 0)
property bool micMuted: (AudioService.source && AudioService.source.audio
&& AudioService.source.audio.muted) || false
@@ -94,7 +95,8 @@ Column {
x: Math.max(0, Math.min(parent.width - width,
micSliderFill.width - width / 2))
anchors.verticalCenter: parent.verticalCenter
scale: micMouseArea.containsMouse || micMouseArea.pressed ? 1.2 : 1
scale: micMouseArea.containsMouse
|| micMouseArea.pressed ? 1.2 : 1
Rectangle {
id: micTooltip
@@ -151,10 +153,12 @@ Column {
preventStealing: true
onPressed: mouse => {
isDragging = true
let ratio = Math.max(0, Math.min(
1, mouse.x / micSliderTrack.width))
let ratio = Math.max(
0, Math.min(1,
mouse.x / micSliderTrack.width))
let newMicLevel = Math.round(ratio * 100)
if (AudioService.source && AudioService.source.audio) {
if (AudioService.source
&& AudioService.source.audio) {
AudioService.source.audio.muted = false
AudioService.source.audio.volume = newMicLevel / 100
}
@@ -165,9 +169,12 @@ Column {
onPositionChanged: mouse => {
if (pressed && isDragging) {
let ratio = Math.max(
0, Math.min(1, mouse.x / micSliderTrack.width))
0, Math.min(
1,
mouse.x / micSliderTrack.width))
let newMicLevel = Math.max(
0, Math.min(100, Math.round(ratio * 100)))
0, Math.min(100, Math.round(
ratio * 100)))
if (AudioService.source
&& AudioService.source.audio) {
AudioService.source.audio.muted = false
@@ -176,10 +183,12 @@ Column {
}
}
onClicked: mouse => {
let ratio = Math.max(0, Math.min(
1, mouse.x / micSliderTrack.width))
let ratio = Math.max(
0, Math.min(1,
mouse.x / micSliderTrack.width))
let newMicLevel = Math.round(ratio * 100)
if (AudioService.source && AudioService.source.audio) {
if (AudioService.source
&& AudioService.source.audio) {
AudioService.source.audio.muted = false
AudioService.source.audio.volume = newMicLevel / 100
}
@@ -198,14 +207,15 @@ Column {
preventStealing: true
onPositionChanged: mouse => {
if (micMouseArea.isDragging) {
let globalPos = mapToItem(micSliderTrack,
mouse.x, mouse.y)
let globalPos = mapToItem(
micSliderTrack, mouse.x, mouse.y)
let ratio = Math.max(
0,
Math.min(1,
0, Math.min(
1,
globalPos.x / micSliderTrack.width))
let newMicLevel = Math.max(
0, Math.min(100, Math.round(ratio * 100)))
0, Math.min(100, Math.round(
ratio * 100)))
if (AudioService.source
&& AudioService.source.audio) {
AudioService.source.audio.muted = false

View File

@@ -9,7 +9,8 @@ Column {
property real volumeLevel: Math.min(
100,
(AudioService.sink && AudioService.sink.audio
&& AudioService.sink.audio.volume * 100) || 0)
&& AudioService.sink.audio.volume * 100)
|| 0)
property bool volumeMuted: (AudioService.sink && AudioService.sink.audio
&& AudioService.sink.audio.muted) || false
@@ -39,7 +40,8 @@ Column {
target: AudioService.sink
&& AudioService.sink.audio ? AudioService.sink.audio : null
function onVolumeChanged() {
volumeSlider.value = Math.round(AudioService.sink.audio.volume * 100)
volumeSlider.value = Math.round(
AudioService.sink.audio.volume * 100)
}
}
@@ -57,7 +59,8 @@ Column {
}
onSliderValueChanged: newValue => {
if (AudioService.sink && AudioService.sink.audio) {
if (AudioService.sink
&& AudioService.sink.audio) {
AudioService.sink.audio.muted = false
AudioService.sink.audio.volume = newValue / 100
}

View File

@@ -28,7 +28,8 @@ Column {
}
Item {
width: parent.width - scanButton.width - parent.spacing - 150 // Spacer to push button right
width: parent.width - scanButton.width - parent.spacing
- 150 // Spacer to push button right
height: 1
}
@@ -38,12 +39,13 @@ Column {
width: Math.max(100, scanText.contentWidth + Theme.spacingL * 2)
height: 32
radius: Theme.cornerRadius
color: scanArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g,
Theme.primary.b,
0.12) : Qt.rgba(Theme.primary.r,
color: scanArea.containsMouse ? Qt.rgba(Theme.primary.r,
Theme.primary.g,
Theme.primary.b,
0.08)
0.12) : Qt.rgba(
Theme.primary.r,
Theme.primary.g,
Theme.primary.b, 0.08)
border.color: Theme.primary
border.width: 1
@@ -134,12 +136,14 @@ Column {
Repeater {
model: {
if (!BluetoothService.adapter || !BluetoothService.adapter.discovering
if (!BluetoothService.adapter
|| !BluetoothService.adapter.discovering
|| !Bluetooth.devices)
return []
var filtered = Bluetooth.devices.values.filter(dev => {
return dev && !dev.paired
return dev
&& !dev.paired
&& !dev.pairing
&& !dev.blocked
&& (dev.signalStrength === undefined
@@ -166,7 +170,8 @@ Column {
Theme.warning.b, 0.12)
if (modelData.blocked)
return Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.08)
return Qt.rgba(Theme.error.r, Theme.error.g,
Theme.error.b, 0.08)
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.08)
@@ -178,7 +183,8 @@ Column {
if (modelData.blocked)
return Theme.error
return Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
return Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
}
border.width: 1
@@ -236,7 +242,8 @@ Column {
if (modelData.blocked)
return "Blocked"
return BluetoothService.getSignalStrength(modelData)
return BluetoothService.getSignalStrength(
modelData)
}
font.pixelSize: Theme.fontSizeSmall
color: {
@@ -246,7 +253,8 @@ Column {
if (modelData.blocked)
return Theme.error
return Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
return Qt.rgba(Theme.surfaceText.r,
Theme.surfaceText.g,
Theme.surfaceText.b, 0.7)
}
}
@@ -254,21 +262,26 @@ Column {
DankIcon {
name: BluetoothService.getSignalIcon(modelData)
size: Theme.fontSizeSmall
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
color: Qt.rgba(Theme.surfaceText.r,
Theme.surfaceText.g,
Theme.surfaceText.b, 0.7)
visible: modelData.signalStrength !== undefined
&& modelData.signalStrength > 0 && !modelData.pairing
&& modelData.signalStrength > 0
&& !modelData.pairing
&& !modelData.blocked
}
StyledText {
text: (modelData.signalStrength !== undefined
&& modelData.signalStrength > 0) ? modelData.signalStrength + "%" : ""
&& modelData.signalStrength
> 0) ? modelData.signalStrength + "%" : ""
font.pixelSize: Theme.fontSizeSmall
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
color: Qt.rgba(Theme.surfaceText.r,
Theme.surfaceText.g,
Theme.surfaceText.b, 0.5)
visible: modelData.signalStrength !== undefined
&& modelData.signalStrength > 0 && !modelData.pairing
&& modelData.signalStrength > 0
&& !modelData.pairing
&& !modelData.blocked
}
}
@@ -286,7 +299,8 @@ Column {
visible: modelData.state !== BluetoothDeviceState.Connecting
color: {
if (!canConnect && !isBusy)
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
return Qt.rgba(Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.3)
if (actionButtonArea.containsMouse && !isBusy)
@@ -357,7 +371,8 @@ Column {
width: parent.width
spacing: Theme.spacingM
visible: {
if (!BluetoothService.adapter || !BluetoothService.adapter.discovering
if (!BluetoothService.adapter
|| !BluetoothService.adapter.discovering
|| !Bluetooth.devices)
return false
@@ -366,7 +381,8 @@ Column {
&& !dev.paired
&& !dev.pairing
&& !dev.blocked
&& (dev.signalStrength === undefined
&& (dev.signalStrength
=== undefined
|| dev.signalStrength > 0)
}).length
return availableCount === 0
@@ -423,7 +439,8 @@ Column {
&& !dev.paired
&& !dev.pairing
&& !dev.blocked
&& (dev.signalStrength === undefined
&& (dev.signalStrength
=== undefined
|| dev.signalStrength > 0)
}).length
return availableCount === 0 && !BluetoothService.adapter.discovering

View File

@@ -40,7 +40,8 @@ Rectangle {
height: menuColumn.implicitHeight + Theme.spacingS * 2
radius: Theme.cornerRadius
color: Theme.popupBackground()
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: 1
z: 1000
opacity: menuVisible ? 1 : 0
@@ -109,7 +110,8 @@ Rectangle {
if (root.deviceData.connected)
root.deviceData.disconnect()
else
BluetoothService.connectDeviceWithTrust(root.deviceData)
BluetoothService.connectDeviceWithTrust(
root.deviceData)
}
root.hide()
}
@@ -133,7 +135,8 @@ Rectangle {
anchors.centerIn: parent
width: parent.width
height: 1
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
}
}
@@ -141,7 +144,8 @@ Rectangle {
width: parent.width
height: 32
radius: Theme.cornerRadius
color: forgetArea.containsMouse ? Qt.rgba(Theme.error.r, Theme.error.g,
color: forgetArea.containsMouse ? Qt.rgba(Theme.error.r,
Theme.error.g,
Theme.error.b,
0.12) : "transparent"

View File

@@ -46,15 +46,10 @@ Column {
height: 60
radius: Theme.cornerRadius
color: btDeviceArea.containsMouse ? Qt.rgba(
Theme.primary.r, Theme.primary.g,
Theme.primary.b,
0.08) : (modelData.connected ? Qt.rgba(
Theme.primary.r,
Theme.primary.g,
Theme.primary.b,
0.12) : Qt.rgba(
Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b,
0.08))
0.08) : (modelData.connected ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.08))
border.color: modelData.connected ? Theme.primary : "transparent"
border.width: 1
@@ -88,25 +83,37 @@ Column {
StyledText {
text: BluetoothDeviceState.toString(modelData.state)
font.pixelSize: Theme.fontSizeSmall
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
color: Qt.rgba(Theme.surfaceText.r,
Theme.surfaceText.g,
Theme.surfaceText.b, 0.7)
}
StyledText {
text: {
if (modelData.batteryAvailable && modelData.battery > 0)
return "• " + Math.round(modelData.battery * 100) + "%"
if (modelData.batteryAvailable
&& modelData.battery > 0)
return "• " + Math.round(
modelData.battery * 100) + "%"
var btBattery = BatteryService.bluetoothDevices.find(dev => {
return dev.name === (modelData.name || modelData.deviceName) || dev.name.toLowerCase().includes((modelData.name || modelData.deviceName).toLowerCase()) || (modelData.name || modelData.deviceName).toLowerCase(
var btBattery = BatteryService.bluetoothDevices.find(
dev => {
return dev.name === (modelData.name
|| modelData.deviceName)
|| dev.name.toLowerCase(
).includes(
dev.name.toLowerCase(
(modelData.name
|| modelData.deviceName).toLowerCase(
))
|| (modelData.name
|| modelData.deviceName).toLowerCase(
).includes(
dev.name.toLowerCase())
})
return btBattery ? "• " + btBattery.percentage + "%" : ""
}
font.pixelSize: Theme.fontSizeSmall
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
color: Qt.rgba(Theme.surfaceText.r,
Theme.surfaceText.g,
Theme.surfaceText.b, 0.7)
visible: text.length > 0
}
@@ -120,7 +127,8 @@ Column {
width: 32
height: 32
radius: Theme.cornerRadius
color: btMenuButtonArea.containsMouse ? Qt.rgba(Theme.surfaceText.r,
color: btMenuButtonArea.containsMouse ? Qt.rgba(
Theme.surfaceText.r,
Theme.surfaceText.g,
Theme.surfaceText.b,
0.08) : "transparent"
@@ -147,7 +155,8 @@ Column {
if (contextMenu) {
contextMenu.deviceData = modelData
let localPos = btMenuButtonArea.mapToItem(
contextMenu.parentItem, btMenuButtonArea.width / 2,
contextMenu.parentItem,
btMenuButtonArea.width / 2,
btMenuButtonArea.height)
contextMenu.show(localPos.x, localPos.y)
}

View File

@@ -48,7 +48,8 @@ DankPopout {
UserInfoService.getUptime()
} else {
NetworkService.autoRefreshEnabled = false
if (BluetoothService.adapter && BluetoothService.adapter.discovering)
if (BluetoothService.adapter
&& BluetoothService.adapter.discovering)
BluetoothService.adapter.discovering = false
}
}
@@ -112,7 +113,8 @@ DankPopout {
width: parent.width
height: 90
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
color: Qt.rgba(Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b,
Theme.getContentBackgroundAlpha() * 0.4)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
@@ -150,7 +152,8 @@ DankPopout {
if (PortalService.profileImage === "")
return ""
if (PortalService.profileImage.startsWith("/"))
if (PortalService.profileImage.startsWith(
"/"))
return "file://" + PortalService.profileImage
return PortalService.profileImage
@@ -227,7 +230,8 @@ DankPopout {
}
StyledText {
text: "Uptime: " + (UserInfoService.uptime || "Unknown")
text: "Uptime: " + (UserInfoService.uptime
|| "Unknown")
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
font.weight: Font.Normal
@@ -246,10 +250,13 @@ DankPopout {
iconName: "lock"
iconSize: Theme.iconSize - 2
iconColor: Theme.surfaceText
backgroundColor: Qt.rgba(Theme.surfaceVariant.r,
backgroundColor: Qt.rgba(
Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.5)
hoverColor: Qt.rgba(Theme.primary.r, Theme.primary.g,
Theme.surfaceVariant.b,
0.5)
hoverColor: Qt.rgba(Theme.primary.r,
Theme.primary.g,
Theme.primary.b, 0.12)
onClicked: {
root.close()
@@ -262,7 +269,8 @@ DankPopout {
height: 40
radius: 20
color: powerButton.containsMouse
|| root.powerOptionsExpanded ? Qt.rgba(Theme.error.r,
|| root.powerOptionsExpanded ? Qt.rgba(
Theme.error.r,
Theme.error.g,
Theme.error.b,
0.12) : Qt.rgba(
@@ -339,10 +347,13 @@ DankPopout {
iconName: "settings"
iconSize: Theme.iconSize - 2
iconColor: Theme.surfaceText
backgroundColor: Qt.rgba(Theme.surfaceVariant.r,
backgroundColor: Qt.rgba(
Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.5)
hoverColor: Qt.rgba(Theme.primary.r, Theme.primary.g,
Theme.surfaceVariant.b,
0.5)
hoverColor: Qt.rgba(Theme.primary.r,
Theme.primary.g,
Theme.primary.b, 0.12)
onClicked: {
root.close()
@@ -356,7 +367,8 @@ DankPopout {
width: parent.width
height: root.powerOptionsExpanded ? 60 : 0
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
color: Qt.rgba(Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b,
Theme.getContentBackgroundAlpha() * 0.4)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
@@ -374,7 +386,8 @@ DankPopout {
width: 100
height: 34
radius: Theme.cornerRadius
color: logoutButton.containsMouse ? Qt.rgba(Theme.warning.r,
color: logoutButton.containsMouse ? Qt.rgba(
Theme.warning.r,
Theme.warning.g,
Theme.warning.b,
0.12) : Qt.rgba(
@@ -430,7 +443,8 @@ DankPopout {
width: 100
height: 34
radius: Theme.cornerRadius
color: rebootButton.containsMouse ? Qt.rgba(Theme.warning.r,
color: rebootButton.containsMouse ? Qt.rgba(
Theme.warning.r,
Theme.warning.g,
Theme.warning.b,
0.12) : Qt.rgba(
@@ -486,7 +500,8 @@ DankPopout {
width: 100
height: 34
radius: Theme.cornerRadius
color: suspendButton.containsMouse ? Qt.rgba(Theme.primary.r,
color: suspendButton.containsMouse ? Qt.rgba(
Theme.primary.r,
Theme.primary.g,
Theme.primary.b,
0.12) : Qt.rgba(
@@ -542,7 +557,8 @@ DankPopout {
width: 100
height: 34
radius: Theme.cornerRadius
color: shutdownButton.containsMouse ? Qt.rgba(Theme.error.r,
color: shutdownButton.containsMouse ? Qt.rgba(
Theme.error.r,
Theme.error.g,
Theme.error.b,
0.12) : Qt.rgba(
@@ -614,7 +630,8 @@ DankPopout {
width: parent.width
height: tabBar.height + Theme.spacingM * 2
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
color: Qt.rgba(Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.15)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.06)
@@ -675,7 +692,8 @@ DankPopout {
width: parent.width
Layout.fillHeight: true
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
color: Qt.rgba(Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.1)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.05)
@@ -704,7 +722,8 @@ DankPopout {
Loader {
anchors.fill: parent
anchors.margins: Theme.spacingS
active: BluetoothService.available && root.currentTab === "bluetooth"
active: BluetoothService.available
&& root.currentTab === "bluetooth"
asynchronous: true
sourceComponent: Component {
BluetoothTab {}

View File

@@ -34,12 +34,9 @@ Item {
width: parent.width
sourceComponent: settingsComponent
}
}
}
Component {
id: brightnessComponent
@@ -62,57 +59,62 @@ Item {
visible: BrightnessService.devices.length > 1
text: "Device"
description: {
const deviceInfo = BrightnessService.getCurrentDeviceInfo();
const deviceInfo = BrightnessService.getCurrentDeviceInfo()
if (deviceInfo && deviceInfo.class === "ddc") {
return "DDC changes can be slow and unreliable";
return "DDC changes can be slow and unreliable"
}
return "";
return ""
}
currentValue: BrightnessService.currentDevice
options: BrightnessService.devices.map(function (d) {
return d.name;
return d.name
})
optionIcons: BrightnessService.devices.map(function (d) {
if (d.class === "backlight")
return "desktop_windows";
return "desktop_windows"
if (d.class === "ddc")
return "tv";
return "tv"
if (d.name.includes("kbd"))
return "keyboard";
return "keyboard"
return "lightbulb";
return "lightbulb"
})
onValueChanged: function (value) {
BrightnessService.setCurrentDevice(value, true);
BrightnessService.setCurrentDevice(value, true)
}
Connections {
target: BrightnessService
function onDevicesChanged() {
if (BrightnessService.currentDevice) {
deviceDropdown.currentValue = BrightnessService.currentDevice;
deviceDropdown.currentValue = BrightnessService.currentDevice
}
// Check if saved device is now available
const lastDevice = SessionData.lastBrightnessDevice || "";
const lastDevice = SessionData.lastBrightnessDevice
|| ""
if (lastDevice) {
const deviceExists = BrightnessService.devices.some(d => d.name === lastDevice);
if (deviceExists && (!BrightnessService.currentDevice || BrightnessService.currentDevice !== lastDevice)) {
BrightnessService.setCurrentDevice(lastDevice, false);
const deviceExists = BrightnessService.devices.some(
d => d.name === lastDevice)
if (deviceExists
&& (!BrightnessService.currentDevice
|| BrightnessService.currentDevice !== lastDevice)) {
BrightnessService.setCurrentDevice(lastDevice,
false)
}
}
}
function onDeviceSwitched() {
// Force update the description when device switches
deviceDropdown.description = Qt.binding(function () {
const deviceInfo = BrightnessService.getCurrentDeviceInfo();
const deviceInfo = BrightnessService.getCurrentDeviceInfo()
if (deviceInfo && deviceInfo.class === "ddc") {
return "DDC changes can be slow and unreliable";
return "DDC changes can be slow and unreliable"
}
return "";
});
return ""
})
}
}
}
@@ -123,31 +125,31 @@ Item {
value: BrightnessService.brightnessLevel
leftIcon: "brightness_low"
rightIcon: "brightness_high"
enabled: BrightnessService.brightnessAvailable && BrightnessService.isCurrentDeviceReady()
enabled: BrightnessService.brightnessAvailable
&& BrightnessService.isCurrentDeviceReady()
opacity: BrightnessService.isCurrentDeviceReady() ? 1.0 : 0.5
onSliderValueChanged: function (newValue) {
brightnessDebounceTimer.pendingValue = newValue;
brightnessDebounceTimer.restart();
brightnessDebounceTimer.pendingValue = newValue
brightnessDebounceTimer.restart()
}
onSliderDragFinished: function (finalValue) {
brightnessDebounceTimer.stop();
BrightnessService.setBrightnessInternal(finalValue, BrightnessService.currentDevice);
brightnessDebounceTimer.stop()
BrightnessService.setBrightnessInternal(
finalValue, BrightnessService.currentDevice)
}
Connections {
target: BrightnessService
function onBrightnessChanged() {
brightnessSlider.value = BrightnessService.brightnessLevel;
brightnessSlider.value = BrightnessService.brightnessLevel
}
function onDeviceSwitched() {
brightnessSlider.value = BrightnessService.brightnessLevel;
brightnessSlider.value = BrightnessService.brightnessLevel
}
}
}
}
}
Component {
@@ -172,7 +174,11 @@ Item {
width: (parent.width - Theme.spacingM) / 2
height: 80
radius: Theme.cornerRadius
color: BrightnessService.nightModeActive ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : (nightModeToggle.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) : Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.08))
color: BrightnessService.nightModeActive ? Qt.rgba(
Theme.primary.r,
Theme.primary.g,
Theme.primary.b,
0.12) : (nightModeToggle.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) : Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.08))
border.color: BrightnessService.nightModeActive ? Theme.primary : "transparent"
border.width: BrightnessService.nightModeActive ? 1 : 0
@@ -194,7 +200,6 @@ Item {
font.weight: Font.Medium
anchors.horizontalCenter: parent.horizontalCenter
}
}
MouseArea {
@@ -204,17 +209,20 @@ Item {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
BrightnessService.toggleNightMode();
BrightnessService.toggleNightMode()
}
}
}
Rectangle {
width: (parent.width - Theme.spacingM) / 2
height: 80
radius: Theme.cornerRadius
color: Theme.isLightMode ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12) : (lightModeToggle.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) : Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.08))
color: Theme.isLightMode ? Qt.rgba(
Theme.primary.r,
Theme.primary.g,
Theme.primary.b,
0.12) : (lightModeToggle.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08) : Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.08))
border.color: Theme.isLightMode ? Theme.primary : "transparent"
border.width: Theme.isLightMode ? 1 : 0
@@ -236,7 +244,6 @@ Item {
font.weight: Font.Medium
anchors.horizontalCenter: parent.horizontalCenter
}
}
MouseArea {
@@ -246,7 +253,7 @@ Item {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
Theme.toggleLightMode();
Theme.toggleLightMode()
}
}
@@ -255,15 +262,10 @@ Item {
duration: Theme.shortDuration
easing.type: Theme.standardEasing
}
}
}
}
}
}
brightnessDebounceTimer: Timer {
@@ -271,13 +273,13 @@ Item {
interval: {
// Use longer interval for DDC devices since ddcutil is slow
const deviceInfo = BrightnessService.getCurrentDeviceInfo();
return (deviceInfo && deviceInfo.class === "ddc") ? 100 : 50;
const deviceInfo = BrightnessService.getCurrentDeviceInfo()
return (deviceInfo && deviceInfo.class === "ddc") ? 100 : 50
}
repeat: false
onTriggered: {
BrightnessService.setBrightnessInternal(pendingValue, BrightnessService.currentDevice);
BrightnessService.setBrightnessInternal(
pendingValue, BrightnessService.currentDevice)
}
}
}

View File

@@ -14,7 +14,8 @@ Rectangle {
height: 80
radius: Theme.cornerRadius
color: {
if (ethernetPreferenceArea.containsMouse && NetworkService.ethernetConnected
if (ethernetPreferenceArea.containsMouse
&& NetworkService.ethernetConnected
&& NetworkService.wifiEnabled
&& NetworkService.networkStatus !== "ethernet")
return Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g,
@@ -23,8 +24,8 @@ Rectangle {
return Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g,
Theme.surfaceContainer.b, 0.5)
}
border.color: NetworkService.networkStatus === "ethernet" ? Theme.primary : Qt.rgba(
Theme.outline.r,
border.color: NetworkService.networkStatus
=== "ethernet" ? Theme.primary : Qt.rgba(Theme.outline.r,
Theme.outline.g,
Theme.outline.b,
0.12)
@@ -52,7 +53,8 @@ Rectangle {
StyledText {
text: "Ethernet"
font.pixelSize: Theme.fontSizeMedium
color: NetworkService.networkStatus === "ethernet" ? Theme.primary : Theme.surfaceText
color: NetworkService.networkStatus
=== "ethernet" ? Theme.primary : Theme.surfaceText
font.weight: Font.Medium
elide: Text.ElideRight
}
@@ -92,20 +94,21 @@ Rectangle {
}
}
MouseArea {
id: ethernetPreferenceArea
anchors.fill: parent
hoverEnabled: true
cursorShape: (NetworkService.ethernetConnected && NetworkService.wifiEnabled
cursorShape: (NetworkService.ethernetConnected
&& NetworkService.wifiEnabled
&& NetworkService.networkStatus
!== "ethernet") ? Qt.PointingHandCursor : Qt.ArrowCursor
enabled: NetworkService.ethernetConnected && NetworkService.wifiEnabled
&& NetworkService.networkStatus !== "ethernet"
&& !NetworkService.changingNetworkPreference
onClicked: {
if (NetworkService.ethernetConnected && NetworkService.wifiEnabled) {
if (NetworkService.ethernetConnected
&& NetworkService.wifiEnabled) {
if (NetworkService.networkStatus !== "ethernet")
NetworkService.setNetworkPreference("ethernet")

View File

@@ -56,7 +56,8 @@ Rectangle {
text: {
if (!NetworkService.wifiEnabled)
return "WiFi is off"
else if (NetworkService.wifiEnabled && NetworkService.currentWifiSSID)
else if (NetworkService.wifiEnabled
&& NetworkService.currentWifiSSID)
return NetworkService.currentWifiSSID || "Connected"
else
return "Not Connected"
@@ -71,7 +72,8 @@ Rectangle {
text: {
if (!NetworkService.wifiEnabled)
return "Turn on WiFi to see networks"
else if (NetworkService.wifiEnabled && NetworkService.currentWifiSSID)
else if (NetworkService.wifiEnabled
&& NetworkService.currentWifiSSID)
return NetworkService.wifiIP || "Connected"
else
return "Select a network below"
@@ -140,14 +142,16 @@ Rectangle {
anchors.fill: parent
anchors.rightMargin: 60 // Exclude toggle area
hoverEnabled: true
cursorShape: (NetworkService.ethernetConnected && NetworkService.wifiEnabled
cursorShape: (NetworkService.ethernetConnected
&& NetworkService.wifiEnabled
&& NetworkService.networkStatus
!== "wifi") ? Qt.PointingHandCursor : Qt.ArrowCursor
enabled: NetworkService.ethernetConnected && NetworkService.wifiEnabled
&& NetworkService.networkStatus !== "wifi"
&& !NetworkService.changingNetworkPreference
onClicked: {
if (NetworkService.ethernetConnected && NetworkService.wifiEnabled) {
if (NetworkService.ethernetConnected
&& NetworkService.wifiEnabled) {
if (NetworkService.networkStatus !== "wifi")
NetworkService.setNetworkPreference("wifi")

View File

@@ -24,12 +24,12 @@ Rectangle {
let finalX = x - menuWidth / 2
let finalY = y + 4
finalX = Math.max(
Theme.spacingS,
Math.min(finalX,
Theme.spacingS, Math.min(
finalX,
parentItem.width - menuWidth - Theme.spacingS))
finalY = Math.max(
Theme.spacingS,
Math.min(finalY,
Theme.spacingS, Math.min(
finalY,
parentItem.height - menuHeight - Theme.spacingS))
if (finalY + menuHeight > parentItem.height - Theme.spacingS) {
finalY = y - menuHeight - 4
@@ -53,7 +53,8 @@ Rectangle {
height: wifiMenuColumn.implicitHeight + Theme.spacingS * 2
radius: Theme.cornerRadius
color: Theme.popupBackground()
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: 1
z: 1000
opacity: menuVisible ? 1 : 0
@@ -131,7 +132,8 @@ Rectangle {
wifiContextMenuWindow.networkData.ssid)
} else if (wifiContextMenuWindow.networkData.secured) {
if (wifiPasswordModalRef) {
wifiPasswordModalRef.show(wifiContextMenuWindow.networkData.ssid)
wifiPasswordModalRef.show(
wifiContextMenuWindow.networkData.ssid)
}
} else {
NetworkService.connectToWifi(
@@ -161,7 +163,8 @@ Rectangle {
anchors.centerIn: parent
width: parent.width
height: 1
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
}
}
@@ -262,7 +265,8 @@ Rectangle {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
if (wifiContextMenuWindow.networkData && networkInfoModalRef)
if (wifiContextMenuWindow.networkData
&& networkInfoModalRef)
networkInfoModalRef.showNetworkInfo(
wifiContextMenuWindow.networkData.ssid,
wifiContextMenuWindow.networkData)

View File

@@ -110,8 +110,8 @@ Column {
let delta = event.pixelDelta.y
!== 0 ? event.pixelDelta.y * 1.8 : event.angleDelta.y / 120 * 60
let newY = parent.contentY - delta
newY = Math.max(0,
Math.min(parent.contentHeight - parent.height,
newY = Math.max(
0, Math.min(parent.contentHeight - parent.height,
newY))
parent.contentY = newY
event.accepted = true
@@ -187,7 +187,8 @@ Column {
return "Invalid password"
if (modelData.saved)
return "Saved" + (modelData.secured ? " • Secured" : " • Open")
return "Saved"
+ (modelData.secured ? " • Secured" : " • Open")
return modelData.secured ? "Secured" : "Open"
}
@@ -201,7 +202,8 @@ Column {
&& NetworkService.connectingSSID === modelData.ssid)
return Theme.error
return Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
return Qt.rgba(Theme.surfaceText.r,
Theme.surfaceText.g,
Theme.surfaceText.b, 0.7)
}
elide: Text.ElideRight
@@ -218,7 +220,8 @@ Column {
DankIcon {
name: "lock"
size: Theme.iconSize - 8
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
color: Qt.rgba(Theme.surfaceText.r,
Theme.surfaceText.g,
Theme.surfaceText.b, 0.6)
visible: modelData.secured
anchors.verticalCenter: parent.verticalCenter
@@ -255,10 +258,11 @@ Column {
let buttonCenter = wifiMenuButtonArea.width / 2
let buttonBottom = wifiMenuButtonArea.height
let globalPos = wifiMenuButtonArea.mapToItem(
wifiContextMenuWindow.parentItem, buttonCenter,
buttonBottom)
wifiContextMenuWindow.parentItem,
buttonCenter, buttonBottom)
Qt.callLater(() => {
wifiContextMenuWindow.show(globalPos.x,
wifiContextMenuWindow.show(
globalPos.x,
globalPos.y)
})
}

View File

@@ -103,7 +103,9 @@ Item {
!== 0 ? event.pixelDelta.y * 1.8 : event.angleDelta.y / 120 * 60
let newY = parent.contentY - delta
newY = Math.max(
0, Math.min(parent.contentHeight - parent.height, newY))
0, Math.min(
parent.contentHeight - parent.height,
newY))
parent.contentY = newY
event.accepted = true
}
@@ -148,7 +150,9 @@ Item {
!== 0 ? event.pixelDelta.y * 1.8 : event.angleDelta.y / 120 * 60
let newY = parent.contentY - delta
newY = Math.max(
0, Math.min(parent.contentHeight - parent.height, newY))
0, Math.min(
parent.contentHeight - parent.height,
newY))
parent.contentY = newY
event.accepted = true
}
@@ -226,7 +230,8 @@ Item {
}
onVisibleChanged: {
if (visible && NetworkService.wifiEnabled && NetworkService.wifiNetworks.length === 0) {
if (visible && NetworkService.wifiEnabled
&& NetworkService.wifiNetworks.length === 0) {
// Scan when tab becomes visible if we don't have networks cached
NetworkService.scanWifi()
}

View File

@@ -81,7 +81,8 @@ PanelWindow {
iconName: "close"
iconSize: Theme.iconSize - 4
iconColor: Theme.surfaceText
hoverColor: Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.12)
hoverColor: Qt.rgba(Theme.error.r, Theme.error.g,
Theme.error.b, 0.12)
onClicked: {
powerMenuVisible = false
}
@@ -102,7 +103,8 @@ PanelWindow {
0.08) : Qt.rgba(
Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.08)
Theme.surfaceVariant.b,
0.08)
Row {
anchors.left: parent.left
@@ -134,7 +136,9 @@ PanelWindow {
cursorShape: Qt.PointingHandCursor
onClicked: {
powerMenuVisible = false
root.powerActionRequested("logout", "Log Out", "Are you sure you want to log out?")
root.powerActionRequested(
"logout", "Log Out",
"Are you sure you want to log out?")
}
}
}
@@ -149,7 +153,8 @@ PanelWindow {
0.08) : Qt.rgba(
Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.08)
Theme.surfaceVariant.b,
0.08)
Row {
anchors.left: parent.left
@@ -181,7 +186,9 @@ PanelWindow {
cursorShape: Qt.PointingHandCursor
onClicked: {
powerMenuVisible = false
root.powerActionRequested("suspend", "Suspend", "Are you sure you want to suspend the system?")
root.powerActionRequested(
"suspend", "Suspend",
"Are you sure you want to suspend the system?")
}
}
}
@@ -196,7 +203,8 @@ PanelWindow {
0.08) : Qt.rgba(
Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.08)
Theme.surfaceVariant.b,
0.08)
Row {
anchors.left: parent.left
@@ -228,7 +236,9 @@ PanelWindow {
cursorShape: Qt.PointingHandCursor
onClicked: {
powerMenuVisible = false
root.powerActionRequested("reboot", "Reboot", "Are you sure you want to reboot the system?")
root.powerActionRequested(
"reboot", "Reboot",
"Are you sure you want to reboot the system?")
}
}
}
@@ -243,7 +253,8 @@ PanelWindow {
0.08) : Qt.rgba(
Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.08)
Theme.surfaceVariant.b,
0.08)
Row {
anchors.left: parent.left
@@ -275,7 +286,9 @@ PanelWindow {
cursorShape: Qt.PointingHandCursor
onClicked: {
powerMenuVisible = false
root.powerActionRequested("poweroff", "Power Off", "Are you sure you want to power off the system?")
root.powerActionRequested(
"poweroff", "Power Off",
"Are you sure you want to power off the system?")
}
}
}

View File

@@ -117,7 +117,8 @@ PanelWindow {
anchors.topMargin: 4
anchors.bottomMargin: 1
color: Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g,
color: Qt.rgba(Theme.surfaceContainer.r,
Theme.surfaceContainer.g,
Theme.surfaceContainer.b, backgroundTransparency)
radius: Theme.cornerRadius
border.width: 1
@@ -165,7 +166,8 @@ PanelWindow {
return null
for (var i = 0; i < repeater.count; i++) {
var item = repeater.itemAt(i)
if (item && item.dockButton && item.dockButton.showTooltip) {
if (item && item.dockButton
&& item.dockButton.showTooltip) {
return item.dockButton
}
}
@@ -184,8 +186,8 @@ PanelWindow {
border.color: Theme.outlineMedium
y: -height - 8
x: hoveredButton ? hoveredButton.mapToItem(dockContainer,
hoveredButton.width / 2,
x: hoveredButton ? hoveredButton.mapToItem(
dockContainer, hoveredButton.width / 2,
0).x - width / 2 : 0
StyledText {

View File

@@ -26,33 +26,34 @@ Item {
property bool showTooltip: mouseArea.containsMouse && !dragging
property string tooltipText: {
if (!appData)
return "";
return ""
// For window type, show app name + window title
if (appData.type === "window" && showWindowTitle) {
var desktopEntry = DesktopEntries.byId(appData.appId);
var appName = desktopEntry && desktopEntry.name ? desktopEntry.name : appData.appId;
return appName + (windowTitle ? " • " + windowTitle : "");
var desktopEntry = DesktopEntries.byId(appData.appId)
var appName = desktopEntry
&& desktopEntry.name ? desktopEntry.name : appData.appId
return appName + (windowTitle ? " • " + windowTitle : "")
}
// For pinned apps, just show app name
if (!appData.appId)
return "";
return ""
var desktopEntry = DesktopEntries.byId(appData.appId);
return desktopEntry && desktopEntry.name ? desktopEntry.name : appData.appId;
var desktopEntry = DesktopEntries.byId(appData.appId)
return desktopEntry
&& desktopEntry.name ? desktopEntry.name : appData.appId
}
width: 40
height: 40
onIsHoveredChanged: {
if (isHovered) {
exitAnimation.stop();
exitAnimation.stop()
if (!bounceAnimation.running)
bounceAnimation.restart();
bounceAnimation.restart()
} else {
bounceAnimation.stop();
exitAnimation.restart();
bounceAnimation.stop()
exitAnimation.restart()
}
}
@@ -78,7 +79,6 @@ Item {
easing.type: Easing.BezierSpline
easing.bezierCurve: Anims.emphasizedDecel
}
}
NumberAnimation {
@@ -110,8 +110,7 @@ Item {
repeat: false
onTriggered: {
if (appData && appData.isPinned)
longPressing = true;
longPressing = true
}
}
@@ -123,95 +122,114 @@ Item {
hoverEnabled: true
cursorShape: longPressing ? Qt.DragMoveCursor : Qt.PointingHandCursor
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
onPressed: (mouse) => {
if (mouse.button === Qt.LeftButton && appData && appData.isPinned) {
dragStartPos = Qt.point(mouse.x, mouse.y);
longPressTimer.start();
onPressed: mouse => {
if (mouse.button === Qt.LeftButton && appData
&& appData.isPinned) {
dragStartPos = Qt.point(mouse.x, mouse.y)
longPressTimer.start()
}
}
onReleased: (mouse) => {
longPressTimer.stop();
onReleased: mouse => {
longPressTimer.stop()
if (longPressing) {
if (dragging && targetIndex >= 0 && targetIndex !== originalIndex && dockApps)
dockApps.movePinnedApp(originalIndex, targetIndex);
if (dragging && targetIndex >= 0
&& targetIndex !== originalIndex && dockApps)
dockApps.movePinnedApp(originalIndex, targetIndex)
longPressing = false;
dragging = false;
dragOffset = Qt.point(0, 0);
targetIndex = -1;
originalIndex = -1;
longPressing = false
dragging = false
dragOffset = Qt.point(0, 0)
targetIndex = -1
originalIndex = -1
}
}
onPositionChanged: (mouse) => {
onPositionChanged: mouse => {
if (longPressing && !dragging) {
var distance = Math.sqrt(Math.pow(mouse.x - dragStartPos.x, 2) + Math.pow(mouse.y - dragStartPos.y, 2));
var distance = Math.sqrt(
Math.pow(mouse.x - dragStartPos.x,
2) + Math.pow(
mouse.y - dragStartPos.y, 2))
if (distance > 5) {
dragging = true;
targetIndex = index;
originalIndex = index;
dragging = true
targetIndex = index
originalIndex = index
}
}
if (dragging) {
dragOffset = Qt.point(mouse.x - dragStartPos.x, mouse.y - dragStartPos.y);
dragOffset = Qt.point(
mouse.x - dragStartPos.x,
mouse.y - dragStartPos.y)
if (dockApps) {
var threshold = 40;
var newTargetIndex = targetIndex;
if (dragOffset.x > threshold && targetIndex < dockApps.pinnedAppCount - 1)
newTargetIndex = targetIndex + 1;
else if (dragOffset.x < -threshold && targetIndex > 0)
newTargetIndex = targetIndex - 1;
var threshold = 40
var newTargetIndex = targetIndex
if (dragOffset.x > threshold
&& targetIndex < dockApps.pinnedAppCount - 1)
newTargetIndex = targetIndex + 1
else if (dragOffset.x < -threshold
&& targetIndex > 0)
newTargetIndex = targetIndex - 1
if (newTargetIndex !== targetIndex) {
targetIndex = newTargetIndex;
dragStartPos = Qt.point(mouse.x, mouse.y);
targetIndex = newTargetIndex
dragStartPos = Qt.point(mouse.x,
mouse.y)
}
}
}
}
onClicked: (mouse) => {
onClicked: mouse => {
if (!appData || longPressing)
return ;
return
if (mouse.button === Qt.LeftButton) {
// Handle based on type
if (appData.type === "pinned") {
// Launch the pinned app
if (appData && appData.appId) {
var desktopEntry = DesktopEntries.byId(appData.appId);
var desktopEntry = DesktopEntries.byId(
appData.appId)
if (desktopEntry)
AppUsageHistoryData.addAppUsage({
"id": appData.appId,
"name": desktopEntry.name || appData.appId,
"icon": desktopEntry.icon || "",
"exec": desktopEntry.exec || "",
"name": desktopEntry.name
|| appData.appId,
"icon": desktopEntry.icon
|| "",
"exec": desktopEntry.exec
|| "",
"comment": desktopEntry.comment || ""
});
})
Quickshell.execDetached(["gtk-launch", appData.appId]);
Quickshell.execDetached(
["gtk-launch", appData.appId])
}
} else if (appData.type === "window") {
// Focus the specific window
if (appData.windowId)
NiriService.focusWindow(appData.windowId);
NiriService.focusWindow(appData.windowId)
}
} else if (mouse.button === Qt.MiddleButton) {
if (appData && appData.appId) {
var desktopEntry = DesktopEntries.byId(appData.appId);
var desktopEntry = DesktopEntries.byId(
appData.appId)
if (desktopEntry)
AppUsageHistoryData.addAppUsage({
"id": appData.appId,
"name": desktopEntry.name || appData.appId,
"icon": desktopEntry.icon || "",
"exec": desktopEntry.exec || "",
"comment": desktopEntry.comment || ""
});
"name": desktopEntry.name
|| appData.appId,
"icon": desktopEntry.icon
|| "",
"exec": desktopEntry.exec
|| "",
"comment": desktopEntry.comment
|| ""
})
Quickshell.execDetached(["gtk-launch", appData.appId]);
Quickshell.execDetached(
["gtk-launch", appData.appId])
}
} else if (mouse.button === Qt.RightButton) {
if (contextMenu)
contextMenu.showForButton(root, appData, 40);
contextMenu.showForButton(root, appData, 40)
}
}
}
@@ -224,14 +242,16 @@ Item {
anchors.centerIn: parent
source: {
if (!appData || !appData.appId)
return "";
return ""
var desktopEntry = DesktopEntries.byId(appData.appId);
var desktopEntry = DesktopEntries.byId(appData.appId)
if (desktopEntry && desktopEntry.icon) {
var iconPath = Quickshell.iconPath(desktopEntry.icon, SettingsData.iconTheme === "System Default" ? "" : SettingsData.iconTheme);
return iconPath;
var iconPath = Quickshell.iconPath(
desktopEntry.icon, SettingsData.iconTheme
=== "System Default" ? "" : SettingsData.iconTheme)
return iconPath
}
return "";
return ""
}
smooth: true
mipmap: true
@@ -254,19 +274,18 @@ Item {
anchors.centerIn: parent
text: {
if (!appData || !appData.appId)
return "?";
return "?"
var desktopEntry = DesktopEntries.byId(appData.appId);
var desktopEntry = DesktopEntries.byId(appData.appId)
if (desktopEntry && desktopEntry.name)
return desktopEntry.name.charAt(0).toUpperCase();
return desktopEntry.name.charAt(0).toUpperCase()
return appData.appId.charAt(0).toUpperCase();
return appData.appId.charAt(0).toUpperCase()
}
font.pixelSize: 14
color: Theme.primary
font.weight: Font.Bold
}
}
// Indicator for running/focused state
@@ -280,17 +299,18 @@ Item {
visible: appData && (appData.isRunning || appData.type === "window")
color: {
if (!appData)
return "transparent";
return "transparent"
// For window type, check if focused
if (appData.type === "window" && appData.isFocused)
return Theme.primary;
return Theme.primary
// For running apps, show dimmer indicator
if (appData.isRunning || appData.type === "window")
return Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.6);
return Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
Theme.surfaceText.b, 0.6)
return "transparent";
return "transparent"
}
}
@@ -299,5 +319,4 @@ Item {
y: 0
}
}

View File

@@ -55,10 +55,12 @@ Item {
items.push({
"type": "pinned",
"appId": appId,
"windowId": -1, // Use -1 instead of null to avoid ListModel warnings
"windowTitle": "",
"workspaceId": -1, // Use -1 instead of null
"isPinned": true,
"windowId": -1,
"windowTitle"// Use -1 instead of null to avoid ListModel warnings
: "",
"workspaceId": -1,
"isPinned"// Use -1 instead of null
: true,
"isRunning": false,
"isFocused": false
})
@@ -67,14 +69,17 @@ Item {
root.pinnedAppCount = pinnedApps.length
// Add separator between pinned and running if both exist
if (pinnedApps.length > 0 && NiriService.windows.length > 0) {
if (pinnedApps.length > 0
&& NiriService.windows.length > 0) {
items.push({
"type": "separator",
"appId": "__SEPARATOR__",
"windowId": -1, // Use -1 instead of null
"windowTitle": "",
"workspaceId": -1, // Use -1 instead of null
"isPinned": false,
"windowId": -1,
"windowTitle"// Use -1 instead of null
: "",
"workspaceId": -1,
"isPinned"// Use -1 instead of null
: false,
"isRunning": false,
"isFocused": false
})
@@ -84,17 +89,21 @@ Item {
// NiriService.windows is already sorted by sortWindowsByLayout
NiriService.windows.forEach(window => {
// Limit window title length for tooltip
var title = window.title || "(Unnamed)"
var title = window.title
|| "(Unnamed)"
if (title.length > 50) {
title = title.substring(0, 47) + "..."
title = title.substring(
0, 47) + "..."
}
// Check if this window is focused - compare as numbers
var isFocused = window.id == NiriService.focusedWindowId
var isFocused = window.id
== NiriService.focusedWindowId
items.push({
"type": "window",
"appId": window.app_id || "",
"appId": window.app_id
|| "",
"windowId": window.id || -1,
"windowTitle": title,
"workspaceId": window.workspace_id || -1,
@@ -121,7 +130,8 @@ Item {
visible: model.type === "separator"
width: 2
height: 20
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.3)
color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.3)
radius: 1
anchors.centerIn: parent
}
@@ -161,7 +171,6 @@ Item {
}
}
Connections {
target: SessionData
function onPinnedAppsChanged() {

View File

@@ -187,10 +187,12 @@ PanelWindow {
}
Rectangle {
visible: !!(root.appData && root.appData.windows && root.appData.windows.count > 0)
visible: !!(root.appData && root.appData.windows
&& root.appData.windows.count > 0)
width: parent.width
height: 1
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
}
Repeater {
@@ -202,7 +204,8 @@ PanelWindow {
width: menuColumn.width
height: 28
radius: Theme.cornerRadius
color: windowArea.containsMouse ? Qt.rgba(Theme.primary.r,
color: windowArea.containsMouse ? Qt.rgba(
Theme.primary.r,
Theme.primary.g,
Theme.primary.b,
0.12) : "transparent"
@@ -235,18 +238,22 @@ PanelWindow {
}
Rectangle {
visible: !!(root.appData && root.appData.windows && root.appData.windows.count > 1)
visible: !!(root.appData && root.appData.windows
&& root.appData.windows.count > 1)
width: parent.width
height: 1
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
}
Rectangle {
visible: !!(root.appData && root.appData.windows && root.appData.windows.count > 1)
visible: !!(root.appData && root.appData.windows
&& root.appData.windows.count > 1)
width: parent.width
height: 28
radius: Theme.cornerRadius
color: closeAllArea.containsMouse ? Qt.rgba(Theme.error.r,
color: closeAllArea.containsMouse ? Qt.rgba(
Theme.error.r,
Theme.error.g,
Theme.error.b,
0.12) : "transparent"

View File

@@ -106,8 +106,8 @@ PanelWindow {
Rectangle {
id: menuContainer
width: Math.min(600,
Math.max(250,
width: Math.min(600, Math.max(
250,
windowColumn.implicitWidth + Theme.spacingS * 2))
height: Math.max(60, windowColumn.implicitHeight + Theme.spacingS * 2)
@@ -154,7 +154,8 @@ PanelWindow {
width: windowColumn.width
height: 32
radius: Theme.cornerRadius
color: windowArea.containsMouse ? Qt.rgba(Theme.primary.r,
color: windowArea.containsMouse ? Qt.rgba(
Theme.primary.r,
Theme.primary.g,
Theme.primary.b,
0.12) : "transparent"

View File

@@ -54,8 +54,9 @@ Item {
stdout: StdioCollector {
onStreamFinished: {
if (text.includes("true")) {
console.log("Session is locked on startup, activating lock screen")
LockScreenService.resetState();
console.log(
"Session is locked on startup, activating lock screen")
LockScreenService.resetState()
loader.activeAsync = true
}
}
@@ -63,7 +64,8 @@ Item {
onExited: (exitCode, exitStatus) => {
if (exitCode !== 0) {
console.warn("Failed to check initial lock state, exit code:", exitCode)
console.warn("Failed to check initial lock state, exit code:",
exitCode)
}
}
}
@@ -76,19 +78,22 @@ Item {
stdout: SplitParser {
splitMarker: "\n"
onRead: (line) => {
onRead: line => {
if (line.includes("org.freedesktop.login1.Session.Lock")) {
console.log("login1: Lock signal received -> show lock")
LockScreenService.resetState();
LockScreenService.resetState()
loader.activeAsync = true
} else if (line.includes("org.freedesktop.login1.Session.Unlock")) {
} else if (line.includes(
"org.freedesktop.login1.Session.Unlock")) {
console.log("login1: Unlock signal received -> hide lock")
loader.active = false
} else if (line.includes("LockedHint") && line.includes("true")) {
} else if (line.includes("LockedHint") && line.includes(
"true")) {
console.log("login1: LockedHint=true -> show lock")
LockScreenService.resetState();
LockScreenService.resetState()
loader.activeAsync = true
} else if (line.includes("LockedHint") && line.includes("false")) {
} else if (line.includes("LockedHint") && line.includes(
"false")) {
console.log("login1: LockedHint=false -> hide lock")
loader.active = false
}
@@ -102,7 +107,6 @@ Item {
}
}
LazyLoader {
id: loader
@@ -139,7 +143,7 @@ Item {
function lock(): void {
console.log("Lock screen requested via IPC")
LockScreenService.resetState();
LockScreenService.resetState()
loader.activeAsync = true
}

View File

@@ -11,7 +11,8 @@ DankListView {
property bool autoScrollDisabled: false
onIsUserScrollingChanged: {
if (isUserScrolling && keyboardController && keyboardController.keyboardNavigationActive) {
if (isUserScrolling && keyboardController
&& keyboardController.keyboardNavigationActive) {
autoScrollDisabled = true
}
}
@@ -30,10 +31,14 @@ DankListView {
Timer {
id: positionPreservationTimer
interval: 200
running: keyboardController && keyboardController.keyboardNavigationActive && !autoScrollDisabled
running: keyboardController
&& keyboardController.keyboardNavigationActive
&& !autoScrollDisabled
repeat: true
onTriggered: {
if (keyboardController && keyboardController.keyboardNavigationActive && !autoScrollDisabled) {
if (keyboardController
&& keyboardController.keyboardNavigationActive
&& !autoScrollDisabled) {
keyboardController.ensureVisible()
}
}
@@ -48,7 +53,9 @@ DankListView {
if (keyboardController && keyboardController.keyboardNavigationActive) {
keyboardController.rebuildFlatNavigation()
Qt.callLater(function () {
if (keyboardController && keyboardController.keyboardNavigationActive && !autoScrollDisabled) {
if (keyboardController
&& keyboardController.keyboardNavigationActive
&& !autoScrollDisabled) {
keyboardController.ensureVisible()
}
})
@@ -59,7 +66,8 @@ DankListView {
required property var modelData
required property int index
readonly property bool isExpanded: NotificationService.expandedGroups[modelData?.key] || false
readonly property bool isExpanded: NotificationService.expandedGroups[modelData?.key]
|| false
width: ListView.view.width
height: notificationCardWrapper.height
@@ -75,28 +83,32 @@ DankListView {
notificationGroup: modelData
isGroupSelected: {
if (!keyboardController || !keyboardController.keyboardNavigationActive) return false
if (!keyboardController
|| !keyboardController.keyboardNavigationActive)
return false
keyboardController.selectionVersion
if (!listView.keyboardActive) return false
if (!listView.keyboardActive)
return false
const selection = keyboardController.getCurrentSelection()
return selection.type === "group" && selection.groupIndex === index
return selection.type === "group"
&& selection.groupIndex === index
}
selectedNotificationIndex: {
if (!keyboardController || !keyboardController.keyboardNavigationActive) return -1
if (!keyboardController
|| !keyboardController.keyboardNavigationActive)
return -1
keyboardController.selectionVersion
if (!listView.keyboardActive) return -1
if (!listView.keyboardActive)
return -1
const selection = keyboardController.getCurrentSelection()
return (selection.type === "notification" && selection.groupIndex === index)
? selection.notificationIndex : -1
return (selection.type === "notification"
&& selection.groupIndex === index) ? selection.notificationIndex : -1
}
keyboardNavigationActive: listView.keyboardActive
}
}
}
Connections {
function onGroupedNotificationsChanged() {
if (keyboardController) {
@@ -118,7 +130,8 @@ DankListView {
}
function onExpandedGroupsChanged() {
if (keyboardController && keyboardController.keyboardNavigationActive) {
if (keyboardController
&& keyboardController.keyboardNavigationActive) {
Qt.callLater(function () {
if (!autoScrollDisabled) {
keyboardController.ensureVisible()
@@ -128,7 +141,8 @@ DankListView {
}
function onExpandedMessagesChanged() {
if (keyboardController && keyboardController.keyboardNavigationActive) {
if (keyboardController
&& keyboardController.keyboardNavigationActive) {
Qt.callLater(function () {
if (!autoScrollDisabled) {
keyboardController.ensureVisible()
@@ -139,5 +153,4 @@ DankListView {
target: NotificationService
}
}

View File

@@ -29,7 +29,8 @@ Rectangle {
}
const baseHeight = 116
if (descriptionExpanded) {
return baseHeight + descriptionText.contentHeight - (descriptionText.font.pixelSize * 1.2 * 2)
return baseHeight + descriptionText.contentHeight
- (descriptionText.font.pixelSize * 1.2 * 2)
}
return baseHeight
}
@@ -52,26 +53,34 @@ Rectangle {
color: {
// Keyboard selection highlighting for groups (both collapsed and expanded)
if (isGroupSelected && keyboardNavigationActive) {
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.2)
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.2)
}
// Very subtle group highlighting when navigating within expanded group
if (keyboardNavigationActive && expanded && selectedNotificationIndex >= 0) {
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.12)
if (keyboardNavigationActive && expanded
&& selectedNotificationIndex >= 0) {
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.12)
}
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.1)
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.1)
}
border.color: {
// Keyboard selection highlighting for groups (both collapsed and expanded)
if (isGroupSelected && keyboardNavigationActive) {
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.5)
return Qt.rgba(Theme.primary.r, Theme.primary.g,
Theme.primary.b, 0.5)
}
// Subtle group border when navigating within expanded group
if (keyboardNavigationActive && expanded && selectedNotificationIndex >= 0) {
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.2)
if (keyboardNavigationActive && expanded
&& selectedNotificationIndex >= 0) {
return Qt.rgba(Theme.primary.r, Theme.primary.g,
Theme.primary.b, 0.2)
}
// Critical notification styling
if (notificationGroup?.latestNotification?.urgency === NotificationUrgency.Critical) {
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.3)
return Qt.rgba(Theme.primary.r, Theme.primary.g,
Theme.primary.b, 0.3)
}
return Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.05)
}
@@ -81,7 +90,8 @@ Rectangle {
return 1.5
}
// Subtle group border when navigating within expanded group
if (keyboardNavigationActive && expanded && selectedNotificationIndex >= 0) {
if (keyboardNavigationActive && expanded
&& selectedNotificationIndex >= 0) {
return 1
}
// Critical notification styling
@@ -127,14 +137,13 @@ Rectangle {
Rectangle {
id: iconContainer
readonly property bool hasNotificationImage: notificationGroup?.latestNotification?.image
&& notificationGroup.latestNotification.image
!== ""
readonly property bool hasNotificationImage: notificationGroup?.latestNotification?.image && notificationGroup.latestNotification.image !== ""
width: 55
height: 55
radius: 27.5
color: Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.1)
color: Qt.rgba(Theme.primary.r, Theme.primary.g,
Theme.primary.b, 0.1)
border.color: "transparent"
border.width: 0
anchors.left: parent.left
@@ -149,8 +158,9 @@ Rectangle {
return notificationGroup.latestNotification.cleanImage
if (notificationGroup?.latestNotification?.appIcon) {
const appIcon = notificationGroup.latestNotification.appIcon
if (appIcon.startsWith("file://") || appIcon.startsWith("http://")
|| appIcon.startsWith("https://"))
if (appIcon.startsWith("file://") || appIcon.startsWith(
"http://") || appIcon.startsWith(
"https://"))
return appIcon
return Quickshell.iconPath(appIcon, "")
}
@@ -187,7 +197,8 @@ Rectangle {
StyledText {
anchors.centerIn: parent
text: (notificationGroup?.count
|| 0) > 99 ? "99+" : (notificationGroup?.count || 0).toString()
|| 0) > 99 ? "99+" : (notificationGroup?.count
|| 0).toString()
color: Theme.primaryText
font.pixelSize: 9
font.weight: Font.Bold
@@ -223,7 +234,8 @@ Rectangle {
const timeStr = notificationGroup?.latestNotification?.timeStr
|| ""
if (timeStr.length > 0)
return (notificationGroup?.appName || "") + " • " + timeStr
return (notificationGroup?.appName
|| "") + " • " + timeStr
else
return notificationGroup?.appName || ""
}
@@ -235,7 +247,8 @@ Rectangle {
}
StyledText {
text: notificationGroup?.latestNotification?.summary || ""
text: notificationGroup?.latestNotification?.summary
|| ""
color: Theme.surfaceText
font.pixelSize: Theme.fontSizeMedium
font.weight: Font.Medium
@@ -264,12 +277,12 @@ Rectangle {
MouseArea {
anchors.fill: parent
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : (parent.hasMoreText
|| descriptionExpanded) ? Qt.PointingHandCursor : Qt.ArrowCursor
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : (parent.hasMoreText || descriptionExpanded) ? Qt.PointingHandCursor : Qt.ArrowCursor
onClicked: mouse => {
if (!parent.hoveredLink
&& (parent.hasMoreText || descriptionExpanded)) {
&& (parent.hasMoreText
|| descriptionExpanded)) {
const messageId = notificationGroup?.latestNotification?.notification?.id + "_desc"
NotificationService.toggleMessageExpansion(
messageId)
@@ -310,7 +323,6 @@ Rectangle {
width: parent.width
height: 40
Row {
anchors.left: parent.left
anchors.right: parent.right
@@ -376,8 +388,17 @@ Rectangle {
return baseHeight
}
radius: Theme.cornerRadius
color: isSelected ? Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.25) : "transparent"
border.color: isSelected ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.4) : Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.05)
color: isSelected ? Qt.rgba(Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b,
0.25) : "transparent"
border.color: isSelected ? Qt.rgba(Theme.primary.r,
Theme.primary.g,
Theme.primary.b,
0.4) : Qt.rgba(
Theme.outline.r,
Theme.outline.g,
Theme.outline.b, 0.05)
border.width: isSelected ? 1 : 1
Behavior on color {
@@ -417,7 +438,8 @@ Rectangle {
anchors.topMargin: 32
color: Qt.rgba(Theme.primary.r, Theme.primary.g,
Theme.primary.b, 0.1)
border.color: Qt.rgba(Theme.primary.r, Theme.primary.g,
border.color: Qt.rgba(Theme.primary.r,
Theme.primary.g,
Theme.primary.b, 0.2)
border.width: 1
@@ -430,8 +452,10 @@ Rectangle {
if (modelData?.appIcon) {
const appIcon = modelData.appIcon
if (appIcon.startsWith("file://") || appIcon.startsWith(
"http://") || appIcon.startsWith("https://"))
if (appIcon.startsWith("file://")
|| appIcon.startsWith("http://")
|| appIcon.startsWith(
"https://"))
return appIcon
return Quickshell.iconPath(appIcon, "")
@@ -444,7 +468,8 @@ Rectangle {
StyledText {
anchors.centerIn: parent
visible: !parent.hasNotificationImage
&& (!modelData?.appIcon || modelData.appIcon === "")
&& (!modelData?.appIcon
|| modelData.appIcon === "")
text: {
const appName = modelData?.appName || "?"
return appName.charAt(0).toUpperCase()
@@ -506,7 +531,8 @@ Rectangle {
wrapMode: Text.WordWrap
visible: text.length > 0
linkColor: Theme.primary
onLinkActivated: link => Qt.openUrlExternally(link)
onLinkActivated: link => Qt.openUrlExternally(
link)
MouseArea {
anchors.fill: parent
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : (bodyText.hasMoreText || messageExpanded) ? Qt.PointingHandCursor : Qt.ArrowCursor
@@ -516,7 +542,8 @@ Rectangle {
&& (bodyText.hasMoreText
|| messageExpanded)) {
NotificationService.toggleMessageExpansion(
modelData?.notification?.id || "")
modelData?.notification?.id
|| "")
}
}
@@ -553,10 +580,13 @@ Rectangle {
Rectangle {
property bool isHovered: false
width: Math.max(actionText.implicitWidth + 12, 50)
width: Math.max(
actionText.implicitWidth + 12,
50)
height: 24
radius: 4
color: isHovered ? Qt.rgba(Theme.primary.r,
color: isHovered ? Qt.rgba(
Theme.primary.r,
Theme.primary.g,
Theme.primary.b,
0.1) : "transparent"
@@ -564,8 +594,12 @@ Rectangle {
StyledText {
id: actionText
text: {
const baseText = modelData.text || "View"
if (keyboardNavigationActive && (isGroupSelected || selectedNotificationIndex >= 0)) {
const baseText = modelData.text
|| "View"
if (keyboardNavigationActive
&& (isGroupSelected
|| selectedNotificationIndex
>= 0)) {
return `${baseText} (${index + 1})`
}
return baseText
@@ -584,7 +618,8 @@ Rectangle {
onEntered: parent.isHovered = true
onExited: parent.isHovered = false
onClicked: {
if (modelData && modelData.invoke) {
if (modelData
&& modelData.invoke) {
modelData.invoke()
}
}
@@ -595,10 +630,13 @@ Rectangle {
Rectangle {
property bool isHovered: false
width: Math.max(clearText.implicitWidth + 12, 50)
width: Math.max(
clearText.implicitWidth + 12,
50)
height: 24
radius: 4
color: isHovered ? Qt.rgba(Theme.primary.r,
color: isHovered ? Qt.rgba(
Theme.primary.r,
Theme.primary.g,
Theme.primary.b,
0.1) : "transparent"
@@ -714,7 +752,8 @@ Rectangle {
cursorShape: Qt.PointingHandCursor
onEntered: clearButton.isHovered = true
onExited: clearButton.isHovered = false
onClicked: NotificationService.dismissGroup(notificationGroup?.key || "")
onClicked: NotificationService.dismissGroup(
notificationGroup?.key || "")
}
}
@@ -724,7 +763,8 @@ Rectangle {
&& !descriptionExpanded
onClicked: {
root.userInitiatedExpansion = true
NotificationService.toggleGroupExpansion(notificationGroup?.key || "")
NotificationService.toggleGroupExpansion(
notificationGroup?.key || "")
}
z: -1
}
@@ -747,7 +787,8 @@ Rectangle {
buttonSize: 28
onClicked: {
root.userInitiatedExpansion = true
NotificationService.toggleGroupExpansion(notificationGroup?.key || "")
NotificationService.toggleGroupExpansion(
notificationGroup?.key || "")
}
}
@@ -757,7 +798,8 @@ Rectangle {
iconName: "close"
iconSize: 18
buttonSize: 28
onClicked: NotificationService.dismissGroup(notificationGroup?.key || "")
onClicked: NotificationService.dismissGroup(
notificationGroup?.key || "")
}
}

View File

@@ -20,9 +20,10 @@ DankPopout {
id: keyboardController
listView: null
isOpen: notificationHistoryVisible
onClose: function() { notificationHistoryVisible = false }
onClose: function () {
notificationHistoryVisible = false
}
}
function setTriggerPosition(x, y, width, section, screen) {
triggerX = x
@@ -60,8 +61,10 @@ DankPopout {
contentLoader.item.externalKeyboardController = keyboardController
// Find the notification list and set up the connection
var notificationList = findChild(contentLoader.item, "notificationList")
var notificationHeader = findChild(contentLoader.item, "notificationHeader")
var notificationList = findChild(contentLoader.item,
"notificationList")
var notificationHeader = findChild(contentLoader.item,
"notificationHeader")
if (notificationList) {
keyboardController.listView = notificationList
@@ -112,7 +115,10 @@ DankPopout {
if (NotificationService.groupedNotifications.length === 0)
listHeight = 200
baseHeight += Math.min(listHeight, 600)
return Math.max(300, Math.min(baseHeight, root.screen ? root.screen.height * 0.8 : Screen.height * 0.8))
return Math.max(
300, Math.min(
baseHeight,
root.screen ? root.screen.height * 0.8 : Screen.height * 0.8))
}
color: Theme.popupBackground()
@@ -176,7 +182,8 @@ DankPopout {
objectName: "notificationList"
width: parent.width
height: parent.height - notificationContent.cachedHeaderHeight - notificationSettings.height - contentColumnInner.spacing * 2
height: parent.height - notificationContent.cachedHeaderHeight
- notificationSettings.height - contentColumnInner.spacing * 2
}
}
}

View File

@@ -80,7 +80,8 @@ Item {
DankActionButton {
id: helpButton
iconName: "info"
iconColor: keyboardController && keyboardController.showKeyboardHints ? Theme.primary : Theme.surfaceText
iconColor: keyboardController
&& keyboardController.showKeyboardHints ? Theme.primary : Theme.surfaceText
buttonSize: 28
visible: keyboardController !== null
anchors.verticalCenter: parent.verticalCenter
@@ -108,13 +109,16 @@ Item {
height: 28
radius: Theme.cornerRadius
visible: NotificationService.notifications.length > 0
color: clearArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g,
Theme.primary.b, 0.12) : Qt.rgba(
color: clearArea.containsMouse ? Qt.rgba(Theme.primary.r,
Theme.primary.g,
Theme.primary.b,
0.12) : Qt.rgba(
Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.3)
border.color: clearArea.containsMouse ? Theme.primary : Qt.rgba(
Theme.outline.r, Theme.outline.g,
Theme.outline.r,
Theme.outline.g,
Theme.outline.b, 0.08)
border.width: 1

View File

@@ -30,28 +30,30 @@ QtObject {
for (var i = 0; i < groups.length; i++) {
var group = groups[i]
var isExpanded = NotificationService.expandedGroups[group.key] || false
var isExpanded = NotificationService.expandedGroups[group.key]
|| false
// Add the group itself
nav.push({
type: "group",
groupIndex: i,
notificationIndex: -1,
groupKey: group.key,
notificationId: ""
"type": "group",
"groupIndex": i,
"notificationIndex": -1,
"groupKey": group.key,
"notificationId": ""
})
// If expanded, add individual notifications
if (isExpanded) {
var notifications = group.notifications || []
for (var j = 0; j < notifications.length; j++) {
var notifId = String(notifications[j]?.notification?.id || "")
var notifId = String(
notifications[j]?.notification?.id || "")
nav.push({
type: "notification",
groupIndex: i,
notificationIndex: j,
groupKey: group.key,
notificationId: notifId
"type": "notification",
"groupIndex": i,
"notificationIndex": j,
"groupKey": group.key,
"notificationId": notifId
})
}
}
@@ -63,17 +65,22 @@ QtObject {
}
function updateSelectedIndexFromId() {
if (!keyboardNavigationActive) return
if (!keyboardNavigationActive)
return
// Find the index that matches our selected ID/key
for (var i = 0; i < flatNavigation.length; i++) {
var item = flatNavigation[i]
if (selectedItemType === "group" && item.type === "group" && item.groupKey === selectedGroupKey) {
if (selectedItemType === "group" && item.type === "group"
&& item.groupKey === selectedGroupKey) {
selectedFlatIndex = i
selectionVersion++ // Trigger UI update
return
} else if (selectedItemType === "notification" && item.type === "notification" && String(item.notificationId) === String(selectedNotificationId)) {
} else if (selectedItemType === "notification"
&& item.type === "notification" && String(
item.notificationId) === String(
selectedNotificationId)) {
selectedFlatIndex = i
selectionVersion++ // Trigger UI update
return
@@ -84,7 +91,8 @@ QtObject {
if (selectedItemType === "notification") {
for (var j = 0; j < flatNavigation.length; j++) {
var groupItem = flatNavigation[j]
if (groupItem.type === "group" && groupItem.groupKey === selectedGroupKey) {
if (groupItem.type === "group"
&& groupItem.groupKey === selectedGroupKey) {
selectedFlatIndex = j
selectedItemType = "group"
selectedNotificationId = ""
@@ -96,7 +104,8 @@ QtObject {
// If still not found, clamp to valid range and update
if (flatNavigation.length > 0) {
selectedFlatIndex = Math.min(selectedFlatIndex, flatNavigation.length - 1)
selectedFlatIndex = Math.min(selectedFlatIndex,
flatNavigation.length - 1)
selectedFlatIndex = Math.max(selectedFlatIndex, 0)
updateSelectedIdFromIndex()
selectionVersion++ // Trigger UI update
@@ -104,7 +113,8 @@ QtObject {
}
function updateSelectedIdFromIndex() {
if (selectedFlatIndex >= 0 && selectedFlatIndex < flatNavigation.length) {
if (selectedFlatIndex >= 0
&& selectedFlatIndex < flatNavigation.length) {
var item = flatNavigation[selectedFlatIndex]
selectedItemType = item.type
selectedGroupKey = item.groupKey
@@ -125,14 +135,16 @@ QtObject {
function selectNext() {
keyboardNavigationActive = true
if (flatNavigation.length === 0) return
if (flatNavigation.length === 0)
return
// Re-enable auto-scrolling when arrow keys are used
if (listView && listView.enableAutoScroll) {
listView.enableAutoScroll()
}
selectedFlatIndex = Math.min(selectedFlatIndex + 1, flatNavigation.length - 1)
selectedFlatIndex = Math.min(selectedFlatIndex + 1,
flatNavigation.length - 1)
updateSelectedIdFromIndex()
selectionVersion++
ensureVisible()
@@ -140,7 +152,8 @@ QtObject {
function selectPrevious() {
keyboardNavigationActive = true
if (flatNavigation.length === 0) return
if (flatNavigation.length === 0)
return
// Re-enable auto-scrolling when arrow keys are used
if (listView && listView.enableAutoScroll) {
@@ -154,18 +167,23 @@ QtObject {
}
function toggleGroupExpanded() {
if (flatNavigation.length === 0 || selectedFlatIndex >= flatNavigation.length) return
if (flatNavigation.length === 0
|| selectedFlatIndex >= flatNavigation.length)
return
const currentItem = flatNavigation[selectedFlatIndex]
const groups = NotificationService.groupedNotifications
const group = groups[currentItem.groupIndex]
if (!group) return
if (!group)
return
// Prevent expanding groups with < 2 notifications
const notificationCount = group.notifications ? group.notifications.length : 0
if (notificationCount < 2) return
if (notificationCount < 2)
return
const wasExpanded = NotificationService.expandedGroups[group.key] || false
const wasExpanded = NotificationService.expandedGroups[group.key]
|| false
const groupIndex = currentItem.groupIndex
isTogglingGroup = true
@@ -175,16 +193,18 @@ QtObject {
// Smart selection after toggle
if (!wasExpanded) {
// Just expanded - move to first notification in the group
for (let i = 0; i < flatNavigation.length; i++) {
if (flatNavigation[i].type === "notification" && flatNavigation[i].groupIndex === groupIndex) {
for (var i = 0; i < flatNavigation.length; i++) {
if (flatNavigation[i].type === "notification"
&& flatNavigation[i].groupIndex === groupIndex) {
selectedFlatIndex = i
break
}
}
} else {
// Just collapsed - stay on the group header
for (let i = 0; i < flatNavigation.length; i++) {
if (flatNavigation[i].type === "group" && flatNavigation[i].groupIndex === groupIndex) {
for (var i = 0; i < flatNavigation.length; i++) {
if (flatNavigation[i].type === "group"
&& flatNavigation[i].groupIndex === groupIndex) {
selectedFlatIndex = i
break
}
@@ -196,12 +216,15 @@ QtObject {
}
function handleEnterKey() {
if (flatNavigation.length === 0 || selectedFlatIndex >= flatNavigation.length) return
if (flatNavigation.length === 0
|| selectedFlatIndex >= flatNavigation.length)
return
const currentItem = flatNavigation[selectedFlatIndex]
const groups = NotificationService.groupedNotifications
const group = groups[currentItem.groupIndex]
if (!group) return
if (!group)
return
if (currentItem.type === "group") {
const notificationCount = group.notifications ? group.notifications.length : 0
@@ -216,19 +239,25 @@ QtObject {
}
function toggleTextExpanded() {
if (flatNavigation.length === 0 || selectedFlatIndex >= flatNavigation.length) return
if (flatNavigation.length === 0
|| selectedFlatIndex >= flatNavigation.length)
return
const currentItem = flatNavigation[selectedFlatIndex]
const groups = NotificationService.groupedNotifications
const group = groups[currentItem.groupIndex]
if (!group) return
if (!group)
return
var messageId = ""
if (currentItem.type === "group") {
messageId = group.latestNotification?.notification?.id + "_desc"
} else if (currentItem.type === "notification" && currentItem.notificationIndex >= 0 && currentItem.notificationIndex < group.notifications.length) {
messageId = group.notifications[currentItem.notificationIndex]?.notification?.id + "_desc"
} else if (currentItem.type === "notification"
&& currentItem.notificationIndex >= 0
&& currentItem.notificationIndex < group.notifications.length) {
messageId = group.notifications[currentItem.notificationIndex]?.notification?.id
+ "_desc"
}
if (messageId) {
@@ -237,45 +266,57 @@ QtObject {
}
function executeAction(actionIndex) {
if (flatNavigation.length === 0 || selectedFlatIndex >= flatNavigation.length) return
if (flatNavigation.length === 0
|| selectedFlatIndex >= flatNavigation.length)
return
const currentItem = flatNavigation[selectedFlatIndex]
const groups = NotificationService.groupedNotifications
const group = groups[currentItem.groupIndex]
if (!group) return
if (!group)
return
var actions = []
if (currentItem.type === "group") {
actions = group.latestNotification?.actions || []
} else if (currentItem.type === "notification" && currentItem.notificationIndex >= 0 && currentItem.notificationIndex < group.notifications.length) {
actions = group.notifications[currentItem.notificationIndex]?.actions || []
} else if (currentItem.type === "notification"
&& currentItem.notificationIndex >= 0
&& currentItem.notificationIndex < group.notifications.length) {
actions = group.notifications[currentItem.notificationIndex]?.actions
|| []
}
if (actionIndex >= 0 && actionIndex < actions.length) {
const action = actions[actionIndex]
if (action.invoke) {
action.invoke()
if (onClose) onClose()
if (onClose)
onClose()
}
}
}
function clearSelected() {
if (flatNavigation.length === 0 || selectedFlatIndex >= flatNavigation.length) return
if (flatNavigation.length === 0
|| selectedFlatIndex >= flatNavigation.length)
return
const currentItem = flatNavigation[selectedFlatIndex]
const groups = NotificationService.groupedNotifications
const group = groups[currentItem.groupIndex]
if (!group) return
if (!group)
return
// Save current state for smart navigation
const currentGroupKey = group.key
const isNotification = currentItem.type === "notification"
const notificationIndex = currentItem.notificationIndex
const totalNotificationsInGroup = group.notifications ? group.notifications.length : 0
const isLastNotificationInGroup = isNotification && totalNotificationsInGroup === 1
const isLastNotificationInList = isNotification && notificationIndex === totalNotificationsInGroup - 1
const isLastNotificationInGroup = isNotification
&& totalNotificationsInGroup === 1
const isLastNotificationInList = isNotification
&& notificationIndex === totalNotificationsInGroup - 1
// Store what to select next BEFORE clearing
let nextTargetType = ""
@@ -286,7 +327,7 @@ QtObject {
NotificationService.dismissGroup(group.key)
// Look for next group
for (let i = currentItem.groupIndex + 1; i < groups.length; i++) {
for (var i = currentItem.groupIndex + 1; i < groups.length; i++) {
nextTargetType = "group"
nextTargetGroupKey = groups[i].key
break
@@ -296,13 +337,12 @@ QtObject {
nextTargetType = "group"
nextTargetGroupKey = groups[currentItem.groupIndex - 1].key
}
} else if (isNotification) {
const notification = group.notifications[notificationIndex]
NotificationService.dismissNotification(notification)
if (isLastNotificationInGroup) {
for (let i = currentItem.groupIndex + 1; i < groups.length; i++) {
for (var i = currentItem.groupIndex + 1; i < groups.length; i++) {
nextTargetType = "group"
nextTargetGroupKey = groups[i].key
break
@@ -340,15 +380,18 @@ QtObject {
updateSelectedIdFromIndex()
} else if (nextTargetGroupKey) {
let found = false
for (let i = 0; i < flatNavigation.length; i++) {
for (var i = 0; i < flatNavigation.length; i++) {
const item = flatNavigation[i]
if (nextTargetType === "group" && item.type === "group" && item.groupKey === nextTargetGroupKey) {
if (nextTargetType === "group" && item.type === "group"
&& item.groupKey === nextTargetGroupKey) {
selectedFlatIndex = i
found = true
break
} else if (nextTargetType === "notification" && item.type === "notification" &&
item.groupKey === nextTargetGroupKey && item.notificationIndex === nextTargetNotificationIndex) {
} else if (nextTargetType === "notification"
&& item.type === "notification"
&& item.groupKey === nextTargetGroupKey
&& item.notificationIndex === nextTargetNotificationIndex) {
selectedFlatIndex = i
found = true
break
@@ -356,12 +399,14 @@ QtObject {
}
if (!found) {
selectedFlatIndex = Math.min(selectedFlatIndex, flatNavigation.length - 1)
selectedFlatIndex = Math.min(selectedFlatIndex,
flatNavigation.length - 1)
}
updateSelectedIdFromIndex()
} else {
selectedFlatIndex = Math.min(selectedFlatIndex, flatNavigation.length - 1)
selectedFlatIndex = Math.min(selectedFlatIndex,
flatNavigation.length - 1)
updateSelectedIdFromIndex()
}
@@ -369,19 +414,24 @@ QtObject {
}
function ensureVisible() {
if (flatNavigation.length === 0 || selectedFlatIndex >= flatNavigation.length || !listView) return
if (flatNavigation.length === 0
|| selectedFlatIndex >= flatNavigation.length || !listView)
return
const currentItem = flatNavigation[selectedFlatIndex]
if (keyboardNavigationActive && currentItem && currentItem.groupIndex >= 0) {
if (keyboardNavigationActive && currentItem
&& currentItem.groupIndex >= 0) {
// Always center the selected item for better visibility
// This ensures the selected item stays in view even when new notifications arrive
if (currentItem.type === "notification") {
// For individual notifications, center on the group but bias towards the notification
listView.positionViewAtIndex(currentItem.groupIndex, ListView.Center)
listView.positionViewAtIndex(currentItem.groupIndex,
ListView.Center)
} else {
// For group headers, center on the group
listView.positionViewAtIndex(currentItem.groupIndex, ListView.Center)
listView.positionViewAtIndex(currentItem.groupIndex,
ListView.Center)
}
// Force immediate update
@@ -390,7 +440,8 @@ QtObject {
}
function handleKey(event) {
if ((event.key === Qt.Key_Delete || event.key === Qt.Key_Backspace) && (event.modifiers & Qt.ShiftModifier)) {
if ((event.key === Qt.Key_Delete || event.key === Qt.Key_Backspace)
&& (event.modifiers & Qt.ShiftModifier)) {
NotificationService.clearAllNotifications()
rebuildFlatNavigation()
if (flatNavigation.length === 0) {
@@ -412,7 +463,8 @@ QtObject {
keyboardNavigationActive = false
event.accepted = true
} else {
if (onClose) onClose()
if (onClose)
onClose()
event.accepted = true
}
} else if (event.key === Qt.Key_Down || event.key === 16777237) {
@@ -462,13 +514,15 @@ QtObject {
if (event.key === Qt.Key_Space) {
toggleGroupExpanded()
event.accepted = true
} else if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
} else if (event.key === Qt.Key_Return
|| event.key === Qt.Key_Enter) {
handleEnterKey()
event.accepted = true
} else if (event.key === Qt.Key_E) {
toggleTextExpanded()
event.accepted = true
} else if (event.key === Qt.Key_Delete || event.key === Qt.Key_Backspace) {
} else if (event.key === Qt.Key_Delete
|| event.key === Qt.Key_Backspace) {
clearSelected()
event.accepted = true
} else if (event.key >= Qt.Key_1 && event.key <= Qt.Key_9) {
@@ -486,10 +540,19 @@ QtObject {
// Get current selection info for UI
function getCurrentSelection() {
if (!keyboardNavigationActive || selectedFlatIndex < 0 || selectedFlatIndex >= flatNavigation.length) {
return { type: "", groupIndex: -1, notificationIndex: -1 }
if (!keyboardNavigationActive || selectedFlatIndex < 0
|| selectedFlatIndex >= flatNavigation.length) {
return {
"type": "",
"groupIndex": -1,
"notificationIndex": -1
}
}
const result = flatNavigation[selectedFlatIndex] || {
"type": "",
"groupIndex": -1,
"notificationIndex": -1
}
const result = flatNavigation[selectedFlatIndex] || { type: "", groupIndex: -1, notificationIndex: -1 }
return result
}
}

View File

@@ -9,7 +9,8 @@ Rectangle {
height: 80
radius: Theme.cornerRadius
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: Theme.primary
border.width: 2
opacity: showHints ? 1 : 0
@@ -39,7 +40,6 @@ Rectangle {
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
}
}
Behavior on opacity {
@@ -47,7 +47,5 @@ Rectangle {
duration: Theme.shortDuration
easing.type: Theme.standardEasing
}
}
}

View File

@@ -15,8 +15,10 @@ Rectangle {
visible: expanded
clip: true
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g, Theme.surfaceContainer.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.1)
color: Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g,
Theme.surfaceContainer.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.1)
border.width: 1
Behavior on height {
@@ -37,34 +39,60 @@ Rectangle {
}
}
readonly property var timeoutOptions: [
{ text: "Never", value: 0 },
{ text: "1 second", value: 1000 },
{ text: "3 seconds", value: 3000 },
{ text: "5 seconds", value: 5000 },
{ text: "8 seconds", value: 8000 },
{ text: "10 seconds", value: 10000 },
{ text: "15 seconds", value: 15000 },
{ text: "30 seconds", value: 30000 },
{ text: "1 minute", value: 60000 },
{ text: "2 minutes", value: 120000 },
{ text: "5 minutes", value: 300000 },
{ text: "10 minutes", value: 600000 }
]
readonly property var timeoutOptions: [{
"text": "Never",
"value": 0
}, {
"text": "1 second",
"value": 1000
}, {
"text": "3 seconds",
"value": 3000
}, {
"text": "5 seconds",
"value": 5000
}, {
"text": "8 seconds",
"value": 8000
}, {
"text": "10 seconds",
"value": 10000
}, {
"text": "15 seconds",
"value": 15000
}, {
"text": "30 seconds",
"value": 30000
}, {
"text": "1 minute",
"value": 60000
}, {
"text": "2 minutes",
"value": 120000
}, {
"text": "5 minutes",
"value": 300000
}, {
"text": "10 minutes",
"value": 600000
}]
function getTimeoutText(value) {
if (value === undefined || value === null || isNaN(value)) {
return "5 seconds"
}
for (let i = 0; i < timeoutOptions.length; i++) {
for (var i = 0; i < timeoutOptions.length; i++) {
if (timeoutOptions[i].value === value) {
return timeoutOptions[i].text
}
}
if (value === 0) return "Never"
if (value < 1000) return value + "ms"
if (value < 60000) return Math.round(value / 1000) + " seconds"
if (value === 0)
return "Never"
if (value < 1000)
return value + "ms"
if (value < 60000)
return Math.round(value / 1000) + " seconds"
return Math.round(value / 60000) + " minutes"
}
@@ -111,14 +139,16 @@ Rectangle {
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
checked: SessionData.doNotDisturb
onToggled: SessionData.setDoNotDisturb(!SessionData.doNotDisturb)
onToggled: SessionData.setDoNotDisturb(
!SessionData.doNotDisturb)
}
}
Rectangle {
width: parent.width
height: 1
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.1)
color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.1)
}
StyledText {
@@ -135,9 +165,10 @@ Rectangle {
currentValue: getTimeoutText(SettingsData.notificationTimeoutLow)
options: timeoutOptions.map(opt => opt.text)
onValueChanged: value => {
for (let i = 0; i < timeoutOptions.length; i++) {
for (var i = 0; i < timeoutOptions.length; i++) {
if (timeoutOptions[i].text === value) {
SettingsData.setNotificationTimeoutLow(timeoutOptions[i].value)
SettingsData.setNotificationTimeoutLow(
timeoutOptions[i].value)
break
}
}
@@ -151,9 +182,10 @@ Rectangle {
currentValue: getTimeoutText(SettingsData.notificationTimeoutNormal)
options: timeoutOptions.map(opt => opt.text)
onValueChanged: value => {
for (let i = 0; i < timeoutOptions.length; i++) {
for (var i = 0; i < timeoutOptions.length; i++) {
if (timeoutOptions[i].text === value) {
SettingsData.setNotificationTimeoutNormal(timeoutOptions[i].value)
SettingsData.setNotificationTimeoutNormal(
timeoutOptions[i].value)
break
}
}
@@ -164,12 +196,14 @@ Rectangle {
width: parent.width
text: "Critical Priority"
description: "Timeout for critical priority notifications"
currentValue: getTimeoutText(SettingsData.notificationTimeoutCritical)
currentValue: getTimeoutText(
SettingsData.notificationTimeoutCritical)
options: timeoutOptions.map(opt => opt.text)
onValueChanged: value => {
for (let i = 0; i < timeoutOptions.length; i++) {
for (var i = 0; i < timeoutOptions.length; i++) {
if (timeoutOptions[i].text === value) {
SettingsData.setNotificationTimeoutCritical(timeoutOptions[i].value)
SettingsData.setNotificationTimeoutCritical(
timeoutOptions[i].value)
break
}
}
@@ -179,7 +213,8 @@ Rectangle {
Rectangle {
width: parent.width
height: 1
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.1)
color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.1)
}
Item {
@@ -220,7 +255,8 @@ Rectangle {
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.notificationOverlayEnabled
onToggled: (toggled) => SettingsData.setNotificationOverlayEnabled(toggled)
onToggled: toggled => SettingsData.setNotificationOverlayEnabled(
toggled)
}
}
}

View File

@@ -31,7 +31,8 @@ PanelWindow {
exitAnim.restart()
exitWatchdog.restart()
if (NotificationService.removeFromVisibleNotifications)
NotificationService.removeFromVisibleNotifications(win.notificationData)
NotificationService.removeFromVisibleNotifications(
win.notificationData)
}
function forceExit() {
@@ -59,12 +60,13 @@ PanelWindow {
visible: hasValidData
WlrLayershell.layer: {
if (!notificationData) return WlrLayershell.Top
if (!notificationData)
return WlrLayershell.Top
SettingsData.notificationOverlayEnabled
const shouldUseOverlay = (SettingsData.notificationOverlayEnabled) ||
(notificationData.urgency === NotificationUrgency.Critical)
const shouldUseOverlay = (SettingsData.notificationOverlayEnabled)
|| (notificationData.urgency === NotificationUrgency.Critical)
return shouldUseOverlay ? WlrLayershell.Overlay : WlrLayershell.Top
}
@@ -136,13 +138,15 @@ PanelWindow {
radius: Theme.cornerRadius
color: Theme.popupBackground()
border.color: notificationData && notificationData.urgency
=== NotificationUrgency.Critical ? Qt.rgba(Theme.primary.r,
=== NotificationUrgency.Critical ? Qt.rgba(
Theme.primary.r,
Theme.primary.g,
Theme.primary.b,
0.3) : Qt.rgba(
Theme.outline.r,
Theme.outline.g,
Theme.outline.b, 0.08)
Theme.outline.b,
0.08)
border.width: notificationData
&& notificationData.urgency === NotificationUrgency.Critical ? 2 : 1
clip: true
@@ -231,7 +235,8 @@ PanelWindow {
width: 55
height: 55
radius: 27.5
color: Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.1)
color: Qt.rgba(Theme.primary.r, Theme.primary.g,
Theme.primary.b, 0.1)
border.color: "transparent"
border.width: 0
anchors.left: parent.left
@@ -252,8 +257,9 @@ PanelWindow {
if (notificationData.appIcon) {
const appIcon = notificationData.appIcon
if (appIcon.startsWith("file://") || appIcon.startsWith(
"http://") || appIcon.startsWith("https://"))
if (appIcon.startsWith("file://")
|| appIcon.startsWith("http://")
|| appIcon.startsWith("https://"))
return appIcon
return Quickshell.iconPath(appIcon, "")
@@ -266,7 +272,8 @@ PanelWindow {
StyledText {
anchors.centerIn: parent
visible: !parent.hasNotificationImage
&& (!notificationData || !notificationData.appIcon
&& (!notificationData
|| !notificationData.appIcon
|| notificationData.appIcon === "")
text: {
const appName = notificationData
@@ -307,8 +314,10 @@ PanelWindow {
if (!notificationData)
return ""
const appName = notificationData.appName || ""
const timeStr = notificationData.timeStr || ""
const appName = notificationData.appName
|| ""
const timeStr = notificationData.timeStr
|| ""
if (timeStr.length > 0)
return appName + " • " + timeStr
else
@@ -322,7 +331,8 @@ PanelWindow {
}
StyledText {
text: notificationData ? (notificationData.summary || "") : ""
text: notificationData ? (notificationData.summary
|| "") : ""
color: Theme.surfaceText
font.pixelSize: Theme.fontSizeMedium
font.weight: Font.Medium
@@ -333,7 +343,8 @@ PanelWindow {
}
StyledText {
text: notificationData ? (notificationData.htmlBody || "") : ""
text: notificationData ? (notificationData.htmlBody
|| "") : ""
color: Theme.surfaceVariantText
font.pixelSize: Theme.fontSizeSmall
width: parent.width
@@ -343,7 +354,8 @@ PanelWindow {
visible: text.length > 0
linkColor: Theme.primary
onLinkActivated: link => {
return Qt.openUrlExternally(link)
return Qt.openUrlExternally(
link)
}
MouseArea {
@@ -383,7 +395,8 @@ PanelWindow {
z: 20
Repeater {
model: notificationData ? (notificationData.actions || []) : []
model: notificationData ? (notificationData.actions
|| []) : []
Rectangle {
property bool isHovered: false
@@ -391,8 +404,10 @@ PanelWindow {
width: Math.max(actionText.implicitWidth + 12, 50)
height: 24
radius: 4
color: isHovered ? Qt.rgba(Theme.primary.r, Theme.primary.g,
Theme.primary.b, 0.1) : "transparent"
color: isHovered ? Qt.rgba(Theme.primary.r,
Theme.primary.g,
Theme.primary.b,
0.1) : "transparent"
StyledText {
id: actionText
@@ -459,7 +474,8 @@ PanelWindow {
onExited: clearButton.isHovered = false
onClicked: {
if (notificationData && !win.exiting)
NotificationService.dismissNotification(notificationData)
NotificationService.dismissNotification(
notificationData)
}
}
}

View File

@@ -103,8 +103,8 @@ QtObject {
if (!_isValidWindow(p))
continue
if (p.notificationData && newWrappers.indexOf(p.notificationData) === -1
&& !p.exiting) {
if (p.notificationData && newWrappers.indexOf(
p.notificationData) === -1 && !p.exiting) {
p.notificationData.removedByLimit = true
p.notificationData.popup = false
}
@@ -151,7 +151,8 @@ QtObject {
function _active() {
return popupWindows.filter(p => {
return _isValidWindow(p) && p.notificationData
return _isValidWindow(p)
&& p.notificationData
&& p.notificationData.popup && !p.exiting
})
}
@@ -173,14 +174,19 @@ QtObject {
return
const expiredCandidates = activeWindows.filter(p => {
if (!p.notificationData || !p.notificationData.notification) return false
if (p.notificationData.notification.urgency === 2) return false
if (!p.notificationData
|| !p.notificationData.notification)
return false
if (p.notificationData.notification.urgency === 2)
return false
const timeoutMs = p.notificationData.timer ? p.notificationData.timer.interval : 5000
if (timeoutMs === 0) return false
if (timeoutMs === 0)
return false
return !p.notificationData.timer.running
}).sort((a, b) => b.screenY - a.screenY)
}).sort(
(a, b) => b.screenY - a.screenY)
if (expiredCandidates.length > 0) {
const toRemove = expiredCandidates[0]
@@ -192,15 +198,19 @@ QtObject {
}
const timeoutCandidates = activeWindows.filter(p => {
if (!p.notificationData || !p.notificationData.notification) return false
if (p.notificationData.notification.urgency === 2) return false
if (!p.notificationData
|| !p.notificationData.notification)
return false
if (p.notificationData.notification.urgency === 2)
return false
const timeoutMs = p.notificationData.timer ? p.notificationData.timer.interval : 5000
return timeoutMs > 0
}).sort((a, b) => {
const aTimeout = a.notificationData.timer ? a.notificationData.timer.interval : 5000
const bTimeout = b.notificationData.timer ? b.notificationData.timer.interval : 5000
if (aTimeout !== bTimeout) return aTimeout - bTimeout
if (aTimeout !== bTimeout)
return aTimeout - bTimeout
return b.screenY - a.screenY
})

View File

@@ -123,12 +123,14 @@ Column {
width: parent.width - 80
height: 6
radius: 3
color: Qt.rgba(Theme.outline.r, Theme.outline.g,
color: Qt.rgba(Theme.outline.r,
Theme.outline.g,
Theme.outline.b, 0.2)
anchors.verticalCenter: parent.verticalCenter
Rectangle {
width: parent.width * Math.min(1, modelData / 100)
width: parent.width * Math.min(
1, modelData / 100)
height: parent.height
radius: parent.radius
color: {
@@ -151,7 +153,8 @@ Column {
}
StyledText {
text: modelData ? modelData.toFixed(0) + "%" : "0%"
text: modelData ? modelData.toFixed(
0) + "%" : "0%"
font.pixelSize: Theme.fontSizeSmall
font.weight: Font.Medium
color: Theme.surfaceText
@@ -215,7 +218,8 @@ Column {
width: parent.width
height: 16
radius: 8
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
Rectangle {
width: DgopService.totalMemoryKB
@@ -296,7 +300,8 @@ Column {
width: parent.width
height: 16
radius: 8
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
Rectangle {
width: DgopService.totalSwapKB
@@ -306,7 +311,8 @@ Column {
radius: parent.radius
color: {
if (!DgopService.totalSwapKB)
return Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
return Qt.rgba(Theme.surfaceText.r,
Theme.surfaceText.g,
Theme.surfaceText.b, 0.3)
const usage = DgopService.usedSwapKB / DgopService.totalSwapKB
@@ -329,8 +335,7 @@ Column {
StyledText {
text: DgopService.totalSwapKB
> 0 ? ((DgopService.usedSwapKB
/ DgopService.totalSwapKB) * 100).toFixed(
> 0 ? ((DgopService.usedSwapKB / DgopService.totalSwapKB) * 100).toFixed(
1) + "% used" : "Not available"
font.pixelSize: Theme.fontSizeSmall
font.weight: Font.Bold

View File

@@ -102,7 +102,8 @@ Popup {
onClicked: {
if (processContextMenu.processData)
Quickshell.execDetached(
["wl-copy", processContextMenu.processData.pid.toString()])
["wl-copy", processContextMenu.processData.pid.toString(
)])
processContextMenu.close()
}
@@ -113,7 +114,8 @@ Popup {
width: parent.width
height: 28
radius: Theme.cornerRadius
color: copyNameArea.containsMouse ? Qt.rgba(Theme.primary.r,
color: copyNameArea.containsMouse ? Qt.rgba(
Theme.primary.r,
Theme.primary.g,
Theme.primary.b,
0.12) : "transparent"
@@ -155,7 +157,8 @@ Popup {
anchors.centerIn: parent
width: parent.width
height: 1
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
}
}
@@ -163,7 +166,8 @@ Popup {
width: parent.width
height: 28
radius: Theme.cornerRadius
color: killArea.containsMouse ? Qt.rgba(Theme.error.r, Theme.error.g,
color: killArea.containsMouse ? Qt.rgba(Theme.error.r,
Theme.error.g,
Theme.error.b,
0.12) : "transparent"
enabled: processContextMenu.processData
@@ -176,7 +180,8 @@ Popup {
text: "Kill Process"
font.pixelSize: Theme.fontSizeSmall
color: parent.enabled ? (killArea.containsMouse ? Theme.error : Theme.surfaceText) : Qt.rgba(
Theme.surfaceText.r, Theme.surfaceText.g,
Theme.surfaceText.r,
Theme.surfaceText.g,
Theme.surfaceText.b, 0.5)
font.weight: Font.Normal
}
@@ -191,7 +196,8 @@ Popup {
onClicked: {
if (processContextMenu.processData)
Quickshell.execDetached(
["kill", processContextMenu.processData.pid.toString()])
["kill", processContextMenu.processData.pid.toString(
)])
processContextMenu.close()
}
@@ -202,7 +208,8 @@ Popup {
width: parent.width
height: 28
radius: Theme.cornerRadius
color: forceKillArea.containsMouse ? Qt.rgba(Theme.error.r,
color: forceKillArea.containsMouse ? Qt.rgba(
Theme.error.r,
Theme.error.g,
Theme.error.b,
0.12) : "transparent"
@@ -217,7 +224,8 @@ Popup {
text: "Force Kill Process"
font.pixelSize: Theme.fontSizeSmall
color: parent.enabled ? (forceKillArea.containsMouse ? Theme.error : Theme.surfaceText) : Qt.rgba(
Theme.surfaceText.r, Theme.surfaceText.g,
Theme.surfaceText.r,
Theme.surfaceText.g,
Theme.surfaceText.b, 0.5)
font.weight: Font.Normal
}

View File

@@ -33,8 +33,8 @@ Rectangle {
if (mouse.button === Qt.RightButton) {
if (process && process.pid > 0 && contextMenu) {
contextMenu.processData = process
let globalPos = processMouseArea.mapToGlobal(mouse.x,
mouse.y)
let globalPos = processMouseArea.mapToGlobal(
mouse.x, mouse.y)
let localPos = contextMenu.parent ? contextMenu.parent.mapFromGlobal(
globalPos.x,
globalPos.y) : globalPos
@@ -96,7 +96,8 @@ Rectangle {
radius: Theme.cornerRadius
color: {
if (process && process.cpu > 80)
return Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.12)
return Qt.rgba(Theme.error.r, Theme.error.g,
Theme.error.b, 0.12)
if (process && process.cpu > 50)
return Qt.rgba(Theme.warning.r, Theme.warning.g,
@@ -135,7 +136,8 @@ Rectangle {
radius: Theme.cornerRadius
color: {
if (process && process.memoryKB > 1024 * 1024)
return Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.12)
return Qt.rgba(Theme.error.r, Theme.error.g,
Theme.error.b, 0.12)
if (process && process.memoryKB > 512 * 1024)
return Qt.rgba(Theme.warning.r, Theme.warning.g,

View File

@@ -96,7 +96,8 @@ DankPopout {
Layout.fillWidth: true
height: systemOverview.height + Theme.spacingM * 2
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
color: Qt.rgba(Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.2)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.08)
@@ -114,7 +115,8 @@ DankPopout {
Layout.fillWidth: true
Layout.fillHeight: true
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
color: Qt.rgba(Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.1)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.05)

View File

@@ -28,9 +28,11 @@ Column {
height: 20
color: {
if (DgopService.currentSort === "name") {
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12)
return Qt.rgba(Theme.primary.r, Theme.primary.g,
Theme.primary.b, 0.12)
}
return processHeaderArea.containsMouse ? Qt.rgba(Theme.surfaceText.r,
return processHeaderArea.containsMouse ? Qt.rgba(
Theme.surfaceText.r,
Theme.surfaceText.g,
Theme.surfaceText.b,
0.08) : "transparent"
@@ -73,9 +75,11 @@ Column {
height: 20
color: {
if (DgopService.currentSort === "cpu") {
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12)
return Qt.rgba(Theme.primary.r, Theme.primary.g,
Theme.primary.b, 0.12)
}
return cpuHeaderArea.containsMouse ? Qt.rgba(Theme.surfaceText.r,
return cpuHeaderArea.containsMouse ? Qt.rgba(
Theme.surfaceText.r,
Theme.surfaceText.g,
Theme.surfaceText.b,
0.08) : "transparent"
@@ -118,9 +122,11 @@ Column {
height: 20
color: {
if (DgopService.currentSort === "memory") {
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12)
return Qt.rgba(Theme.primary.r, Theme.primary.g,
Theme.primary.b, 0.12)
}
return memoryHeaderArea.containsMouse ? Qt.rgba(Theme.surfaceText.r,
return memoryHeaderArea.containsMouse ? Qt.rgba(
Theme.surfaceText.r,
Theme.surfaceText.g,
Theme.surfaceText.b,
0.08) : "transparent"
@@ -163,9 +169,11 @@ Column {
height: 20
color: {
if (DgopService.currentSort === "pid") {
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12)
return Qt.rgba(Theme.primary.r, Theme.primary.g,
Theme.primary.b, 0.12)
}
return pidHeaderArea.containsMouse ? Qt.rgba(Theme.surfaceText.r,
return pidHeaderArea.containsMouse ? Qt.rgba(
Theme.surfaceText.r,
Theme.surfaceText.g,
Theme.surfaceText.b,
0.08) : "transparent"
@@ -230,6 +238,7 @@ Column {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
// ! TODO - we lost this with dgop
}
}

View File

@@ -8,10 +8,10 @@ Row {
width: parent.width
spacing: Theme.spacingM
Component.onCompleted: {
DgopService.addRef(["cpu", "memory", "system"]);
DgopService.addRef(["cpu", "memory", "system"])
}
Component.onDestruction: {
DgopService.removeRef(["cpu", "memory", "system"]);
DgopService.removeRef(["cpu", "memory", "system"])
}
Rectangle {
@@ -20,13 +20,22 @@ Row {
radius: Theme.cornerRadius
color: {
if (DgopService.sortBy === "cpu")
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.16);
return Qt.rgba(Theme.primary.r, Theme.primary.g,
Theme.primary.b, 0.16)
else if (cpuCardMouseArea.containsMouse)
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12);
return Qt.rgba(Theme.primary.r, Theme.primary.g,
Theme.primary.b, 0.12)
else
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.08);
return Qt.rgba(Theme.primary.r, Theme.primary.g,
Theme.primary.b, 0.08)
}
border.color: DgopService.sortBy === "cpu" ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.4) : Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.2)
border.color: DgopService.sortBy === "cpu" ? Qt.rgba(Theme.primary.r,
Theme.primary.g,
Theme.primary.b,
0.4) : Qt.rgba(
Theme.primary.r,
Theme.primary.g,
Theme.primary.b, 0.2)
border.width: DgopService.sortBy === "cpu" ? 2 : 1
MouseArea {
@@ -57,7 +66,8 @@ Row {
StyledText {
text: {
if (DgopService.cpuUsage === undefined || DgopService.cpuUsage === null)
if (DgopService.cpuUsage === undefined
|| DgopService.cpuUsage === null)
return "--%"
return DgopService.cpuUsage.toFixed(1) + "%"
}
@@ -71,32 +81,34 @@ Row {
Rectangle {
width: 1
height: 20
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.3)
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
Theme.surfaceText.b, 0.3)
anchors.verticalCenter: parent.verticalCenter
}
StyledText {
text: {
if (DgopService.cpuTemperature === undefined || DgopService.cpuTemperature === null || DgopService.cpuTemperature <= 0)
return "--°";
if (DgopService.cpuTemperature === undefined
|| DgopService.cpuTemperature === null
|| DgopService.cpuTemperature <= 0)
return "--°"
return Math.round(DgopService.cpuTemperature) + "°";
return Math.round(DgopService.cpuTemperature) + "°"
}
font.pixelSize: Theme.fontSizeMedium
font.family: SettingsData.monoFontFamily
font.weight: Font.Medium
color: {
if (DgopService.cpuTemperature > 80)
return Theme.error;
return Theme.error
if (DgopService.cpuTemperature > 60)
return Theme.warning;
return Theme.warning
return Theme.surfaceText;
return Theme.surfaceText
}
anchors.verticalCenter: parent.verticalCenter
}
}
StyledText {
@@ -106,23 +118,19 @@ Row {
color: Theme.surfaceText
opacity: 0.7
}
}
Behavior on color {
ColorAnimation {
duration: Theme.shortDuration
}
}
Behavior on border.color {
ColorAnimation {
duration: Theme.shortDuration
}
}
}
Rectangle {
@@ -131,13 +139,24 @@ Row {
radius: Theme.cornerRadius
color: {
if (DgopService.sortBy === "memory")
return Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.16);
return Qt.rgba(Theme.primary.r, Theme.primary.g,
Theme.primary.b, 0.16)
else if (memoryCardMouseArea.containsMouse)
return Qt.rgba(Theme.secondary.r, Theme.secondary.g, Theme.secondary.b, 0.12);
return Qt.rgba(Theme.secondary.r, Theme.secondary.g,
Theme.secondary.b, 0.12)
else
return Qt.rgba(Theme.secondary.r, Theme.secondary.g, Theme.secondary.b, 0.08);
return Qt.rgba(Theme.secondary.r, Theme.secondary.g,
Theme.secondary.b, 0.08)
}
border.color: DgopService.sortBy === "memory" ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.4) : Qt.rgba(Theme.secondary.r, Theme.secondary.g, Theme.secondary.b, 0.2)
border.color: DgopService.sortBy === "memory" ? Qt.rgba(
Theme.primary.r,
Theme.primary.g,
Theme.primary.b,
0.4) : Qt.rgba(
Theme.secondary.r,
Theme.secondary.g,
Theme.secondary.b,
0.2)
border.width: DgopService.sortBy === "memory" ? 2 : 1
MouseArea {
@@ -167,7 +186,8 @@ Row {
spacing: Theme.spacingS
StyledText {
text: DgopService.formatSystemMemory(DgopService.usedMemoryKB)
text: DgopService.formatSystemMemory(
DgopService.usedMemoryKB)
font.pixelSize: Theme.fontSizeLarge
font.family: SettingsData.monoFontFamily
font.weight: Font.Bold
@@ -178,13 +198,15 @@ Row {
Rectangle {
width: 1
height: 20
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.3)
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
Theme.surfaceText.b, 0.3)
anchors.verticalCenter: parent.verticalCenter
visible: DgopService.totalSwapKB > 0
}
StyledText {
text: DgopService.totalSwapKB > 0 ? DgopService.formatSystemMemory(DgopService.usedSwapKB) : ""
text: DgopService.totalSwapKB > 0 ? DgopService.formatSystemMemory(
DgopService.usedSwapKB) : ""
font.pixelSize: Theme.fontSizeMedium
font.family: SettingsData.monoFontFamily
font.weight: Font.Medium
@@ -192,38 +214,35 @@ Row {
anchors.verticalCenter: parent.verticalCenter
visible: DgopService.totalSwapKB > 0
}
}
StyledText {
text: {
if (DgopService.totalSwapKB > 0)
return "of " + DgopService.formatSystemMemory(DgopService.totalMemoryKB) + " + swap";
return "of " + DgopService.formatSystemMemory(
DgopService.totalMemoryKB) + " + swap"
return "of " + DgopService.formatSystemMemory(DgopService.totalMemoryKB);
return "of " + DgopService.formatSystemMemory(
DgopService.totalMemoryKB)
}
font.pixelSize: Theme.fontSizeSmall
font.family: SettingsData.monoFontFamily
color: Theme.surfaceText
opacity: 0.7
}
}
Behavior on color {
ColorAnimation {
duration: Theme.shortDuration
}
}
Behavior on border.color {
ColorAnimation {
duration: Theme.shortDuration
}
}
}
Rectangle {
@@ -231,48 +250,74 @@ Row {
height: 80
radius: Theme.cornerRadius
color: {
if (!DgopService.availableGpus || DgopService.availableGpus.length === 0) {
if (gpuCardMouseArea.containsMouse && DgopService.availableGpus.length > 1)
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.16);
if (!DgopService.availableGpus
|| DgopService.availableGpus.length === 0) {
if (gpuCardMouseArea.containsMouse
&& DgopService.availableGpus.length > 1)
return Qt.rgba(Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.16)
else
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.08);
return Qt.rgba(Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.08)
}
var gpu = DgopService.availableGpus[Math.min(SessionData.selectedGpuIndex, DgopService.availableGpus.length - 1)];
var vendor = gpu.vendor.toLowerCase();
var gpu = DgopService.availableGpus[Math.min(
SessionData.selectedGpuIndex,
DgopService.availableGpus.length - 1)]
var vendor = gpu.vendor.toLowerCase()
if (vendor.includes("nvidia")) {
if (gpuCardMouseArea.containsMouse && DgopService.availableGpus.length > 1)
return Qt.rgba(Theme.success.r, Theme.success.g, Theme.success.b, 0.2);
if (gpuCardMouseArea.containsMouse
&& DgopService.availableGpus.length > 1)
return Qt.rgba(Theme.success.r, Theme.success.g,
Theme.success.b, 0.2)
else
return Qt.rgba(Theme.success.r, Theme.success.g, Theme.success.b, 0.12);
return Qt.rgba(Theme.success.r, Theme.success.g,
Theme.success.b, 0.12)
} else if (vendor.includes("amd")) {
if (gpuCardMouseArea.containsMouse && DgopService.availableGpus.length > 1)
return Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.2);
if (gpuCardMouseArea.containsMouse
&& DgopService.availableGpus.length > 1)
return Qt.rgba(Theme.error.r, Theme.error.g,
Theme.error.b, 0.2)
else
return Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.12);
return Qt.rgba(Theme.error.r, Theme.error.g,
Theme.error.b, 0.12)
} else if (vendor.includes("intel")) {
if (gpuCardMouseArea.containsMouse && DgopService.availableGpus.length > 1)
return Qt.rgba(Theme.info.r, Theme.info.g, Theme.info.b, 0.2);
if (gpuCardMouseArea.containsMouse
&& DgopService.availableGpus.length > 1)
return Qt.rgba(Theme.info.r, Theme.info.g,
Theme.info.b, 0.2)
else
return Qt.rgba(Theme.info.r, Theme.info.g, Theme.info.b, 0.12);
return Qt.rgba(Theme.info.r, Theme.info.g,
Theme.info.b, 0.12)
}
if (gpuCardMouseArea.containsMouse && DgopService.availableGpus.length > 1)
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.16);
if (gpuCardMouseArea.containsMouse
&& DgopService.availableGpus.length > 1)
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.16)
else
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.08);
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.08)
}
border.color: {
if (!DgopService.availableGpus || DgopService.availableGpus.length === 0)
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.2);
if (!DgopService.availableGpus
|| DgopService.availableGpus.length === 0)
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.2)
var gpu = DgopService.availableGpus[Math.min(SessionData.selectedGpuIndex, DgopService.availableGpus.length - 1)];
var vendor = gpu.vendor.toLowerCase();
var gpu = DgopService.availableGpus[Math.min(
SessionData.selectedGpuIndex,
DgopService.availableGpus.length - 1)]
var vendor = gpu.vendor.toLowerCase()
if (vendor.includes("nvidia"))
return Qt.rgba(Theme.success.r, Theme.success.g, Theme.success.b, 0.3);
return Qt.rgba(Theme.success.r, Theme.success.g,
Theme.success.b, 0.3)
else if (vendor.includes("amd"))
return Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.3);
return Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.3)
else if (vendor.includes("intel"))
return Qt.rgba(Theme.info.r, Theme.info.g, Theme.info.b, 0.3);
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.2);
return Qt.rgba(Theme.info.r, Theme.info.g, Theme.info.b, 0.3)
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.2)
}
border.width: 1
@@ -282,15 +327,17 @@ Row {
anchors.fill: parent
hoverEnabled: true
acceptedButtons: Qt.LeftButton | Qt.RightButton
cursorShape: DgopService.availableGpus.length > 1 ? Qt.PointingHandCursor : Qt.ArrowCursor
onClicked: (mouse) => {
cursorShape: DgopService.availableGpus.length
> 1 ? Qt.PointingHandCursor : Qt.ArrowCursor
onClicked: mouse => {
if (mouse.button === Qt.LeftButton) {
if (DgopService.availableGpus.length > 1) {
var nextIndex = (SessionData.selectedGpuIndex + 1) % DgopService.availableGpus.length;
SessionData.setSelectedGpuIndex(nextIndex);
var nextIndex = (SessionData.selectedGpuIndex + 1)
% DgopService.availableGpus.length
SessionData.setSelectedGpuIndex(nextIndex)
}
} else if (mouse.button === Qt.RightButton) {
gpuContextMenu.popup();
gpuContextMenu.popup()
}
}
}
@@ -311,52 +358,69 @@ Row {
StyledText {
text: {
if (!DgopService.availableGpus || DgopService.availableGpus.length === 0)
return "No GPU";
if (!DgopService.availableGpus
|| DgopService.availableGpus.length === 0)
return "No GPU"
var gpu = DgopService.availableGpus[Math.min(SessionData.selectedGpuIndex, DgopService.availableGpus.length - 1)];
var gpu = DgopService.availableGpus[Math.min(
SessionData.selectedGpuIndex,
DgopService.availableGpus.length - 1)]
// Check if temperature monitoring is enabled for this GPU
var tempEnabled = SessionData.enabledGpuPciIds && SessionData.enabledGpuPciIds.indexOf(gpu.pciId) !== -1;
var temp = gpu.temperature;
var hasTemp = tempEnabled && temp !== undefined && temp !== null && temp !== 0;
var tempEnabled = SessionData.enabledGpuPciIds
&& SessionData.enabledGpuPciIds.indexOf(
gpu.pciId) !== -1
var temp = gpu.temperature
var hasTemp = tempEnabled && temp !== undefined
&& temp !== null && temp !== 0
if (hasTemp)
return Math.round(temp) + "°";
return Math.round(temp) + "°"
else
return gpu.vendor;
return gpu.vendor
}
font.pixelSize: Theme.fontSizeLarge
font.family: SettingsData.monoFontFamily
font.weight: Font.Bold
color: {
if (!DgopService.availableGpus || DgopService.availableGpus.length === 0)
return Theme.surfaceText;
if (!DgopService.availableGpus
|| DgopService.availableGpus.length === 0)
return Theme.surfaceText
var gpu = DgopService.availableGpus[Math.min(SessionData.selectedGpuIndex, DgopService.availableGpus.length - 1)];
var tempEnabled = SessionData.enabledGpuPciIds && SessionData.enabledGpuPciIds.indexOf(gpu.pciId) !== -1;
var temp = gpu.temperature || 0;
var gpu = DgopService.availableGpus[Math.min(
SessionData.selectedGpuIndex,
DgopService.availableGpus.length - 1)]
var tempEnabled = SessionData.enabledGpuPciIds
&& SessionData.enabledGpuPciIds.indexOf(
gpu.pciId) !== -1
var temp = gpu.temperature || 0
if (tempEnabled && temp > 80)
return Theme.error;
return Theme.error
if (tempEnabled && temp > 60)
return Theme.warning;
return Theme.warning
return Theme.surfaceText;
return Theme.surfaceText
}
}
StyledText {
text: {
if (!DgopService.availableGpus || DgopService.availableGpus.length === 0)
return "No GPUs detected";
if (!DgopService.availableGpus
|| DgopService.availableGpus.length === 0)
return "No GPUs detected"
var gpu = DgopService.availableGpus[Math.min(SessionData.selectedGpuIndex, DgopService.availableGpus.length - 1)];
var tempEnabled = SessionData.enabledGpuPciIds && SessionData.enabledGpuPciIds.indexOf(gpu.pciId) !== -1;
var temp = gpu.temperature;
var hasTemp = tempEnabled && temp !== undefined && temp !== null && temp !== 0;
var gpu = DgopService.availableGpus[Math.min(
SessionData.selectedGpuIndex,
DgopService.availableGpus.length - 1)]
var tempEnabled = SessionData.enabledGpuPciIds
&& SessionData.enabledGpuPciIds.indexOf(
gpu.pciId) !== -1
var temp = gpu.temperature
var hasTemp = tempEnabled && temp !== undefined
&& temp !== null && temp !== 0
if (hasTemp)
return gpu.vendor + " " + gpu.displayName;
return gpu.vendor + " " + gpu.displayName
else
return gpu.displayName;
return gpu.displayName
}
font.pixelSize: Theme.fontSizeSmall
font.family: SettingsData.monoFontFamily
@@ -366,7 +430,6 @@ Row {
elide: Text.ElideRight
maximumLineCount: 1
}
}
Menu {
@@ -376,24 +439,34 @@ Row {
text: "Enable GPU Temperature"
checkable: true
checked: {
if (!DgopService.availableGpus || DgopService.availableGpus.length === 0) {
if (!DgopService.availableGpus
|| DgopService.availableGpus.length === 0) {
return false
}
var gpu = DgopService.availableGpus[Math.min(SessionData.selectedGpuIndex, DgopService.availableGpus.length - 1)]
if (!gpu.pciId) return false
var gpu = DgopService.availableGpus[Math.min(
SessionData.selectedGpuIndex,
DgopService.availableGpus.length - 1)]
if (!gpu.pciId)
return false
return SessionData.enabledGpuPciIds ? SessionData.enabledGpuPciIds.indexOf(gpu.pciId) !== -1 : false
return SessionData.enabledGpuPciIds ? SessionData.enabledGpuPciIds.indexOf(
gpu.pciId) !== -1 : false
}
onTriggered: {
if (!DgopService.availableGpus || DgopService.availableGpus.length === 0) {
if (!DgopService.availableGpus
|| DgopService.availableGpus.length === 0) {
return
}
var gpu = DgopService.availableGpus[Math.min(SessionData.selectedGpuIndex, DgopService.availableGpus.length - 1)]
if (!gpu.pciId) return
var gpu = DgopService.availableGpus[Math.min(
SessionData.selectedGpuIndex,
DgopService.availableGpus.length - 1)]
if (!gpu.pciId)
return
var enabledIds = SessionData.enabledGpuPciIds ? SessionData.enabledGpuPciIds.slice() : []
var enabledIds = SessionData.enabledGpuPciIds ? SessionData.enabledGpuPciIds.slice(
) : []
var index = enabledIds.indexOf(gpu.pciId)
if (checked && index === -1) {
@@ -413,9 +486,6 @@ Row {
ColorAnimation {
duration: Theme.shortDuration
}
}
}
}

View File

@@ -65,16 +65,19 @@ ScrollView {
+ " • " + DgopService.kernelVersion
font.pixelSize: Theme.fontSizeMedium
font.family: SettingsData.monoFontFamily
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
color: Qt.rgba(Theme.surfaceText.r,
Theme.surfaceText.g,
Theme.surfaceText.b, 0.7)
verticalAlignment: Text.AlignVCenter
}
StyledText {
text: "Up " + UserInfoService.uptime + " • Boot: " + DgopService.bootTime
text: "Up " + UserInfoService.uptime + " • Boot: "
+ DgopService.bootTime
font.pixelSize: Theme.fontSizeSmall
font.family: SettingsData.monoFontFamily
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
color: Qt.rgba(Theme.surfaceText.r,
Theme.surfaceText.g,
Theme.surfaceText.b, 0.6)
verticalAlignment: Text.AlignVCenter
}
@@ -85,7 +88,8 @@ ScrollView {
+ DgopService.threadCount + " threads"
font.pixelSize: Theme.fontSizeSmall
font.family: SettingsData.monoFontFamily
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
color: Qt.rgba(Theme.surfaceText.r,
Theme.surfaceText.g,
Theme.surfaceText.b, 0.6)
verticalAlignment: Text.AlignVCenter
}
@@ -95,7 +99,8 @@ ScrollView {
Rectangle {
width: parent.width
height: 1
color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
}
Row {
@@ -160,7 +165,8 @@ ScrollView {
text: DgopService.motherboard
font.pixelSize: Theme.fontSizeSmall
font.family: SettingsData.monoFontFamily
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
color: Qt.rgba(Theme.surfaceText.r,
Theme.surfaceText.g,
Theme.surfaceText.b, 0.8)
width: parent.width
elide: Text.ElideRight
@@ -173,7 +179,8 @@ ScrollView {
text: "BIOS " + DgopService.biosVersion
font.pixelSize: Theme.fontSizeSmall
font.family: SettingsData.monoFontFamily
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
color: Qt.rgba(Theme.surfaceText.r,
Theme.surfaceText.g,
Theme.surfaceText.b, 0.7)
width: parent.width
elide: Text.ElideRight
@@ -185,7 +192,8 @@ ScrollView {
DgopService.totalMemoryKB) + " RAM"
font.pixelSize: Theme.fontSizeSmall
font.family: SettingsData.monoFontFamily
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
color: Qt.rgba(Theme.surfaceText.r,
Theme.surfaceText.g,
Theme.surfaceText.b, 0.8)
width: parent.width
elide: Text.ElideRight
@@ -199,19 +207,28 @@ ScrollView {
height: gpuColumn.implicitHeight + Theme.spacingL
radius: Theme.cornerRadius
color: {
var baseColor = Qt.rgba(Theme.surfaceContainerHigh.r,
var baseColor = Qt.rgba(
Theme.surfaceContainerHigh.r,
Theme.surfaceContainerHigh.g,
Theme.surfaceContainerHigh.b, 0.4)
var hoverColor = Qt.rgba(Theme.surfaceContainerHigh.r,
var hoverColor = Qt.rgba(
Theme.surfaceContainerHigh.r,
Theme.surfaceContainerHigh.g,
Theme.surfaceContainerHigh.b, 0.6)
if (!DgopService.availableGpus || DgopService.availableGpus.length === 0) {
return gpuCardMouseArea.containsMouse && DgopService.availableGpus.length > 1 ? hoverColor : baseColor
if (!DgopService.availableGpus
|| DgopService.availableGpus.length === 0) {
return gpuCardMouseArea.containsMouse
&& DgopService.availableGpus.length
> 1 ? hoverColor : baseColor
}
var gpu = DgopService.availableGpus[Math.min(SessionData.selectedGpuIndex, DgopService.availableGpus.length - 1)]
var vendor = gpu.fullName.split(' ')[0].toLowerCase()
var gpu = DgopService.availableGpus[Math.min(
SessionData.selectedGpuIndex,
DgopService.availableGpus.length
- 1)]
var vendor = gpu.fullName.split(
' ')[0].toLowerCase()
var tintColor
if (vendor.includes("nvidia")) {
@@ -221,37 +238,56 @@ ScrollView {
} else if (vendor.includes("intel")) {
tintColor = Theme.info
} else {
return gpuCardMouseArea.containsMouse && DgopService.availableGpus.length > 1 ? hoverColor : baseColor
return gpuCardMouseArea.containsMouse
&& DgopService.availableGpus.length
> 1 ? hoverColor : baseColor
}
if (gpuCardMouseArea.containsMouse && DgopService.availableGpus.length > 1) {
return Qt.rgba((hoverColor.r + tintColor.r * 0.1) / 1.1,
if (gpuCardMouseArea.containsMouse
&& DgopService.availableGpus.length > 1) {
return Qt.rgba(
(hoverColor.r + tintColor.r * 0.1) / 1.1,
(hoverColor.g + tintColor.g * 0.1) / 1.1,
(hoverColor.b + tintColor.b * 0.1) / 1.1, 0.6)
(hoverColor.b + tintColor.b * 0.1) / 1.1,
0.6)
} else {
return Qt.rgba((baseColor.r + tintColor.r * 0.08) / 1.08,
return Qt.rgba(
(baseColor.r + tintColor.r * 0.08) / 1.08,
(baseColor.g + tintColor.g * 0.08) / 1.08,
(baseColor.b + tintColor.b * 0.08) / 1.08, 0.4)
(baseColor.b + tintColor.b * 0.08) / 1.08,
0.4)
}
}
border.width: 1
border.color: {
if (!DgopService.availableGpus || DgopService.availableGpus.length === 0) {
return Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.1)
if (!DgopService.availableGpus
|| DgopService.availableGpus.length === 0) {
return Qt.rgba(Theme.outline.r,
Theme.outline.g,
Theme.outline.b, 0.1)
}
var gpu = DgopService.availableGpus[Math.min(SessionData.selectedGpuIndex, DgopService.availableGpus.length - 1)]
var vendor = gpu.fullName.split(' ')[0].toLowerCase()
var gpu = DgopService.availableGpus[Math.min(
SessionData.selectedGpuIndex,
DgopService.availableGpus.length
- 1)]
var vendor = gpu.fullName.split(
' ')[0].toLowerCase()
if (vendor.includes("nvidia")) {
return Qt.rgba(Theme.success.r, Theme.success.g, Theme.success.b, 0.3)
return Qt.rgba(Theme.success.r,
Theme.success.g,
Theme.success.b, 0.3)
} else if (vendor.includes("amd")) {
return Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.3)
return Qt.rgba(Theme.error.r, Theme.error.g,
Theme.error.b, 0.3)
} else if (vendor.includes("intel")) {
return Qt.rgba(Theme.info.r, Theme.info.g, Theme.info.b, 0.3)
return Qt.rgba(Theme.info.r, Theme.info.g,
Theme.info.b, 0.3)
}
return Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.1)
return Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.1)
}
MouseArea {
@@ -306,9 +342,7 @@ ScrollView {
return "No GPUs detected"
}
var gpu = DgopService.availableGpus[Math.min(
SessionData.selectedGpuIndex,
DgopService.availableGpus.length
- 1)]
SessionData.selectedGpuIndex, DgopService.availableGpus.length - 1)]
return gpu.fullName
}
font.pixelSize: Theme.fontSizeSmall
@@ -328,14 +362,13 @@ ScrollView {
return "Device: N/A"
}
var gpu = DgopService.availableGpus[Math.min(
SessionData.selectedGpuIndex,
DgopService.availableGpus.length
- 1)]
SessionData.selectedGpuIndex, DgopService.availableGpus.length - 1)]
return "Device: " + gpu.pciId
}
font.pixelSize: Theme.fontSizeSmall
font.family: SettingsData.monoFontFamily
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
color: Qt.rgba(Theme.surfaceText.r,
Theme.surfaceText.g,
Theme.surfaceText.b, 0.8)
width: parent.width
elide: Text.ElideRight
@@ -350,14 +383,13 @@ ScrollView {
return "Driver: N/A"
}
var gpu = DgopService.availableGpus[Math.min(
SessionData.selectedGpuIndex,
DgopService.availableGpus.length
- 1)]
SessionData.selectedGpuIndex, DgopService.availableGpus.length - 1)]
return "Driver: " + gpu.driver
}
font.pixelSize: Theme.fontSizeSmall
font.family: SettingsData.monoFontFamily
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
color: Qt.rgba(Theme.surfaceText.r,
Theme.surfaceText.g,
Theme.surfaceText.b, 0.8)
width: parent.width
elide: Text.ElideRight
@@ -371,11 +403,10 @@ ScrollView {
return "Temp: --°"
}
var gpu = DgopService.availableGpus[Math.min(
SessionData.selectedGpuIndex,
DgopService.availableGpus.length
- 1)]
SessionData.selectedGpuIndex, DgopService.availableGpus.length - 1)]
var temp = gpu.temperature
return "Temp: " + ((temp === undefined || temp === null
return "Temp: " + ((temp === undefined
|| temp === null
|| temp === 0) ? "--°" : Math.round(
temp) + "°C")
}
@@ -384,19 +415,19 @@ ScrollView {
color: {
if (!DgopService.availableGpus
|| DgopService.availableGpus.length === 0) {
return Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
return Qt.rgba(Theme.surfaceText.r,
Theme.surfaceText.g,
Theme.surfaceText.b, 0.7)
}
var gpu = DgopService.availableGpus[Math.min(
SessionData.selectedGpuIndex,
DgopService.availableGpus.length
- 1)]
SessionData.selectedGpuIndex, DgopService.availableGpus.length - 1)]
var temp = gpu.temperature || 0
if (temp > 80)
return Theme.error
if (temp > 60)
return Theme.warning
return Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g,
return Qt.rgba(Theme.surfaceText.r,
Theme.surfaceText.g,
Theme.surfaceText.b, 0.7)
}
width: parent.width
@@ -538,7 +569,8 @@ ScrollView {
width: parent.width
height: 24
radius: Theme.cornerRadius
color: diskMouseArea.containsMouse ? Qt.rgba(Theme.surfaceText.r,
color: diskMouseArea.containsMouse ? Qt.rgba(
Theme.surfaceText.r,
Theme.surfaceText.g,
Theme.surfaceText.b,
0.04) : "transparent"
@@ -614,7 +646,8 @@ ScrollView {
font.pixelSize: Theme.fontSizeSmall
font.family: SettingsData.monoFontFamily
color: {
const percent = parseInt(modelData.percent)
const percent = parseInt(
modelData.percent)
if (percent > 90)
return Theme.error

View File

@@ -24,8 +24,10 @@ Item {
width: parent.width
height: asciiSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
border.width: 1
Column {
@@ -63,7 +65,7 @@ Item {
text: "A desktop shell built with <a href=\"https://quickshell.org\">Quickshell</a>"
font.pixelSize: Theme.fontSizeMedium
linkColor: Theme.primary
onLinkActivated: (url) => Qt.openUrlExternally(url)
onLinkActivated: url => Qt.openUrlExternally(url)
color: Theme.surfaceVariantText
horizontalAlignment: Text.AlignHCenter
width: parent.width
@@ -76,9 +78,7 @@ Item {
propagateComposedEvents: true
}
}
}
}
// Project Information
@@ -86,8 +86,10 @@ Item {
width: parent.width
height: projectSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
border.width: 1
Column {
@@ -115,7 +117,6 @@ Item {
color: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
}
}
StyledText {
@@ -124,7 +125,7 @@ Item {
`
font.pixelSize: Theme.fontSizeMedium
linkColor: Theme.primary
onLinkActivated: (url) => Qt.openUrlExternally(url)
onLinkActivated: url => Qt.openUrlExternally(url)
color: Theme.surfaceVariantText
width: parent.width
wrapMode: Text.WordWrap
@@ -137,7 +138,6 @@ Item {
}
}
}
}
// Technical Details
@@ -145,8 +145,10 @@ Item {
width: parent.width
height: techSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
border.width: 1
Column {
@@ -174,7 +176,6 @@ Item {
color: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
}
}
Grid {
@@ -234,7 +235,7 @@ Item {
font.pixelSize: Theme.fontSizeMedium
color: Theme.surfaceVariantText
linkColor: Theme.primary
onLinkActivated: (url) => Qt.openUrlExternally(url)
onLinkActivated: url => Qt.openUrlExternally(url)
MouseArea {
anchors.fill: parent
@@ -256,7 +257,7 @@ Item {
font.pixelSize: Theme.fontSizeMedium
color: Theme.surfaceVariantText
linkColor: Theme.primary
onLinkActivated: (url) => Qt.openUrlExternally(url)
onLinkActivated: url => Qt.openUrlExternally(url)
MouseArea {
anchors.fill: parent
@@ -265,15 +266,9 @@ Item {
propagateComposedEvents: true
}
}
}
}
}
}
}
}

View File

@@ -19,7 +19,6 @@ Item {
width: parent.width
spacing: Theme.spacingXL
// Enable Dock
StyledRect {
width: parent.width
@@ -50,7 +49,8 @@ Item {
}
Column {
width: parent.width - Theme.iconSize - Theme.spacingM - enableToggle.width - Theme.spacingM
width: parent.width - Theme.iconSize - Theme.spacingM
- enableToggle.width - Theme.spacingM
spacing: Theme.spacingXS
anchors.verticalCenter: parent.verticalCenter
@@ -68,7 +68,6 @@ Item {
wrapMode: Text.WordWrap
width: parent.width
}
}
DankToggle {
@@ -80,11 +79,8 @@ Item {
SettingsData.setShowDock(checked)
}
}
}
}
}
// Auto-hide Dock
@@ -119,7 +115,8 @@ Item {
}
Column {
width: parent.width - Theme.iconSize - Theme.spacingM - autoHideToggle.width - Theme.spacingM
width: parent.width - Theme.iconSize - Theme.spacingM
- autoHideToggle.width - Theme.spacingM
spacing: Theme.spacingXS
anchors.verticalCenter: parent.verticalCenter
@@ -137,7 +134,6 @@ Item {
wrapMode: Text.WordWrap
width: parent.width
}
}
DankToggle {
@@ -149,9 +145,7 @@ Item {
SettingsData.setDockAutoHide(checked)
}
}
}
}
Behavior on opacity {
@@ -160,7 +154,6 @@ Item {
easing.type: Theme.emphasizedEasing
}
}
}
// Dock Transparency Section
@@ -225,8 +218,6 @@ Item {
}
}
}
}
}
}

View File

@@ -17,56 +17,75 @@ Item {
property bool fontsEnumerated: false
function enumerateFonts() {
var fonts = ["Default"];
var availableFonts = Qt.fontFamilies();
var rootFamilies = [];
var seenFamilies = new Set();
var fonts = ["Default"]
var availableFonts = Qt.fontFamilies()
var rootFamilies = []
var seenFamilies = new Set()
for (var i = 0; i < availableFonts.length; i++) {
var fontName = availableFonts[i];
var fontName = availableFonts[i]
if (fontName.startsWith("."))
continue;
continue
if (fontName === SettingsData.defaultFontFamily)
continue;
continue
var rootName = fontName.replace(/ (Thin|Extra Light|Light|Regular|Medium|Semi Bold|Demi Bold|Bold|Extra Bold|Black|Heavy)$/i, "").replace(/ (Italic|Oblique|Condensed|Extended|Narrow|Wide)$/i, "").replace(/ (UI|Display|Text|Mono|Sans|Serif)$/i, function(match, suffix) {
return match;
}).trim();
var rootName = fontName.replace(
/ (Thin|Extra Light|Light|Regular|Medium|Semi Bold|Demi Bold|Bold|Extra Bold|Black|Heavy)$/i,
"").replace(
/ (Italic|Oblique|Condensed|Extended|Narrow|Wide)$/i,
"").replace(/ (UI|Display|Text|Mono|Sans|Serif)$/i,
function (match, suffix) {
return match
}).trim()
if (!seenFamilies.has(rootName) && rootName !== "") {
seenFamilies.add(rootName);
rootFamilies.push(rootName);
seenFamilies.add(rootName)
rootFamilies.push(rootName)
}
}
cachedFontFamilies = fonts.concat(rootFamilies.sort());
var monoFonts = ["Default"];
var monoFamilies = [];
var seenMonoFamilies = new Set();
cachedFontFamilies = fonts.concat(rootFamilies.sort())
var monoFonts = ["Default"]
var monoFamilies = []
var seenMonoFamilies = new Set()
for (var j = 0; j < availableFonts.length; j++) {
var fontName2 = availableFonts[j];
var fontName2 = availableFonts[j]
if (fontName2.startsWith("."))
continue;
continue
if (fontName2 === SettingsData.defaultMonoFontFamily)
continue;
continue
var lowerName = fontName2.toLowerCase();
if (lowerName.includes("mono") || lowerName.includes("code") || lowerName.includes("console") || lowerName.includes("terminal") || lowerName.includes("courier") || lowerName.includes("dejavu sans mono") || lowerName.includes("jetbrains") || lowerName.includes("fira") || lowerName.includes("hack") || lowerName.includes("source code") || lowerName.includes("ubuntu mono") || lowerName.includes("cascadia")) {
var rootName2 = fontName2.replace(/ (Thin|Extra Light|Light|Regular|Medium|Semi Bold|Demi Bold|Bold|Extra Bold|Black|Heavy)$/i, "").replace(/ (Italic|Oblique|Condensed|Extended|Narrow|Wide)$/i, "").trim();
var lowerName = fontName2.toLowerCase()
if (lowerName.includes("mono") || lowerName.includes(
"code") || lowerName.includes(
"console") || lowerName.includes(
"terminal") || lowerName.includes(
"courier") || lowerName.includes(
"dejavu sans mono") || lowerName.includes(
"jetbrains") || lowerName.includes(
"fira") || lowerName.includes(
"hack") || lowerName.includes(
"source code") || lowerName.includes(
"ubuntu mono") || lowerName.includes("cascadia")) {
var rootName2 = fontName2.replace(
/ (Thin|Extra Light|Light|Regular|Medium|Semi Bold|Demi Bold|Bold|Extra Bold|Black|Heavy)$/i,
"").replace(
/ (Italic|Oblique|Condensed|Extended|Narrow|Wide)$/i,
"").trim()
if (!seenMonoFamilies.has(rootName2) && rootName2 !== "") {
seenMonoFamilies.add(rootName2);
monoFamilies.push(rootName2);
seenMonoFamilies.add(rootName2)
monoFamilies.push(rootName2)
}
}
}
cachedMonoFamilies = monoFonts.concat(monoFamilies.sort());
cachedMonoFamilies = monoFonts.concat(monoFamilies.sort())
}
Component.onCompleted: {
// Access WallpaperCyclingService to ensure it's initialized
WallpaperCyclingService.cyclingActive;
WallpaperCyclingService.cyclingActive
if (!fontsEnumerated) {
enumerateFonts();
fontsEnumerated = true;
enumerateFonts()
fontsEnumerated = true
}
}
@@ -83,14 +102,15 @@ Item {
width: parent.width
spacing: Theme.spacingXL
// Wallpaper Section
StyledRect {
width: parent.width
height: wallpaperSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
border.width: 1
Column {
@@ -118,7 +138,6 @@ Item {
color: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
}
}
Row {
@@ -148,7 +167,6 @@ Item {
maskThresholdMin: 0.5
maskSpreadAtMin: 1
}
}
Rectangle {
@@ -169,7 +187,6 @@ Item {
color: Theme.surfaceVariantText
visible: SessionData.wallpaperPath === ""
}
}
Column {
@@ -178,7 +195,9 @@ Item {
anchors.verticalCenter: parent.verticalCenter
StyledText {
text: SessionData.wallpaperPath ? SessionData.wallpaperPath.split('/').pop() : "No wallpaper selected"
text: SessionData.wallpaperPath ? SessionData.wallpaperPath.split(
'/').pop(
) : "No wallpaper selected"
font.pixelSize: Theme.fontSizeLarge
color: Theme.surfaceText
elide: Text.ElideMiddle
@@ -222,7 +241,6 @@ Item {
font.pixelSize: Theme.fontSizeSmall
anchors.verticalCenter: parent.verticalCenter
}
}
MouseArea {
@@ -230,13 +248,12 @@ Item {
cursorShape: Qt.PointingHandCursor
onClicked: {
if (parentModal) {
parentModal.allowFocusOverride = true;
parentModal.shouldHaveFocus = false;
parentModal.allowFocusOverride = true
parentModal.shouldHaveFocus = false
}
wallpaperBrowser.open();
wallpaperBrowser.open()
}
}
}
StyledRect {
@@ -263,7 +280,6 @@ Item {
font.pixelSize: Theme.fontSizeSmall
anchors.verticalCenter: parent.verticalCenter
}
}
MouseArea {
@@ -271,16 +287,12 @@ Item {
enabled: SessionData.wallpaperPath !== ""
cursorShape: enabled ? Qt.PointingHandCursor : Qt.ArrowCursor
onClicked: {
SessionData.setWallpaper("");
SessionData.setWallpaper("")
}
}
}
}
}
}
// Wallpaper Cycling Section - Full Width
@@ -309,7 +321,8 @@ Item {
}
Column {
width: parent.width - Theme.iconSize - Theme.spacingM - controlsRow.width - Theme.spacingM
width: parent.width - Theme.iconSize - Theme.spacingM
- controlsRow.width - Theme.spacingM
spacing: Theme.spacingXS
anchors.verticalCenter: parent.verticalCenter
@@ -326,7 +339,6 @@ Item {
color: Theme.surfaceVariantText
width: parent.width
}
}
Row {
@@ -339,7 +351,11 @@ Item {
width: 60
height: 32
radius: Theme.cornerRadius
color: prevButtonArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.8) : Theme.primary
color: prevButtonArea.containsMouse ? Qt.rgba(
Theme.primary.r,
Theme.primary.g,
Theme.primary.b,
0.8) : Theme.primary
opacity: SessionData.wallpaperPath ? 1 : 0.5
Row {
@@ -359,7 +375,6 @@ Item {
font.pixelSize: Theme.fontSizeSmall
anchors.verticalCenter: parent.verticalCenter
}
}
MouseArea {
@@ -370,17 +385,20 @@ Item {
cursorShape: enabled ? Qt.PointingHandCursor : Qt.ArrowCursor
hoverEnabled: true
onClicked: {
WallpaperCyclingService.cyclePrevManually();
WallpaperCyclingService.cyclePrevManually()
}
}
}
StyledRect {
width: 60
height: 32
radius: Theme.cornerRadius
color: nextButtonArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.8) : Theme.primary
color: nextButtonArea.containsMouse ? Qt.rgba(
Theme.primary.r,
Theme.primary.g,
Theme.primary.b,
0.8) : Theme.primary
opacity: SessionData.wallpaperPath ? 1 : 0.5
Row {
@@ -400,7 +418,6 @@ Item {
font.pixelSize: Theme.fontSizeSmall
anchors.verticalCenter: parent.verticalCenter
}
}
MouseArea {
@@ -411,10 +428,9 @@ Item {
cursorShape: enabled ? Qt.PointingHandCursor : Qt.ArrowCursor
hoverEnabled: true
onClicked: {
WallpaperCyclingService.cycleNextManually();
WallpaperCyclingService.cycleNextManually()
}
}
}
DankToggle {
@@ -422,13 +438,12 @@ Item {
anchors.verticalCenter: parent.verticalCenter
checked: SessionData.wallpaperCyclingEnabled
onToggled: (toggled) => {
return SessionData.setWallpaperCyclingEnabled(toggled);
onToggled: toggled => {
return SessionData.setWallpaperCyclingEnabled(
toggled)
}
}
}
}
// Cycling mode and settings
@@ -459,12 +474,13 @@ Item {
}, {
"text": "Time"
}]
currentIndex: SessionData.wallpaperCyclingMode === "time" ? 1 : 0
onTabClicked: (index) => {
SessionData.setWallpaperCyclingMode(index === 1 ? "time" : "interval");
currentIndex: SessionData.wallpaperCyclingMode
=== "time" ? 1 : 0
onTabClicked: index => {
SessionData.setWallpaperCyclingMode(
index === 1 ? "time" : "interval")
}
}
}
// Interval settings
@@ -478,15 +494,17 @@ Item {
description: "How often to change wallpaper"
options: intervalOptions
currentValue: {
const currentSeconds = SessionData.wallpaperCyclingInterval;
const index = intervalValues.indexOf(currentSeconds);
return index >= 0 ? intervalOptions[index] : "5 minutes";
const currentSeconds = SessionData.wallpaperCyclingInterval
const index = intervalValues.indexOf(
currentSeconds)
return index >= 0 ? intervalOptions[index] : "5 minutes"
}
onValueChanged: (value) => {
const index = intervalOptions.indexOf(value);
onValueChanged: value => {
const index = intervalOptions.indexOf(
value)
if (index >= 0)
SessionData.setWallpaperCyclingInterval(intervalValues[index]);
SessionData.setWallpaperCyclingInterval(
intervalValues[index])
}
}
@@ -512,25 +530,28 @@ Item {
topPadding: Theme.spacingS
bottomPadding: Theme.spacingS
onAccepted: {
var isValid = /^([0-1][0-9]|2[0-3]):[0-5][0-9]$/.test(text);
var isValid = /^([0-1][0-9]|2[0-3]):[0-5][0-9]$/.test(
text)
if (isValid)
SessionData.setWallpaperCyclingTime(text);
SessionData.setWallpaperCyclingTime(
text)
else
text = SessionData.wallpaperCyclingTime;
text = SessionData.wallpaperCyclingTime
}
onEditingFinished: {
var isValid = /^([0-1][0-9]|2[0-3]):[0-5][0-9]$/.test(text);
var isValid = /^([0-1][0-9]|2[0-3]):[0-5][0-9]$/.test(
text)
if (isValid)
SessionData.setWallpaperCyclingTime(text);
SessionData.setWallpaperCyclingTime(
text)
else
text = SessionData.wallpaperCyclingTime;
text = SessionData.wallpaperCyclingTime
}
anchors.verticalCenter: parent.verticalCenter
validator: RegularExpressionValidator {
regularExpression: /^([0-1][0-9]|2[0-3]):[0-5][0-9]$/
}
}
StyledText {
@@ -539,15 +560,10 @@ Item {
color: Theme.surfaceVariantText
anchors.verticalCenter: parent.verticalCenter
}
}
}
}
}
}
// Dynamic Theme Section
@@ -555,8 +571,10 @@ Item {
width: parent.width
height: dynamicThemeSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
border.width: 1
Column {
@@ -578,7 +596,8 @@ Item {
}
Column {
width: parent.width - Theme.iconSize - Theme.spacingM - toggle.width - Theme.spacingM
width: parent.width - Theme.iconSize - Theme.spacingM
- toggle.width - Theme.spacingM
spacing: Theme.spacingXS
anchors.verticalCenter: parent.verticalCenter
@@ -596,7 +615,6 @@ Item {
wrapMode: Text.WordWrap
width: parent.width
}
}
DankToggle {
@@ -605,14 +623,13 @@ Item {
anchors.verticalCenter: parent.verticalCenter
checked: Theme.isDynamicTheme
enabled: ToastService.wallpaperErrorStatus !== "matugen_missing"
onToggled: (toggled) => {
onToggled: toggled => {
if (toggled)
Theme.switchTheme(10, true);
Theme.switchTheme(10, true)
else
Theme.switchTheme(0);
Theme.switchTheme(0)
}
}
}
StyledText {
@@ -623,9 +640,7 @@ Item {
width: parent.width
leftPadding: Theme.iconSize + Theme.spacingM
}
}
}
// Display Settings
@@ -633,8 +648,10 @@ Item {
width: parent.width
height: displaySection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
border.width: 1
Column {
@@ -662,7 +679,6 @@ Item {
color: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
}
}
DankToggle {
@@ -672,23 +688,22 @@ Item {
text: "Night Mode"
description: "Apply warm color temperature to reduce eye strain"
checked: BrightnessService.nightModeActive
onToggled: (checked) => {
onToggled: checked => {
if (checked !== BrightnessService.nightModeActive) {
if (checked)
BrightnessService.enableNightMode();
BrightnessService.enableNightMode()
else
BrightnessService.disableNightMode();
BrightnessService.disableNightMode()
}
}
Connections {
function onNightModeActiveChanged() {
nightModeToggle.checked = BrightnessService.nightModeActive;
nightModeToggle.checked = BrightnessService.nightModeActive
}
target: BrightnessService
}
}
DankDropdown {
@@ -699,15 +714,17 @@ Item {
opacity: !BrightnessService.nightModeActive ? 1 : 0.6
currentValue: SessionData.nightModeTemperature + "K"
options: {
var temps = [];
var temps = []
for (var i = 2500; i <= 6000; i += 500) {
temps.push(i + "K");
temps.push(i + "K")
}
return temps;
return temps
}
onValueChanged: (value) => {
var temp = parseInt(value.replace("K", ""));
SessionData.setNightModeTemperature(temp);
onValueChanged: value => {
var temp = parseInt(
value.replace("K", ""))
SessionData.setNightModeTemperature(
temp)
}
}
@@ -716,15 +733,13 @@ Item {
text: "Light Mode"
description: "Use light theme instead of dark theme"
checked: SessionData.isLightMode
onToggled: (checked) => {
SessionData.setLightMode(checked);
Theme.isLightMode = checked;
PortalService.setLightMode(checked);
onToggled: checked => {
SessionData.setLightMode(checked)
Theme.isLightMode = checked
PortalService.setLightMode(checked)
}
}
}
}
// Font Settings
@@ -732,8 +747,10 @@ Item {
width: parent.width
height: fontSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
border.width: 1
Column {
@@ -761,7 +778,6 @@ Item {
color: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
}
}
DankDropdown {
@@ -770,19 +786,20 @@ Item {
description: "Select system font family"
currentValue: {
if (SettingsData.fontFamily === SettingsData.defaultFontFamily)
return "Default";
return "Default"
else
return SettingsData.fontFamily || "Default";
return SettingsData.fontFamily || "Default"
}
enableFuzzySearch: true
popupWidthOffset: 100
maxPopupHeight: 400
options: cachedFontFamilies
onValueChanged: (value) => {
onValueChanged: value => {
if (value.startsWith("Default"))
SettingsData.setFontFamily(SettingsData.defaultFontFamily);
SettingsData.setFontFamily(
SettingsData.defaultFontFamily)
else
SettingsData.setFontFamily(value);
SettingsData.setFontFamily(value)
}
}
@@ -793,63 +810,63 @@ Item {
currentValue: {
switch (SettingsData.fontWeight) {
case Font.Thin:
return "Thin";
return "Thin"
case Font.ExtraLight:
return "Extra Light";
return "Extra Light"
case Font.Light:
return "Light";
return "Light"
case Font.Normal:
return "Regular";
return "Regular"
case Font.Medium:
return "Medium";
return "Medium"
case Font.DemiBold:
return "Demi Bold";
return "Demi Bold"
case Font.Bold:
return "Bold";
return "Bold"
case Font.ExtraBold:
return "Extra Bold";
return "Extra Bold"
case Font.Black:
return "Black";
return "Black"
default:
return "Regular";
return "Regular"
}
}
options: ["Thin", "Extra Light", "Light", "Regular", "Medium", "Demi Bold", "Bold", "Extra Bold", "Black"]
onValueChanged: (value) => {
var weight;
onValueChanged: value => {
var weight
switch (value) {
case "Thin":
weight = Font.Thin;
break;
weight = Font.Thin
break
case "Extra Light":
weight = Font.ExtraLight;
break;
weight = Font.ExtraLight
break
case "Light":
weight = Font.Light;
break;
weight = Font.Light
break
case "Regular":
weight = Font.Normal;
break;
weight = Font.Normal
break
case "Medium":
weight = Font.Medium;
break;
weight = Font.Medium
break
case "Demi Bold":
weight = Font.DemiBold;
break;
weight = Font.DemiBold
break
case "Bold":
weight = Font.Bold;
break;
weight = Font.Bold
break
case "Extra Bold":
weight = Font.ExtraBold;
break;
weight = Font.ExtraBold
break
case "Black":
weight = Font.Black;
break;
weight = Font.Black
break
default:
weight = Font.Normal;
break;
weight = Font.Normal
break
}
SettingsData.setFontWeight(weight);
SettingsData.setFontWeight(weight)
}
}
@@ -859,24 +876,24 @@ Item {
description: "Select monospace font for process list and technical displays"
currentValue: {
if (SettingsData.monoFontFamily === SettingsData.defaultMonoFontFamily)
return "Default";
return "Default"
return SettingsData.monoFontFamily || "Default";
return SettingsData.monoFontFamily || "Default"
}
enableFuzzySearch: true
popupWidthOffset: 100
maxPopupHeight: 400
options: cachedMonoFamilies
onValueChanged: (value) => {
onValueChanged: value => {
if (value === "Default")
SettingsData.setMonoFontFamily(SettingsData.defaultMonoFontFamily);
SettingsData.setMonoFontFamily(
SettingsData.defaultMonoFontFamily)
else
SettingsData.setMonoFontFamily(value);
SettingsData.setMonoFontFamily(
value)
}
}
}
}
// Corner Radius
@@ -884,8 +901,10 @@ Item {
width: parent.width
height: cornerRadiusSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
border.width: 1
Column {
@@ -934,19 +953,17 @@ Item {
maximum: 32
unit: ""
showValue: true
onSliderValueChanged: (newValue) => {
SettingsData.setCornerRadius(newValue);
onSliderValueChanged: newValue => {
SettingsData.setCornerRadius(
newValue)
}
}
}
}
}
}
}
FileBrowserModal {
id: wallpaperBrowser
@@ -954,18 +971,17 @@ Item {
browserIcon: "wallpaper"
browserType: "wallpaper"
fileExtensions: ["*.jpg", "*.jpeg", "*.png", "*.bmp", "*.gif", "*.webp"]
onFileSelected: (path) => {
SessionData.setWallpaper(path);
close();
onFileSelected: path => {
SessionData.setWallpaper(path)
close()
}
onDialogClosed: {
if (parentModal) {
parentModal.allowFocusOverride = false;
parentModal.allowFocusOverride = false
parentModal.shouldHaveFocus = Qt.binding(() => {
return parentModal.shouldBeVisible;
});
return parentModal.shouldBeVisible
})
}
}
}
}

View File

@@ -34,8 +34,10 @@ Item {
property var rankedAppsModel: {
var apps = []
for (var appId in (AppUsageHistoryData.appUsageRanking || {})) {
var appData = (AppUsageHistoryData.appUsageRanking || {})[appId]
for (var appId in (AppUsageHistoryData.appUsageRanking
|| {})) {
var appData = (AppUsageHistoryData.appUsageRanking
|| {})[appId]
apps.push({
"id": appId,
"name": appData.name,
@@ -79,7 +81,8 @@ Item {
}
Item {
width: parent.width - parent.children[0].width - parent.children[1].width
width: parent.width - parent.children[0].width
- parent.children[1].width
- clearAllButton.width - Theme.spacingM * 3
height: 1
}
@@ -124,7 +127,8 @@ Item {
color: Qt.rgba(Theme.surfaceContainer.r,
Theme.surfaceContainer.g,
Theme.surfaceContainer.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
border.color: Qt.rgba(Theme.outline.r,
Theme.outline.g,
Theme.outline.b, 0.1)
border.width: 1
@@ -162,7 +166,8 @@ Item {
spacing: 2
StyledText {
text: modelData.name || "Unknown App"
text: modelData.name
|| "Unknown App"
font.pixelSize: Theme.fontSizeMedium
font.weight: Font.Medium
color: Theme.surfaceText
@@ -176,9 +181,12 @@ Item {
var date = new Date(modelData.lastUsed)
var now = new Date()
var diffMs = now - date
var diffMins = Math.floor(diffMs / (1000 * 60))
var diffHours = Math.floor(diffMs / (1000 * 60 * 60))
var diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24))
var diffMins = Math.floor(
diffMs / (1000 * 60))
var diffHours = Math.floor(
diffMs / (1000 * 60 * 60))
var diffDays = Math.floor(
diffMs / (1000 * 60 * 60 * 24))
if (diffMins < 1)
return "Last launched just now"
@@ -210,11 +218,14 @@ Item {
iconName: "close"
iconSize: 16
iconColor: Theme.error
hoverColor: Qt.rgba(Theme.error.r, Theme.error.g,
hoverColor: Qt.rgba(Theme.error.r,
Theme.error.g,
Theme.error.b, 0.12)
onClicked: {
var currentRanking = Object.assign(
{}, AppUsageHistoryData.appUsageRanking || {})
{},
AppUsageHistoryData.appUsageRanking
|| {})
delete currentRanking[modelData.id]
AppUsageHistoryData.appUsageRanking = currentRanking
SettingsData.saveSettings()

View File

@@ -33,7 +33,8 @@ Column {
Rectangle {
anchors.fill: parent
color: parent.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g,
color: parent.containsMouse ? Qt.rgba(Theme.primary.r,
Theme.primary.g,
Theme.primary.b,
0.08) : "transparent"
radius: Theme.radiusS

View File

@@ -12,54 +12,73 @@ Item {
property bool fontsEnumerated: false
function enumerateFonts() {
var fonts = ["Default"];
var availableFonts = Qt.fontFamilies();
var rootFamilies = [];
var seenFamilies = new Set();
var fonts = ["Default"]
var availableFonts = Qt.fontFamilies()
var rootFamilies = []
var seenFamilies = new Set()
for (var i = 0; i < availableFonts.length; i++) {
var fontName = availableFonts[i];
var fontName = availableFonts[i]
if (fontName.startsWith("."))
continue;
continue
if (fontName === SettingsData.defaultFontFamily)
continue;
continue
var rootName = fontName.replace(/ (Thin|Extra Light|Light|Regular|Medium|Semi Bold|Demi Bold|Bold|Extra Bold|Black|Heavy)$/i, "").replace(/ (Italic|Oblique|Condensed|Extended|Narrow|Wide)$/i, "").replace(/ (UI|Display|Text|Mono|Sans|Serif)$/i, function(match, suffix) {
return match;
}).trim();
var rootName = fontName.replace(
/ (Thin|Extra Light|Light|Regular|Medium|Semi Bold|Demi Bold|Bold|Extra Bold|Black|Heavy)$/i,
"").replace(
/ (Italic|Oblique|Condensed|Extended|Narrow|Wide)$/i,
"").replace(/ (UI|Display|Text|Mono|Sans|Serif)$/i,
function (match, suffix) {
return match
}).trim()
if (!seenFamilies.has(rootName) && rootName !== "") {
seenFamilies.add(rootName);
rootFamilies.push(rootName);
seenFamilies.add(rootName)
rootFamilies.push(rootName)
}
}
cachedFontFamilies = fonts.concat(rootFamilies.sort());
var monoFonts = ["Default"];
var monoFamilies = [];
var seenMonoFamilies = new Set();
cachedFontFamilies = fonts.concat(rootFamilies.sort())
var monoFonts = ["Default"]
var monoFamilies = []
var seenMonoFamilies = new Set()
for (var j = 0; j < availableFonts.length; j++) {
var fontName2 = availableFonts[j];
var fontName2 = availableFonts[j]
if (fontName2.startsWith("."))
continue;
continue
if (fontName2 === SettingsData.defaultMonoFontFamily)
continue;
continue
var lowerName = fontName2.toLowerCase();
if (lowerName.includes("mono") || lowerName.includes("code") || lowerName.includes("console") || lowerName.includes("terminal") || lowerName.includes("courier") || lowerName.includes("dejavu sans mono") || lowerName.includes("jetbrains") || lowerName.includes("fira") || lowerName.includes("hack") || lowerName.includes("source code") || lowerName.includes("ubuntu mono") || lowerName.includes("cascadia")) {
var rootName2 = fontName2.replace(/ (Thin|Extra Light|Light|Regular|Medium|Semi Bold|Demi Bold|Bold|Extra Bold|Black|Heavy)$/i, "").replace(/ (Italic|Oblique|Condensed|Extended|Narrow|Wide)$/i, "").trim();
var lowerName = fontName2.toLowerCase()
if (lowerName.includes("mono") || lowerName.includes(
"code") || lowerName.includes(
"console") || lowerName.includes(
"terminal") || lowerName.includes(
"courier") || lowerName.includes(
"dejavu sans mono") || lowerName.includes(
"jetbrains") || lowerName.includes(
"fira") || lowerName.includes(
"hack") || lowerName.includes(
"source code") || lowerName.includes(
"ubuntu mono") || lowerName.includes("cascadia")) {
var rootName2 = fontName2.replace(
/ (Thin|Extra Light|Light|Regular|Medium|Semi Bold|Demi Bold|Bold|Extra Bold|Black|Heavy)$/i,
"").replace(
/ (Italic|Oblique|Condensed|Extended|Narrow|Wide)$/i,
"").trim()
if (!seenMonoFamilies.has(rootName2) && rootName2 !== "") {
seenMonoFamilies.add(rootName2);
monoFamilies.push(rootName2);
seenMonoFamilies.add(rootName2)
monoFamilies.push(rootName2)
}
}
}
cachedMonoFamilies = monoFonts.concat(monoFamilies.sort());
cachedMonoFamilies = monoFonts.concat(monoFamilies.sort())
}
Component.onCompleted: {
if (!fontsEnumerated) {
enumerateFonts();
fontsEnumerated = true;
enumerateFonts()
fontsEnumerated = true
}
}
@@ -81,8 +100,10 @@ Item {
width: parent.width
height: themeSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
border.width: 1
Column {
@@ -110,7 +131,6 @@ Item {
color: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
}
}
Column {
@@ -128,10 +148,11 @@ Item {
StyledText {
text: {
if (Theme.isDynamicTheme)
return "Wallpaper-based dynamic colors";
return "Wallpaper-based dynamic colors"
var descriptions = ["Material blue inspired by modern interfaces", "Deep blue inspired by material 3", "Rich purple tones for BB elegance", "Natural green for productivity", "Energetic orange for creativity", "Bold red for impact", "Cool cyan for tranquility", "Vibrant pink for expression", "Warm amber for comfort", "Soft coral for gentle warmth"];
return descriptions[Theme.currentThemeIndex] || "Select a theme";
var descriptions = ["Material blue inspired by modern interfaces", "Deep blue inspired by material 3", "Rich purple tones for BB elegance", "Natural green for productivity", "Energetic orange for creativity", "Bold red for impact", "Cool cyan for tranquility", "Vibrant pink for expression", "Warm amber for comfort", "Soft coral for gentle warmth"]
return descriptions[Theme.currentThemeIndex]
|| "Select a theme"
}
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
@@ -140,7 +161,6 @@ Item {
width: Math.min(parent.width, 400)
horizontalAlignment: Text.AlignHCenter
}
}
Column {
@@ -160,8 +180,10 @@ Item {
radius: 16
color: Theme.themes[index].primary
border.color: Theme.outline
border.width: (Theme.currentThemeIndex === index && !Theme.isDynamicTheme) ? 2 : 1
scale: (Theme.currentThemeIndex === index && !Theme.isDynamicTheme) ? 1.1 : 1
border.width: (Theme.currentThemeIndex === index
&& !Theme.isDynamicTheme) ? 2 : 1
scale: (Theme.currentThemeIndex === index
&& !Theme.isDynamicTheme) ? 1.1 : 1
Rectangle {
width: nameText.contentWidth + Theme.spacingS * 2
@@ -183,7 +205,6 @@ Item {
color: Theme.surfaceText
anchors.centerIn: parent
}
}
MouseArea {
@@ -193,7 +214,7 @@ Item {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
Theme.switchTheme(index, false);
Theme.switchTheme(index, false)
}
}
@@ -202,7 +223,6 @@ Item {
duration: Theme.shortDuration
easing.type: Theme.emphasizedEasing
}
}
Behavior on border.width {
@@ -210,13 +230,9 @@ Item {
duration: Theme.shortDuration
easing.type: Theme.emphasizedEasing
}
}
}
}
}
Row {
@@ -248,7 +264,8 @@ Item {
anchors.bottom: parent.top
anchors.bottomMargin: Theme.spacingXS
anchors.horizontalCenter: parent.horizontalCenter
visible: mouseArea2.containsMouse && themeIndex < Theme.themes.length
visible: mouseArea2.containsMouse
&& themeIndex < Theme.themes.length
StyledText {
id: nameText2
@@ -258,7 +275,6 @@ Item {
color: Theme.surfaceText
anchors.centerIn: parent
}
}
MouseArea {
@@ -269,8 +285,7 @@ Item {
cursorShape: Qt.PointingHandCursor
onClicked: {
if (themeIndex < Theme.themes.length)
Theme.switchTheme(themeIndex);
Theme.switchTheme(themeIndex)
}
}
@@ -279,7 +294,6 @@ Item {
duration: Theme.shortDuration
easing.type: Theme.emphasizedEasing
}
}
Behavior on border.width {
@@ -287,13 +301,9 @@ Item {
duration: Theme.shortDuration
easing.type: Theme.emphasizedEasing
}
}
}
}
}
Item {
@@ -307,18 +317,26 @@ Item {
radius: 20
anchors.horizontalCenter: parent.horizontalCenter
color: {
if (ToastService.wallpaperErrorStatus === "error" || ToastService.wallpaperErrorStatus === "matugen_missing")
return Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.12);
if (ToastService.wallpaperErrorStatus === "error"
|| ToastService.wallpaperErrorStatus === "matugen_missing")
return Qt.rgba(Theme.error.r,
Theme.error.g,
Theme.error.b, 0.12)
else
return Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3);
return Qt.rgba(Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.3)
}
border.color: {
if (ToastService.wallpaperErrorStatus === "error" || ToastService.wallpaperErrorStatus === "matugen_missing")
return Qt.rgba(Theme.error.r, Theme.error.g, Theme.error.b, 0.5);
if (ToastService.wallpaperErrorStatus === "error"
|| ToastService.wallpaperErrorStatus === "matugen_missing")
return Qt.rgba(Theme.error.r,
Theme.error.g,
Theme.error.b, 0.5)
else if (Theme.isDynamicTheme)
return Theme.primary;
return Theme.primary
else
return Theme.outline;
return Theme.outline
}
border.width: Theme.isDynamicTheme ? 2 : 1
scale: Theme.isDynamicTheme ? 1.1 : (autoMouseArea.containsMouse ? 1.02 : 1)
@@ -329,17 +347,21 @@ Item {
DankIcon {
name: {
if (ToastService.wallpaperErrorStatus === "error" || ToastService.wallpaperErrorStatus === "matugen_missing")
return "error";
if (ToastService.wallpaperErrorStatus === "error"
|| ToastService.wallpaperErrorStatus
=== "matugen_missing")
return "error"
else
return "palette";
return "palette"
}
size: 16
color: {
if (ToastService.wallpaperErrorStatus === "error" || ToastService.wallpaperErrorStatus === "matugen_missing")
return Theme.error;
if (ToastService.wallpaperErrorStatus === "error"
|| ToastService.wallpaperErrorStatus
=== "matugen_missing")
return Theme.error
else
return Theme.surfaceText;
return Theme.surfaceText
}
anchors.verticalCenter: parent.verticalCenter
}
@@ -347,23 +369,25 @@ Item {
StyledText {
text: {
if (ToastService.wallpaperErrorStatus === "error")
return "Error";
else if (ToastService.wallpaperErrorStatus === "matugen_missing")
return "No matugen";
return "Error"
else if (ToastService.wallpaperErrorStatus
=== "matugen_missing")
return "No matugen"
else
return "Auto";
return "Auto"
}
font.pixelSize: Theme.fontSizeMedium
color: {
if (ToastService.wallpaperErrorStatus === "error" || ToastService.wallpaperErrorStatus === "matugen_missing")
return Theme.error;
if (ToastService.wallpaperErrorStatus === "error"
|| ToastService.wallpaperErrorStatus
=== "matugen_missing")
return Theme.error
else
return Theme.surfaceText;
return Theme.surfaceText
}
font.weight: Font.Medium
anchors.verticalCenter: parent.verticalCenter
}
}
MouseArea {
@@ -374,11 +398,13 @@ Item {
cursorShape: Qt.PointingHandCursor
onClicked: {
if (ToastService.wallpaperErrorStatus === "matugen_missing")
ToastService.showError("matugen not found - install matugen package for dynamic theming");
ToastService.showError(
"matugen not found - install matugen package for dynamic theming")
else if (ToastService.wallpaperErrorStatus === "error")
ToastService.showError("Wallpaper processing failed - check wallpaper path");
ToastService.showError(
"Wallpaper processing failed - check wallpaper path")
else
Theme.switchTheme(10, true);
Theme.switchTheme(10, true)
}
}
@@ -392,25 +418,30 @@ Item {
anchors.bottom: parent.top
anchors.bottomMargin: Theme.spacingS
anchors.horizontalCenter: parent.horizontalCenter
visible: autoMouseArea.containsMouse && (!Theme.isDynamicTheme || ToastService.wallpaperErrorStatus === "error" || ToastService.wallpaperErrorStatus === "matugen_missing")
visible: autoMouseArea.containsMouse
&& (!Theme.isDynamicTheme
|| ToastService.wallpaperErrorStatus === "error"
|| ToastService.wallpaperErrorStatus
=== "matugen_missing")
StyledText {
id: autoTooltipText
text: {
if (ToastService.wallpaperErrorStatus === "matugen_missing")
return "Install matugen package for dynamic themes";
return "Install matugen package for dynamic themes"
else
return "Dynamic wallpaper-based colors";
return "Dynamic wallpaper-based colors"
}
font.pixelSize: Theme.fontSizeSmall
color: (ToastService.wallpaperErrorStatus === "error" || ToastService.wallpaperErrorStatus === "matugen_missing") ? Theme.error : Theme.surfaceText
color: (ToastService.wallpaperErrorStatus === "error"
|| ToastService.wallpaperErrorStatus
=== "matugen_missing") ? Theme.error : Theme.surfaceText
anchors.centerIn: parent
wrapMode: Text.WordWrap
width: Math.min(implicitWidth, 250)
horizontalAlignment: Text.AlignHCenter
}
}
Behavior on scale {
@@ -418,7 +449,6 @@ Item {
duration: Theme.shortDuration
easing.type: Theme.emphasizedEasing
}
}
Behavior on color {
@@ -426,7 +456,6 @@ Item {
duration: Theme.mediumDuration
easing.type: Theme.standardEasing
}
}
Behavior on border.color {
@@ -434,15 +463,10 @@ Item {
duration: Theme.mediumDuration
easing.type: Theme.standardEasing
}
}
}
}
}
}
// Transparency Settings
@@ -450,8 +474,10 @@ Item {
width: parent.width
height: transparencySection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
border.width: 1
Column {
@@ -479,7 +505,6 @@ Item {
color: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
}
}
Column {
@@ -496,16 +521,17 @@ Item {
DankSlider {
width: parent.width
height: 24
value: Math.round(SettingsData.topBarTransparency * 100)
value: Math.round(
SettingsData.topBarTransparency * 100)
minimum: 0
maximum: 100
unit: ""
showValue: true
onSliderValueChanged: (newValue) => {
SettingsData.setTopBarTransparency(newValue / 100);
onSliderValueChanged: newValue => {
SettingsData.setTopBarTransparency(
newValue / 100)
}
}
}
Column {
@@ -522,16 +548,17 @@ Item {
DankSlider {
width: parent.width
height: 24
value: Math.round(SettingsData.topBarWidgetTransparency * 100)
value: Math.round(
SettingsData.topBarWidgetTransparency * 100)
minimum: 0
maximum: 100
unit: ""
showValue: true
onSliderValueChanged: (newValue) => {
SettingsData.setTopBarWidgetTransparency(newValue / 100);
onSliderValueChanged: newValue => {
SettingsData.setTopBarWidgetTransparency(
newValue / 100)
}
}
}
Column {
@@ -548,20 +575,19 @@ Item {
DankSlider {
width: parent.width
height: 24
value: Math.round(SettingsData.popupTransparency * 100)
value: Math.round(
SettingsData.popupTransparency * 100)
minimum: 0
maximum: 100
unit: ""
showValue: true
onSliderValueChanged: (newValue) => {
SettingsData.setPopupTransparency(newValue / 100);
onSliderValueChanged: newValue => {
SettingsData.setPopupTransparency(
newValue / 100)
}
}
}
}
}
// System Configuration Warning
@@ -569,8 +595,10 @@ Item {
width: parent.width
height: warningText.implicitHeight + Theme.spacingM * 2
radius: Theme.cornerRadius
color: Qt.rgba(Theme.warning.r, Theme.warning.g, Theme.warning.b, 0.12)
border.color: Qt.rgba(Theme.warning.r, Theme.warning.g, Theme.warning.b, 0.3)
color: Qt.rgba(Theme.warning.r, Theme.warning.g,
Theme.warning.b, 0.12)
border.color: Qt.rgba(Theme.warning.r, Theme.warning.g,
Theme.warning.b, 0.3)
border.width: 1
Row {
@@ -595,9 +623,7 @@ Item {
width: parent.width - Theme.iconSizeSmall - Theme.spacingM
anchors.verticalCenter: parent.verticalCenter
}
}
}
// Icon Theme
@@ -605,8 +631,10 @@ Item {
width: parent.width
height: iconThemeSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
border.width: 1
Column {
@@ -637,21 +665,20 @@ Item {
popupWidthOffset: 100
maxPopupHeight: 236
options: {
SettingsData.detectAvailableIconThemes();
return SettingsData.availableIconThemes;
SettingsData.detectAvailableIconThemes()
return SettingsData.availableIconThemes
}
onValueChanged: (value) => {
SettingsData.setIconTheme(value);
if (value !== "System Default" && !SettingsData.qt5ctAvailable && !SettingsData.qt6ctAvailable)
ToastService.showWarning("qt5ct or qt6ct not found - Qt app themes may not update without these tools");
onValueChanged: value => {
SettingsData.setIconTheme(value)
if (value !== "System Default"
&& !SettingsData.qt5ctAvailable
&& !SettingsData.qt6ctAvailable)
ToastService.showWarning(
"qt5ct or qt6ct not found - Qt app themes may not update without these tools")
}
}
}
}
}
// System App Theming
@@ -659,8 +686,10 @@ Item {
width: parent.width
height: systemThemingSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
border.width: 1
visible: Theme.isDynamicTheme && Colors.matugenAvailable
@@ -689,7 +718,6 @@ Item {
color: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
}
}
DankToggle {
@@ -697,9 +725,10 @@ Item {
text: "Theme GTK Applications"
description: Colors.gtkThemingEnabled ? "File managers, text editors, and system dialogs will match your theme" : "GTK theming not available (install gsettings)"
enabled: Colors.gtkThemingEnabled
checked: Colors.gtkThemingEnabled && SettingsData.gtkThemingEnabled
checked: Colors.gtkThemingEnabled
&& SettingsData.gtkThemingEnabled
onToggled: function (checked) {
SettingsData.setGtkThemingEnabled(checked);
SettingsData.setGtkThemingEnabled(checked)
}
}
@@ -708,18 +737,14 @@ Item {
text: "Theme Qt Applications"
description: Colors.qtThemingEnabled ? "Qt applications will match your theme colors" : "Qt theming not available (install qt5ct or qt6ct)"
enabled: Colors.qtThemingEnabled
checked: Colors.qtThemingEnabled && SettingsData.qtThemingEnabled
checked: Colors.qtThemingEnabled
&& SettingsData.qtThemingEnabled
onToggled: function (checked) {
SettingsData.setQtThemingEnabled(checked);
SettingsData.setQtThemingEnabled(checked)
}
}
}
}
}
}
}

View File

@@ -24,8 +24,10 @@ Item {
width: parent.width
height: timeSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
border.width: 1
Column {
@@ -47,7 +49,8 @@ Item {
}
Column {
width: parent.width - Theme.iconSize - Theme.spacingM - toggle.width - Theme.spacingM
width: parent.width - Theme.iconSize - Theme.spacingM
- toggle.width - Theme.spacingM
spacing: Theme.spacingXS
anchors.verticalCenter: parent.verticalCenter
@@ -65,7 +68,6 @@ Item {
wrapMode: Text.WordWrap
width: parent.width
}
}
DankToggle {
@@ -73,15 +75,13 @@ Item {
anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.use24HourClock
onToggled: (checked) => {
return SettingsData.setClockFormat(checked);
onToggled: checked => {
return SettingsData.setClockFormat(
checked)
}
}
}
}
}
// Date Format Section
@@ -89,8 +89,10 @@ Item {
width: parent.width
height: dateSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
border.width: 1
Column {
@@ -118,14 +120,15 @@ Item {
color: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
}
}
DankDropdown {
width: parent.width
height: 50
text: "Top Bar Format"
description: "Preview: " + Qt.formatDate(new Date(), SettingsData.clockDateFormat)
description: "Preview: " + Qt.formatDate(
new Date(),
SettingsData.clockDateFormat)
currentValue: {
// Find matching preset or show "Custom"
const presets = [{
@@ -152,14 +155,15 @@ Item {
}, {
"format": "dddd, MMMM d",
"label": "Full Day & Month"
}];
const match = presets.find((p) => {
return p.format === SettingsData.clockDateFormat;
});
return match ? match.label : "Custom: " + SettingsData.clockDateFormat;
}]
const match = presets.find(p => {
return p.format
=== SettingsData.clockDateFormat
})
return match ? match.label : "Custom: " + SettingsData.clockDateFormat
}
options: ["Day Date", "Day Month Date", "Month Date", "Numeric (M/D)", "Numeric (D/M)", "Full with Year", "ISO Date", "Full Day & Month", "Custom..."]
onValueChanged: (value) => {
onValueChanged: value => {
const formatMap = {
"Day Date": "ddd d",
"Day Month Date": "ddd MMM d",
@@ -169,12 +173,13 @@ Item {
"Full with Year": "ddd d MMM yyyy",
"ISO Date": "yyyy-MM-dd",
"Full Day & Month": "dddd, MMMM d"
};
}
if (value === "Custom...") {
customFormatInput.visible = true;
customFormatInput.visible = true
} else {
customFormatInput.visible = false;
SettingsData.setClockDateFormat(formatMap[value]);
customFormatInput.visible = false
SettingsData.setClockDateFormat(
formatMap[value])
}
}
}
@@ -183,7 +188,9 @@ Item {
width: parent.width
height: 50
text: "Lock Screen Format"
description: "Preview: " + Qt.formatDate(new Date(), SettingsData.lockDateFormat)
description: "Preview: " + Qt.formatDate(
new Date(),
SettingsData.lockDateFormat)
currentValue: {
// Find matching preset or show "Custom"
const presets = [{
@@ -210,14 +217,15 @@ Item {
}, {
"format": "dddd, MMMM d",
"label": "Full Day & Month"
}];
const match = presets.find((p) => {
return p.format === SettingsData.lockDateFormat;
});
return match ? match.label : "Custom: " + SettingsData.lockDateFormat;
}]
const match = presets.find(p => {
return p.format
=== SettingsData.lockDateFormat
})
return match ? match.label : "Custom: " + SettingsData.lockDateFormat
}
options: ["Day Date", "Day Month Date", "Month Date", "Numeric (M/D)", "Numeric (D/M)", "Full with Year", "ISO Date", "Full Day & Month", "Custom..."]
onValueChanged: (value) => {
onValueChanged: value => {
const formatMap = {
"Day Date": "ddd d",
"Day Month Date": "ddd MMM d",
@@ -227,12 +235,13 @@ Item {
"Full with Year": "ddd d MMM yyyy",
"ISO Date": "yyyy-MM-dd",
"Full Day & Month": "dddd, MMMM d"
};
}
if (value === "Custom...") {
customLockFormatInput.visible = true;
customLockFormatInput.visible = true
} else {
customLockFormatInput.visible = false;
SettingsData.setLockDateFormat(formatMap[value]);
customLockFormatInput.visible = false
SettingsData.setLockDateFormat(
formatMap[value])
}
}
}
@@ -246,8 +255,7 @@ Item {
text: SettingsData.clockDateFormat
onTextChanged: {
if (visible && text)
SettingsData.setClockDateFormat(text);
SettingsData.setClockDateFormat(text)
}
}
@@ -260,8 +268,7 @@ Item {
text: SettingsData.lockDateFormat
onTextChanged: {
if (visible && text)
SettingsData.setLockDateFormat(text);
SettingsData.setLockDateFormat(text)
}
}
@@ -269,8 +276,11 @@ Item {
width: parent.width
height: formatHelp.implicitHeight + Theme.spacingM * 2
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.2)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.1)
color: Qt.rgba(Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.2)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.1)
border.width: 1
Column {
@@ -324,7 +334,6 @@ Item {
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
}
}
Column {
@@ -360,21 +369,12 @@ Item {
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText
}
}
}
}
}
}
}
}
}
}

View File

@@ -246,11 +246,16 @@ Item {
"id": widget.id,
"enabled": enabled
}
if (widget.size !== undefined) newWidget.size = widget.size
if (widget.selectedGpuIndex !== undefined) newWidget.selectedGpuIndex = widget.selectedGpuIndex
else if (widget.id === "gpuTemp") newWidget.selectedGpuIndex = 0
if (widget.pciId !== undefined) newWidget.pciId = widget.pciId
else if (widget.id === "gpuTemp") newWidget.pciId = ""
if (widget.size !== undefined)
newWidget.size = widget.size
if (widget.selectedGpuIndex !== undefined)
newWidget.selectedGpuIndex = widget.selectedGpuIndex
else if (widget.id === "gpuTemp")
newWidget.selectedGpuIndex = 0
if (widget.pciId !== undefined)
newWidget.pciId = widget.pciId
else if (widget.id === "gpuTemp")
newWidget.pciId = ""
widgets[i] = newWidget
}
break
@@ -297,8 +302,10 @@ Item {
"enabled": widget.enabled,
"size": newSize
}
if (widget.selectedGpuIndex !== undefined) newWidget.selectedGpuIndex = widget.selectedGpuIndex
if (widget.pciId !== undefined) newWidget.pciId = widget.pciId
if (widget.selectedGpuIndex !== undefined)
newWidget.selectedGpuIndex = widget.selectedGpuIndex
if (widget.pciId !== undefined)
newWidget.pciId = widget.pciId
widgets[i] = newWidget
}
break
@@ -328,16 +335,21 @@ Item {
"id": widget,
"enabled": true,
"selectedGpuIndex": selectedGpuIndex,
"pciId": DgopService.availableGpus && DgopService.availableGpus.length > selectedGpuIndex ? DgopService.availableGpus[selectedGpuIndex].pciId : ""
"pciId": DgopService.availableGpus
&& DgopService.availableGpus.length
> selectedGpuIndex ? DgopService.availableGpus[selectedGpuIndex].pciId : ""
}
} else {
var newWidget = {
"id": widget.id,
"enabled": widget.enabled,
"selectedGpuIndex": selectedGpuIndex,
"pciId": DgopService.availableGpus && DgopService.availableGpus.length > selectedGpuIndex ? DgopService.availableGpus[selectedGpuIndex].pciId : ""
"pciId": DgopService.availableGpus
&& DgopService.availableGpus.length
> selectedGpuIndex ? DgopService.availableGpus[selectedGpuIndex].pciId : ""
}
if (widget.size !== undefined) newWidget.size = widget.size
if (widget.size !== undefined)
newWidget.size = widget.size
widgets[widgetIndex] = newWidget
}
}
@@ -361,7 +373,8 @@ Item {
widgetData = SettingsData.topBarRightWidgets || []
widgetData.forEach(widget => {
var widgetId = typeof widget === "string" ? widget : widget.id
var widgetEnabled = typeof widget === "string" ? true : widget.enabled
var widgetEnabled = typeof widget
=== "string" ? true : widget.enabled
var widgetSize = typeof widget === "string" ? undefined : widget.size
var widgetSelectedGpuIndex = typeof widget
=== "string" ? undefined : widget.selectedGpuIndex
@@ -396,8 +409,8 @@ Item {
if (!SettingsData.topBarRightWidgets)
SettingsData.setTopBarRightWidgets(defaultRightWidgets)
["left", "center", "right"].forEach(sectionId => {
const sections = ["left", "center", "right"]
sections.forEach(sectionId => {
var widgets = []
if (sectionId === "left")
widgets = SettingsData.topBarLeftWidgets.slice()
@@ -406,16 +419,12 @@ Item {
else if (sectionId === "right")
widgets = SettingsData.topBarRightWidgets.slice()
var updated = false
for (var i = 0; i
< widgets.length; i++) {
for (var i = 0; i < widgets.length; i++) {
var widget = widgets[i]
if (typeof widget === "object"
&& widget.id === "spacer"
&& !widget.size) {
widgets[i] = Object.assign(
{},
widget,
{
widgets[i] = Object.assign({}, widget, {
"size": 20
})
updated = true
@@ -423,14 +432,11 @@ Item {
}
if (updated) {
if (sectionId === "left")
SettingsData.setTopBarLeftWidgets(
widgets)
SettingsData.setTopBarLeftWidgets(widgets)
else if (sectionId === "center")
SettingsData.setTopBarCenterWidgets(
widgets)
SettingsData.setTopBarCenterWidgets(widgets)
else if (sectionId === "right")
SettingsData.setTopBarRightWidgets(
widgets)
SettingsData.setTopBarRightWidgets(widgets)
}
})
}
@@ -453,8 +459,10 @@ Item {
width: parent.width
height: topBarAutoHideSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
border.width: 1
Column {
@@ -476,7 +484,8 @@ Item {
}
Column {
width: parent.width - Theme.iconSize - Theme.spacingM - autoHideToggle.width - Theme.spacingM
width: parent.width - Theme.iconSize - Theme.spacingM
- autoHideToggle.width - Theme.spacingM
spacing: Theme.spacingXS
anchors.verticalCenter: parent.verticalCenter
@@ -494,7 +503,6 @@ Item {
wrapMode: Text.WordWrap
width: parent.width
}
}
DankToggle {
@@ -502,15 +510,13 @@ Item {
anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.topBarAutoHide
onToggled: (toggled) => {
return SettingsData.setTopBarAutoHide(toggled);
onToggled: toggled => {
return SettingsData.setTopBarAutoHide(
toggled)
}
}
}
}
}
// Spacing
@@ -518,8 +524,10 @@ Item {
width: parent.width
height: topBarSpacingSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
border.width: 1
Column {
@@ -547,7 +555,6 @@ Item {
color: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
}
}
Column {
@@ -569,11 +576,11 @@ Item {
maximum: 32
unit: ""
showValue: true
onSliderValueChanged: (newValue) => {
SettingsData.setTopBarSpacing(newValue);
onSliderValueChanged: newValue => {
SettingsData.setTopBarSpacing(
newValue)
}
}
}
DankToggle {
@@ -581,13 +588,12 @@ Item {
text: "Square Corners"
description: "Disable corner radius for the top bar (always square corners)"
checked: SettingsData.topBarSquareCorners
onToggled: (checked) => {
SettingsData.setTopBarSquareCorners(checked);
onToggled: checked => {
SettingsData.setTopBarSquareCorners(
checked)
}
}
}
}
// Widget Management Section
@@ -595,8 +601,10 @@ Item {
width: parent.width
height: widgetManagementSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
border.width: 1
Column {
@@ -643,7 +651,8 @@ Item {
border.color: resetArea.containsMouse ? Theme.outline : Qt.rgba(
Theme.outline.r,
Theme.outline.g,
Theme.outline.b, 0.5)
Theme.outline.b,
0.5)
Row {
anchors.centerIn: parent
@@ -672,9 +681,12 @@ Item {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
SettingsData.setTopBarLeftWidgets(defaultLeftWidgets)
SettingsData.setTopBarCenterWidgets(defaultCenterWidgets)
SettingsData.setTopBarRightWidgets(defaultRightWidgets)
SettingsData.setTopBarLeftWidgets(
defaultLeftWidgets)
SettingsData.setTopBarCenterWidgets(
defaultCenterWidgets)
SettingsData.setTopBarRightWidgets(
defaultRightWidgets)
}
}
@@ -713,8 +725,11 @@ Item {
width: parent.width
height: leftSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
color: Qt.rgba(Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
border.width: 1
WidgetsTabSection {
@@ -727,42 +742,47 @@ Item {
allWidgets: topBarTab.baseWidgetDefinitions
items: topBarTab.getItemsForSection("left")
onItemEnabledChanged: (sectionId, itemId, enabled) => {
topBarTab.handleItemEnabledChanged(sectionId,
itemId,
enabled)
topBarTab.handleItemEnabledChanged(
sectionId,
itemId, enabled)
}
onItemOrderChanged: newOrder => {
topBarTab.handleItemOrderChanged("left",
newOrder)
topBarTab.handleItemOrderChanged(
"left", newOrder)
}
onAddWidget: sectionId => {
widgetSelectionPopup.allWidgets = topBarTab.baseWidgetDefinitions
widgetSelectionPopup.allWidgets
= topBarTab.baseWidgetDefinitions
widgetSelectionPopup.targetSection = sectionId
widgetSelectionPopup.safeOpen()
}
onRemoveWidget: (sectionId, widgetIndex) => {
topBarTab.removeWidgetFromSection(sectionId,
widgetIndex)
topBarTab.removeWidgetFromSection(
sectionId, widgetIndex)
}
onSpacerSizeChanged: (sectionId, itemId, newSize) => {
topBarTab.handleSpacerSizeChanged(sectionId,
itemId,
newSize)
topBarTab.handleSpacerSizeChanged(
sectionId, itemId, newSize)
}
onCompactModeChanged: (widgetId, value) => {
if (widgetId === "clock") {
SettingsData.setClockCompactMode(value)
SettingsData.setClockCompactMode(
value)
} else if (widgetId === "music") {
SettingsData.setMediaSize(value)
SettingsData.setMediaSize(
value)
} else if (widgetId === "focusedWindow") {
SettingsData.setFocusedWindowCompactMode(value)
SettingsData.setFocusedWindowCompactMode(
value)
} else if (widgetId === "runningApps") {
SettingsData.setRunningAppsCompactMode(value)
SettingsData.setRunningAppsCompactMode(
value)
}
}
onGpuSelectionChanged: (sectionId, widgetIndex, selectedIndex) => {
topBarTab.handleGpuSelectionChanged(
sectionId, widgetIndex, selectedIndex)
sectionId, widgetIndex,
selectedIndex)
}
}
}
@@ -772,8 +792,11 @@ Item {
width: parent.width
height: centerSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
color: Qt.rgba(Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
border.width: 1
WidgetsTabSection {
@@ -786,42 +809,47 @@ Item {
allWidgets: topBarTab.baseWidgetDefinitions
items: topBarTab.getItemsForSection("center")
onItemEnabledChanged: (sectionId, itemId, enabled) => {
topBarTab.handleItemEnabledChanged(sectionId,
itemId,
enabled)
topBarTab.handleItemEnabledChanged(
sectionId,
itemId, enabled)
}
onItemOrderChanged: newOrder => {
topBarTab.handleItemOrderChanged("center",
newOrder)
topBarTab.handleItemOrderChanged(
"center", newOrder)
}
onAddWidget: sectionId => {
widgetSelectionPopup.allWidgets = topBarTab.baseWidgetDefinitions
widgetSelectionPopup.allWidgets
= topBarTab.baseWidgetDefinitions
widgetSelectionPopup.targetSection = sectionId
widgetSelectionPopup.safeOpen()
}
onRemoveWidget: (sectionId, widgetIndex) => {
topBarTab.removeWidgetFromSection(sectionId,
widgetIndex)
topBarTab.removeWidgetFromSection(
sectionId, widgetIndex)
}
onSpacerSizeChanged: (sectionId, itemId, newSize) => {
topBarTab.handleSpacerSizeChanged(sectionId,
itemId,
newSize)
topBarTab.handleSpacerSizeChanged(
sectionId, itemId, newSize)
}
onCompactModeChanged: (widgetId, value) => {
if (widgetId === "clock") {
SettingsData.setClockCompactMode(value)
SettingsData.setClockCompactMode(
value)
} else if (widgetId === "music") {
SettingsData.setMediaSize(value)
SettingsData.setMediaSize(
value)
} else if (widgetId === "focusedWindow") {
SettingsData.setFocusedWindowCompactMode(value)
SettingsData.setFocusedWindowCompactMode(
value)
} else if (widgetId === "runningApps") {
SettingsData.setRunningAppsCompactMode(value)
SettingsData.setRunningAppsCompactMode(
value)
}
}
onGpuSelectionChanged: (sectionId, widgetIndex, selectedIndex) => {
topBarTab.handleGpuSelectionChanged(
sectionId, widgetIndex, selectedIndex)
sectionId, widgetIndex,
selectedIndex)
}
}
}
@@ -831,8 +859,11 @@ Item {
width: parent.width
height: rightSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
color: Qt.rgba(Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
border.width: 1
WidgetsTabSection {
@@ -845,42 +876,47 @@ Item {
allWidgets: topBarTab.baseWidgetDefinitions
items: topBarTab.getItemsForSection("right")
onItemEnabledChanged: (sectionId, itemId, enabled) => {
topBarTab.handleItemEnabledChanged(sectionId,
itemId,
enabled)
topBarTab.handleItemEnabledChanged(
sectionId,
itemId, enabled)
}
onItemOrderChanged: newOrder => {
topBarTab.handleItemOrderChanged("right",
newOrder)
topBarTab.handleItemOrderChanged(
"right", newOrder)
}
onAddWidget: sectionId => {
widgetSelectionPopup.allWidgets = topBarTab.baseWidgetDefinitions
widgetSelectionPopup.allWidgets
= topBarTab.baseWidgetDefinitions
widgetSelectionPopup.targetSection = sectionId
widgetSelectionPopup.safeOpen()
}
onRemoveWidget: (sectionId, widgetIndex) => {
topBarTab.removeWidgetFromSection(sectionId,
widgetIndex)
topBarTab.removeWidgetFromSection(
sectionId, widgetIndex)
}
onSpacerSizeChanged: (sectionId, itemId, newSize) => {
topBarTab.handleSpacerSizeChanged(sectionId,
itemId,
newSize)
topBarTab.handleSpacerSizeChanged(
sectionId, itemId, newSize)
}
onCompactModeChanged: (widgetId, value) => {
if (widgetId === "clock") {
SettingsData.setClockCompactMode(value)
SettingsData.setClockCompactMode(
value)
} else if (widgetId === "music") {
SettingsData.setMediaSize(value)
SettingsData.setMediaSize(
value)
} else if (widgetId === "focusedWindow") {
SettingsData.setFocusedWindowCompactMode(value)
SettingsData.setFocusedWindowCompactMode(
value)
} else if (widgetId === "runningApps") {
SettingsData.setRunningAppsCompactMode(value)
SettingsData.setRunningAppsCompactMode(
value)
}
}
onGpuSelectionChanged: (sectionId, widgetIndex, selectedIndex) => {
topBarTab.handleGpuSelectionChanged(
sectionId, widgetIndex, selectedIndex)
sectionId, widgetIndex,
selectedIndex)
}
}
}
@@ -893,7 +929,8 @@ Item {
anchors.centerIn: parent
onWidgetSelected: (widgetId, targetSection) => {
topBarTab.addWidgetToSection(widgetId, targetSection)
topBarTab.addWidgetToSection(widgetId,
targetSection)
}
}
}

View File

@@ -24,8 +24,10 @@ Item {
width: parent.width
height: enableWeatherSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
border.width: 1
Column {
@@ -47,7 +49,8 @@ Item {
}
Column {
width: parent.width - Theme.iconSize - Theme.spacingM - enableToggle.width - Theme.spacingM
width: parent.width - Theme.iconSize - Theme.spacingM
- enableToggle.width - Theme.spacingM
spacing: Theme.spacingXS
anchors.verticalCenter: parent.verticalCenter
@@ -65,7 +68,6 @@ Item {
wrapMode: Text.WordWrap
width: parent.width
}
}
DankToggle {
@@ -73,15 +75,13 @@ Item {
anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.weatherEnabled
onToggled: (checked) => {
return SettingsData.setWeatherEnabled(checked);
onToggled: checked => {
return SettingsData.setWeatherEnabled(
checked)
}
}
}
}
}
// Temperature Unit
@@ -89,8 +89,10 @@ Item {
width: parent.width
height: temperatureSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
border.width: 1
visible: SettingsData.weatherEnabled
opacity: visible ? 1 : 0
@@ -114,7 +116,8 @@ Item {
}
Column {
width: parent.width - Theme.iconSize - Theme.spacingM - temperatureToggle.width - Theme.spacingM
width: parent.width - Theme.iconSize - Theme.spacingM
- temperatureToggle.width - Theme.spacingM
spacing: Theme.spacingXS
anchors.verticalCenter: parent.verticalCenter
@@ -132,7 +135,6 @@ Item {
wrapMode: Text.WordWrap
width: parent.width
}
}
DankToggle {
@@ -140,13 +142,12 @@ Item {
anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.useFahrenheit
onToggled: (checked) => {
return SettingsData.setTemperatureUnit(checked);
onToggled: checked => {
return SettingsData.setTemperatureUnit(
checked)
}
}
}
}
Behavior on opacity {
@@ -155,7 +156,6 @@ Item {
easing.type: Theme.emphasizedEasing
}
}
}
// Location Settings
@@ -163,8 +163,10 @@ Item {
width: parent.width
height: locationSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
border.width: 1
visible: SettingsData.weatherEnabled
opacity: visible ? 1 : 0
@@ -188,7 +190,8 @@ Item {
}
Column {
width: parent.width - Theme.iconSize - Theme.spacingM - autoLocationToggle.width - Theme.spacingM
width: parent.width - Theme.iconSize - Theme.spacingM
- autoLocationToggle.width - Theme.spacingM
spacing: Theme.spacingXS
anchors.verticalCenter: parent.verticalCenter
@@ -206,7 +209,6 @@ Item {
wrapMode: Text.WordWrap
width: parent.width
}
}
DankToggle {
@@ -214,11 +216,11 @@ Item {
anchors.verticalCenter: parent.verticalCenter
checked: SettingsData.useAutoLocation
onToggled: (checked) => {
return SettingsData.setAutoLocation(checked);
onToggled: checked => {
return SettingsData.setAutoLocation(
checked)
}
}
}
Column {
@@ -245,12 +247,12 @@ Item {
currentLocation: SettingsData.weatherLocation
placeholderText: "New York, NY"
onLocationSelected: (displayName, coordinates) => {
SettingsData.setWeatherLocation(displayName, coordinates);
SettingsData.setWeatherLocation(
displayName,
coordinates)
}
}
}
}
Behavior on opacity {
@@ -259,11 +261,7 @@ Item {
easing.type: Theme.emphasizedEasing
}
}
}
}
}
}

View File

@@ -24,8 +24,10 @@ Item {
width: parent.width
height: launcherButtonSection.implicitHeight + Theme.spacingL * 2
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g, Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g, Theme.outline.b, 0.2)
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
Theme.surfaceVariant.b, 0.3)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
border.width: 1
Column {
@@ -95,8 +97,10 @@ Item {
bottomPadding: Theme.spacingXS
onEditingFinished: {
var color = text.trim()
if (color === "" || /^#[0-9A-Fa-f]{6}$/.test(color))
SettingsData.setOSLogoColorOverride(color)
if (color === ""
|| /^#[0-9A-Fa-f]{6}$/.test(color))
SettingsData.setOSLogoColorOverride(
color)
else
text = SettingsData.osLogoColorOverride
}
@@ -119,7 +123,8 @@ Item {
height: 20
minimum: 0
maximum: 100
value: Math.round(SettingsData.osLogoBrightness * 100)
value: Math.round(
SettingsData.osLogoBrightness * 100)
unit: "%"
showValue: true
onSliderValueChanged: newValue => {
@@ -145,7 +150,8 @@ Item {
height: 20
minimum: 0
maximum: 200
value: Math.round(SettingsData.osLogoContrast * 100)
value: Math.round(
SettingsData.osLogoContrast * 100)
unit: "%"
showValue: true
onSliderValueChanged: newValue => {
@@ -208,7 +214,8 @@ Item {
description: "Show workspace index numbers in the top bar workspace switcher"
checked: SettingsData.showWorkspaceIndex
onToggled: checked => {
return SettingsData.setShowWorkspaceIndex(checked)
return SettingsData.setShowWorkspaceIndex(
checked)
}
}
@@ -218,7 +225,8 @@ Item {
description: "Always show a minimum of 3 workspaces, even if fewer are available"
checked: SettingsData.showWorkspacePadding
onToggled: checked => {
return SettingsData.setShowWorkspacePadding(checked)
return SettingsData.setShowWorkspacePadding(
checked)
}
}
}
@@ -277,9 +285,11 @@ Item {
width: parent.width
height: workspaceIconRow.implicitHeight + Theme.spacingM
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g,
color: Qt.rgba(Theme.surfaceContainer.r,
Theme.surfaceContainer.g,
Theme.surfaceContainer.b, 0.5)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
border.color: Qt.rgba(Theme.outline.r,
Theme.outline.g,
Theme.outline.b, 0.3)
border.width: 1
@@ -308,26 +318,33 @@ Item {
anchors.verticalCenter: parent.verticalCenter
Component.onCompleted: {
var iconData = SettingsData.getWorkspaceNameIcon(modelData)
var iconData = SettingsData.getWorkspaceNameIcon(
modelData)
if (iconData) {
setIcon(iconData.value, iconData.type)
setIcon(iconData.value,
iconData.type)
}
}
onIconSelected: (iconName, iconType) => {
SettingsData.setWorkspaceNameIcon(modelData, {
type: iconType,
value: iconName
SettingsData.setWorkspaceNameIcon(
modelData, {
"type": iconType,
"value": iconName
})
setIcon(iconName, iconType)
setIcon(iconName,
iconType)
}
Connections {
target: SettingsData
function onWorkspaceIconsUpdated() {
var iconData = SettingsData.getWorkspaceNameIcon(modelData)
var iconData = SettingsData.getWorkspaceNameIcon(
modelData)
if (iconData) {
iconPicker.setIcon(iconData.value, iconData.type)
iconPicker.setIcon(
iconData.value,
iconData.type)
} else {
iconPicker.setIcon("", "icon")
}
@@ -358,7 +375,8 @@ Item {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
SettingsData.removeWorkspaceNameIcon(modelData)
SettingsData.removeWorkspaceNameIcon(
modelData)
}
}
}

View File

@@ -245,11 +245,16 @@ Item {
"id": widget.id,
"enabled": enabled
}
if (widget.size !== undefined) newWidget.size = widget.size
if (widget.selectedGpuIndex !== undefined) newWidget.selectedGpuIndex = widget.selectedGpuIndex
else if (widget.id === "gpuTemp") newWidget.selectedGpuIndex = 0
if (widget.pciId !== undefined) newWidget.pciId = widget.pciId
else if (widget.id === "gpuTemp") newWidget.pciId = ""
if (widget.size !== undefined)
newWidget.size = widget.size
if (widget.selectedGpuIndex !== undefined)
newWidget.selectedGpuIndex = widget.selectedGpuIndex
else if (widget.id === "gpuTemp")
newWidget.selectedGpuIndex = 0
if (widget.pciId !== undefined)
newWidget.pciId = widget.pciId
else if (widget.id === "gpuTemp")
newWidget.pciId = ""
widgets[i] = newWidget
}
break
@@ -296,8 +301,10 @@ Item {
"enabled": widget.enabled,
"size": newSize
}
if (widget.selectedGpuIndex !== undefined) newWidget.selectedGpuIndex = widget.selectedGpuIndex
if (widget.pciId !== undefined) newWidget.pciId = widget.pciId
if (widget.selectedGpuIndex !== undefined)
newWidget.selectedGpuIndex = widget.selectedGpuIndex
if (widget.pciId !== undefined)
newWidget.pciId = widget.pciId
widgets[i] = newWidget
}
break
@@ -327,16 +334,21 @@ Item {
"id": widget,
"enabled": true,
"selectedGpuIndex": selectedGpuIndex,
"pciId": DgopService.availableGpus && DgopService.availableGpus.length > selectedGpuIndex ? DgopService.availableGpus[selectedGpuIndex].pciId : ""
"pciId": DgopService.availableGpus
&& DgopService.availableGpus.length
> selectedGpuIndex ? DgopService.availableGpus[selectedGpuIndex].pciId : ""
}
} else {
var newWidget = {
"id": widget.id,
"enabled": widget.enabled,
"selectedGpuIndex": selectedGpuIndex,
"pciId": DgopService.availableGpus && DgopService.availableGpus.length > selectedGpuIndex ? DgopService.availableGpus[selectedGpuIndex].pciId : ""
"pciId": DgopService.availableGpus
&& DgopService.availableGpus.length
> selectedGpuIndex ? DgopService.availableGpus[selectedGpuIndex].pciId : ""
}
if (widget.size !== undefined) newWidget.size = widget.size
if (widget.size !== undefined)
newWidget.size = widget.size
widgets[widgetIndex] = newWidget
}
}
@@ -360,7 +372,8 @@ Item {
widgetData = SettingsData.topBarRightWidgets || []
widgetData.forEach(widget => {
var widgetId = typeof widget === "string" ? widget : widget.id
var widgetEnabled = typeof widget === "string" ? true : widget.enabled
var widgetEnabled = typeof widget
=== "string" ? true : widget.enabled
var widgetSize = typeof widget === "string" ? undefined : widget.size
var widgetSelectedGpuIndex = typeof widget
=== "string" ? undefined : widget.selectedGpuIndex
@@ -394,9 +407,9 @@ Item {
SettingsData.setTopBarCenterWidgets(defaultCenterWidgets)
if (!SettingsData.topBarRightWidgets)
SettingsData.setTopBarRightWidgets(defaultRightWidgets)
["left", "center", "right"].forEach(sectionId => {
SettingsData.setTopBarRightWidgets(
defaultRightWidgets)["left""center""right"].forEach(
sectionId => {
var widgets = []
if (sectionId === "left")
widgets = SettingsData.topBarLeftWidgets.slice()
@@ -405,16 +418,11 @@ Item {
else if (sectionId === "right")
widgets = SettingsData.topBarRightWidgets.slice()
var updated = false
for (var i = 0; i
< widgets.length; i++) {
for (var i = 0; i < widgets.length; i++) {
var widget = widgets[i]
if (typeof widget === "object"
&& widget.id === "spacer"
&& !widget.size) {
widgets[i] = Object.assign(
{},
widget,
{
&& widget.id === "spacer" && !widget.size) {
widgets[i] = Object.assign({}, widget, {
"size": 20
})
updated = true
@@ -422,14 +430,11 @@ Item {
}
if (updated) {
if (sectionId === "left")
SettingsData.setTopBarLeftWidgets(
widgets)
SettingsData.setTopBarLeftWidgets(widgets)
else if (sectionId === "center")
SettingsData.setTopBarCenterWidgets(
widgets)
SettingsData.setTopBarCenterWidgets(widgets)
else if (sectionId === "right")
SettingsData.setTopBarRightWidgets(
widgets)
SettingsData.setTopBarRightWidgets(widgets)
}
})
}
@@ -480,7 +485,8 @@ Item {
border.color: resetArea.containsMouse ? Theme.outline : Qt.rgba(
Theme.outline.r,
Theme.outline.g,
Theme.outline.b, 0.5)
Theme.outline.b,
0.5)
Row {
anchors.centerIn: parent
@@ -509,9 +515,12 @@ Item {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
SettingsData.setTopBarLeftWidgets(defaultLeftWidgets)
SettingsData.setTopBarCenterWidgets(defaultCenterWidgets)
SettingsData.setTopBarRightWidgets(defaultRightWidgets)
SettingsData.setTopBarLeftWidgets(
defaultLeftWidgets)
SettingsData.setTopBarCenterWidgets(
defaultCenterWidgets)
SettingsData.setTopBarRightWidgets(
defaultRightWidgets)
}
}
@@ -565,42 +574,46 @@ Item {
allWidgets: widgetsTab.baseWidgetDefinitions
items: widgetsTab.getItemsForSection("left")
onItemEnabledChanged: (sectionId, itemId, enabled) => {
widgetsTab.handleItemEnabledChanged(sectionId,
itemId,
enabled)
widgetsTab.handleItemEnabledChanged(
sectionId, itemId, enabled)
}
onItemOrderChanged: newOrder => {
widgetsTab.handleItemOrderChanged("left",
newOrder)
widgetsTab.handleItemOrderChanged(
"left", newOrder)
}
onAddWidget: sectionId => {
widgetSelectionPopup.allWidgets = widgetsTab.baseWidgetDefinitions
widgetSelectionPopup.allWidgets
= widgetsTab.baseWidgetDefinitions
widgetSelectionPopup.targetSection = sectionId
widgetSelectionPopup.safeOpen()
}
onRemoveWidget: (sectionId, widgetIndex) => {
widgetsTab.removeWidgetFromSection(sectionId,
widgetIndex)
widgetsTab.removeWidgetFromSection(
sectionId, widgetIndex)
}
onSpacerSizeChanged: (sectionId, itemId, newSize) => {
widgetsTab.handleSpacerSizeChanged(sectionId,
itemId,
newSize)
widgetsTab.handleSpacerSizeChanged(
sectionId, itemId, newSize)
}
onCompactModeChanged: (widgetId, value) => {
if (widgetId === "clock") {
SettingsData.setClockCompactMode(value)
SettingsData.setClockCompactMode(
value)
} else if (widgetId === "music") {
SettingsData.setMediaSize(value)
SettingsData.setMediaSize(
value)
} else if (widgetId === "focusedWindow") {
SettingsData.setFocusedWindowCompactMode(value)
SettingsData.setFocusedWindowCompactMode(
value)
} else if (widgetId === "runningApps") {
SettingsData.setRunningAppsCompactMode(value)
SettingsData.setRunningAppsCompactMode(
value)
}
}
onGpuSelectionChanged: (sectionId, widgetIndex, selectedIndex) => {
widgetsTab.handleGpuSelectionChanged(
sectionId, widgetIndex, selectedIndex)
sectionId, widgetIndex,
selectedIndex)
}
}
@@ -612,42 +625,46 @@ Item {
allWidgets: widgetsTab.baseWidgetDefinitions
items: widgetsTab.getItemsForSection("center")
onItemEnabledChanged: (sectionId, itemId, enabled) => {
widgetsTab.handleItemEnabledChanged(sectionId,
itemId,
enabled)
widgetsTab.handleItemEnabledChanged(
sectionId, itemId, enabled)
}
onItemOrderChanged: newOrder => {
widgetsTab.handleItemOrderChanged("center",
newOrder)
widgetsTab.handleItemOrderChanged(
"center", newOrder)
}
onAddWidget: sectionId => {
widgetSelectionPopup.allWidgets = widgetsTab.baseWidgetDefinitions
widgetSelectionPopup.allWidgets
= widgetsTab.baseWidgetDefinitions
widgetSelectionPopup.targetSection = sectionId
widgetSelectionPopup.safeOpen()
}
onRemoveWidget: (sectionId, widgetIndex) => {
widgetsTab.removeWidgetFromSection(sectionId,
widgetIndex)
widgetsTab.removeWidgetFromSection(
sectionId, widgetIndex)
}
onSpacerSizeChanged: (sectionId, itemId, newSize) => {
widgetsTab.handleSpacerSizeChanged(sectionId,
itemId,
newSize)
widgetsTab.handleSpacerSizeChanged(
sectionId, itemId, newSize)
}
onCompactModeChanged: (widgetId, value) => {
if (widgetId === "clock") {
SettingsData.setClockCompactMode(value)
SettingsData.setClockCompactMode(
value)
} else if (widgetId === "music") {
SettingsData.setMediaSize(value)
SettingsData.setMediaSize(
value)
} else if (widgetId === "focusedWindow") {
SettingsData.setFocusedWindowCompactMode(value)
SettingsData.setFocusedWindowCompactMode(
value)
} else if (widgetId === "runningApps") {
SettingsData.setRunningAppsCompactMode(value)
SettingsData.setRunningAppsCompactMode(
value)
}
}
onGpuSelectionChanged: (sectionId, widgetIndex, selectedIndex) => {
widgetsTab.handleGpuSelectionChanged(
sectionId, widgetIndex, selectedIndex)
sectionId, widgetIndex,
selectedIndex)
}
}
@@ -659,42 +676,46 @@ Item {
allWidgets: widgetsTab.baseWidgetDefinitions
items: widgetsTab.getItemsForSection("right")
onItemEnabledChanged: (sectionId, itemId, enabled) => {
widgetsTab.handleItemEnabledChanged(sectionId,
itemId,
enabled)
widgetsTab.handleItemEnabledChanged(
sectionId, itemId, enabled)
}
onItemOrderChanged: newOrder => {
widgetsTab.handleItemOrderChanged("right",
newOrder)
widgetsTab.handleItemOrderChanged(
"right", newOrder)
}
onAddWidget: sectionId => {
widgetSelectionPopup.allWidgets = widgetsTab.baseWidgetDefinitions
widgetSelectionPopup.allWidgets
= widgetsTab.baseWidgetDefinitions
widgetSelectionPopup.targetSection = sectionId
widgetSelectionPopup.safeOpen()
}
onRemoveWidget: (sectionId, widgetIndex) => {
widgetsTab.removeWidgetFromSection(sectionId,
widgetIndex)
widgetsTab.removeWidgetFromSection(
sectionId, widgetIndex)
}
onSpacerSizeChanged: (sectionId, itemId, newSize) => {
widgetsTab.handleSpacerSizeChanged(sectionId,
itemId,
newSize)
widgetsTab.handleSpacerSizeChanged(
sectionId, itemId, newSize)
}
onCompactModeChanged: (widgetId, value) => {
if (widgetId === "clock") {
SettingsData.setClockCompactMode(value)
SettingsData.setClockCompactMode(
value)
} else if (widgetId === "music") {
SettingsData.setMediaSize(value)
SettingsData.setMediaSize(
value)
} else if (widgetId === "focusedWindow") {
SettingsData.setFocusedWindowCompactMode(value)
SettingsData.setFocusedWindowCompactMode(
value)
} else if (widgetId === "runningApps") {
SettingsData.setRunningAppsCompactMode(value)
SettingsData.setRunningAppsCompactMode(
value)
}
}
onGpuSelectionChanged: (sectionId, widgetIndex, selectedIndex) => {
widgetsTab.handleGpuSelectionChanged(
sectionId, widgetIndex, selectedIndex)
sectionId, widgetIndex,
selectedIndex)
}
}
}
@@ -742,7 +763,8 @@ Item {
description: "Show workspace index numbers in the top bar workspace switcher"
checked: SettingsData.showWorkspaceIndex
onToggled: checked => {
return SettingsData.setShowWorkspaceIndex(checked)
return SettingsData.setShowWorkspaceIndex(
checked)
}
}
@@ -752,7 +774,8 @@ Item {
description: "Always show a minimum of 3 workspaces, even if fewer are available"
checked: SettingsData.showWorkspacePadding
onToggled: checked => {
return SettingsData.setShowWorkspacePadding(checked)
return SettingsData.setShowWorkspacePadding(
checked)
}
}
}
@@ -811,9 +834,11 @@ Item {
width: parent.width
height: workspaceIconRow.implicitHeight + Theme.spacingM
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g,
color: Qt.rgba(Theme.surfaceContainer.r,
Theme.surfaceContainer.g,
Theme.surfaceContainer.b, 0.5)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
border.color: Qt.rgba(Theme.outline.r,
Theme.outline.g,
Theme.outline.b, 0.3)
border.width: 1
@@ -842,26 +867,33 @@ Item {
anchors.verticalCenter: parent.verticalCenter
Component.onCompleted: {
var iconData = SettingsData.getWorkspaceNameIcon(modelData)
var iconData = SettingsData.getWorkspaceNameIcon(
modelData)
if (iconData) {
setIcon(iconData.value, iconData.type)
setIcon(iconData.value,
iconData.type)
}
}
onIconSelected: (iconName, iconType) => {
SettingsData.setWorkspaceNameIcon(modelData, {
type: iconType,
value: iconName
SettingsData.setWorkspaceNameIcon(
modelData, {
"type": iconType,
"value": iconName
})
setIcon(iconName, iconType)
setIcon(iconName,
iconType)
}
Connections {
target: SettingsData
function onWorkspaceIconsUpdated() {
var iconData = SettingsData.getWorkspaceNameIcon(modelData)
var iconData = SettingsData.getWorkspaceNameIcon(
modelData)
if (iconData) {
iconPicker.setIcon(iconData.value, iconData.type)
iconPicker.setIcon(
iconData.value,
iconData.type)
} else {
iconPicker.setIcon("", "icon")
}
@@ -892,7 +924,8 @@ Item {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
SettingsData.removeWorkspaceNameIcon(modelData)
SettingsData.removeWorkspaceNameIcon(
modelData)
}
}
}
@@ -909,13 +942,13 @@ Item {
}
}
DankWidgetSelectionPopup {
id: widgetSelectionPopup
anchors.centerIn: parent
onWidgetSelected: (widgetId, targetSection) => {
widgetsTab.addWidgetToSection(widgetId, targetSection)
widgetsTab.addWidgetToSection(widgetId,
targetSection)
}
}
}

View File

@@ -75,7 +75,8 @@ Column {
anchors.fill: parent
anchors.margins: 2
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g,
color: Qt.rgba(Theme.surfaceContainer.r,
Theme.surfaceContainer.g,
Theme.surfaceContainer.b, 0.8)
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
Theme.outline.b, 0.2)
@@ -121,7 +122,8 @@ Column {
text: modelData.description
font.pixelSize: Theme.fontSizeSmall
color: modelData.enabled ? Theme.outline : Qt.rgba(
Theme.outline.r, Theme.outline.g,
Theme.outline.r,
Theme.outline.g,
Theme.outline.b, 0.6)
elide: Text.ElideRight
width: parent.width
@@ -156,7 +158,8 @@ Column {
}
return DgopService.availableGpus
&& DgopService.availableGpus.length
> 0 ? DgopService.availableGpus[0].driver.toUpperCase() : ""
> 0 ? DgopService.availableGpus[0].driver.toUpperCase(
) : ""
}
options: {
var gpuOptions = []
@@ -164,15 +167,19 @@ Column {
&& DgopService.availableGpus.length > 0) {
for (var i = 0; i < DgopService.availableGpus.length; i++) {
var gpu = DgopService.availableGpus[i]
gpuOptions.push(gpu.driver.toUpperCase())
gpuOptions.push(
gpu.driver.toUpperCase(
))
}
}
return gpuOptions
}
onValueChanged: value => {
var gpuIndex = options.indexOf(value)
var gpuIndex = options.indexOf(
value)
if (gpuIndex >= 0) {
root.gpuSelectionChanged(root.sectionId,
root.gpuSelectionChanged(
root.sectionId,
index, gpuIndex)
}
}
@@ -182,7 +189,12 @@ Column {
Item {
width: 32
height: 32
visible: (modelData.warning !== undefined && modelData.warning !== "") && (modelData.id === "cpuUsage" || modelData.id === "memUsage" || modelData.id === "cpuTemp" || modelData.id === "gpuTemp")
visible: (modelData.warning !== undefined
&& modelData.warning !== "")
&& (modelData.id === "cpuUsage"
|| modelData.id === "memUsage"
|| modelData.id === "cpuTemp"
|| modelData.id === "gpuTemp")
DankIcon {
name: "warning"
@@ -202,15 +214,20 @@ Column {
Rectangle {
id: warningTooltip
property string warningText: (modelData.warning !== undefined && modelData.warning !== "") ? modelData.warning : ""
property string warningText: (modelData.warning !== undefined
&& modelData.warning
!== "") ? modelData.warning : ""
width: Math.min(250, warningTooltipText.implicitWidth) + Theme.spacingM * 2
width: Math.min(
250,
warningTooltipText.implicitWidth) + Theme.spacingM * 2
height: warningTooltipText.implicitHeight + Theme.spacingS * 2
radius: Theme.cornerRadius
color: Theme.surfaceContainer
border.color: Theme.outline
border.width: 1
visible: warningArea.containsMouse && warningText !== ""
visible: warningArea.containsMouse
&& warningText !== ""
opacity: visible ? 1 : 0
x: -width - Theme.spacingS
y: (parent.height - height) / 2
@@ -238,7 +255,10 @@ Column {
Row {
spacing: Theme.spacingXS
visible: modelData.id === "clock" || modelData.id === "music" || modelData.id === "focusedWindow" || modelData.id === "runningApps"
visible: modelData.id === "clock"
|| modelData.id === "music"
|| modelData.id === "focusedWindow"
|| modelData.id === "runningApps"
DankActionButton {
id: smallSizeButton
@@ -246,7 +266,8 @@ Column {
visible: modelData.id === "music"
iconName: "photo_size_select_small"
iconSize: 16
iconColor: SettingsData.mediaSize === 0 ? Theme.primary : Theme.outline
iconColor: SettingsData.mediaSize
=== 0 ? Theme.primary : Theme.outline
onClicked: {
root.compactModeChanged("music", 0)
}
@@ -258,7 +279,8 @@ Column {
visible: modelData.id === "music"
iconName: "photo_size_select_actual"
iconSize: 16
iconColor: SettingsData.mediaSize === 1 ? Theme.primary : Theme.outline
iconColor: SettingsData.mediaSize
=== 1 ? Theme.primary : Theme.outline
onClicked: {
root.compactModeChanged("music", 1)
}
@@ -270,7 +292,8 @@ Column {
visible: modelData.id === "music"
iconName: "photo_size_select_large"
iconSize: 16
iconColor: SettingsData.mediaSize === 2 ? Theme.primary : Theme.outline
iconColor: SettingsData.mediaSize
=== 2 ? Theme.primary : Theme.outline
onClicked: {
root.compactModeChanged("music", 2)
}
@@ -279,27 +302,41 @@ Column {
DankActionButton {
id: compactModeButton
buttonSize: 28
visible: modelData.id === "clock" || modelData.id === "focusedWindow" || modelData.id === "runningApps"
visible: modelData.id === "clock"
|| modelData.id === "focusedWindow"
|| modelData.id === "runningApps"
iconName: {
if (modelData.id === "clock") return SettingsData.clockCompactMode ? "zoom_out" : "zoom_in"
if (modelData.id === "focusedWindow") return SettingsData.focusedWindowCompactMode ? "zoom_out" : "zoom_in"
if (modelData.id === "runningApps") return SettingsData.runningAppsCompactMode ? "zoom_out" : "zoom_in"
if (modelData.id === "clock")
return SettingsData.clockCompactMode ? "zoom_out" : "zoom_in"
if (modelData.id === "focusedWindow")
return SettingsData.focusedWindowCompactMode ? "zoom_out" : "zoom_in"
if (modelData.id === "runningApps")
return SettingsData.runningAppsCompactMode ? "zoom_out" : "zoom_in"
return "zoom_in"
}
iconSize: 16
iconColor: {
if (modelData.id === "clock") return SettingsData.clockCompactMode ? Theme.primary : Theme.outline
if (modelData.id === "focusedWindow") return SettingsData.focusedWindowCompactMode ? Theme.primary : Theme.outline
if (modelData.id === "runningApps") return SettingsData.runningAppsCompactMode ? Theme.primary : Theme.outline
if (modelData.id === "clock")
return SettingsData.clockCompactMode ? Theme.primary : Theme.outline
if (modelData.id === "focusedWindow")
return SettingsData.focusedWindowCompactMode ? Theme.primary : Theme.outline
if (modelData.id === "runningApps")
return SettingsData.runningAppsCompactMode ? Theme.primary : Theme.outline
return Theme.outline
}
onClicked: {
if (modelData.id === "clock") {
root.compactModeChanged("clock", !SettingsData.clockCompactMode)
root.compactModeChanged(
"clock",
!SettingsData.clockCompactMode)
} else if (modelData.id === "focusedWindow") {
root.compactModeChanged("focusedWindow", !SettingsData.focusedWindowCompactMode)
root.compactModeChanged(
"focusedWindow",
!SettingsData.focusedWindowCompactMode)
} else if (modelData.id === "runningApps") {
root.compactModeChanged("runningApps", !SettingsData.runningAppsCompactMode)
root.compactModeChanged(
"runningApps",
!SettingsData.runningAppsCompactMode)
}
}
}
@@ -342,7 +379,8 @@ Column {
iconSize: 18
iconColor: modelData.enabled ? Theme.primary : Theme.outline
onClicked: {
root.itemEnabledChanged(root.sectionId, modelData.id,
root.itemEnabledChanged(root.sectionId,
modelData.id,
!modelData.enabled)
}
}
@@ -360,7 +398,9 @@ Column {
onClicked: {
var currentSize = modelData.size || 20
var newSize = Math.max(5, currentSize - 5)
root.spacerSizeChanged(root.sectionId, modelData.id, newSize)
root.spacerSizeChanged(root.sectionId,
modelData.id,
newSize)
}
}
@@ -378,8 +418,11 @@ Column {
iconColor: Theme.outline
onClicked: {
var currentSize = modelData.size || 20
var newSize = Math.min(5000, currentSize + 5)
root.spacerSizeChanged(root.sectionId, modelData.id, newSize)
var newSize = Math.min(5000,
currentSize + 5)
root.spacerSizeChanged(root.sectionId,
modelData.id,
newSize)
}
}
}
@@ -417,12 +460,15 @@ Column {
delegateItem.z = 1
if (drag.active) {
var newIndex = Math.round(
delegateItem.y / (delegateItem.height + itemsList.spacing))
newIndex = Math.max(0, Math.min(newIndex,
delegateItem.y / (delegateItem.height
+ itemsList.spacing))
newIndex = Math.max(
0, Math.min(newIndex,
root.items.length - 1))
if (newIndex !== index) {
var newItems = root.items.slice()
var draggedItem = newItems.splice(index, 1)[0]
var draggedItem = newItems.splice(index,
1)[0]
newItems.splice(newIndex, 0, draggedItem)
root.itemOrderChanged(newItems.map(item => {
return ({

View File

@@ -39,7 +39,8 @@ PanelWindow {
}
}
width: ToastService.hasDetails ? 380 : messageText.implicitWidth + Theme.iconSize + Theme.spacingM * 3 + Theme.spacingL * 2
width: ToastService.hasDetails ? 380 : messageText.implicitWidth + Theme.iconSize
+ Theme.spacingM * 3 + Theme.spacingL * 2
height: toastContent.height + Theme.spacingL * 2
anchors.horizontalCenter: parent.horizontalCenter
y: Theme.barHeight - 4 + SettingsData.topBarSpacing + 2
@@ -177,7 +178,8 @@ PanelWindow {
property bool showTooltip: false
onClicked: {
Quickshell.execDetached(["wl-copy", ToastService.currentDetails])
Quickshell.execDetached(
["wl-copy", ToastService.currentDetails])
showTooltip = true
tooltipTimer.start()
}
@@ -237,7 +239,6 @@ PanelWindow {
}
}
Behavior on color {
ColorAnimation {
duration: Theme.shortDuration

View File

@@ -49,7 +49,8 @@ Item {
height: {
if (root.isPlaying && CavaService.values.length > index) {
const rawLevel = CavaService.values[index] || 0
const scaledLevel = Math.sqrt(Math.min(Math.max(rawLevel, 0),
const scaledLevel = Math.sqrt(
Math.min(Math.max(rawLevel, 0),
100) / 100) * 100
const maxHeight = Theme.iconSize - 2
const minHeight = 3

View File

@@ -131,8 +131,8 @@ Rectangle {
var currentScreen = parentScreen || Screen
var screenX = currentScreen.x || 0
var relativeX = globalPos.x - screenX
popupTarget.setTriggerPosition(relativeX,
Theme.barHeight + Theme.spacingXS,
popupTarget.setTriggerPosition(
relativeX, Theme.barHeight + Theme.spacingXS,
width, section, currentScreen)
}
toggleBatteryPopup()

View File

@@ -50,7 +50,6 @@ DankPopout {
shouldBeVisible: false
visible: shouldBeVisible
content: Component {
Rectangle {
id: batteryContent
@@ -167,7 +166,8 @@ DankPopout {
width: parent.width
height: 80
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
color: Qt.rgba(Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b,
Theme.getContentBackgroundAlpha() * 0.4)
border.color: BatteryService.isCharging ? Theme.primary : (BatteryService.isLowBattery ? Theme.error : Theme.outlineMedium)
@@ -187,7 +187,8 @@ DankPopout {
return "power"
// Check if plugged in but not charging (like at 80% charge limit)
if (!BatteryService.isCharging && BatteryService.isPluggedIn) {
if (!BatteryService.isCharging
&& BatteryService.isPluggedIn) {
if (BatteryService.batteryLevel >= 90)
return "battery_charging_full"
if (BatteryService.batteryLevel >= 80)
@@ -235,10 +236,12 @@ DankPopout {
}
size: Theme.iconSizeLarge
color: {
if (BatteryService.isLowBattery && !BatteryService.isCharging)
if (BatteryService.isLowBattery
&& !BatteryService.isCharging)
return Theme.error
if (BatteryService.isCharging || BatteryService.isPluggedIn)
if (BatteryService.isCharging
|| BatteryService.isPluggedIn)
return Theme.primary
return Theme.surfaceText
@@ -291,8 +294,7 @@ DankPopout {
text: {
let time = BatteryService.formatTimeRemaining()
if (time !== "Unknown")
return BatteryService.isCharging ? "Time until full: "
+ time : "Time remaining: " + time
return BatteryService.isCharging ? "Time until full: " + time : "Time remaining: " + time
return ""
}
@@ -308,7 +310,8 @@ DankPopout {
width: parent.width
height: 80
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceVariant.r, Theme.surfaceVariant.g,
color: Qt.rgba(Theme.surfaceVariant.r,
Theme.surfaceVariant.g,
Theme.surfaceVariant.b,
Theme.getContentBackgroundAlpha() * 0.4)
border.color: Theme.outlineMedium
@@ -380,7 +383,8 @@ DankPopout {
if (BatteryService.batteryHealth === "N/A")
return Theme.surfaceText
var healthNum = parseInt(BatteryService.batteryHealth)
var healthNum = parseInt(
BatteryService.batteryHealth)
return healthNum < 80 ? Theme.error : Theme.surfaceText
}
}
@@ -398,7 +402,8 @@ DankPopout {
}
StyledText {
text: BatteryService.batteryCapacity > 0 ? BatteryService.batteryCapacity.toFixed(
text: BatteryService.batteryCapacity
> 0 ? BatteryService.batteryCapacity.toFixed(
1) + " Wh" : "Unknown"
font.pixelSize: Theme.fontSizeMedium
color: Theme.surfaceText
@@ -424,9 +429,7 @@ DankPopout {
spacing: Theme.spacingS
Repeater {
model: (typeof PowerProfiles
!== "undefined") ? [PowerProfile.PowerSaver, PowerProfile.Balanced].concat(
PowerProfiles.hasPerformanceProfile ? [PowerProfile.Performance] : []) : [PowerProfile.PowerSaver, PowerProfile.Balanced, PowerProfile.Performance]
model: (typeof PowerProfiles !== "undefined") ? [PowerProfile.PowerSaver, PowerProfile.Balanced].concat(PowerProfiles.hasPerformanceProfile ? [PowerProfile.Performance] : []) : [PowerProfile.PowerSaver, PowerProfile.Balanced, PowerProfile.Performance]
Rectangle {
width: parent.width
@@ -435,7 +438,8 @@ DankPopout {
color: profileArea.containsMouse ? Theme.primaryHoverLight : (root.isActiveProfile(modelData) ? Theme.primaryPressed : Theme.surfaceLight)
border.color: root.isActiveProfile(
modelData) ? Theme.primary : Theme.outlineLight
border.width: root.isActiveProfile(modelData) ? 2 : 1
border.width: root.isActiveProfile(
modelData) ? 2 : 1
Row {
anchors.left: parent.left
@@ -444,7 +448,8 @@ DankPopout {
spacing: Theme.spacingM
DankIcon {
name: Theme.getPowerProfileIcon(modelData)
name: Theme.getPowerProfileIcon(
modelData)
size: Theme.iconSize
color: root.isActiveProfile(
modelData) ? Theme.primary : Theme.surfaceText
@@ -456,7 +461,8 @@ DankPopout {
anchors.verticalCenter: parent.verticalCenter
StyledText {
text: Theme.getPowerProfileLabel(modelData)
text: Theme.getPowerProfileLabel(
modelData)
font.pixelSize: Theme.fontSizeMedium
color: root.isActiveProfile(
modelData) ? Theme.primary : Theme.surfaceText
@@ -465,7 +471,8 @@ DankPopout {
}
StyledText {
text: Theme.getPowerProfileDescription(modelData)
text: Theme.getPowerProfileDescription(
modelData)
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceTextMedium
}
@@ -495,7 +502,8 @@ DankPopout {
border.color: Theme.primarySelected
border.width: 1
visible: (typeof PowerProfiles !== "undefined")
&& PowerProfiles.degradationReason !== PerformanceDegradationReason.None
&& PowerProfiles.degradationReason
!== PerformanceDegradationReason.None
Row {
anchors.left: parent.left

View File

@@ -12,17 +12,18 @@ Rectangle {
property var popupTarget: null
property var parentScreen: null
signal clockClicked()
signal clockClicked
width: clockRow.implicitWidth + Theme.spacingS * 2
height: 30
radius: Theme.cornerRadius
color: {
const baseColor = clockMouseArea.containsMouse ? Theme.primaryHover : Theme.surfaceTextHover;
return Qt.rgba(baseColor.r, baseColor.g, baseColor.b, baseColor.a * Theme.widgetTransparency);
const baseColor = clockMouseArea.containsMouse ? Theme.primaryHover : Theme.surfaceTextHover
return Qt.rgba(baseColor.r, baseColor.g, baseColor.b,
baseColor.a * Theme.widgetTransparency)
}
Component.onCompleted: {
root.currentDate = systemClock.date;
root.currentDate = systemClock.date
}
Row {
@@ -32,7 +33,10 @@ Rectangle {
spacing: Theme.spacingS
StyledText {
text: SettingsData.use24HourClock ? Qt.formatTime(root.currentDate, "H:mm") : Qt.formatTime(root.currentDate, "h:mm AP")
text: SettingsData.use24HourClock ? Qt.formatTime(
root.currentDate,
"H:mm") : Qt.formatTime(
root.currentDate, "h:mm AP")
font.pixelSize: Theme.fontSizeMedium - 1
color: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
@@ -53,7 +57,6 @@ Rectangle {
anchors.verticalCenter: parent.verticalCenter
visible: !SettingsData.clockCompactMode
}
}
SystemClock {
@@ -71,13 +74,15 @@ Rectangle {
cursorShape: Qt.PointingHandCursor
onPressed: {
if (popupTarget && popupTarget.setTriggerPosition) {
var globalPos = mapToGlobal(0, 0);
var currentScreen = parentScreen || Screen;
var screenX = currentScreen.x || 0;
var relativeX = globalPos.x - screenX;
popupTarget.setTriggerPosition(relativeX, Theme.barHeight + Theme.spacingXS, width, section, currentScreen);
var globalPos = mapToGlobal(0, 0)
var currentScreen = parentScreen || Screen
var screenX = currentScreen.x || 0
var relativeX = globalPos.x - screenX
popupTarget.setTriggerPosition(
relativeX, Theme.barHeight + Theme.spacingXS,
width, section, currentScreen)
}
root.clockClicked();
root.clockClicked()
}
}
@@ -86,7 +91,5 @@ Rectangle {
duration: Theme.shortDuration
easing.type: Theme.standardEasing
}
}
}

View File

@@ -36,7 +36,8 @@ Rectangle {
return NetworkService.wifiSignalIcon
}
size: Theme.iconSize - 8
color: NetworkService.networkStatus !== "disconnected" ? Theme.primary : Theme.outlineButton
color: NetworkService.networkStatus
!== "disconnected" ? Theme.primary : Theme.outlineButton
anchors.verticalCenter: parent.verticalCenter
visible: true
}
@@ -60,7 +61,8 @@ Rectangle {
name: {
if (AudioService.sink && AudioService.sink.audio) {
if (AudioService.sink.audio.muted || AudioService.sink.audio.volume === 0)
if (AudioService.sink.audio.muted
|| AudioService.sink.audio.volume === 0)
return "volume_off"
else if (AudioService.sink.audio.volume * 100 < 33)
return "volume_down"
@@ -70,7 +72,8 @@ Rectangle {
return "volume_up"
}
size: Theme.iconSize - 8
color: audioWheelArea.containsMouse || controlCenterArea.containsMouse
color: audioWheelArea.containsMouse
|| controlCenterArea.containsMouse
|| root.isActive ? Theme.primary : Theme.surfaceText
anchors.centerIn: parent
}
@@ -83,8 +86,10 @@ Rectangle {
acceptedButtons: Qt.NoButton
onWheel: function (wheelEvent) {
let delta = wheelEvent.angleDelta.y
let currentVolume = (AudioService.sink && AudioService.sink.audio
&& AudioService.sink.audio.volume * 100) || 0
let currentVolume = (AudioService.sink
&& AudioService.sink.audio
&& AudioService.sink.audio.volume * 100)
|| 0
let newVolume
if (delta > 0)
newVolume = Math.min(100, currentVolume + 5)
@@ -120,8 +125,8 @@ Rectangle {
var currentScreen = parentScreen || Screen
var screenX = currentScreen.x || 0
var relativeX = globalPos.x - screenX
popupTarget.setTriggerPosition(relativeX,
Theme.barHeight + Theme.spacingXS,
popupTarget.setTriggerPosition(
relativeX, Theme.barHeight + Theme.spacingXS,
width, section, currentScreen)
}
root.clicked()

View File

@@ -41,8 +41,8 @@ Rectangle {
var currentScreen = parentScreen || Screen
var screenX = currentScreen.x || 0
var relativeX = globalPos.x - screenX
popupTarget.setTriggerPosition(relativeX,
Theme.barHeight + Theme.spacingXS,
popupTarget.setTriggerPosition(
relativeX, Theme.barHeight + Theme.spacingXS,
width, section, currentScreen)
}
DgopService.setSortBy("cpu")

View File

@@ -41,8 +41,8 @@ Rectangle {
var currentScreen = parentScreen || Screen
var screenX = currentScreen.x || 0
var relativeX = globalPos.x - screenX
popupTarget.setTriggerPosition(relativeX,
Theme.barHeight + Theme.spacingXS,
popupTarget.setTriggerPosition(
relativeX, Theme.barHeight + Theme.spacingXS,
width, section, currentScreen)
}
DgopService.setSortBy("cpu")

View File

@@ -13,15 +13,18 @@ Rectangle {
readonly property int maxNormalWidth: 456
readonly property int maxCompactWidth: 288
width: compactMode ? Math.min(baseWidth, maxCompactWidth) : Math.min(baseWidth, maxNormalWidth)
width: compactMode ? Math.min(baseWidth,
maxCompactWidth) : Math.min(baseWidth,
maxNormalWidth)
height: 30
radius: Theme.cornerRadius
color: {
if (!NiriService.focusedWindowTitle)
return "transparent";
return "transparent"
const baseColor = mouseArea.containsMouse ? Theme.primaryHover : Theme.surfaceTextHover;
return Qt.rgba(baseColor.r, baseColor.g, baseColor.b, baseColor.a * Theme.widgetTransparency);
const baseColor = mouseArea.containsMouse ? Theme.primaryHover : Theme.surfaceTextHover
return Qt.rgba(baseColor.r, baseColor.g, baseColor.b,
baseColor.a * Theme.widgetTransparency)
}
clip: true
visible: NiriService.niriAvailable && NiriService.focusedWindowTitle
@@ -37,16 +40,17 @@ Rectangle {
text: {
if (!NiriService.focusedWindowId)
return "";
return ""
var window = NiriService.windows.find((w) => {
return w.id == NiriService.focusedWindowId;
});
var window = NiriService.windows.find(w => {
return w.id == NiriService.focusedWindowId
})
if (!window || !window.app_id)
return "";
return ""
var desktopEntry = DesktopEntries.byId(window.app_id);
return desktopEntry && desktopEntry.name ? desktopEntry.name : window.app_id;
var desktopEntry = DesktopEntries.byId(window.app_id)
return desktopEntry
&& desktopEntry.name ? desktopEntry.name : window.app_id
}
font.pixelSize: Theme.fontSizeSmall
font.weight: Font.Medium
@@ -70,20 +74,24 @@ Rectangle {
id: titleText
text: {
var title = NiriService.focusedWindowTitle || "";
var appName = appText.text;
var title = NiriService.focusedWindowTitle || ""
var appName = appText.text
if (!title || !appName) return title;
if (!title || !appName)
return title
// Remove app name from end of title if it exists there
if (title.endsWith(" - " + appName)) {
return title.substring(0, title.length - (" - " + appName).length);
return title.substring(
0, title.length - (" - " + appName).length)
}
if (title.endsWith(appName)) {
return title.substring(0, title.length - appName.length).replace(/ - $/, "");
return title.substring(
0, title.length - appName.length).replace(
/ - $/, "")
}
return title;
return title
}
font.pixelSize: Theme.fontSizeSmall
font.weight: Font.Medium
@@ -94,7 +102,6 @@ Rectangle {
width: Math.min(implicitWidth, compactMode ? 280 : 250)
visible: text.length > 0
}
}
MouseArea {
@@ -109,7 +116,6 @@ Rectangle {
duration: Theme.shortDuration
easing.type: Theme.standardEasing
}
}
Behavior on width {
@@ -117,7 +123,5 @@ Rectangle {
duration: Theme.shortDuration
easing.type: Theme.standardEasing
}
}
}

View File

@@ -38,7 +38,10 @@ Rectangle {
}
Component.onCompleted: {
DgopService.addRef(["gpu"])
console.log("GpuTemperature widget - pciId:", widgetData ? widgetData.pciId : "no widgetData", "selectedGpuIndex:", widgetData ? widgetData.selectedGpuIndex : "no widgetData")
console.log("GpuTemperature widget - pciId:",
widgetData ? widgetData.pciId : "no widgetData",
"selectedGpuIndex:",
widgetData ? widgetData.selectedGpuIndex : "no widgetData")
// Add this widget's PCI ID to the service
if (widgetData && widgetData.pciId) {
console.log("Adding GPU PCI ID to service:", widgetData.pciId)
@@ -80,8 +83,8 @@ Rectangle {
var currentScreen = parentScreen || Screen
var screenX = currentScreen.x || 0
var relativeX = globalPos.x - screenX
popupTarget.setTriggerPosition(relativeX,
Theme.barHeight + Theme.spacingXS,
popupTarget.setTriggerPosition(
relativeX, Theme.barHeight + Theme.spacingXS,
width, section, currentScreen)
}
DgopService.setSortBy("cpu")
@@ -136,7 +139,8 @@ Rectangle {
interval: 100
running: false
onTriggered: {
if (DgopService.availableGpus && DgopService.availableGpus.length > 0) {
if (DgopService.availableGpus
&& DgopService.availableGpus.length > 0) {
const firstGpu = DgopService.availableGpus[0]
if (firstGpu && firstGpu.pciId) {
// Save the first GPU's PCI ID to this widget's settings
@@ -182,5 +186,4 @@ Rectangle {
}
}
}
}

View File

@@ -16,9 +16,7 @@ Rectangle {
height: 30
radius: Theme.cornerRadius
color: {
const baseColor = mouseArea.containsMouse
? Theme.primaryPressed
: (IdleInhibitorService.idleInhibited ? Theme.primaryHover : Theme.secondaryHover)
const baseColor = mouseArea.containsMouse ? Theme.primaryPressed : (IdleInhibitorService.idleInhibited ? Theme.primaryHover : Theme.secondaryHover)
return Qt.rgba(baseColor.r, baseColor.g, baseColor.b,
baseColor.a * Theme.widgetTransparency)
}
@@ -42,7 +40,6 @@ Rectangle {
}
}
Behavior on color {
ColorAnimation {
duration: Theme.shortDuration

View File

@@ -29,19 +29,19 @@ Item {
var currentScreen = parentScreen || Screen
var screenX = currentScreen.x || 0
var relativeX = globalPos.x - screenX
popupTarget.setTriggerPosition(relativeX,
Theme.barHeight + Theme.spacingXS,
popupTarget.setTriggerPosition(
relativeX, Theme.barHeight + Theme.spacingXS,
width, section, currentScreen)
}
root.clicked()
}
}
Rectangle {
anchors.fill: parent
radius: Theme.cornerRadius
color: Qt.rgba(Theme.surfaceTextHover.r, Theme.surfaceTextHover.g, Theme.surfaceTextHover.b,
color: Qt.rgba(Theme.surfaceTextHover.r, Theme.surfaceTextHover.g,
Theme.surfaceTextHover.b,
Theme.surfaceTextHover.a * Theme.widgetTransparency)
SystemLogo {
@@ -61,6 +61,5 @@ Item {
size: Theme.iconSize - 6
color: Theme.surfaceText
}
}
}

View File

@@ -12,9 +12,12 @@ Rectangle {
property bool compactMode: false
readonly property int textWidth: {
switch (SettingsData.mediaSize) {
case 0: return 0 // No text in small mode
case 2: return 180 // Large text area
default: return 120 // Medium text area
case 0:
return 0 // No text in small mode
case 2:
return 180 // Large text area
default:
return 120 // Medium text area
}
}
@@ -119,7 +122,8 @@ Rectangle {
let identity = activePlayer.identity || ""
let isWebMedia = identity.toLowerCase().includes("firefox")
|| identity.toLowerCase().includes(
"chrome") || identity.toLowerCase().includes("chromium")
"chrome") || identity.toLowerCase(
).includes("chromium")
|| identity.toLowerCase().includes(
"edge") || identity.toLowerCase().includes("safari")
let title = ""
@@ -151,27 +155,36 @@ Rectangle {
SequentialAnimation {
id: scrollAnimation
running: mediaText.needsScrolling && textContainer.visible
running: mediaText.needsScrolling
&& textContainer.visible
loops: Animation.Infinite
PauseAnimation { duration: 2000 }
PauseAnimation {
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)
duration: Math.max(
1000,
(mediaText.implicitWidth - textContainer.width + 5) * 60)
easing.type: Easing.Linear
}
PauseAnimation { duration: 2000 }
PauseAnimation {
duration: 2000
}
NumberAnimation {
target: mediaText
property: "scrollOffset"
to: 0
duration: Math.max(1000, (mediaText.implicitWidth - textContainer.width + 5) * 60)
duration: Math.max(
1000,
(mediaText.implicitWidth - textContainer.width + 5) * 60)
easing.type: Easing.Linear
}
}
@@ -184,18 +197,21 @@ Rectangle {
MouseArea {
anchors.fill: parent
enabled: root.playerAvailable && root.opacity > 0 && root.width > 0 && textContainer.visible
enabled: root.playerAvailable && root.opacity > 0
&& root.width > 0 && textContainer.visible
hoverEnabled: enabled
cursorShape: enabled ? Qt.PointingHandCursor : Qt.ArrowCursor
onPressed: {
if (root.popupTarget && root.popupTarget.setTriggerPosition) {
if (root.popupTarget
&& root.popupTarget.setTriggerPosition) {
var globalPos = mapToGlobal(0, 0)
var currentScreen = root.parentScreen || Screen
var screenX = currentScreen.x || 0
var relativeX = globalPos.x - screenX
root.popupTarget.setTriggerPosition(
relativeX, Theme.barHeight + Theme.spacingXS, root.width,
root.section, currentScreen)
relativeX,
Theme.barHeight + Theme.spacingXS,
root.width, root.section, currentScreen)
}
root.clicked()
}

View File

@@ -55,8 +55,8 @@ Rectangle {
var currentScreen = parentScreen || Screen
var screenX = currentScreen.x || 0
var relativeX = globalPos.x - screenX
popupTarget.setTriggerPosition(relativeX,
Theme.barHeight + Theme.spacingXS,
popupTarget.setTriggerPosition(
relativeX, Theme.barHeight + Theme.spacingXS,
width, section, currentScreen)
}
root.clicked()

View File

@@ -84,7 +84,6 @@ Rectangle {
anchors.top: parent.top
anchors.rightMargin: -2
anchors.topMargin: -1
}
}

View File

@@ -41,8 +41,8 @@ Rectangle {
var currentScreen = parentScreen || Screen
var screenX = currentScreen.x || 0
var relativeX = globalPos.x - screenX
popupTarget.setTriggerPosition(relativeX,
Theme.barHeight + Theme.spacingXS,
popupTarget.setTriggerPosition(
relativeX, Theme.barHeight + Theme.spacingXS,
width, section, currentScreen)
}
DgopService.setSortBy("memory")

View File

@@ -17,11 +17,13 @@ Rectangle {
property Item windowRoot: (Window.window ? Window.window.contentItem : null)
readonly property int windowCount: NiriService.windows.length
readonly property int calculatedWidth: {
if (windowCount === 0) return 0;
if (windowCount === 0)
return 0
if (SettingsData.runningAppsCompactMode) {
return windowCount * 24 + (windowCount - 1) * Theme.spacingXS + Theme.spacingS * 2;
return windowCount * 24 + (windowCount - 1) * Theme.spacingXS + Theme.spacingS * 2
} else {
return windowCount * (24 + Theme.spacingXS + 120) + (windowCount - 1) * Theme.spacingXS + Theme.spacingS * 2;
return windowCount * (24 + Theme.spacingXS + 120)
+ (windowCount - 1) * Theme.spacingXS + Theme.spacingS * 2
}
}
@@ -32,10 +34,11 @@ Rectangle {
clip: false
color: {
if (windowCount === 0)
return "transparent";
return "transparent"
const baseColor = Theme.secondaryHover;
return Qt.rgba(baseColor.r, baseColor.g, baseColor.b, baseColor.a * Theme.widgetTransparency);
const baseColor = Theme.secondaryHover
return Qt.rgba(baseColor.r, baseColor.g, baseColor.b,
baseColor.a * Theme.widgetTransparency)
}
Row {
@@ -52,17 +55,19 @@ Rectangle {
delegate: Item {
id: delegateItem
property bool isFocused: String(modelData.id) === String(NiriService.focusedWindowId)
property bool isFocused: String(modelData.id) === String(
NiriService.focusedWindowId)
property string appId: modelData.app_id || ""
property string windowTitle: modelData.title || "(Unnamed)"
property int windowId: modelData.id
property string tooltipText: {
var appName = "Unknown";
var appName = "Unknown"
if (appId) {
var desktopEntry = DesktopEntries.byId(appId);
appName = desktopEntry && desktopEntry.name ? desktopEntry.name : appId;
var desktopEntry = DesktopEntries.byId(appId)
appName = desktopEntry
&& desktopEntry.name ? desktopEntry.name : appId
}
return appName + (windowTitle ? " • " + windowTitle : "");
return appName + (windowTitle ? " • " + windowTitle : "")
}
width: SettingsData.runningAppsCompactMode ? 24 : (24 + Theme.spacingXS + 120)
@@ -73,9 +78,21 @@ Rectangle {
radius: Theme.cornerRadius
color: {
if (isFocused)
return mouseArea.containsMouse ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.3) : Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.2);
return mouseArea.containsMouse ? Qt.rgba(
Theme.primary.r,
Theme.primary.g,
Theme.primary.b,
0.3) : Qt.rgba(
Theme.primary.r,
Theme.primary.g,
Theme.primary.b,
0.2)
else
return mouseArea.containsMouse ? Qt.rgba(Theme.primaryHover.r, Theme.primaryHover.g, Theme.primaryHover.b, 0.1) : "transparent";
return mouseArea.containsMouse ? Qt.rgba(
Theme.primaryHover.r,
Theme.primaryHover.g,
Theme.primaryHover.b,
0.1) : "transparent"
}
Behavior on color {
@@ -83,9 +100,7 @@ Rectangle {
duration: Theme.shortDuration
easing.type: Theme.standardEasing
}
}
}
// App icon
@@ -99,14 +114,17 @@ Rectangle {
height: 18
source: {
if (!appId)
return "";
return ""
var desktopEntry = DesktopEntries.byId(appId);
var desktopEntry = DesktopEntries.byId(appId)
if (desktopEntry && desktopEntry.icon) {
var iconPath = Quickshell.iconPath(desktopEntry.icon, SettingsData.iconTheme === "System Default" ? "" : SettingsData.iconTheme);
return iconPath;
var iconPath = Quickshell.iconPath(
desktopEntry.icon,
SettingsData.iconTheme
=== "System Default" ? "" : SettingsData.iconTheme)
return iconPath
}
return "";
return ""
}
smooth: true
mipmap: true
@@ -122,13 +140,13 @@ Rectangle {
visible: !iconImg.visible
text: {
if (!appId)
return "?";
return "?"
var desktopEntry = DesktopEntries.byId(appId);
var desktopEntry = DesktopEntries.byId(appId)
if (desktopEntry && desktopEntry.name)
return desktopEntry.name.charAt(0).toUpperCase();
return desktopEntry.name.charAt(0).toUpperCase()
return appId.charAt(0).toUpperCase();
return appId.charAt(0).toUpperCase()
}
font.pixelSize: 10
color: Theme.surfaceText
@@ -158,32 +176,33 @@ Rectangle {
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: {
NiriService.focusWindow(windowId);
NiriService.focusWindow(windowId)
}
onEntered: {
root.hoveredItem = delegateItem;
var globalPos = delegateItem.mapToGlobal(delegateItem.width / 2, delegateItem.height);
tooltipLoader.active = true;
root.hoveredItem = delegateItem
var globalPos = delegateItem.mapToGlobal(
delegateItem.width / 2, delegateItem.height)
tooltipLoader.active = true
if (tooltipLoader.item) {
var tooltipY = Theme.barHeight + SettingsData.topBarSpacing + Theme.spacingXS;
tooltipLoader.item.showTooltip(delegateItem.tooltipText, globalPos.x, tooltipY, root.parentScreen);
var tooltipY = Theme.barHeight
+ SettingsData.topBarSpacing + Theme.spacingXS
tooltipLoader.item.showTooltip(
delegateItem.tooltipText, globalPos.x,
tooltipY, root.parentScreen)
}
}
onExited: {
if (root.hoveredItem === delegateItem) {
root.hoveredItem = null;
root.hoveredItem = null
if (tooltipLoader.item)
tooltipLoader.item.hideTooltip();
tooltipLoader.item.hideTooltip()
tooltipLoader.active = false;
tooltipLoader.active = false
}
}
}
}
}
}
Loader {
@@ -191,9 +210,6 @@ Rectangle {
active: false
sourceComponent: RunningAppsTooltip {
sourceComponent: RunningAppsTooltip {}
}
}
}

View File

@@ -27,7 +27,9 @@ PanelWindow {
}
screen: targetScreen
implicitWidth: Math.min(300, Math.max(120, textContent.implicitWidth + Theme.spacingM * 2))
implicitWidth: Math.min(300, Math.max(
120,
textContent.implicitWidth + Theme.spacingM * 2))
implicitHeight: textContent.implicitHeight + Theme.spacingS * 2
color: "transparent"
visible: false

View File

@@ -95,7 +95,8 @@ Rectangle {
if (!trayItem)
return
if (mouse.button === Qt.LeftButton && !trayItem.onlyMenu) {
if (mouse.button === Qt.LeftButton
&& !trayItem.onlyMenu) {
trayItem.activate()
return
}

View File

@@ -59,31 +59,44 @@ PanelWindow {
function forceWidgetRefresh() {
// Force reload of all widget sections to handle race condition on desktop hardware
if (leftSection) leftSection.visible = false
if (centerSection) centerSection.visible = false
if (rightSection) rightSection.visible = false
if (leftSection)
leftSection.visible = false
if (centerSection)
centerSection.visible = false
if (rightSection)
rightSection.visible = false
Qt.callLater(() => {
if (leftSection) leftSection.visible = true
if (centerSection) centerSection.visible = true
if (rightSection) rightSection.visible = true
if (leftSection)
leftSection.visible = true
if (centerSection)
centerSection.visible = true
if (rightSection)
rightSection.visible = true
})
}
function updateGpuTempConfig() {
const allWidgets = [...(SettingsData.topBarLeftWidgets || []),
...(SettingsData.topBarCenterWidgets || []),
...(SettingsData.topBarRightWidgets || [])]
const allWidgets = [...(SettingsData.topBarLeftWidgets
|| []), ...(SettingsData.topBarCenterWidgets
|| []), ...(SettingsData.topBarRightWidgets
|| [])]
const hasGpuTempWidget = allWidgets.some(widget => {
const widgetId = typeof widget === "string" ? widget : widget.id
const widgetId = typeof widget
=== "string" ? widget : widget.id
const widgetEnabled = typeof widget === "string" ? true : (widget.enabled !== false)
return widgetId === "gpuTemp" && widgetEnabled
return widgetId === "gpuTemp"
&& widgetEnabled
})
DgopService.gpuTempEnabled = hasGpuTempWidget || SessionData.nvidiaGpuTempEnabled || SessionData.nonNvidiaGpuTempEnabled
DgopService.nvidiaGpuTempEnabled = hasGpuTempWidget || SessionData.nvidiaGpuTempEnabled
DgopService.nonNvidiaGpuTempEnabled = hasGpuTempWidget || SessionData.nonNvidiaGpuTempEnabled
DgopService.gpuTempEnabled = hasGpuTempWidget
|| SessionData.nvidiaGpuTempEnabled
|| SessionData.nonNvidiaGpuTempEnabled
DgopService.nvidiaGpuTempEnabled = hasGpuTempWidget
|| SessionData.nvidiaGpuTempEnabled
DgopService.nonNvidiaGpuTempEnabled = hasGpuTempWidget
|| SessionData.nonNvidiaGpuTempEnabled
}
Connections {
@@ -189,8 +202,10 @@ PanelWindow {
Rectangle {
anchors.fill: parent
radius: SettingsData.topBarSquareCorners ? 0 : Theme.cornerRadius
color: Qt.rgba(Theme.surfaceContainer.r, Theme.surfaceContainer.g,
Theme.surfaceContainer.b, root.backgroundTransparency)
color: Qt.rgba(Theme.surfaceContainer.r,
Theme.surfaceContainer.g,
Theme.surfaceContainer.b,
root.backgroundTransparency)
layer.enabled: true
Rectangle {
@@ -203,7 +218,8 @@ PanelWindow {
Rectangle {
anchors.fill: parent
color: Qt.rgba(Theme.surfaceTint.r, Theme.surfaceTint.g,
color: Qt.rgba(Theme.surfaceTint.r,
Theme.surfaceTint.g,
Theme.surfaceTint.b, 0.04)
radius: parent.radius
@@ -242,8 +258,7 @@ PanelWindow {
readonly property int launcherButtonWidth: 40
readonly property int workspaceSwitcherWidth: 120 // Approximate
readonly property int focusedAppMaxWidth: 456 // Fixed width since we don't have focusedApp reference
readonly property int estimatedLeftSectionWidth: launcherButtonWidth + workspaceSwitcherWidth
+ focusedAppMaxWidth + (Theme.spacingXS * 2)
readonly property int estimatedLeftSectionWidth: launcherButtonWidth + workspaceSwitcherWidth + focusedAppMaxWidth + (Theme.spacingXS * 2)
readonly property int rightSectionWidth: rightSection.width
readonly property int clockWidth: 120 // Approximate clock width
readonly property int mediaMaxWidth: 280 // Normal max width
@@ -254,19 +269,17 @@ PanelWindow {
readonly property int clockLeftEdge: (availableWidth - clockWidth) / 2
readonly property int clockRightEdge: clockLeftEdge + clockWidth
readonly property int leftSectionRightEdge: estimatedLeftSectionWidth
readonly property int mediaLeftEdge: clockLeftEdge - mediaMaxWidth - Theme.spacingS
readonly property int mediaLeftEdge: clockLeftEdge - mediaMaxWidth
- Theme.spacingS
readonly property int rightSectionLeftEdge: availableWidth - rightSectionWidth
readonly property int leftToClockGap: Math.max(
0,
clockLeftEdge - leftSectionRightEdge)
readonly property int leftToMediaGap: mediaMaxWidth > 0 ? Math.max(
0,
mediaLeftEdge - leftSectionRightEdge) : leftToClockGap
readonly property int leftToMediaGap: mediaMaxWidth > 0 ? Math.max(0, mediaLeftEdge - leftSectionRightEdge) : leftToClockGap
readonly property int mediaToClockGap: mediaMaxWidth > 0 ? Theme.spacingS : 0
readonly property int clockToRightGap: validLayout ? Math.max(
0,
rightSectionLeftEdge
- clockRightEdge) : 1000
rightSectionLeftEdge - clockRightEdge) : 1000
readonly property bool spacingTight: validLayout
&& (leftToMediaGap < 150
|| clockToRightGap < 100)
@@ -396,9 +409,12 @@ PanelWindow {
property int spacerSize: model.size || 20
anchors.verticalCenter: parent ? parent.verticalCenter : undefined
active: topBarContent.getWidgetVisible(model.widgetId)
sourceComponent: topBarContent.getWidgetComponent(model.widgetId)
opacity: topBarContent.getWidgetEnabled(model.enabled) ? 1 : 0
active: topBarContent.getWidgetVisible(
model.widgetId)
sourceComponent: topBarContent.getWidgetComponent(
model.widgetId)
opacity: topBarContent.getWidgetEnabled(
model.enabled) ? 1 : 0
asynchronous: false
}
}
@@ -443,7 +459,8 @@ PanelWindow {
let parentCenterX = width / 2
if (totalWidgets % 2 === 1) {
let middleIndex = Math.floor(totalWidgets / 2)
let currentX = parentCenterX - (centerWidgets[middleIndex].width / 2)
let currentX = parentCenterX
- (centerWidgets[middleIndex].width / 2)
centerWidgets[middleIndex].x = currentX
centerWidgets[middleIndex].anchors.horizontalCenter = undefined
currentX = centerWidgets[middleIndex].x
@@ -452,7 +469,8 @@ PanelWindow {
centerWidgets[i].x = currentX
centerWidgets[i].anchors.horizontalCenter = undefined
}
currentX = centerWidgets[middleIndex].x + centerWidgets[middleIndex].width
currentX = centerWidgets[middleIndex].x
+ centerWidgets[middleIndex].width
for (var i = middleIndex + 1; i < totalWidgets; i++) {
currentX += spacing
centerWidgets[i].x = currentX
@@ -475,7 +493,8 @@ PanelWindow {
centerWidgets[i].x = currentX
centerWidgets[i].anchors.horizontalCenter = undefined
}
currentX = centerWidgets[rightMiddleIndex].x + centerWidgets[rightMiddleIndex].width
currentX = centerWidgets[rightMiddleIndex].x
+ centerWidgets[rightMiddleIndex].width
for (var i = rightMiddleIndex + 1; i < totalWidgets; i++) {
currentX += spacing
centerWidgets[i].x = currentX
@@ -517,17 +536,22 @@ PanelWindow {
property int spacerSize: model.size || 20
anchors.verticalCenter: parent ? parent.verticalCenter : undefined
active: topBarContent.getWidgetVisible(model.widgetId)
sourceComponent: topBarContent.getWidgetComponent(model.widgetId)
opacity: topBarContent.getWidgetEnabled(model.enabled) ? 1 : 0
active: topBarContent.getWidgetVisible(
model.widgetId)
sourceComponent: topBarContent.getWidgetComponent(
model.widgetId)
opacity: topBarContent.getWidgetEnabled(
model.enabled) ? 1 : 0
asynchronous: false
onLoaded: {
if (item) {
item.onWidthChanged.connect(centerSection.updateLayout)
item.onWidthChanged.connect(
centerSection.updateLayout)
if (model.widgetId === "spacer")
item.spacerSize = Qt.binding(() => {
return model.size || 20
return model.size
|| 20
})
Qt.callLater(centerSection.updateLayout)
}
@@ -564,15 +588,17 @@ PanelWindow {
property int spacerSize: model.size || 20
anchors.verticalCenter: parent ? parent.verticalCenter : undefined
active: topBarContent.getWidgetVisible(model.widgetId)
sourceComponent: topBarContent.getWidgetComponent(model.widgetId)
opacity: topBarContent.getWidgetEnabled(model.enabled) ? 1 : 0
active: topBarContent.getWidgetVisible(
model.widgetId)
sourceComponent: topBarContent.getWidgetComponent(
model.widgetId)
opacity: topBarContent.getWidgetEnabled(
model.enabled) ? 1 : 0
asynchronous: false
}
}
}
Component {
id: clipboardComponent
@@ -582,7 +608,9 @@ PanelWindow {
radius: Theme.cornerRadius
color: {
const baseColor = clipboardArea.containsMouse ? Theme.primaryHover : Theme.secondaryHover
return Qt.rgba(baseColor.r, baseColor.g, baseColor.b,
return Qt.rgba(
baseColor.r, baseColor.g,
baseColor.b,
baseColor.a * Theme.widgetTransparency)
}
@@ -695,7 +723,8 @@ PanelWindow {
onClockClicked: {
centcomPopoutLoader.active = true
if (centcomPopoutLoader.item) {
centcomPopoutLoader.item.calendarVisible = !centcomPopoutLoader.item.calendarVisible
centcomPopoutLoader.item.calendarVisible
= !centcomPopoutLoader.item.calendarVisible
}
}
}
@@ -705,7 +734,8 @@ PanelWindow {
id: mediaComponent
Media {
compactMode: topBarContent.spacingTight || topBarContent.overlapping
compactMode: topBarContent.spacingTight
|| topBarContent.overlapping
section: {
if (parent && parent.parent === leftSection)
return "left"
@@ -723,7 +753,8 @@ PanelWindow {
onClicked: {
centcomPopoutLoader.active = true
if (centcomPopoutLoader.item) {
centcomPopoutLoader.item.calendarVisible = !centcomPopoutLoader.item.calendarVisible
centcomPopoutLoader.item.calendarVisible
= !centcomPopoutLoader.item.calendarVisible
}
}
}
@@ -750,7 +781,8 @@ PanelWindow {
onClicked: {
centcomPopoutLoader.active = true
if (centcomPopoutLoader.item) {
centcomPopoutLoader.item.calendarVisible = !centcomPopoutLoader.item.calendarVisible
centcomPopoutLoader.item.calendarVisible
= !centcomPopoutLoader.item.calendarVisible
}
}
}
@@ -1004,7 +1036,8 @@ PanelWindow {
Rectangle {
anchors.fill: parent
color: "transparent"
border.color: Qt.rgba(Theme.outline.r, Theme.outline.g,
border.color: Qt.rgba(Theme.outline.r,
Theme.outline.g,
Theme.outline.b, 0.1)
border.width: 1
radius: 2

View File

@@ -66,8 +66,8 @@ Rectangle {
var currentScreen = parentScreen || Screen
var screenX = currentScreen.x || 0
var relativeX = globalPos.x - screenX
popupTarget.setTriggerPosition(relativeX,
Theme.barHeight + Theme.spacingXS,
popupTarget.setTriggerPosition(
relativeX, Theme.barHeight + Theme.spacingXS,
width, section, currentScreen)
}
root.clicked()

View File

@@ -24,7 +24,8 @@ Rectangle {
}
function getDisplayWorkspaces() {
if (!NiriService.niriAvailable || NiriService.allWorkspaces.length === 0)
if (!NiriService.niriAvailable
|| NiriService.allWorkspaces.length === 0)
return [1, 2]
if (!root.screenName)
@@ -40,7 +41,8 @@ Rectangle {
}
function getDisplayActiveWorkspace() {
if (!NiriService.niriAvailable || NiriService.allWorkspaces.length === 0)
if (!NiriService.niriAvailable
|| NiriService.allWorkspaces.length === 0)
return 1
if (!root.screenName)
@@ -83,10 +85,7 @@ Rectangle {
function onNiriAvailableChanged() {
if (NiriService.niriAvailable) {
root.workspaceList
= SettingsData.showWorkspacePadding ? root.padWorkspaces(
root.getDisplayWorkspaces(
)) : root.getDisplayWorkspaces()
root.workspaceList = SettingsData.showWorkspacePadding ? root.padWorkspaces(root.getDisplayWorkspaces()) : root.getDisplayWorkspaces()
root.currentWorkspace = root.getDisplayActiveWorkspace()
}
}
@@ -119,17 +118,22 @@ Rectangle {
property bool isHovered: mouseArea.containsMouse
property int sequentialNumber: index + 1
property var workspaceData: {
if (isPlaceholder || !NiriService.niriAvailable) return null
if (isPlaceholder || !NiriService.niriAvailable)
return null
for (var i = 0; i < NiriService.allWorkspaces.length; i++) {
var ws = NiriService.allWorkspaces[i]
if (ws.idx + 1 === modelData) return ws
if (ws.idx + 1 === modelData)
return ws
}
return null
}
property var iconData: workspaceData && workspaceData.name ? SettingsData.getWorkspaceNameIcon(workspaceData.name) : null
property var iconData: workspaceData
&& workspaceData.name ? SettingsData.getWorkspaceNameIcon(
workspaceData.name) : null
property bool hasIcon: iconData !== null
width: isActive ? Theme.spacingXL + Theme.spacingM : Theme.spacingL + Theme.spacingXS
width: isActive ? Theme.spacingXL + Theme.spacingM : Theme.spacingL
+ Theme.spacingXS
height: Theme.spacingL
radius: height / 2
color: isActive ? Theme.primary : isPlaceholder ? Theme.surfaceTextLight : isHovered ? Theme.outlineButton : Theme.surfaceTextAlpha
@@ -151,10 +155,10 @@ Rectangle {
DankIcon {
visible: hasIcon && iconData.type === "icon"
anchors.centerIn: parent
name: hasIcon && iconData.type === "icon" ? iconData.value : ""
name: hasIcon
&& iconData.type === "icon" ? iconData.value : ""
size: Theme.fontSizeSmall
color: isActive ? Qt.rgba(
Theme.surfaceContainer.r,
color: isActive ? Qt.rgba(Theme.surfaceContainer.r,
Theme.surfaceContainer.g,
Theme.surfaceContainer.b,
0.95) : Theme.surfaceTextMedium
@@ -165,14 +169,15 @@ Rectangle {
StyledText {
visible: hasIcon && iconData.type === "text"
anchors.centerIn: parent
text: hasIcon && iconData.type === "text" ? iconData.value : ""
color: isActive ? Qt.rgba(
Theme.surfaceContainer.r,
text: hasIcon
&& iconData.type === "text" ? iconData.value : ""
color: isActive ? Qt.rgba(Theme.surfaceContainer.r,
Theme.surfaceContainer.g,
Theme.surfaceContainer.b,
0.95) : Theme.surfaceTextMedium
font.pixelSize: Theme.fontSizeSmall
font.weight: isActive && !isPlaceholder ? Font.DemiBold : Font.Normal
font.weight: isActive
&& !isPlaceholder ? Font.DemiBold : Font.Normal
}
// Number display (secondary priority, only when no icon)
@@ -186,7 +191,8 @@ Rectangle {
Theme.surfaceContainer.b,
0.95) : isPlaceholder ? Theme.surfaceTextAlpha : Theme.surfaceTextMedium
font.pixelSize: Theme.fontSizeSmall
font.weight: isActive && !isPlaceholder ? Font.DemiBold : Font.Normal
font.weight: isActive
&& !isPlaceholder ? Font.DemiBold : Font.Normal
}
Behavior on width {

View File

@@ -138,7 +138,8 @@ PanelWindow {
unit: "%"
Component.onCompleted: {
if (AudioService.sink && AudioService.sink.audio)
value = Math.round(AudioService.sink.audio.volume * 100)
value = Math.round(
AudioService.sink.audio.volume * 100)
}
onSliderValueChanged: function (newValue) {
if (AudioService.sink && AudioService.sink.audio) {

View File

@@ -47,15 +47,18 @@ Singleton {
if (nameLower === queryLower) {
finalScore = nameScore * 100
} else if (nameLower.startsWith(queryLower)) {
} else if (nameLower.startsWith(
queryLower)) {
finalScore = nameScore * 50
} else if (nameLower.includes(" " + queryLower)
} else if (nameLower.includes(
" " + queryLower)
|| nameLower.includes(
queryLower + " ")
|| nameLower.endsWith(
" " + queryLower)) {
finalScore = nameScore * 25
} else if (nameLower.includes(queryLower)) {
} else if (nameLower.includes(
queryLower)) {
finalScore = nameScore * 10
} else {
finalScore = nameScore * 2 + commentScore * 0.1
@@ -150,7 +153,8 @@ Singleton {
}
return applications.filter(app => {
var appCategories = getCategoriesForApp(app)
var appCategories = getCategoriesForApp(
app)
return appCategories.includes(category)
})
}

View File

@@ -125,7 +125,8 @@ Singleton {
root.sink.audio.muted = false
}
const currentVolume = Math.round(root.sink.audio.volume * 100)
const newVolume = Math.max(0, Math.min(100, currentVolume + parseInt(
const newVolume = Math.max(0, Math.min(100,
currentVolume + parseInt(
step || "5")))
root.sink.audio.volume = newVolume / 100
root.volumeChanged()
@@ -140,7 +141,8 @@ Singleton {
root.sink.audio.muted = false
}
const currentVolume = Math.round(root.sink.audio.volume * 100)
const newVolume = Math.max(0, Math.min(100, currentVolume - parseInt(
const newVolume = Math.max(0, Math.min(100,
currentVolume - parseInt(
step || "5")))
root.sink.audio.volume = newVolume / 100
root.volumeChanged()
@@ -169,7 +171,8 @@ Singleton {
let result = "Audio Status:\n"
if (root.sink && root.sink.audio) {
const volume = Math.round(root.sink.audio.volume * 100)
result += "Output: " + volume + "%" + (root.sink.audio.muted ? " (muted)" : "") + "\n"
result += "Output: " + volume + "%"
+ (root.sink.audio.muted ? " (muted)" : "") + "\n"
} else {
result += "Output: No sink available\n"
}

Some files were not shown because too many files have changed in this diff Show More