Formatting
This commit is contained in:
parent
3f64bb1879
commit
151e2b6aaf
7 changed files with 869 additions and 840 deletions
|
|
@ -26,10 +26,6 @@ NLoader {
|
||||||
|
|
||||||
// Removed local clipboard processes; handled by Clipboard service
|
// Removed local clipboard processes; handled by Clipboard service
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Copy helpers via simple exec; avoid keeping processes alive locally
|
// Copy helpers via simple exec; avoid keeping processes alive locally
|
||||||
function copyImageBase64(mime, base64) {
|
function copyImageBase64(mime, base64) {
|
||||||
Quickshell.execDetached(["sh", "-lc", `printf %s ${base64} | base64 -d | wl-copy -t '${mime}'`])
|
Quickshell.execDetached(["sh", "-lc", `printf %s ${base64} | base64 -d | wl-copy -t '${mime}'`])
|
||||||
|
|
@ -39,36 +35,35 @@ NLoader {
|
||||||
Quickshell.execDetached(["sh", "-lc", `printf %s ${text} | wl-copy -t text/plain;charset=utf-8`])
|
Quickshell.execDetached(["sh", "-lc", `printf %s ${text} | wl-copy -t text/plain;charset=utf-8`])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function updateClipboardHistory() {
|
function updateClipboardHistory() {
|
||||||
Clipboard.refresh();
|
Clipboard.refresh()
|
||||||
}
|
}
|
||||||
|
|
||||||
function selectNext() {
|
function selectNext() {
|
||||||
if (filteredEntries.length > 0) {
|
if (filteredEntries.length > 0) {
|
||||||
selectedIndex = Math.min(selectedIndex + 1, filteredEntries.length - 1);
|
selectedIndex = Math.min(selectedIndex + 1, filteredEntries.length - 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function selectPrev() {
|
function selectPrev() {
|
||||||
if (filteredEntries.length > 0) {
|
if (filteredEntries.length > 0) {
|
||||||
selectedIndex = Math.max(selectedIndex - 1, 0);
|
selectedIndex = Math.max(selectedIndex - 1, 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function activateSelected() {
|
function activateSelected() {
|
||||||
if (filteredEntries.length === 0) return;
|
if (filteredEntries.length === 0)
|
||||||
|
return
|
||||||
|
|
||||||
var modelData = filteredEntries[selectedIndex];
|
var modelData = filteredEntries[selectedIndex]
|
||||||
if (modelData && modelData.execute) {
|
if (modelData && modelData.execute) {
|
||||||
if (modelData.isCommand) {
|
if (modelData.isCommand) {
|
||||||
modelData.execute();
|
modelData.execute()
|
||||||
return;
|
return
|
||||||
} else {
|
} else {
|
||||||
modelData.execute();
|
modelData.execute()
|
||||||
}
|
}
|
||||||
appLauncherPanel.hide();
|
appLauncherPanel.hide()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -92,142 +87,141 @@ NLoader {
|
||||||
|
|
||||||
console.log("[AppLauncher] Visible entries:", visibleEntries.length)
|
console.log("[AppLauncher] Visible entries:", visibleEntries.length)
|
||||||
|
|
||||||
var query = searchText ? searchText.toLowerCase() : "";
|
var query = searchText ? searchText.toLowerCase() : ""
|
||||||
var results = [];
|
var results = []
|
||||||
|
|
||||||
// Handle special commands
|
// Handle special commands
|
||||||
if (query === ">") {
|
if (query === ">") {
|
||||||
results.push({
|
results.push({
|
||||||
isCommand: true,
|
"isCommand": true,
|
||||||
name: ">calc",
|
"name": ">calc",
|
||||||
content: "Calculator - evaluate mathematical expressions",
|
"content": "Calculator - evaluate mathematical expressions",
|
||||||
icon: "calculate",
|
"icon": "calculate",
|
||||||
execute: function() {
|
"execute": function () {
|
||||||
searchText = ">calc ";
|
searchText = ">calc "
|
||||||
searchInput.cursorPosition = searchText.length;
|
searchInput.cursorPosition = searchText.length
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
|
||||||
results.push({
|
results.push({
|
||||||
isCommand: true,
|
"isCommand": true,
|
||||||
name: ">clip",
|
"name": ">clip",
|
||||||
content: "Clipboard history - browse and restore clipboard items",
|
"content": "Clipboard history - browse and restore clipboard items",
|
||||||
icon: "content_paste",
|
"icon": "content_paste",
|
||||||
execute: function() {
|
"execute": function () {
|
||||||
searchText = ">clip ";
|
searchText = ">clip "
|
||||||
searchInput.cursorPosition = searchText.length;
|
searchInput.cursorPosition = searchText.length
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
|
||||||
return results;
|
return results
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle clipboard history
|
// Handle clipboard history
|
||||||
if (query.startsWith(">clip")) {
|
if (query.startsWith(">clip")) {
|
||||||
if (!Clipboard.initialized) {
|
if (!Clipboard.initialized) {
|
||||||
Clipboard.refresh();
|
Clipboard.refresh()
|
||||||
}
|
}
|
||||||
const searchTerm = query.slice(5).trim();
|
const searchTerm = query.slice(5).trim()
|
||||||
|
|
||||||
Clipboard.history.forEach(function (clip, index) {
|
Clipboard.history.forEach(function (clip, index) {
|
||||||
let searchContent = clip.type === 'image' ?
|
let searchContent = clip.type === 'image' ? clip.mimeType : clip.content || clip
|
||||||
clip.mimeType :
|
|
||||||
clip.content || clip;
|
|
||||||
|
|
||||||
if (!searchTerm || searchContent.toLowerCase().includes(searchTerm)) {
|
if (!searchTerm || searchContent.toLowerCase().includes(searchTerm)) {
|
||||||
let entry;
|
let entry
|
||||||
if (clip.type === 'image') {
|
if (clip.type === 'image') {
|
||||||
entry = {
|
entry = {
|
||||||
isClipboard: true,
|
"isClipboard": true,
|
||||||
name: "Image from " + new Date(clip.timestamp).toLocaleTimeString(),
|
"name": "Image from " + new Date(clip.timestamp).toLocaleTimeString(),
|
||||||
content: "Image: " + clip.mimeType,
|
"content": "Image: " + clip.mimeType,
|
||||||
icon: "image",
|
"icon": "image",
|
||||||
type: 'image',
|
"type": 'image',
|
||||||
data: clip.data,
|
"data": clip.data,
|
||||||
execute: function() {
|
"execute": function () {
|
||||||
const base64Data = clip.data.split(',')[1];
|
const base64Data = clip.data.split(',')[1]
|
||||||
copyImageBase64(clip.mimeType, base64Data);
|
copyImageBase64(clip.mimeType, base64Data)
|
||||||
Quickshell.execDetached(["notify-send", "Clipboard", "Image copied: " + clip.mimeType]);
|
Quickshell.execDetached(["notify-send", "Clipboard", "Image copied: " + clip.mimeType])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
|
||||||
} else {
|
} else {
|
||||||
const textContent = clip.content || clip;
|
const textContent = clip.content || clip
|
||||||
let displayContent = textContent;
|
let displayContent = textContent
|
||||||
let previewContent = "";
|
let previewContent = ""
|
||||||
|
|
||||||
displayContent = displayContent.replace(/\s+/g, ' ').trim();
|
displayContent = displayContent.replace(/\s+/g, ' ').trim()
|
||||||
|
|
||||||
if (displayContent.length > 50) {
|
if (displayContent.length > 50) {
|
||||||
previewContent = displayContent;
|
previewContent = displayContent
|
||||||
displayContent = displayContent.split('\n')[0].substring(0, 50) + "...";
|
displayContent = displayContent.split('\n')[0].substring(0, 50) + "..."
|
||||||
}
|
}
|
||||||
|
|
||||||
entry = {
|
entry = {
|
||||||
isClipboard: true,
|
"isClipboard": true,
|
||||||
name: displayContent,
|
"name": displayContent,
|
||||||
content: previewContent || textContent,
|
"content": previewContent || textContent,
|
||||||
icon: "content_paste",
|
"icon": "content_paste",
|
||||||
execute: function() {
|
"execute": function () {
|
||||||
Quickshell.clipboardText = String(textContent);
|
Quickshell.clipboardText = String(textContent)
|
||||||
copyText(String(textContent));
|
copyText(String(textContent))
|
||||||
var preview = (textContent.length > 50) ? textContent.slice(0,50) + "…" : textContent;
|
var preview = (textContent.length > 50) ? textContent.slice(0, 50) + "…" : textContent
|
||||||
Quickshell.execDetached(["notify-send", "Clipboard", "Text copied: " + preview]);
|
Quickshell.execDetached(["notify-send", "Clipboard", "Text copied: " + preview])
|
||||||
}
|
}
|
||||||
};
|
|
||||||
}
|
}
|
||||||
results.push(entry);
|
|
||||||
}
|
}
|
||||||
});
|
results.push(entry)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
if (results.length === 0) {
|
if (results.length === 0) {
|
||||||
results.push({
|
results.push({
|
||||||
isClipboard: true,
|
"isClipboard": true,
|
||||||
name: "No clipboard history",
|
"name": "No clipboard history",
|
||||||
content: "No matching clipboard entries found",
|
"content": "No matching clipboard entries found",
|
||||||
icon: "content_paste_off"
|
"icon": "content_paste_off"
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return results;
|
return results
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle calculator
|
// Handle calculator
|
||||||
if (query.startsWith(">calc")) {
|
if (query.startsWith(">calc")) {
|
||||||
var expr = searchText.slice(5).trim();
|
var expr = searchText.slice(5).trim()
|
||||||
if (expr && isMathExpression(expr)) {
|
if (expr && isMathExpression(expr)) {
|
||||||
var value = safeEval(expr);
|
var value = safeEval(expr)
|
||||||
if (value !== null && value !== undefined && value !== "") {
|
if (value !== null && value !== undefined && value !== "") {
|
||||||
var formattedResult = MathHelper.MathHelper.formatResult(value);
|
var formattedResult = MathHelper.MathHelper.formatResult(value)
|
||||||
results.push({
|
results.push({
|
||||||
isCalculator: true,
|
"isCalculator": true,
|
||||||
name: `Calculator: ${expr} = ${formattedResult}`,
|
"name": `Calculator: ${expr} = ${formattedResult}`,
|
||||||
result: value,
|
"result": value,
|
||||||
expr: expr,
|
"expr": expr,
|
||||||
icon: "calculate",
|
"icon": "calculate",
|
||||||
execute: function() {
|
"execute": function () {
|
||||||
Quickshell.clipboardText = String(formattedResult);
|
Quickshell.clipboardText = String(formattedResult)
|
||||||
clipboardTextCopyProcess.copyText(String(formattedResult));
|
clipboardTextCopyProcess.copyText(String(formattedResult))
|
||||||
Quickshell.execDetached(["notify-send", "Calculator Result", `${expr} = ${formattedResult} (copied to clipboard)`]);
|
Quickshell.execDetached(
|
||||||
|
["notify-send", "Calculator Result", `${expr} = ${formattedResult} (copied to clipboard)`])
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return results;
|
return results
|
||||||
}
|
}
|
||||||
|
|
||||||
// Regular app search
|
// Regular app search
|
||||||
if (!query) {
|
if (!query) {
|
||||||
results = results.concat(visibleEntries.sort(function (a, b) {
|
results = results.concat(visibleEntries.sort(function (a, b) {
|
||||||
return a.name.toLowerCase().localeCompare(b.name.toLowerCase());
|
return a.name.toLowerCase().localeCompare(b.name.toLowerCase())
|
||||||
}));
|
}))
|
||||||
} else {
|
} else {
|
||||||
var fuzzyResults = Fuzzysort.go(query, visibleEntries, {
|
var fuzzyResults = Fuzzysort.go(query, visibleEntries, {
|
||||||
keys: ["name", "comment", "genericName"]
|
"keys": ["name", "comment", "genericName"]
|
||||||
});
|
})
|
||||||
results = results.concat(fuzzyResults.map(function (r) {
|
results = results.concat(fuzzyResults.map(function (r) {
|
||||||
return r.obj;
|
return r.obj
|
||||||
}));
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("[AppLauncher] Filtered entries:", results.length)
|
console.log("[AppLauncher] Filtered entries:", results.length)
|
||||||
|
|
@ -238,19 +232,20 @@ NLoader {
|
||||||
console.log("[AppLauncher] Component completed")
|
console.log("[AppLauncher] Component completed")
|
||||||
console.log("[AppLauncher] DesktopEntries available:", typeof DesktopEntries !== 'undefined')
|
console.log("[AppLauncher] DesktopEntries available:", typeof DesktopEntries !== 'undefined')
|
||||||
if (typeof DesktopEntries !== 'undefined') {
|
if (typeof DesktopEntries !== 'undefined') {
|
||||||
console.log("[AppLauncher] DesktopEntries.entries:", DesktopEntries.entries ? DesktopEntries.entries.length : 'undefined')
|
console.log("[AppLauncher] DesktopEntries.entries:",
|
||||||
|
DesktopEntries.entries ? DesktopEntries.entries.length : 'undefined')
|
||||||
}
|
}
|
||||||
// Start clipboard refresh immediately on open
|
// Start clipboard refresh immediately on open
|
||||||
updateClipboardHistory();
|
updateClipboardHistory()
|
||||||
}
|
}
|
||||||
|
|
||||||
function isMathExpression(str) {
|
function isMathExpression(str) {
|
||||||
// Allow more characters for enhanced math functions
|
// Allow more characters for enhanced math functions
|
||||||
return /^[-+*/().0-9\s\w]+$/.test(str);
|
return /^[-+*/().0-9\s\w]+$/.test(str)
|
||||||
}
|
}
|
||||||
|
|
||||||
function safeEval(expr) {
|
function safeEval(expr) {
|
||||||
return MathHelper.MathHelper.evaluate(expr);
|
return MathHelper.MathHelper.evaluate(expr)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Main content container
|
// Main content container
|
||||||
|
|
@ -265,19 +260,21 @@ NLoader {
|
||||||
|
|
||||||
// Subtle gradient background
|
// Subtle gradient background
|
||||||
gradient: Gradient {
|
gradient: Gradient {
|
||||||
GradientStop { position: 0.0; color: Qt.lighter(Colors.backgroundPrimary, 1.02) }
|
GradientStop {
|
||||||
GradientStop { position: 1.0; color: Qt.darker(Colors.backgroundPrimary, 1.1) }
|
position: 0.0
|
||||||
|
color: Qt.lighter(Colors.backgroundPrimary, 1.02)
|
||||||
|
}
|
||||||
|
GradientStop {
|
||||||
|
position: 1.0
|
||||||
|
color: Qt.darker(Colors.backgroundPrimary, 1.1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: Style.marginLarge * scaling
|
anchors.margins: Style.marginLarge * scaling
|
||||||
spacing: Style.marginMedium * scaling
|
spacing: Style.marginMedium * scaling
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Search bar
|
// Search bar
|
||||||
Rectangle {
|
Rectangle {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
@ -309,8 +306,8 @@ NLoader {
|
||||||
font.pointSize: 13 * scaling
|
font.pointSize: 13 * scaling
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
onTextChanged: {
|
onTextChanged: {
|
||||||
searchText = text;
|
searchText = text
|
||||||
selectedIndex = 0; // Reset selection when search changes
|
selectedIndex = 0 // Reset selection when search changes
|
||||||
}
|
}
|
||||||
selectedTextColor: Colors.textPrimary
|
selectedTextColor: Colors.textPrimary
|
||||||
selectionColor: Colors.accentPrimary
|
selectionColor: Colors.accentPrimary
|
||||||
|
|
@ -340,11 +337,15 @@ NLoader {
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on border.color {
|
Behavior on border.color {
|
||||||
ColorAnimation { duration: 120 }
|
ColorAnimation {
|
||||||
|
duration: 120
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on border.width {
|
Behavior on border.width {
|
||||||
NumberAnimation { duration: 120 }
|
NumberAnimation {
|
||||||
|
duration: 120
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -368,20 +369,29 @@ NLoader {
|
||||||
height: 56 * scaling
|
height: 56 * scaling
|
||||||
radius: 16 * scaling
|
radius: 16 * scaling
|
||||||
property bool isSelected: index === selectedIndex
|
property bool isSelected: index === selectedIndex
|
||||||
color: (appCardArea.containsMouse || isSelected) ? Qt.darker(Colors.accentPrimary, 1.1) : Colors.backgroundSecondary
|
color: (appCardArea.containsMouse || isSelected) ? Qt.darker(
|
||||||
border.color: (appCardArea.containsMouse || isSelected) ? Colors.accentPrimary : "transparent"
|
Colors.accentPrimary,
|
||||||
|
1.1) : Colors.backgroundSecondary
|
||||||
|
border.color: (appCardArea.containsMouse
|
||||||
|
|| isSelected) ? Colors.accentPrimary : "transparent"
|
||||||
border.width: (appCardArea.containsMouse || isSelected) ? 2 : 0
|
border.width: (appCardArea.containsMouse || isSelected) ? 2 : 0
|
||||||
|
|
||||||
Behavior on color {
|
Behavior on color {
|
||||||
ColorAnimation { duration: 150 }
|
ColorAnimation {
|
||||||
|
duration: 150
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on border.color {
|
Behavior on border.color {
|
||||||
ColorAnimation { duration: 150 }
|
ColorAnimation {
|
||||||
|
duration: 150
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on border.width {
|
Behavior on border.width {
|
||||||
NumberAnimation { duration: 150 }
|
NumberAnimation {
|
||||||
|
duration: 150
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
|
@ -394,8 +404,13 @@ NLoader {
|
||||||
Layout.preferredWidth: 40 * scaling
|
Layout.preferredWidth: 40 * scaling
|
||||||
Layout.preferredHeight: 40 * scaling
|
Layout.preferredHeight: 40 * scaling
|
||||||
radius: 14 * scaling
|
radius: 14 * scaling
|
||||||
color: appCardArea.containsMouse ? Qt.darker(Colors.accentPrimary, 1.1) : Colors.backgroundTertiary
|
color: appCardArea.containsMouse ? Qt.darker(Colors.accentPrimary,
|
||||||
property bool iconLoaded: (modelData.isCalculator || modelData.isClipboard || modelData.isCommand) || (iconImg.status === Image.Ready && iconImg.source !== "" && iconImg.status !== Image.Error && iconImg.source !== "")
|
1.1) : Colors.backgroundTertiary
|
||||||
|
property bool iconLoaded: (modelData.isCalculator || modelData.isClipboard
|
||||||
|
|| modelData.isCommand) || (iconImg.status === Image.Ready
|
||||||
|
&& iconImg.source !== ""
|
||||||
|
&& iconImg.status !== Image.Error
|
||||||
|
&& iconImg.source !== "")
|
||||||
visible: !searchText.startsWith(">calc") // Hide icon when in calculator mode
|
visible: !searchText.startsWith(">calc") // Hide icon when in calculator mode
|
||||||
|
|
||||||
// Clipboard image display
|
// Clipboard image display
|
||||||
|
|
@ -415,11 +430,9 @@ NLoader {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: 6 * scaling
|
anchors.margins: 6 * scaling
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
source: modelData.isCalculator ? "calculate" :
|
source: modelData.isCalculator ? "calculate" : modelData.isClipboard ? (modelData.type === 'image' ? "" : "content_paste") : modelData.isCommand ? modelData.icon : (modelData.icon ? Quickshell.iconPath(modelData.icon, "application-x-executable") : "")
|
||||||
modelData.isClipboard ? (modelData.type === 'image' ? "" : "content_paste") :
|
visible: (modelData.isCalculator || modelData.isClipboard || modelData.isCommand
|
||||||
modelData.isCommand ? modelData.icon :
|
|| parent.iconLoaded) && modelData.type !== 'image'
|
||||||
(modelData.icon ? Quickshell.iconPath(modelData.icon, "application-x-executable") : "")
|
|
||||||
visible: (modelData.isCalculator || modelData.isClipboard || modelData.isCommand || parent.iconLoaded) && modelData.type !== 'image'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fallback icon container
|
// Fallback icon container
|
||||||
|
|
@ -434,7 +447,8 @@ NLoader {
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
visible: !parent.iconLoaded && !(modelData.isCalculator || modelData.isClipboard || modelData.isCommand)
|
visible: !parent.iconLoaded && !(modelData.isCalculator || modelData.isClipboard
|
||||||
|
|| modelData.isCommand)
|
||||||
text: modelData.name ? modelData.name.charAt(0).toUpperCase() : "?"
|
text: modelData.name ? modelData.name.charAt(0).toUpperCase() : "?"
|
||||||
font.pointSize: 18 * scaling
|
font.pointSize: 18 * scaling
|
||||||
font.weight: Font.Bold
|
font.weight: Font.Bold
|
||||||
|
|
@ -442,7 +456,9 @@ NLoader {
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on color {
|
Behavior on color {
|
||||||
ColorAnimation { duration: 150 }
|
ColorAnimation {
|
||||||
|
duration: 150
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -461,19 +477,15 @@ NLoader {
|
||||||
}
|
}
|
||||||
|
|
||||||
NText {
|
NText {
|
||||||
text: modelData.isCalculator ? (modelData.expr + " = " + modelData.result) :
|
text: modelData.isCalculator ? (modelData.expr + " = " + modelData.result) : modelData.isClipboard ? modelData.content : modelData.isCommand ? modelData.content : (modelData.genericName || modelData.comment || "")
|
||||||
modelData.isClipboard ? modelData.content :
|
|
||||||
modelData.isCommand ? modelData.content :
|
|
||||||
(modelData.genericName || modelData.comment || "")
|
|
||||||
font.pointSize: 11 * scaling
|
font.pointSize: 11 * scaling
|
||||||
color: (appCardArea.containsMouse || isSelected) ? Colors.textPrimary : Colors.textSecondary
|
color: (appCardArea.containsMouse
|
||||||
|
|| isSelected) ? Colors.textPrimary : Colors.textSecondary
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
visible: text !== ""
|
visible: text !== ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
|
@ -483,8 +495,8 @@ NLoader {
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
selectedIndex = index;
|
selectedIndex = index
|
||||||
activateSelected();
|
activateSelected()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -503,9 +515,11 @@ NLoader {
|
||||||
|
|
||||||
// Results count
|
// Results count
|
||||||
NText {
|
NText {
|
||||||
text: searchText.startsWith(">clip") ? `${filteredEntries.length} clipboard item${filteredEntries.length !== 1 ? 's' : ''}` :
|
text: searchText.startsWith(
|
||||||
searchText.startsWith(">calc") ? `${filteredEntries.length} result${filteredEntries.length !== 1 ? 's' : ''}` :
|
">clip") ? `${filteredEntries.length} clipboard item${filteredEntries.length
|
||||||
`${filteredEntries.length} application${filteredEntries.length !== 1 ? 's' : ''}`
|
!== 1 ? 's' : ''}` : searchText.startsWith(
|
||||||
|
">calc") ? `${filteredEntries.length} result${filteredEntries.length
|
||||||
|
!== 1 ? 's' : ''}` : `${filteredEntries.length} application${filteredEntries.length !== 1 ? 's' : ''}`
|
||||||
font.pointSize: Style.fontSizeSmall * scaling
|
font.pointSize: Style.fontSizeSmall * scaling
|
||||||
color: Colors.textSecondary
|
color: Colors.textSecondary
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,8 @@ NLoader {
|
||||||
Timer {
|
Timer {
|
||||||
id: hideTimer
|
id: hideTimer
|
||||||
interval: hideDelay
|
interval: hideDelay
|
||||||
onTriggered: if (autoHide && !dockHovered && !anyAppHovered) hidden = true
|
onTriggered: if (autoHide && !dockHovered && !anyAppHovered)
|
||||||
|
hidden = true
|
||||||
}
|
}
|
||||||
|
|
||||||
// Timer for show delay
|
// Timer for show delay
|
||||||
|
|
@ -63,8 +64,6 @@ NLoader {
|
||||||
onTriggered: hidden = false
|
onTriggered: hidden = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Behavior for smooth hide/show animations
|
// Behavior for smooth hide/show animations
|
||||||
Behavior on margins.bottom {
|
Behavior on margins.bottom {
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
|
|
@ -83,8 +82,10 @@ NLoader {
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
propagateComposedEvents: true
|
propagateComposedEvents: true
|
||||||
|
|
||||||
onEntered: if (autoHide && hidden) showTimer.start()
|
onEntered: if (autoHide && hidden)
|
||||||
onExited: if (autoHide && !hidden && !dockHovered && !anyAppHovered) hideTimer.start()
|
showTimer.start()
|
||||||
|
onExited: if (autoHide && !hidden && !dockHovered && !anyAppHovered)
|
||||||
|
hideTimer.start()
|
||||||
}
|
}
|
||||||
|
|
||||||
margins.bottom: hidden ? -(fullHeight - peekHeight) : 0
|
margins.bottom: hidden ? -(fullHeight - peekHeight) : 0
|
||||||
|
|
@ -125,7 +126,8 @@ NLoader {
|
||||||
}
|
}
|
||||||
onExited: {
|
onExited: {
|
||||||
dockHovered = false
|
dockHovered = false
|
||||||
if (autoHide && !anyAppHovered && !contextMenuVisible) hideTimer.start()
|
if (autoHide && !anyAppHovered && !contextMenuVisible)
|
||||||
|
hideTimer.start()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -142,12 +144,16 @@ NLoader {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAppIcon(toplevel: Toplevel): string {
|
function getAppIcon(toplevel: Toplevel): string {
|
||||||
if (!toplevel) return "";
|
if (!toplevel)
|
||||||
let icon = Quickshell.iconPath(toplevel.appId?.toLowerCase(), true);
|
return ""
|
||||||
if (!icon) icon = Quickshell.iconPath(toplevel.appId, true);
|
let icon = Quickshell.iconPath(toplevel.appId?.toLowerCase(), true)
|
||||||
if (!icon) icon = Quickshell.iconPath(toplevel.title?.toLowerCase(), true);
|
if (!icon)
|
||||||
if (!icon) icon = Quickshell.iconPath(toplevel.title, true);
|
icon = Quickshell.iconPath(toplevel.appId, true)
|
||||||
return icon || Quickshell.iconPath("application-x-executable", true);
|
if (!icon)
|
||||||
|
icon = Quickshell.iconPath(toplevel.title?.toLowerCase(), true)
|
||||||
|
if (!icon)
|
||||||
|
icon = Quickshell.iconPath(toplevel.title, true)
|
||||||
|
return icon || Quickshell.iconPath("application-x-executable", true)
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
|
|
@ -166,12 +172,17 @@ NLoader {
|
||||||
radius: 18
|
radius: 18
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|
||||||
property bool isActive: ToplevelManager.activeToplevel && ToplevelManager.activeToplevel === modelData
|
property bool isActive: ToplevelManager.activeToplevel
|
||||||
|
&& ToplevelManager.activeToplevel === modelData
|
||||||
property bool hovered: appMouseArea.containsMouse
|
property bool hovered: appMouseArea.containsMouse
|
||||||
property string appId: modelData ? modelData.appId : ""
|
property string appId: modelData ? modelData.appId : ""
|
||||||
property string appTitle: modelData ? modelData.title : ""
|
property string appTitle: modelData ? modelData.title : ""
|
||||||
|
|
||||||
Behavior on color { ColorAnimation { duration: 150 } }
|
Behavior on color {
|
||||||
|
ColorAnimation {
|
||||||
|
duration: 150
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
id: appIcon
|
id: appIcon
|
||||||
|
|
@ -218,7 +229,8 @@ NLoader {
|
||||||
onExited: {
|
onExited: {
|
||||||
anyAppHovered = false
|
anyAppHovered = false
|
||||||
appTooltip.hide()
|
appTooltip.hide()
|
||||||
if (autoHide && !dockHovered && !contextMenuVisible) hideTimer.start()
|
if (autoHide && !dockHovered && !contextMenuVisible)
|
||||||
|
hideTimer.start()
|
||||||
}
|
}
|
||||||
|
|
||||||
onClicked: function (mouse) {
|
onClicked: function (mouse) {
|
||||||
|
|
@ -250,8 +262,6 @@ NLoader {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -277,8 +287,6 @@ NLoader {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: contextMenuContainer
|
id: contextMenuContainer
|
||||||
width: 80
|
width: 80
|
||||||
|
|
@ -289,14 +297,16 @@ NLoader {
|
||||||
border.width: 1
|
border.width: 1
|
||||||
|
|
||||||
x: {
|
x: {
|
||||||
if (!contextMenuTarget) return 0
|
if (!contextMenuTarget)
|
||||||
|
return 0
|
||||||
const pos = contextMenuTarget.mapToItem(null, 0, 0)
|
const pos = contextMenuTarget.mapToItem(null, 0, 0)
|
||||||
let xPos = pos.x + (contextMenuTarget.width - width) / 2
|
let xPos = pos.x + (contextMenuTarget.width - width) / 2
|
||||||
return Math.max(0, Math.min(xPos, dockWindow.width - width))
|
return Math.max(0, Math.min(xPos, dockWindow.width - width))
|
||||||
}
|
}
|
||||||
|
|
||||||
y: {
|
y: {
|
||||||
if (!contextMenuTarget) return 0
|
if (!contextMenuTarget)
|
||||||
|
return 0
|
||||||
const pos = contextMenuTarget.mapToItem(null, 0, 0)
|
const pos = contextMenuTarget.mapToItem(null, 0, 0)
|
||||||
return pos.y - height + 32
|
return pos.y - height + 32
|
||||||
}
|
}
|
||||||
|
|
@ -315,7 +325,8 @@ NLoader {
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (contextMenuToplevel?.close) contextMenuToplevel.close()
|
if (contextMenuToplevel?.close)
|
||||||
|
contextMenuToplevel.close()
|
||||||
contextMenuVisible = false
|
contextMenuVisible = false
|
||||||
hidden = true
|
hidden = true
|
||||||
}
|
}
|
||||||
|
|
@ -334,7 +345,9 @@ NLoader {
|
||||||
}
|
}
|
||||||
|
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
NumberAnimation { duration: 100 }
|
NumberAnimation {
|
||||||
|
duration: 100
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -540,7 +540,7 @@ WlSessionLock {
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
text: lock.authenticating ? "EXECUTING..." : "EXECUTE"
|
text: lock.authenticating ? "EXECUTING" : "EXECUTE"
|
||||||
color: executeButtonArea.containsMouse ? Colors.onAccent : Colors.accentPrimary
|
color: executeButtonArea.containsMouse ? Colors.onAccent : Colors.accentPrimary
|
||||||
font.family: "DejaVu Sans Mono"
|
font.family: "DejaVu Sans Mono"
|
||||||
font.pointSize: Style.fontSizeMedium
|
font.pointSize: Style.fontSizeMedium
|
||||||
|
|
|
||||||
|
|
@ -236,7 +236,8 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
|
|
||||||
NText {
|
NText {
|
||||||
text: (modelData.contributions || 0) + " " + ((modelData.contributions || 0) === 1 ? "commit" : "commits")
|
text: (modelData.contributions || 0) + " " + ((modelData.contributions
|
||||||
|
|| 0) === 1 ? "commit" : "commits")
|
||||||
font.pointSize: Style.fontSizeSmall * scaling
|
font.pointSize: Style.fontSizeSmall * scaling
|
||||||
color: contributorArea.containsMouse ? Colors.backgroundPrimary : Colors.textSecondary
|
color: contributorArea.containsMouse ? Colors.backgroundPrimary : Colors.textSecondary
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,10 +58,10 @@ Singleton {
|
||||||
const base64 = stdout.text.trim()
|
const base64 = stdout.text.trim()
|
||||||
if (base64) {
|
if (base64) {
|
||||||
const entry = {
|
const entry = {
|
||||||
type: 'image',
|
"type": 'image',
|
||||||
mimeType: mimeType,
|
"mimeType": mimeType,
|
||||||
data: `data:${mimeType};base64,${base64}`,
|
"data": `data:${mimeType};base64,${base64}`,
|
||||||
timestamp: new Date().getTime()
|
"timestamp": new Date().getTime()
|
||||||
}
|
}
|
||||||
|
|
||||||
const exists = root.history.find(item => item.type === 'image' && item.data === entry.data)
|
const exists = root.history.find(item => item.type === 'image' && item.data === entry.data)
|
||||||
|
|
@ -90,9 +90,9 @@ Singleton {
|
||||||
const content = String(stdout.text).trim()
|
const content = String(stdout.text).trim()
|
||||||
if (content) {
|
if (content) {
|
||||||
const entry = {
|
const entry = {
|
||||||
type: 'text',
|
"type": 'text',
|
||||||
content: content,
|
"content": content,
|
||||||
timestamp: new Date().getTime()
|
"timestamp": new Date().getTime()
|
||||||
}
|
}
|
||||||
|
|
||||||
const exists = root.history.find(item => {
|
const exists = root.history.find(item => {
|
||||||
|
|
@ -106,9 +106,9 @@ Singleton {
|
||||||
const newHistory = root.history.map(item => {
|
const newHistory = root.history.map(item => {
|
||||||
if (typeof item === 'string') {
|
if (typeof item === 'string') {
|
||||||
return {
|
return {
|
||||||
type: 'text',
|
"type": 'text',
|
||||||
content: item,
|
"content": item,
|
||||||
timestamp: new Date().getTime()
|
"timestamp": new Date().getTime()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return item
|
return item
|
||||||
|
|
@ -136,4 +136,3 @@ Singleton {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,8 @@ Singleton {
|
||||||
console.log("[GitHub] Raw contributors response length:", response ? response.length : 0)
|
console.log("[GitHub] Raw contributors response length:", response ? response.length : 0)
|
||||||
if (response && response.trim()) {
|
if (response && response.trim()) {
|
||||||
const data = JSON.parse(response)
|
const data = JSON.parse(response)
|
||||||
console.log("[GitHub] Parsed contributors data type:", typeof data, "length:", Array.isArray(data) ? data.length : "not array")
|
console.log("[GitHub] Parsed contributors data type:", typeof data, "length:",
|
||||||
|
Array.isArray(data) ? data.length : "not array")
|
||||||
root.data.contributors = data || []
|
root.data.contributors = data || []
|
||||||
root.contributors = root.data.contributors
|
root.contributors = root.data.contributors
|
||||||
console.log("[GitHub] Contributors fetched from GitHub:", root.contributors.length)
|
console.log("[GitHub] Contributors fetched from GitHub:", root.contributors.length)
|
||||||
|
|
|
||||||
|
|
@ -160,6 +160,7 @@ Singleton {
|
||||||
running: false
|
running: false
|
||||||
stdout: StdioCollector {
|
stdout: StdioCollector {
|
||||||
onStreamFinished: {
|
onStreamFinished: {
|
||||||
|
|
||||||
// console.log(this.text)
|
// console.log(this.text)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue