1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-05-16 09:12:47 -04:00

text: change default rendering back to Qt

This commit is contained in:
bbedward
2026-05-15 09:45:10 -04:00
parent 0a892a4a9e
commit 1c1ab1c7d5
50 changed files with 520 additions and 496 deletions
+1 -1
View File
@@ -497,7 +497,7 @@ Singleton {
property int fontWeight: Font.Normal property int fontWeight: Font.Normal
property real fontScale: 1.0 property real fontScale: 1.0
property real dankBarFontScale: 1.0 property real dankBarFontScale: 1.0
property int textRenderType: SettingsData.TextRenderType.Native property int textRenderType: SettingsData.TextRenderType.Qt
property int textRenderQuality: SettingsData.TextRenderQuality.Default property int textRenderQuality: SettingsData.TextRenderQuality.Default
property bool notepadUseMonospace: true property bool notepadUseMonospace: true
+1 -1
View File
@@ -242,7 +242,7 @@ var SPEC = {
monoFontFamily: { def: "Fira Code" }, monoFontFamily: { def: "Fira Code" },
fontWeight: { def: 400 }, fontWeight: { def: 400 },
fontScale: { def: 1.0 }, fontScale: { def: 1.0 },
textRenderType: { def: 1 }, textRenderType: { def: 0 },
textRenderQuality: { def: 0 }, textRenderQuality: { def: 0 },
notepadUseMonospace: { def: true }, notepadUseMonospace: { def: true },
+2 -2
View File
@@ -29,7 +29,7 @@ DankModal {
confirmButtonText = "Confirm"; confirmButtonText = "Confirm";
cancelButtonText = "Cancel"; cancelButtonText = "Cancel";
confirmButtonColor = Theme.primary; confirmButtonColor = Theme.primary;
onConfirm = onConfirmCallback || ((text) => {}); onConfirm = onConfirmCallback || (text => {});
onCancel = onCancelCallback || (() => {}); onCancel = onCancelCallback || (() => {});
selectedButton = -1; selectedButton = -1;
keyboardNavigation = false; keyboardNavigation = false;
@@ -44,7 +44,7 @@ DankModal {
confirmButtonText = options.confirmText || "Confirm"; confirmButtonText = options.confirmText || "Confirm";
cancelButtonText = options.cancelText || "Cancel"; cancelButtonText = options.cancelText || "Cancel";
confirmButtonColor = options.confirmColor || Theme.primary; confirmButtonColor = options.confirmColor || Theme.primary;
onConfirm = options.onConfirm || ((text) => {}); onConfirm = options.onConfirm || (text => {});
onCancel = options.onCancel || (() => {}); onCancel = options.onCancel || (() => {});
selectedButton = -1; selectedButton = -1;
keyboardNavigation = false; keyboardNavigation = false;
@@ -70,7 +70,7 @@ Rectangle {
materialIconSizeAdjustment: root.computedIconSize * 0.3 materialIconSizeAdjustment: root.computedIconSize * 0.3
} }
Text { StyledText {
width: parent.width width: parent.width
text: root.item?._hName ?? root.item?.name ?? "" text: root.item?._hName ?? root.item?.name ?? ""
textFormat: root.item?._hRich ? Text.RichText : Text.PlainText textFormat: root.item?._hRich ? Text.RichText : Text.PlainText
@@ -95,7 +95,7 @@ Rectangle {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
height: nameText.implicitHeight + (subText.visible ? subText.height + 2 : 0) height: nameText.implicitHeight + (subText.visible ? subText.height + 2 : 0)
Text { StyledText {
id: nameText id: nameText
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
@@ -128,7 +128,7 @@ Rectangle {
return e.endsWith("…") ? e.length - 1 : e.length; return e.endsWith("…") ? e.length - 1 : e.length;
} }
Text { StyledText {
id: subText id: subText
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
@@ -72,7 +72,9 @@ Rectangle {
readonly property var iconMap: { readonly property var iconMap: {
const cats = root.controller?.appCategories ?? []; const cats = root.controller?.appCategories ?? [];
const m = {}; const m = {};
cats.forEach(c => { m[c] = AppSearchService.getCategoryIcon(c); }); cats.forEach(c => {
m[c] = AppSearchService.getCategoryIcon(c);
});
return m; return m;
} }
@@ -137,7 +139,9 @@ Rectangle {
dim: false dim: false
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
background: Rectangle { color: "transparent" } background: Rectangle {
color: "transparent"
}
contentItem: Rectangle { contentItem: Rectangle {
radius: Theme.cornerRadius radius: Theme.cornerRadius
@@ -114,7 +114,7 @@ Rectangle {
color: Theme.withAlpha(Theme.surfaceContainer, 0.85) color: Theme.withAlpha(Theme.surfaceContainer, 0.85)
visible: root.item?.name?.length > 0 visible: root.item?.name?.length > 0
Text { StyledText {
id: labelText id: labelText
anchors.fill: parent anchors.fill: parent
anchors.margins: Theme.spacingXS anchors.margins: Theme.spacingXS
@@ -13,7 +13,7 @@ Row {
property bool pathEditMode: false property bool pathEditMode: false
property bool pathInputHasFocus: false property bool pathInputHasFocus: false
signal navigateUp() signal navigateUp
signal navigateTo(string path) signal navigateTo(string path)
signal pathInputFocusChanged(bool hasFocus) signal pathInputFocusChanged(bool hasFocus)
@@ -80,9 +80,9 @@ Row {
anchors.fill: parent anchors.fill: parent
cursorShape: Qt.IBeamCursor cursorShape: Qt.IBeamCursor
onClicked: { onClicked: {
pathEditMode = true pathEditMode = true;
pathInput.text = currentPath.replace("file://", "") pathInput.text = currentPath.replace("file://", "");
Qt.callLater(() => pathInput.forceActiveFocus()) Qt.callLater(() => pathInput.forceActiveFocus());
} }
} }
} }
@@ -94,22 +94,22 @@ Row {
topPadding: Theme.spacingXS topPadding: Theme.spacingXS
bottomPadding: Theme.spacingXS bottomPadding: Theme.spacingXS
onAccepted: { onAccepted: {
const newPath = text.trim() const newPath = text.trim();
if (newPath !== "") { if (newPath !== "") {
navigation.navigateTo(newPath) navigation.navigateTo(newPath);
} }
pathEditMode = false pathEditMode = false;
} }
Keys.onEscapePressed: { Keys.onEscapePressed: {
pathEditMode = false pathEditMode = false;
} }
Keys.onDownPressed: { Keys.onDownPressed: {
pathEditMode = false pathEditMode = false;
} }
onActiveFocusChanged: { onActiveFocusChanged: {
navigation.pathInputFocusChanged(activeFocus) navigation.pathInputFocusChanged(activeFocus);
if (!activeFocus && pathEditMode) { if (!activeFocus && pathEditMode) {
pathEditMode = false pathEditMode = false;
} }
} }
} }
@@ -9,17 +9,17 @@ Item {
property string pendingFilePath: "" property string pendingFilePath: ""
signal confirmed(string filePath) signal confirmed(string filePath)
signal cancelled() signal cancelled
visible: showDialog visible: showDialog
focus: showDialog focus: showDialog
Keys.onEscapePressed: { Keys.onEscapePressed: {
cancelled() cancelled();
} }
Keys.onReturnPressed: { Keys.onReturnPressed: {
confirmed(pendingFilePath) confirmed(pendingFilePath);
} }
Rectangle { Rectangle {
@@ -30,7 +30,7 @@ Item {
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
onClicked: { onClicked: {
cancelled() cancelled();
} }
} }
} }
@@ -92,7 +92,7 @@ Item {
hoverEnabled: true hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: { onClicked: {
cancelled() cancelled();
} }
} }
} }
@@ -117,7 +117,7 @@ Item {
hoverEnabled: true hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: { onClicked: {
confirmed(pendingFilePath) confirmed(pendingFilePath);
} }
} }
} }
@@ -29,15 +29,15 @@ Row {
Component.onCompleted: { Component.onCompleted: {
if (saveMode) if (saveMode)
Qt.callLater(() => { Qt.callLater(() => {
forceActiveFocus() forceActiveFocus();
}) });
} }
onAccepted: { onAccepted: {
if (text.trim() !== "") { if (text.trim() !== "") {
var basePath = currentPath.replace(/^file:\/\//, '') var basePath = currentPath.replace(/^file:\/\//, '');
var fullPath = basePath + "/" + text.trim() var fullPath = basePath + "/" + text.trim();
fullPath = fullPath.replace(/\/+/g, '/') fullPath = fullPath.replace(/\/+/g, '/');
saveRequested(fullPath) saveRequested(fullPath);
} }
} }
} }
@@ -63,10 +63,10 @@ Row {
enabled: fileNameInput.text.trim() !== "" enabled: fileNameInput.text.trim() !== ""
onClicked: { onClicked: {
if (fileNameInput.text.trim() !== "") { if (fileNameInput.text.trim() !== "") {
var basePath = currentPath.replace(/^file:\/\//, '') var basePath = currentPath.replace(/^file:\/\//, '');
var fullPath = basePath + "/" + fileNameInput.text.trim() var fullPath = basePath + "/" + fileNameInput.text.trim();
fullPath = fullPath.replace(/\/+/g, '/') fullPath = fullPath.replace(/\/+/g, '/');
saveRequested(fullPath) saveRequested(fullPath);
} }
} }
} }
@@ -36,19 +36,24 @@ StyledRect {
} }
Repeater { Repeater {
model: [{ model: [
{
"name": "Name", "name": "Name",
"value": "name" "value": "name"
}, { },
{
"name": "Size", "name": "Size",
"value": "size" "value": "size"
}, { },
{
"name": "Modified", "name": "Modified",
"value": "modified" "value": "modified"
}, { },
{
"name": "Type", "name": "Type",
"value": "type" "value": "type"
}] }
]
StyledRect { StyledRect {
width: sortColumn?.width ?? 0 width: sortColumn?.width ?? 0
@@ -83,8 +88,8 @@ StyledRect {
hoverEnabled: true hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: { onClicked: {
sortMenu.sortBySelected(modelData?.value ?? "name") sortMenu.sortBySelected(modelData?.value ?? "name");
sortMenu.visible = false sortMenu.visible = false;
} }
} }
} }
@@ -136,8 +141,8 @@ StyledRect {
hoverEnabled: true hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: { onClicked: {
sortMenu.sortOrderSelected(true) sortMenu.sortOrderSelected(true);
sortMenu.visible = false sortMenu.visible = false;
} }
} }
} }
@@ -174,8 +179,8 @@ StyledRect {
hoverEnabled: true hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: { onClicked: {
sortMenu.sortOrderSelected(false) sortMenu.sortOrderSelected(false);
sortMenu.visible = false sortMenu.visible = false;
} }
} }
} }
+3 -9
View File
@@ -142,13 +142,7 @@ DankModal {
let shouldContinue = false; let shouldContinue = false;
for (let j = 0; j < lowerQueryWords.length; j++) { for (let j = 0; j < lowerQueryWords.length; j++) {
const word = lowerQueryWords[j]; const word = lowerQueryWords[j];
if (!( if (!(word.length === 0 || keyLower.includes(word) || descLower.includes(word) || catLower.includes(word) || actionLower.includes(word))) {
word.length === 0 ||
keyLower.includes(word) ||
descLower.includes(word) ||
catLower.includes(word) ||
actionLower.includes(word)
)) {
shouldContinue = true; shouldContinue = true;
break; break;
} }
@@ -181,7 +175,7 @@ DankModal {
return processed; return processed;
} }
property var categories: generateCategories(""); property var categories: generateCategories("")
function estimateCategoryHeight(catName) { function estimateCategoryHeight(catName) {
const catData = categories[catName]; const catData = categories[catName];
@@ -196,7 +190,7 @@ DankModal {
return 40 + bindCount * 28; return 40 + bindCount * 28;
} }
property var categoryKeys: Object.keys(categories); property var categoryKeys: Object.keys(categories)
function distributeCategories(cols) { function distributeCategories(cols) {
const columns = []; const columns = [];
+97 -89
View File
@@ -21,18 +21,18 @@ DankModal {
property var filteredSessions: [] property var filteredSessions: []
function updateFilteredSessions() { function updateFilteredSessions() {
var filtered = [] var filtered = [];
var lowerSearch = searchText.trim().toLowerCase() var lowerSearch = searchText.trim().toLowerCase();
for (var i = 0; i < MuxService.sessions.length; i++) { for (var i = 0; i < MuxService.sessions.length; i++) {
var session = MuxService.sessions[i] var session = MuxService.sessions[i];
if (lowerSearch.length > 0 && !session.name.toLowerCase().includes(lowerSearch)) if (lowerSearch.length > 0 && !session.name.toLowerCase().includes(lowerSearch))
continue continue;
filtered.push(session) filtered.push(session);
} }
filteredSessions = filtered filteredSessions = filtered;
if (selectedIndex >= filteredSessions.length) { if (selectedIndex >= filteredSessions.length) {
selectedIndex = Math.max(0, filteredSessions.length - 1) selectedIndex = Math.max(0, filteredSessions.length - 1);
} }
} }
@@ -41,7 +41,7 @@ DankModal {
Connections { Connections {
target: MuxService target: MuxService
function onSessionsChanged() { function onSessionsChanged() {
updateFilteredSessions() updateFilteredSessions();
} }
} }
@@ -53,35 +53,35 @@ DankModal {
function toggle() { function toggle() {
if (shouldBeVisible) { if (shouldBeVisible) {
hide() hide();
} else { } else {
show() show();
} }
} }
function show() { function show() {
open() open();
selectedIndex = -1 selectedIndex = -1;
searchText = "" searchText = "";
MuxService.refreshSessions() MuxService.refreshSessions();
shouldHaveFocus = true shouldHaveFocus = true;
Qt.callLater(() => { Qt.callLater(() => {
if (muxPanel && muxPanel.searchField) { if (muxPanel && muxPanel.searchField) {
muxPanel.searchField.forceActiveFocus(); muxPanel.searchField.forceActiveFocus();
} }
}) });
} }
function hide() { function hide() {
close() close();
selectedIndex = -1 selectedIndex = -1;
searchText = "" searchText = "";
} }
function attachToSession(name) { function attachToSession(name) {
MuxService.attachToSession(name) MuxService.attachToSession(name);
hide() hide();
} }
function renameSession(name) { function renameSession(name) {
@@ -90,9 +90,9 @@ DankModal {
message: I18n.tr("Enter a new name for session \"%1\"").arg(name), message: I18n.tr("Enter a new name for session \"%1\"").arg(name),
initialText: name, initialText: name,
onConfirm: function (newName) { onConfirm: function (newName) {
MuxService.renameSession(name, newName) MuxService.renameSession(name, newName);
} }
}) });
} }
function killSession(name) { function killSession(name) {
@@ -102,9 +102,9 @@ DankModal {
confirmText: I18n.tr("Kill"), confirmText: I18n.tr("Kill"),
confirmColor: Theme.primary, confirmColor: Theme.primary,
onConfirm: function () { onConfirm: function () {
MuxService.killSession(name) MuxService.killSession(name);
} }
}) });
} }
function createNewSession() { function createNewSession() {
@@ -112,25 +112,25 @@ DankModal {
title: I18n.tr("New Session"), title: I18n.tr("New Session"),
message: I18n.tr("Please write a name for your new %1 session").arg(MuxService.displayName), message: I18n.tr("Please write a name for your new %1 session").arg(MuxService.displayName),
onConfirm: function (name) { onConfirm: function (name) {
MuxService.createSession(name) MuxService.createSession(name);
hide() hide();
} }
}) });
} }
function selectNext() { function selectNext() {
selectedIndex = Math.min(selectedIndex + 1, filteredSessions.length - 1) selectedIndex = Math.min(selectedIndex + 1, filteredSessions.length - 1);
} }
function selectPrevious() { function selectPrevious() {
selectedIndex = Math.max(selectedIndex - 1, -1) selectedIndex = Math.max(selectedIndex - 1, -1);
} }
function activateSelected() { function activateSelected() {
if (selectedIndex === -1) { if (selectedIndex === -1) {
createNewSession() createNewSession();
} else if (selectedIndex >= 0 && selectedIndex < filteredSessions.length) { } else if (selectedIndex >= 0 && selectedIndex < filteredSessions.length) {
attachToSession(filteredSessions[selectedIndex].name) attachToSession(filteredSessions[selectedIndex].name);
} }
} }
@@ -155,18 +155,18 @@ DankModal {
IpcHandler { IpcHandler {
function open(): string { function open(): string {
muxModal.show() muxModal.show();
return "MUX_OPEN_SUCCESS" return "MUX_OPEN_SUCCESS";
} }
function close(): string { function close(): string {
muxModal.hide() muxModal.hide();
return "MUX_CLOSE_SUCCESS" return "MUX_CLOSE_SUCCESS";
} }
function toggle(): string { function toggle(): string {
muxModal.toggle() muxModal.toggle();
return "MUX_TOGGLE_SUCCESS" return "MUX_TOGGLE_SUCCESS";
} }
target: "mux" target: "mux"
@@ -175,18 +175,18 @@ DankModal {
// Backwards compatibility // Backwards compatibility
IpcHandler { IpcHandler {
function open(): string { function open(): string {
muxModal.show() muxModal.show();
return "TMUX_OPEN_SUCCESS" return "TMUX_OPEN_SUCCESS";
} }
function close(): string { function close(): string {
muxModal.hide() muxModal.hide();
return "TMUX_CLOSE_SUCCESS" return "TMUX_CLOSE_SUCCESS";
} }
function toggle(): string { function toggle(): string {
muxModal.toggle() muxModal.toggle();
return "TMUX_TOGGLE_SUCCESS" return "TMUX_TOGGLE_SUCCESS";
} }
target: "tmux" target: "tmux"
@@ -248,33 +248,31 @@ DankModal {
property alias searchField: searchField property alias searchField: searchField
Keys.onPressed: event => { Keys.onPressed: event => {
if ((event.key === Qt.Key_J && (event.modifiers & Qt.ControlModifier)) || if ((event.key === Qt.Key_J && (event.modifiers & Qt.ControlModifier)) || (event.key === Qt.Key_Down)) {
(event.key === Qt.Key_Down)) { selectNext();
selectNext() event.accepted = true;
event.accepted = true } else if ((event.key === Qt.Key_K && (event.modifiers & Qt.ControlModifier)) || (event.key === Qt.Key_Up)) {
} else if ((event.key === Qt.Key_K && (event.modifiers & Qt.ControlModifier)) || selectPrevious();
(event.key === Qt.Key_Up)) { event.accepted = true;
selectPrevious()
event.accepted = true
} else if (event.key === Qt.Key_N && (event.modifiers & Qt.ControlModifier)) { } else if (event.key === Qt.Key_N && (event.modifiers & Qt.ControlModifier)) {
createNewSession() createNewSession();
event.accepted = true event.accepted = true;
} else if (event.key === Qt.Key_R && (event.modifiers & Qt.ControlModifier)) { } else if (event.key === Qt.Key_R && (event.modifiers & Qt.ControlModifier)) {
if (MuxService.supportsRename && selectedIndex >= 0 && selectedIndex < filteredSessions.length) { if (MuxService.supportsRename && selectedIndex >= 0 && selectedIndex < filteredSessions.length) {
renameSession(filteredSessions[selectedIndex].name) renameSession(filteredSessions[selectedIndex].name);
} }
event.accepted = true event.accepted = true;
} else if (event.key === Qt.Key_D && (event.modifiers & Qt.ControlModifier)) { } else if (event.key === Qt.Key_D && (event.modifiers & Qt.ControlModifier)) {
if (selectedIndex >= 0 && selectedIndex < filteredSessions.length) { if (selectedIndex >= 0 && selectedIndex < filteredSessions.length) {
killSession(filteredSessions[selectedIndex].name) killSession(filteredSessions[selectedIndex].name);
} }
event.accepted = true event.accepted = true;
} else if (event.key === Qt.Key_Escape) { } else if (event.key === Qt.Key_Escape) {
hide() hide();
event.accepted = true 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) {
activateSelected() activateSelected();
event.accepted = true event.accepted = true;
} }
} }
@@ -307,12 +305,8 @@ DankModal {
text: { text: {
const total = MuxService.sessions.length; const total = MuxService.sessions.length;
const filtered = muxModal.filteredSessions.length; const filtered = muxModal.filteredSessions.length;
const activePart = total === 1 const activePart = total === 1 ? I18n.tr("%1 active session").arg(total) : I18n.tr("%1 active sessions").arg(total);
? I18n.tr("%1 active session").arg(total) const filteredPart = filtered === 1 ? I18n.tr("%1 filtered").arg(filtered) : I18n.tr("%1 filtered").arg(filtered);
: I18n.tr("%1 active sessions").arg(total);
const filteredPart = filtered === 1
? I18n.tr("%1 filtered").arg(filtered)
: I18n.tr("%1 filtered").arg(filtered);
return activePart + ", " + filteredPart; return activePart + ", " + filteredPart;
} }
font.pixelSize: Theme.fontSizeMedium font.pixelSize: Theme.fontSizeMedium
@@ -340,8 +334,8 @@ DankModal {
keyForwardTargets: [muxPanel] keyForwardTargets: [muxPanel]
onTextEdited: { onTextEdited: {
muxModal.searchText = text muxModal.searchText = text;
muxModal.selectedIndex = 0 muxModal.selectedIndex = 0;
} }
} }
@@ -350,8 +344,7 @@ DankModal {
width: parent.width width: parent.width
height: 56 height: 56
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: muxModal.selectedIndex === -1 ? Theme.primaryContainer : color: muxModal.selectedIndex === -1 ? Theme.primaryContainer : (newMouse.containsMouse ? Theme.surfaceContainerHigh : Theme.surfaceContainer)
(newMouse.containsMouse ? Theme.surfaceContainerHigh : Theme.surfaceContainer)
RowLayout { RowLayout {
anchors.fill: parent anchors.fill: parent
@@ -428,8 +421,7 @@ DankModal {
width: parent.width width: parent.width
height: 64 height: 64
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: muxModal.selectedIndex === index ? Theme.primaryContainer : color: muxModal.selectedIndex === index ? Theme.primaryContainer : (sessionMouse.containsMouse ? Theme.surfaceContainerHigh : "transparent")
(sessionMouse.containsMouse ? Theme.surfaceContainerHigh : "transparent")
MouseArea { MouseArea {
id: sessionMouse id: sessionMouse
@@ -476,13 +468,11 @@ DankModal {
StyledText { StyledText {
text: { text: {
var parts = [] var parts = [];
if (modelData.windows !== "N/A") if (modelData.windows !== "N/A")
parts.push(modelData.windows === 1 parts.push(modelData.windows === 1 ? I18n.tr("%1 window").arg(modelData.windows) : I18n.tr("%1 windows").arg(modelData.windows));
? I18n.tr("%1 window").arg(modelData.windows) parts.push(modelData.attached ? I18n.tr("attached") : I18n.tr("detached"));
: I18n.tr("%1 windows").arg(modelData.windows)) return parts.join(" \u2022 ");
parts.push(modelData.attached ? I18n.tr("attached") : I18n.tr("detached"))
return parts.join(" \u2022 ")
} }
font.pixelSize: Theme.fontSizeSmall font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceVariantText color: Theme.surfaceVariantText
@@ -533,7 +523,7 @@ DankModal {
hoverEnabled: true hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: { onClicked: {
muxModal.killSession(modelData.name) muxModal.killSession(modelData.name);
} }
} }
} }
@@ -587,15 +577,33 @@ DankModal {
Repeater { Repeater {
model: { model: {
var shortcuts = [ var shortcuts = [
{ key: "↑↓", label: I18n.tr("Navigate") }, {
{ key: "↵", label: I18n.tr("Attach") }, key: "↑↓",
{ key: "^N", label: I18n.tr("New") }, label: I18n.tr("Navigate")
{ key: "^D", label: I18n.tr("Kill") }, },
{ key: "Esc", label: I18n.tr("Close") } {
] key: "↵",
label: I18n.tr("Attach")
},
{
key: "^N",
label: I18n.tr("New")
},
{
key: "^D",
label: I18n.tr("Kill")
},
{
key: "Esc",
label: I18n.tr("Close")
}
];
if (MuxService.supportsRename) if (MuxService.supportsRename)
shortcuts.splice(3, 0, { key: "^R", label: I18n.tr("Rename") }) shortcuts.splice(3, 0, {
return shortcuts key: "^R",
label: I18n.tr("Rename")
});
return shortcuts;
} }
delegate: Row { delegate: Row {
+2 -2
View File
@@ -68,7 +68,7 @@ DankModal {
if (response.error) { if (response.error) {
ToastService.showError(I18n.tr("Failed to remove QR code at %1: %2").arg(path).arg(JSON.stringify(response.error))); ToastService.showError(I18n.tr("Failed to remove QR code at %1: %2").arg(path).arg(JSON.stringify(response.error)));
} }
}) });
} }
LazyLoader { LazyLoader {
@@ -90,7 +90,7 @@ DankModal {
const fileName = cleanPath.split('/').pop(); const fileName = cleanPath.split('/').pop();
const fileUrl = "file://" + cleanPath; const fileUrl = "file://" + cleanPath;
copyQrCodeProcess.exec(["cp", root.normalQrCodePath, cleanPath, "-f"]) copyQrCodeProcess.exec(["cp", root.normalQrCodePath, cleanPath, "-f"]);
} }
Process { Process {
@@ -13,7 +13,10 @@ PluginComponent {
const result = []; const result = [];
for (const id in allProfiles) { for (const id in allProfiles) {
if (allProfiles[id].name) if (allProfiles[id].name)
result.push({ id: id, name: allProfiles[id].name }); result.push({
id: id,
name: allProfiles[id].name
});
} }
return result; return result;
} }
@@ -1,5 +1,4 @@
import QtQuick import QtQuick
import QtQuick.Controls
import qs.Common import qs.Common
import qs.Widgets import qs.Widgets
@@ -39,13 +38,15 @@ Row {
anchors.fill: parent anchors.fill: parent
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: { onClicked: {
root.currentSize = modelData root.currentSize = modelData;
root.sizeChanged(modelData) root.sizeChanged(modelData);
} }
} }
Behavior on color { Behavior on color {
ColorAnimation { duration: Theme.shortDuration } ColorAnimation {
duration: Theme.shortDuration
}
} }
} }
} }
@@ -17,30 +17,44 @@ StyledText {
font.pixelSize: { font.pixelSize: {
switch (style) { switch (style) {
case Typography.Style.Title: return Theme.fontSizeXLarge case Typography.Style.Title:
case Typography.Style.Subtitle: return Theme.fontSizeLarge return Theme.fontSizeXLarge;
case Typography.Style.Body: return Theme.fontSizeMedium case Typography.Style.Subtitle:
case Typography.Style.Caption: return Theme.fontSizeSmall return Theme.fontSizeLarge;
case Typography.Style.Button: return Theme.fontSizeSmall case Typography.Style.Body:
default: return Theme.fontSizeMedium return Theme.fontSizeMedium;
case Typography.Style.Caption:
return Theme.fontSizeSmall;
case Typography.Style.Button:
return Theme.fontSizeSmall;
default:
return Theme.fontSizeMedium;
} }
} }
font.weight: { font.weight: {
switch (style) { switch (style) {
case Typography.Style.Title: return Font.Bold case Typography.Style.Title:
case Typography.Style.Subtitle: return Font.Medium return Font.Bold;
case Typography.Style.Body: return Font.Normal case Typography.Style.Subtitle:
case Typography.Style.Caption: return Font.Normal return Font.Medium;
case Typography.Style.Button: return Font.Medium case Typography.Style.Body:
default: return Font.Normal return Font.Normal;
case Typography.Style.Caption:
return Font.Normal;
case Typography.Style.Button:
return Font.Medium;
default:
return Font.Normal;
} }
} }
color: { color: {
switch (style) { switch (style) {
case Typography.Style.Caption: return Theme.surfaceVariantText case Typography.Style.Caption:
default: return Theme.surfaceText return Theme.surfaceVariantText;
default:
return Theme.surfaceText;
} }
} }
} }
@@ -741,7 +741,7 @@ BasePill {
} }
} }
Text { StyledText {
anchors.centerIn: parent anchors.centerIn: parent
visible: !iconImg.visible && !coreIcon.visible && !Paths.isSteamApp(appItem.appId) visible: !iconImg.visible && !coreIcon.visible && !Paths.isSteamApp(appItem.appId)
text: { text: {
@@ -1,5 +1,4 @@
import QtQuick import QtQuick
import Quickshell
import qs.Common import qs.Common
import qs.Modules.Plugins import qs.Modules.Plugins
import qs.Services import qs.Services
@@ -11,7 +10,7 @@ BasePill {
property bool layoutPopupVisible: false property bool layoutPopupVisible: false
property var popoutTarget: null property var popoutTarget: null
signal toggleLayoutPopup() signal toggleLayoutPopup
visible: CompositorService.isDwl && DwlService.dwlAvailable visible: CompositorService.isDwl && DwlService.dwlAvailable
@@ -20,27 +19,27 @@ BasePill {
property int currentLayoutIndex: outputState?.layout || 0 property int currentLayoutIndex: outputState?.layout || 0
readonly property var layoutIcons: ({ readonly property var layoutIcons: ({
"CT": "view_compact", "CT": "view_compact",
"G": "grid_view", "G": "grid_view",
"K": "layers", "K": "layers",
"M": "fullscreen", "M": "fullscreen",
"RT": "view_sidebar", "RT": "view_sidebar",
"S": "view_carousel", "S": "view_carousel",
"T": "view_quilt", "T": "view_quilt",
"VG": "grid_on", "VG": "grid_on",
"VK": "view_day", "VK": "view_day",
"VS": "scrollable_header", "VS": "scrollable_header",
"VT": "clarify" "VT": "clarify"
}) })
function getLayoutIcon(symbol) { function getLayoutIcon(symbol) {
return layoutIcons[symbol] || "view_quilt" return layoutIcons[symbol] || "view_quilt";
} }
Connections { Connections {
target: DwlService target: DwlService
function onStateChanged() { function onStateChanged() {
outputState = parentScreen ? DwlService.getOutputState(parentScreen.name) : null outputState = parentScreen ? DwlService.getOutputState(parentScreen.name) : null;
} }
} }
@@ -94,17 +93,17 @@ BasePill {
} }
onClicked: { onClicked: {
toggleLayoutPopup() toggleLayoutPopup();
} }
onRightClicked: { onRightClicked: {
if (!parentScreen || !DwlService.dwlAvailable || DwlService.layouts.length === 0) { if (!parentScreen || !DwlService.dwlAvailable || DwlService.layouts.length === 0) {
return return;
} }
const currentIndex = layout.currentLayoutIndex const currentIndex = layout.currentLayoutIndex;
const nextIndex = (currentIndex + 1) % DwlService.layouts.length const nextIndex = (currentIndex + 1) % DwlService.layouts.length;
DwlService.setLayout(parentScreen.name, nextIndex) DwlService.setLayout(parentScreen.name, nextIndex);
} }
} }
@@ -131,12 +131,17 @@ BasePill {
if (root.diskUsagePercent === undefined || root.diskUsagePercent === null || root.diskUsagePercent === 0) { if (root.diskUsagePercent === undefined || root.diskUsagePercent === null || root.diskUsagePercent === 0) {
return "--"; return "--";
} }
if (!root.selectedMount) return "--"; if (!root.selectedMount)
return "--";
switch (root.diskUsageMode) { switch (root.diskUsageMode) {
case 1: return root.selectedMount.size || "--"; case 1:
case 2: return root.selectedMount.avail || "--"; return root.selectedMount.size || "--";
case 3: return (root.selectedMount.avail || "--") + " / " + (root.selectedMount.size || "--"); case 2:
default: return root.diskUsagePercent.toFixed(0); return root.selectedMount.avail || "--";
case 3:
return (root.selectedMount.avail || "--") + " / " + (root.selectedMount.size || "--");
default:
return root.diskUsagePercent.toFixed(0);
} }
} }
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText) font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
@@ -185,12 +190,17 @@ BasePill {
if (root.diskUsagePercent === undefined || root.diskUsagePercent === null || root.diskUsagePercent === 0) { if (root.diskUsagePercent === undefined || root.diskUsagePercent === null || root.diskUsagePercent === 0) {
return "--%"; return "--%";
} }
if (!root.selectedMount) return "--%"; if (!root.selectedMount)
return "--%";
switch (root.diskUsageMode) { switch (root.diskUsageMode) {
case 1: return root.selectedMount.size || "--"; case 1:
case 2: return root.selectedMount.avail || "--"; return root.selectedMount.size || "--";
case 3: return (root.selectedMount.avail || "--") + " / " + (root.selectedMount.size || "--"); case 2:
default: return root.diskUsagePercent.toFixed(0) + "%"; return root.selectedMount.avail || "--";
case 3:
return (root.selectedMount.avail || "--") + " / " + (root.selectedMount.size || "--");
default:
return root.diskUsagePercent.toFixed(0) + "%";
} }
} }
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText) font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
@@ -204,10 +214,13 @@ BasePill {
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText) font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
text: { text: {
switch (root.diskUsageMode) { switch (root.diskUsageMode) {
case 3: return "888.8G / 888.8G"; case 3:
case 1: return "888.8G / 888.8G";
case 2: return "888.8G"; case 1:
default: return "100%"; case 2:
return "888.8G";
default:
return "100%";
} }
} }
} }
@@ -132,9 +132,7 @@ BasePill {
const focusedWin = NiriService.windows.find(w => w.is_focused); const focusedWin = NiriService.windows.find(w => w.is_focused);
if (!focusedWin) if (!focusedWin)
return false; return false;
const screenWsIds = new Set( const screenWsIds = new Set(NiriService.allWorkspaces.filter(ws => ws.output === parentScreen.name).map(ws => ws.id));
NiriService.allWorkspaces.filter(ws => ws.output === parentScreen.name).map(ws => ws.id)
);
return screenWsIds.has(focusedWin.workspace_id); return screenWsIds.has(focusedWin.workspace_id);
} }
@@ -211,7 +209,7 @@ BasePill {
visible: root.isVerticalOrientation && activeWindow && activeWindow.appId && appIcon.status !== Image.Ready && Paths.isSteamApp(activeWindow.appId) visible: root.isVerticalOrientation && activeWindow && activeWindow.appId && appIcon.status !== Image.Ready && Paths.isSteamApp(activeWindow.appId)
} }
Text { StyledText {
anchors.centerIn: parent anchors.centerIn: parent
visible: root.isVerticalOrientation && activeWindow && activeWindow.appId && appIcon.status !== Image.Ready && !Paths.isSteamApp(activeWindow.appId) visible: root.isVerticalOrientation && activeWindow && activeWindow.appId && appIcon.status !== Image.Ready && !Paths.isSteamApp(activeWindow.appId)
text: { text: {
@@ -1,8 +1,6 @@
import QtQuick import QtQuick
import QtQuick.Controls
import qs.Common import qs.Common
import qs.Modules.Plugins import qs.Modules.Plugins
import qs.Modules.ProcessList
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
@@ -11,21 +9,21 @@ BasePill {
function formatNetworkSpeed(bytesPerSec) { function formatNetworkSpeed(bytesPerSec) {
if (bytesPerSec < 1024) { if (bytesPerSec < 1024) {
return bytesPerSec.toFixed(0) + " B/s" return bytesPerSec.toFixed(0) + " B/s";
} else if (bytesPerSec < 1024 * 1024) { } else if (bytesPerSec < 1024 * 1024) {
return (bytesPerSec / 1024).toFixed(1) + " KB/s" return (bytesPerSec / 1024).toFixed(1) + " KB/s";
} else if (bytesPerSec < 1024 * 1024 * 1024) { } else if (bytesPerSec < 1024 * 1024 * 1024) {
return (bytesPerSec / (1024 * 1024)).toFixed(1) + " MB/s" return (bytesPerSec / (1024 * 1024)).toFixed(1) + " MB/s";
} else { } else {
return (bytesPerSec / (1024 * 1024 * 1024)).toFixed(1) + " GB/s" return (bytesPerSec / (1024 * 1024 * 1024)).toFixed(1) + " GB/s";
} }
} }
Component.onCompleted: { Component.onCompleted: {
DgopService.addRef(["network"]) DgopService.addRef(["network"]);
} }
Component.onDestruction: { Component.onDestruction: {
DgopService.removeRef(["network"]) DgopService.removeRef(["network"]);
} }
content: Component { content: Component {
@@ -48,10 +46,12 @@ BasePill {
StyledText { StyledText {
text: { text: {
const rate = DgopService.networkRxRate const rate = DgopService.networkRxRate;
if (rate < 1024) return rate.toFixed(0) if (rate < 1024)
if (rate < 1024 * 1024) return (rate / 1024).toFixed(0) + "K" return rate.toFixed(0);
return (rate / (1024 * 1024)).toFixed(0) + "M" if (rate < 1024 * 1024)
return (rate / 1024).toFixed(0) + "K";
return (rate / (1024 * 1024)).toFixed(0) + "M";
} }
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText) font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
color: Theme.info color: Theme.info
@@ -60,10 +60,12 @@ BasePill {
StyledText { StyledText {
text: { text: {
const rate = DgopService.networkTxRate const rate = DgopService.networkTxRate;
if (rate < 1024) return rate.toFixed(0) if (rate < 1024)
if (rate < 1024 * 1024) return (rate / 1024).toFixed(0) + "K" return rate.toFixed(0);
return (rate / (1024 * 1024)).toFixed(0) + "M" if (rate < 1024 * 1024)
return (rate / 1024).toFixed(0) + "K";
return (rate / (1024 * 1024)).toFixed(0) + "M";
} }
font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText) font.pixelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText)
color: Theme.error color: Theme.error
@@ -316,7 +316,7 @@ BasePill {
visible: !iconImg.visible && Paths.isSteamApp(effectiveAppId) visible: !iconImg.visible && Paths.isSteamApp(effectiveAppId)
} }
Text { StyledText {
anchors.centerIn: parent anchors.centerIn: parent
visible: !iconImg.visible && !Paths.isSteamApp(effectiveAppId) visible: !iconImg.visible && !Paths.isSteamApp(effectiveAppId)
text: { text: {
@@ -570,7 +570,7 @@ BasePill {
visible: !iconImg.visible && Paths.isSteamApp(effectiveAppId) visible: !iconImg.visible && Paths.isSteamApp(effectiveAppId)
} }
Text { StyledText {
anchors.centerIn: parent anchors.centerIn: parent
visible: !iconImg.visible && !Paths.isSteamApp(effectiveAppId) visible: !iconImg.visible && !Paths.isSteamApp(effectiveAppId)
text: { text: {
@@ -428,7 +428,7 @@ BasePill {
} }
} }
Text { StyledText {
anchors.centerIn: parent anchors.centerIn: parent
visible: !iconImg.visible visible: !iconImg.visible
text: { text: {
@@ -649,7 +649,7 @@ BasePill {
} }
} }
Text { StyledText {
anchors.centerIn: parent anchors.centerIn: parent
visible: !inlineIconImg.visible visible: !inlineIconImg.visible
text: { text: {
@@ -783,7 +783,7 @@ BasePill {
} }
} }
Text { StyledText {
anchors.centerIn: parent anchors.centerIn: parent
visible: !iconImg.visible visible: !iconImg.visible
text: { text: {
@@ -1290,7 +1290,7 @@ BasePill {
} }
} }
Text { StyledText {
anchors.centerIn: parent anchors.centerIn: parent
visible: !menuIconImg.visible visible: !menuIconImg.visible
text: { text: {
@@ -16,9 +16,11 @@ BasePill {
content: Component { content: Component {
Item { Item {
implicitWidth: { implicitWidth: {
if (!SettingsData.weatherEnabled) return 0 if (!SettingsData.weatherEnabled)
if (root.isVerticalOrientation) return root.widgetThickness - root.horizontalPadding * 2 return 0;
return Math.min(100 - root.horizontalPadding * 2, weatherRow.implicitWidth) if (root.isVerticalOrientation)
return root.widgetThickness - root.horizontalPadding * 2;
return Math.min(100 - root.horizontalPadding * 2, weatherRow.implicitWidth);
} }
implicitHeight: root.isVerticalOrientation ? weatherColumn.implicitHeight : (root.widgetThickness - root.horizontalPadding * 2) implicitHeight: root.isVerticalOrientation ? weatherColumn.implicitHeight : (root.widgetThickness - root.horizontalPadding * 2)
@@ -1691,7 +1691,7 @@ Item {
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
z: 2 z: 2
Text { StyledText {
anchors.centerIn: parent anchors.centerIn: parent
text: modelData.count text: modelData.count
font.pixelSize: root.appIconSize * 0.44 font.pixelSize: root.appIconSize * 0.44
@@ -1860,7 +1860,7 @@ Item {
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
z: 2 z: 2
Text { StyledText {
anchors.centerIn: parent anchors.centerIn: parent
text: modelData.count text: modelData.count
font.pixelSize: root.appIconSize * 0.44 font.pixelSize: root.appIconSize * 0.44
@@ -1,5 +1,4 @@
import QtQuick import QtQuick
import QtQuick.Effects
import Quickshell import Quickshell
import qs.Common import qs.Common
import qs.Widgets import qs.Widgets
@@ -22,11 +21,11 @@ Card {
StyledText { StyledText {
text: { text: {
if (SettingsData.use24HourClock) { if (SettingsData.use24HourClock) {
return String(systemClock?.date?.getHours()).padStart(2, '0').charAt(0) return String(systemClock?.date?.getHours()).padStart(2, '0').charAt(0);
} else { } else {
const hours = systemClock?.date?.getHours() const hours = systemClock?.date?.getHours();
const display = hours === 0 ? 12 : hours > 12 ? hours - 12 : hours const display = hours === 0 ? 12 : hours > 12 ? hours - 12 : hours;
return String(display).padStart(2, '0').charAt(0) return String(display).padStart(2, '0').charAt(0);
} }
} }
font.pixelSize: 48 font.pixelSize: 48
@@ -39,11 +38,11 @@ Card {
StyledText { StyledText {
text: { text: {
if (SettingsData.use24HourClock) { if (SettingsData.use24HourClock) {
return String(systemClock?.date?.getHours()).padStart(2, '0').charAt(1) return String(systemClock?.date?.getHours()).padStart(2, '0').charAt(1);
} else { } else {
const hours = systemClock?.date?.getHours() const hours = systemClock?.date?.getHours();
const display = hours === 0 ? 12 : hours > 12 ? hours - 12 : hours const display = hours === 0 ? 12 : hours > 12 ? hours - 12 : hours;
return String(display).padStart(2, '0').charAt(1) return String(display).padStart(2, '0').charAt(1);
} }
} }
font.pixelSize: 48 font.pixelSize: 48
@@ -1,6 +1,4 @@
import QtQuick import QtQuick
import QtQuick.Effects
import QtQuick.Shapes
import Quickshell.Services.Mpris import Quickshell.Services.Mpris
import qs.Common import qs.Common
import qs.Services import qs.Services
@@ -10,24 +8,25 @@ Card {
id: root id: root
clip: false clip: false
signal clicked() signal clicked
property MprisPlayer activePlayer: MprisController.activePlayer property MprisPlayer activePlayer: MprisController.activePlayer
property real currentPosition: activePlayer?.positionSupported ? activePlayer.position : 0 property real currentPosition: activePlayer?.positionSupported ? activePlayer.position : 0
property real displayPosition: currentPosition property real displayPosition: currentPosition
readonly property real ratio: { readonly property real ratio: {
if (!activePlayer || activePlayer.length <= 0) return 0 if (!activePlayer || activePlayer.length <= 0)
const pos = displayPosition % Math.max(1, activePlayer.length) return 0;
const calculatedRatio = pos / activePlayer.length const pos = displayPosition % Math.max(1, activePlayer.length);
return Math.max(0, Math.min(1, calculatedRatio)) const calculatedRatio = pos / activePlayer.length;
return Math.max(0, Math.min(1, calculatedRatio));
} }
onActivePlayerChanged: { onActivePlayerChanged: {
if (activePlayer?.positionSupported) { if (activePlayer?.positionSupported) {
currentPosition = Qt.binding(() => activePlayer?.position || 0) currentPosition = Qt.binding(() => activePlayer?.position || 0);
} else { } else {
currentPosition = 0 currentPosition = 0;
} }
} }
@@ -126,73 +125,73 @@ Card {
spacing: Theme.spacingS spacing: Theme.spacingS
anchors.centerIn: parent anchors.centerIn: parent
Rectangle { Rectangle {
width: 28 width: 28
height: 28 height: 28
radius: 14 radius: 14
anchors.verticalCenter: playPauseButton.verticalCenter anchors.verticalCenter: playPauseButton.verticalCenter
color: prevArea.containsMouse ? Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) : "transparent" color: prevArea.containsMouse ? Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) : "transparent"
DankIcon { DankIcon {
anchors.centerIn: parent anchors.centerIn: parent
name: "skip_previous" name: "skip_previous"
size: 14 size: 14
color: Theme.surfaceText color: Theme.surfaceText
}
MouseArea {
id: prevArea
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: MprisController.previousOrRewind()
}
} }
MouseArea { Rectangle {
id: prevArea id: playPauseButton
anchors.fill: parent width: 32
hoverEnabled: true height: 32
cursorShape: Qt.PointingHandCursor radius: 16
onClicked: MprisController.previousOrRewind() color: Theme.primary
}
}
Rectangle { DankIcon {
id: playPauseButton anchors.centerIn: parent
width: 32 name: activePlayer?.playbackState === MprisPlaybackState.Playing ? "pause" : "play_arrow"
height: 32 size: 16
radius: 16 color: Theme.background
color: Theme.primary }
DankIcon { MouseArea {
anchors.centerIn: parent anchors.fill: parent
name: activePlayer?.playbackState === MprisPlaybackState.Playing ? "pause" : "play_arrow" hoverEnabled: true
size: 16 cursorShape: Qt.PointingHandCursor
color: Theme.background onClicked: activePlayer?.togglePlaying()
}
} }
MouseArea { Rectangle {
anchors.fill: parent width: 28
hoverEnabled: true height: 28
cursorShape: Qt.PointingHandCursor radius: 14
onClicked: activePlayer?.togglePlaying() anchors.verticalCenter: playPauseButton.verticalCenter
} color: nextArea.containsMouse ? Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) : "transparent"
}
Rectangle { DankIcon {
width: 28 anchors.centerIn: parent
height: 28 name: "skip_next"
radius: 14 size: 14
anchors.verticalCenter: playPauseButton.verticalCenter color: Theme.surfaceText
color: nextArea.containsMouse ? Theme.withAlpha(Theme.surfaceContainerHigh, Theme.popupTransparency) : "transparent" }
DankIcon { MouseArea {
anchors.centerIn: parent id: nextArea
name: "skip_next" anchors.fill: parent
size: 14 hoverEnabled: true
color: Theme.surfaceText cursorShape: Qt.PointingHandCursor
onClicked: activePlayer?.next()
}
} }
MouseArea {
id: nextArea
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: activePlayer?.next()
}
}
} }
} }
} }
+1 -5
View File
@@ -538,11 +538,7 @@ Item {
StyledText { StyledText {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
text: wallpaperFolderModel.count > 0 text: wallpaperFolderModel.count > 0 ? (wallpaperFolderModel.count === 1 ? I18n.tr("%1 wallpaper • %2 / %3").arg(wallpaperFolderModel.count).arg(currentPage + 1).arg(totalPages) : I18n.tr("%1 wallpapers • %2 / %3").arg(wallpaperFolderModel.count).arg(currentPage + 1).arg(totalPages)) : I18n.tr("No wallpapers")
? (wallpaperFolderModel.count === 1
? I18n.tr("%1 wallpaper • %2 / %3").arg(wallpaperFolderModel.count).arg(currentPage + 1).arg(totalPages)
: I18n.tr("%1 wallpapers • %2 / %3").arg(wallpaperFolderModel.count).arg(currentPage + 1).arg(totalPages))
: I18n.tr("No wallpapers")
font.pixelSize: 14 font.pixelSize: 14
color: Theme.surfaceText color: Theme.surfaceText
opacity: 0.7 opacity: 0.7
+1 -1
View File
@@ -505,7 +505,7 @@ Item {
border.width: 1 border.width: 1
border.color: Theme.primarySelected border.color: Theme.primarySelected
Text { StyledText {
anchors.centerIn: parent anchors.centerIn: parent
text: { text: {
if (!appData || !appData.appId) { if (!appData || !appData.appId) {
@@ -19,10 +19,13 @@ DankActionButton {
DankIcon { DankIcon {
anchors.centerIn: parent anchors.centerIn: parent
name: { name: {
if (parent.text === "keyboard_hide") return "keyboard_hide" if (parent.text === "keyboard_hide")
if (parent.text === "Backspace") return "backspace" return "keyboard_hide";
if (parent.text === "Enter") return "keyboard_return" if (parent.text === "Backspace")
return "" return "backspace";
if (parent.text === "Enter")
return "keyboard_return";
return "";
} }
size: 20 size: 20
color: Theme.surfaceText color: Theme.surfaceText
+3 -3
View File
@@ -34,7 +34,7 @@ Item {
target: slideout target: slideout
enabled: slideout !== null enabled: slideout !== null
function onAboutToHide() { function onAboutToHide() {
textEditor.autoSaveToSession() textEditor.autoSaveToSession();
} }
} }
@@ -213,8 +213,8 @@ Item {
} }
onEscapePressed: { onEscapePressed: {
textEditor.autoSaveToSession() textEditor.autoSaveToSession();
root.hideRequested() root.hideRequested();
} }
onSettingsRequested: { onSettingsRequested: {
+48 -51
View File
@@ -71,27 +71,27 @@ Column {
repeat: false repeat: false
onTriggered: { onTriggered: {
if (NotepadStorageService.tabs.length > 1) { if (NotepadStorageService.tabs.length > 1) {
delegateItem.longPressing = true delegateItem.longPressing = true;
} }
} }
} }
readonly property real shiftOffset: { readonly property real shiftOffset: {
if (root.draggedIndex < 0) if (root.draggedIndex < 0)
return 0 return 0;
if (index === root.draggedIndex) if (index === root.draggedIndex)
return 0 return 0;
var dragIdx = root.draggedIndex var dragIdx = root.draggedIndex;
var dropIdx = root.dropTargetIndex var dropIdx = root.dropTargetIndex;
var myIdx = index var myIdx = index;
var shiftAmount = root.tabItemSize var shiftAmount = root.tabItemSize;
if (dropIdx < 0) if (dropIdx < 0)
return 0 return 0;
if (dragIdx < dropIdx && myIdx > dragIdx && myIdx <= dropIdx) if (dragIdx < dropIdx && myIdx > dragIdx && myIdx <= dropIdx)
return -shiftAmount return -shiftAmount;
if (dragIdx > dropIdx && myIdx >= dropIdx && myIdx < dragIdx) if (dragIdx > dropIdx && myIdx >= dropIdx && myIdx < dragIdx)
return shiftAmount return shiftAmount;
return 0 return 0;
} }
width: tabWidth width: tabWidth
@@ -140,11 +140,11 @@ Column {
id: tabText id: tabText
width: parent.width - (tabCloseButton.visible ? tabCloseButton.width + Theme.spacingXS : 0) width: parent.width - (tabCloseButton.visible ? tabCloseButton.width + Theme.spacingXS : 0)
text: { text: {
var prefix = "" var prefix = "";
if (hasUnsavedChangesForTab(modelData)) { if (hasUnsavedChangesForTab(modelData)) {
prefix = "● " prefix = "● ";
} }
return prefix + (modelData.title || "Untitled") return prefix + (modelData.title || "Untitled");
} }
font.pixelSize: Theme.fontSizeSmall font.pixelSize: Theme.fontSizeSmall
color: isActive ? Theme.primary : Theme.surfaceText color: isActive ? Theme.primary : Theme.surfaceText
@@ -202,68 +202,65 @@ Column {
onPressed: mouse => { onPressed: mouse => {
if (mouse.button === Qt.LeftButton && NotepadStorageService.tabs.length > 1) { if (mouse.button === Qt.LeftButton && NotepadStorageService.tabs.length > 1) {
delegateItem.dragStartPos = Qt.point(mouse.x, mouse.y) delegateItem.dragStartPos = Qt.point(mouse.x, mouse.y);
longPressTimer.start() longPressTimer.start();
} }
} }
onReleased: mouse => { onReleased: mouse => {
longPressTimer.stop() longPressTimer.stop();
var wasDragging = delegateItem.dragging var wasDragging = delegateItem.dragging;
var didReorder = wasDragging && delegateItem.targetIndex >= 0 && delegateItem.targetIndex !== delegateItem.originalIndex var didReorder = wasDragging && delegateItem.targetIndex >= 0 && delegateItem.targetIndex !== delegateItem.originalIndex;
if (didReorder) { if (didReorder) {
root.suppressShiftAnimation = true root.suppressShiftAnimation = true;
NotepadStorageService.reorderTab(delegateItem.originalIndex, delegateItem.targetIndex) NotepadStorageService.reorderTab(delegateItem.originalIndex, delegateItem.targetIndex);
} }
delegateItem.longPressing = false delegateItem.longPressing = false;
delegateItem.dragging = false delegateItem.dragging = false;
delegateItem.dragAxisOffset = 0 delegateItem.dragAxisOffset = 0;
delegateItem.targetIndex = -1 delegateItem.targetIndex = -1;
delegateItem.originalIndex = -1 delegateItem.originalIndex = -1;
root.draggedIndex = -1 root.draggedIndex = -1;
root.dropTargetIndex = -1 root.dropTargetIndex = -1;
if (didReorder) { if (didReorder) {
Qt.callLater(() => { Qt.callLater(() => {
root.suppressShiftAnimation = false root.suppressShiftAnimation = false;
}) });
} }
if (wasDragging || mouse.button !== Qt.LeftButton) if (wasDragging || mouse.button !== Qt.LeftButton)
return return;
root.tabSwitched(index) root.tabSwitched(index);
} }
onPositionChanged: mouse => { onPositionChanged: mouse => {
if (delegateItem.longPressing && !delegateItem.dragging) { if (delegateItem.longPressing && !delegateItem.dragging) {
var distance = Math.sqrt(Math.pow(mouse.x - delegateItem.dragStartPos.x, 2) + Math.pow(mouse.y - delegateItem.dragStartPos.y, 2)) var distance = Math.sqrt(Math.pow(mouse.x - delegateItem.dragStartPos.x, 2) + Math.pow(mouse.y - delegateItem.dragStartPos.y, 2));
if (distance > 5) { if (distance > 5) {
delegateItem.dragging = true delegateItem.dragging = true;
delegateItem.targetIndex = index delegateItem.targetIndex = index;
delegateItem.originalIndex = index delegateItem.originalIndex = index;
root.draggedIndex = index root.draggedIndex = index;
root.dropTargetIndex = index root.dropTargetIndex = index;
} }
} }
if (!delegateItem.dragging) if (!delegateItem.dragging)
return return;
var axisOffset = mouse.x - delegateItem.dragStartPos.x;
delegateItem.dragAxisOffset = axisOffset;
var axisOffset = mouse.x - delegateItem.dragStartPos.x var itemSize = root.tabItemSize;
delegateItem.dragAxisOffset = axisOffset var rawSlot = axisOffset / itemSize;
var slotOffset = rawSlot >= 0 ? Math.floor(rawSlot + 0.4) : Math.ceil(rawSlot - 0.4);
var itemSize = root.tabItemSize var tabCount = NotepadStorageService.tabs.length;
var rawSlot = axisOffset / itemSize var newTargetIndex = Math.max(0, Math.min(tabCount - 1, delegateItem.originalIndex + slotOffset));
var slotOffset = rawSlot >= 0
? Math.floor(rawSlot + 0.4)
: Math.ceil(rawSlot - 0.4)
var tabCount = NotepadStorageService.tabs.length
var newTargetIndex = Math.max(0, Math.min(tabCount - 1, delegateItem.originalIndex + slotOffset))
if (newTargetIndex !== delegateItem.targetIndex) { if (newTargetIndex !== delegateItem.targetIndex) {
delegateItem.targetIndex = newTargetIndex delegateItem.targetIndex = newTargetIndex;
root.dropTargetIndex = newTargetIndex root.dropTargetIndex = newTargetIndex;
} }
} }
} }
@@ -465,7 +465,7 @@ Column {
width: 32 width: 32
height: measuringText.contentHeight height: measuringText.contentHeight
Text { StyledText {
id: measuringText id: measuringText
width: textArea.width - textArea.leftPadding - textArea.rightPadding width: textArea.width - textArea.leftPadding - textArea.rightPadding
text: modelData || " " text: modelData || " "
@@ -719,7 +719,7 @@ Column {
contentWidth: width - 11 contentWidth: width - 11
contentHeight: previewText.paintedHeight + Theme.spacingM * 2 contentHeight: previewText.paintedHeight + Theme.spacingM * 2
Text { StyledText {
id: previewText id: previewText
width: parent.width - Theme.spacingM width: parent.width - Theme.spacingM
padding: Theme.spacingM padding: Theme.spacingM
@@ -718,7 +718,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }
Text { StyledText {
text: root.gridEnabled ? I18n.tr("Grid: ON", "Widget grid snap status") : I18n.tr("Grid: OFF", "Widget grid snap status") text: root.gridEnabled ? I18n.tr("Grid: ON", "Widget grid snap status") : I18n.tr("Grid: OFF", "Widget grid snap status")
font.pixelSize: Theme.fontSizeSmall font.pixelSize: Theme.fontSizeSmall
font.family: Theme.fontFamily font.family: Theme.fontFamily
@@ -733,7 +733,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }
Text { StyledText {
text: root.gridSize + "px" text: root.gridSize + "px"
font.pixelSize: Theme.fontSizeSmall font.pixelSize: Theme.fontSizeSmall
font.family: Theme.fontFamily font.family: Theme.fontFamily
@@ -748,7 +748,7 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
} }
Text { StyledText {
text: I18n.tr("G: grid • Z/X: size", "Widget grid keyboard hints") text: I18n.tr("G: grid • Z/X: size", "Widget grid keyboard hints")
font.pixelSize: Theme.fontSizeSmall font.pixelSize: Theme.fontSizeSmall
font.family: Theme.fontFamily font.family: Theme.fontFamily
+13 -13
View File
@@ -16,38 +16,38 @@ Column {
spacing: Theme.spacingM spacing: Theme.spacingM
Component.onCompleted: { Component.onCompleted: {
const settings = findSettings() const settings = findSettings();
if (settings) { if (settings) {
items = settings.loadValue(settingKey, defaultValue) items = settings.loadValue(settingKey, defaultValue);
} }
} }
onItemsChanged: { onItemsChanged: {
const settings = findSettings() const settings = findSettings();
if (settings) { if (settings) {
settings.saveValue(settingKey, items) settings.saveValue(settingKey, items);
} }
} }
function findSettings() { function findSettings() {
let item = parent let item = parent;
while (item) { while (item) {
if (item.saveValue !== undefined && item.loadValue !== undefined) { if (item.saveValue !== undefined && item.loadValue !== undefined) {
return item return item;
} }
item = item.parent item = item.parent;
} }
return null return null;
} }
function addItem(item) { function addItem(item) {
items = items.concat([item]) items = items.concat([item]);
} }
function removeItem(index) { function removeItem(index) {
const newItems = items.slice() const newItems = items.slice();
newItems.splice(index, 1) newItems.splice(index, 1);
items = newItems items = newItems;
} }
StyledText { StyledText {
@@ -123,7 +123,7 @@ Column {
hoverEnabled: true hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: { onClicked: {
root.removeItem(index) root.removeItem(index);
} }
} }
} }
@@ -18,47 +18,47 @@ Column {
property bool isLoading: false property bool isLoading: false
Component.onCompleted: { Component.onCompleted: {
loadValue() loadValue();
} }
function loadValue() { function loadValue() {
const settings = findSettings() const settings = findSettings();
if (settings) { if (settings) {
isLoading = true isLoading = true;
items = settings.loadValue(settingKey, defaultValue) items = settings.loadValue(settingKey, defaultValue);
isLoading = false isLoading = false;
} }
} }
onItemsChanged: { onItemsChanged: {
if (isLoading) { if (isLoading) {
return return;
} }
const settings = findSettings() const settings = findSettings();
if (settings) { if (settings) {
settings.saveValue(settingKey, items) settings.saveValue(settingKey, items);
} }
} }
function findSettings() { function findSettings() {
let item = parent let item = parent;
while (item) { while (item) {
if (item.saveValue !== undefined && item.loadValue !== undefined) { if (item.saveValue !== undefined && item.loadValue !== undefined) {
return item return item;
} }
item = item.parent item = item.parent;
} }
return null return null;
} }
function addItem(item) { function addItem(item) {
items = items.concat([item]) items = items.concat([item]);
} }
function removeItem(index) { function removeItem(index) {
const newItems = items.slice() const newItems = items.slice();
newItems.splice(index, 1) newItems.splice(index, 1);
items = newItems items = newItems;
} }
StyledText { StyledText {
@@ -110,11 +110,11 @@ Column {
placeholderText: modelData.placeholder || "" placeholderText: modelData.placeholder || ""
Component.onCompleted: { Component.onCompleted: {
inputRow.inputFields.push(this) inputRow.inputFields.push(this);
} }
Keys.onReturnPressed: { Keys.onReturnPressed: {
addButton.clicked() addButton.clicked();
} }
} }
} }
@@ -126,32 +126,32 @@ Column {
text: I18n.tr("Add") text: I18n.tr("Add")
onClicked: { onClicked: {
let newItem = {} let newItem = {};
let hasValue = false let hasValue = false;
for (let i = 0; i < root.fields.length; i++) { for (let i = 0; i < root.fields.length; i++) {
const field = root.fields[i] const field = root.fields[i];
const input = inputRow.inputFields[i] const input = inputRow.inputFields[i];
const value = input.text.trim() const value = input.text.trim();
if (value !== "") { if (value !== "") {
hasValue = true hasValue = true;
} }
if (field.required && value === "") { if (field.required && value === "") {
return return;
} }
newItem[field.id] = value || (field.default || "") newItem[field.id] = value || (field.default || "");
} }
if (hasValue) { if (hasValue) {
root.addItem(newItem) root.addItem(newItem);
for (let i = 0; i < inputRow.inputFields.length; i++) { for (let i = 0; i < inputRow.inputFields.length; i++) {
inputRow.inputFields[i].text = "" inputRow.inputFields[i].text = "";
} }
if (inputRow.inputFields.length > 0) { if (inputRow.inputFields.length > 0) {
inputRow.inputFields[0].forceActiveFocus() inputRow.inputFields[0].forceActiveFocus();
} }
} }
} }
@@ -200,13 +200,13 @@ Column {
required property var modelData required property var modelData
text: { text: {
const field = modelData const field = modelData;
const item = itemRow.itemData const item = itemRow.itemData;
if (!field || !field.id || !item) { if (!field || !field.id || !item) {
return "" return "";
} }
const value = item[field.id] const value = item[field.id];
return value || "" return value || "";
} }
color: Theme.surfaceText color: Theme.surfaceText
font.pixelSize: Theme.fontSizeMedium font.pixelSize: Theme.fontSizeMedium
@@ -239,7 +239,7 @@ Column {
hoverEnabled: true hoverEnabled: true
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
onClicked: { onClicked: {
root.removeItem(index) root.removeItem(index);
} }
} }
} }
+10 -10
View File
@@ -20,32 +20,32 @@ Column {
spacing: Theme.spacingS spacing: Theme.spacingS
function loadValue() { function loadValue() {
const settings = findSettings() const settings = findSettings();
if (settings && settings.pluginService) { if (settings && settings.pluginService) {
value = settings.loadValue(settingKey, defaultValue) value = settings.loadValue(settingKey, defaultValue);
} }
} }
Component.onCompleted: { Component.onCompleted: {
loadValue() loadValue();
} }
onValueChanged: { onValueChanged: {
const settings = findSettings() const settings = findSettings();
if (settings) { if (settings) {
settings.saveValue(settingKey, value) settings.saveValue(settingKey, value);
} }
} }
function findSettings() { function findSettings() {
let item = parent let item = parent;
while (item) { while (item) {
if (item.saveValue !== undefined && item.loadValue !== undefined) { if (item.saveValue !== undefined && item.loadValue !== undefined) {
return item return item;
} }
item = item.parent item = item.parent;
} }
return null return null;
} }
StyledText { StyledText {
@@ -75,7 +75,7 @@ Column {
wheelEnabled: false wheelEnabled: false
thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency) thumbOutlineColor: Theme.withAlpha(Theme.surfaceContainerHighest, Theme.popupTransparency)
onSliderValueChanged: newValue => { onSliderValueChanged: newValue => {
root.value = newValue root.value = newValue;
} }
} }
} }
+14 -13
View File
@@ -17,35 +17,36 @@ Row {
property bool isInitialized: false property bool isInitialized: false
function loadValue() { function loadValue() {
const settings = findSettings() const settings = findSettings();
if (settings && settings.pluginService) { if (settings && settings.pluginService) {
const loadedValue = settings.loadValue(settingKey, defaultValue) const loadedValue = settings.loadValue(settingKey, defaultValue);
value = loadedValue value = loadedValue;
isInitialized = true isInitialized = true;
} }
} }
Component.onCompleted: { Component.onCompleted: {
Qt.callLater(loadValue) Qt.callLater(loadValue);
} }
onValueChanged: { onValueChanged: {
if (!isInitialized) return if (!isInitialized)
const settings = findSettings() return;
const settings = findSettings();
if (settings) { if (settings) {
settings.saveValue(settingKey, value) settings.saveValue(settingKey, value);
} }
} }
function findSettings() { function findSettings() {
let item = parent let item = parent;
while (item) { while (item) {
if (item.saveValue !== undefined && item.loadValue !== undefined) { if (item.saveValue !== undefined && item.loadValue !== undefined) {
return item return item;
} }
item = item.parent item = item.parent;
} }
return null return null;
} }
Column { Column {
@@ -75,7 +76,7 @@ Row {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
checked: root.value checked: root.value
onToggled: isChecked => { onToggled: isChecked => {
root.value = isChecked root.value = isChecked;
} }
} }
} }
+1 -1
View File
@@ -171,7 +171,7 @@ Item {
} }
} }
Text { StyledText {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
text: "DANK LINUX" text: "DANK LINUX"
font.pixelSize: parent.compactLogo ? 32 : 48 font.pixelSize: parent.compactLogo ? 32 : 48
@@ -390,11 +390,9 @@ Item {
} }
StyledText { StyledText {
text: DisplayConfigState.allOutputs[modelData]?.connected text: DisplayConfigState.allOutputs[modelData]?.connected ? I18n.tr("Connected") : I18n.tr("Disconnected")
? I18n.tr("Connected") : I18n.tr("Disconnected")
font.pixelSize: Theme.fontSizeSmall font.pixelSize: Theme.fontSizeSmall
color: DisplayConfigState.allOutputs[modelData]?.connected color: DisplayConfigState.allOutputs[modelData]?.connected ? Theme.success : Theme.surfaceVariantText
? Theme.success : Theme.surfaceVariantText
} }
} }
} }
@@ -2,12 +2,10 @@ pragma ComponentBehavior: Bound
import QtQuick import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
import Quickshell
import Quickshell.Io import Quickshell.Io
import qs.Common import qs.Common
import qs.Modals.Common import qs.Modals.Common
import qs.Modals.FileBrowser import qs.Modals.FileBrowser
import qs.Services
import qs.Widgets import qs.Widgets
import qs.Modules.Settings.Widgets import qs.Modules.Settings.Widgets
+1 -4
View File
@@ -7,10 +7,7 @@ import qs.Modules.Settings.Widgets
Item { Item {
id: root id: root
readonly property var muxTypeOptions: [ readonly property var muxTypeOptions: ["tmux", "zellij"]
"tmux",
"zellij"
]
DankFlickable { DankFlickable {
anchors.fill: parent anchors.fill: parent
+2 -2
View File
@@ -23,7 +23,8 @@ FocusScope {
function updateFilteredPlugins() { function updateFilteredPlugins() {
var query = searchQuery.toLowerCase(); var query = searchQuery.toLowerCase();
filteredPlugins = PluginService.availablePluginsList.filter(plugin => { filteredPlugins = PluginService.availablePluginsList.filter(plugin => {
if (!query) return true; if (!query)
return true;
var name = (plugin.name || "").toLowerCase(); var name = (plugin.name || "").toLowerCase();
var desc = (plugin.description || "").toLowerCase(); var desc = (plugin.description || "").toLowerCase();
var author = (plugin.author || "").toLowerCase(); var author = (plugin.author || "").toLowerCase();
@@ -31,7 +32,6 @@ FocusScope {
}); });
} }
Connections { Connections {
target: PluginService target: PluginService
function onAvailablePluginsListChanged() { function onAvailablePluginsListChanged() {
@@ -251,17 +251,7 @@ Item {
settingKey: "fontWeight" settingKey: "fontWeight"
text: I18n.tr("Font Weight") text: I18n.tr("Font Weight")
description: I18n.tr("Select font weight for UI text") description: I18n.tr("Select font weight for UI text")
options: [ options: [I18n.tr("Thin"), I18n.tr("Extra Light"), I18n.tr("Light"), I18n.tr("Regular"), I18n.tr("Medium"), I18n.tr("Demi Bold"), I18n.tr("Bold"), I18n.tr("Extra Bold"), I18n.tr("Black")]
I18n.tr("Thin"),
I18n.tr("Extra Light"),
I18n.tr("Light"),
I18n.tr("Regular"),
I18n.tr("Medium"),
I18n.tr("Demi Bold"),
I18n.tr("Bold"),
I18n.tr("Extra Bold"),
I18n.tr("Black")
]
currentValue: { currentValue: {
switch (SettingsData.fontWeight) { switch (SettingsData.fontWeight) {
case Font.Thin: case Font.Thin:
@@ -441,13 +431,11 @@ Item {
height: 1 height: 1
color: Theme.outline color: Theme.outline
opacity: 0.15 opacity: 0.15
visible: SettingsData.textRenderType === SettingsData.TextRenderType.Qt
} }
Item { Item {
width: parent.width width: parent.width
height: visible ? qualityGroup.implicitHeight + qualityLabel.implicitHeight + Theme.spacingS : 0 height: qualityGroup.implicitHeight + qualityLabel.implicitHeight + Theme.spacingS
visible: SettingsData.textRenderType === SettingsData.TextRenderType.Qt
clip: true clip: true
StyledText { StyledText {
@@ -223,7 +223,7 @@ Item {
onClicked: { onClicked: {
if (root.draggingTargetWorkspace === -1) { if (root.draggingTargetWorkspace === -1) {
root.overviewOpen = false; root.overviewOpen = false;
HyplandService.focusWorkspace(workspaceValue) HyplandService.focusWorkspace(workspaceValue);
} }
} }
} }
@@ -352,7 +352,7 @@ Item {
root.draggingTargetWorkspace = -1; root.draggingTargetWorkspace = -1;
if (targetWorkspace !== -1 && targetWorkspace !== windowData?.workspace.id) { if (targetWorkspace !== -1 && targetWorkspace !== windowData?.workspace.id) {
HyprlandService.moveToWorkspace(targetWorkspace, windowData?.address, false) HyprlandService.moveToWorkspace(targetWorkspace, windowData?.address, false);
Qt.callLater(() => { Qt.callLater(() => {
Hyprland.refreshToplevels(); Hyprland.refreshToplevels();
Hyprland.refreshWorkspaces(); Hyprland.refreshWorkspaces();
-2
View File
@@ -1,8 +1,6 @@
import QtQuick import QtQuick
import Quickshell
import Quickshell.Widgets import Quickshell.Widgets
import qs.Common import qs.Common
import qs.Services
Item { Item {
id: root id: root
+12 -6
View File
@@ -1,4 +1,3 @@
import QtCore
import QtQuick import QtQuick
import qs.Common import qs.Common
@@ -27,7 +26,6 @@ Column {
readonly property bool effectiveIncrementEnabled: root.onIncrement ? root.incrementEnabled : false readonly property bool effectiveIncrementEnabled: root.onIncrement ? root.incrementEnabled : false
readonly property bool effectiveDecrementEnabled: root.onDecrement ? root.decrementEnabled : false readonly property bool effectiveDecrementEnabled: root.onDecrement ? root.decrementEnabled : false
width: Math.max(buttonSize * 2, root.implicitWidth + horizontalPadding * 2) width: Math.max(buttonSize * 2, root.implicitWidth + horizontalPadding * 2)
spacing: 4 spacing: 4
@@ -38,20 +36,27 @@ Column {
iconSize: root.iconSize iconSize: root.iconSize
buttonSize: root.buttonSize buttonSize: root.buttonSize
iconName: root.incrementIconName iconName: root.incrementIconName
onClicked: if (typeof root.onIncrement === 'function') root.onIncrement() onClicked: if (typeof root.onIncrement === 'function')
root.onIncrement()
tooltipText: root.incrementTooltipText tooltipText: root.incrementTooltipText
} }
Row { Row {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
Item { width: 5; height: 1 } Item {
width: 5
height: 1
}
StyledText { StyledText {
isMonospace: true isMonospace: true
text: root.text text: root.text
font.pixelSize: root.textSize font.pixelSize: root.textSize
color: root.textColor color: root.textColor
} }
Item { width: 5; height: 1 } Item {
width: 5
height: 1
}
} }
DankActionButton { DankActionButton {
@@ -61,7 +66,8 @@ Column {
iconSize: root.iconSize iconSize: root.iconSize
buttonSize: root.buttonSize buttonSize: root.buttonSize
iconName: root.decrementIconName iconName: root.decrementIconName
onClicked: if (typeof root.onDecrement === 'function') root.onDecrement() onClicked: if (typeof root.onDecrement === 'function')
root.onDecrement()
tooltipText: root.decrementTooltipText tooltipText: root.decrementTooltipText
} }
} }
+3 -2
View File
@@ -1,6 +1,5 @@
pragma ComponentBehavior: Bound pragma ComponentBehavior: Bound
import QtQuick import QtQuick
import QtQuick.Controls
import Quickshell import Quickshell
import Quickshell.Wayland import Quickshell.Wayland
import qs.Common import qs.Common
@@ -29,7 +28,9 @@ PanelWindow {
function show() { function show() {
mappedVisible = true; mappedVisible = true;
Qt.callLater(() => { isVisible = true; }); Qt.callLater(() => {
isVisible = true;
});
} }
function hide() { function hide() {
+8 -8
View File
@@ -50,21 +50,21 @@ PanelWindow {
margins { margins {
left: { left: {
const screenWidth = targetScreen?.width ?? Screen.width const screenWidth = targetScreen?.width ?? Screen.width;
if (alignLeft) { if (alignLeft) {
return Math.round(Math.max(Theme.spacingS, Math.min(screenWidth - implicitWidth - Theme.spacingS, targetX))) return Math.round(Math.max(Theme.spacingS, Math.min(screenWidth - implicitWidth - Theme.spacingS, targetX)));
} else if (alignRight) { } else if (alignRight) {
return Math.round(Math.max(Theme.spacingS, Math.min(screenWidth - implicitWidth - Theme.spacingS, targetX - implicitWidth))) return Math.round(Math.max(Theme.spacingS, Math.min(screenWidth - implicitWidth - Theme.spacingS, targetX - implicitWidth)));
} else { } else {
return Math.round(Math.max(Theme.spacingS, Math.min(screenWidth - implicitWidth - Theme.spacingS, targetX - implicitWidth / 2))) return Math.round(Math.max(Theme.spacingS, Math.min(screenWidth - implicitWidth - Theme.spacingS, targetX - implicitWidth / 2)));
} }
} }
top: { top: {
const screenHeight = targetScreen?.height ?? Screen.height const screenHeight = targetScreen?.height ?? Screen.height;
if (alignLeft || alignRight) { if (alignLeft || alignRight) {
return Math.round(Math.max(Theme.spacingS, Math.min(screenHeight - implicitHeight - Theme.spacingS, targetY - implicitHeight / 2))) return Math.round(Math.max(Theme.spacingS, Math.min(screenHeight - implicitHeight - Theme.spacingS, targetY - implicitHeight / 2)));
} else { } else {
return Math.round(Math.max(Theme.spacingS, Math.min(screenHeight - implicitHeight - Theme.spacingS, targetY))) return Math.round(Math.max(Theme.spacingS, Math.min(screenHeight - implicitHeight - Theme.spacingS, targetY)));
} }
} }
} }
@@ -76,7 +76,7 @@ PanelWindow {
border.width: 1 border.width: 1
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)
Text { StyledText {
id: textContent id: textContent
anchors.centerIn: parent anchors.centerIn: parent