autofmt arch stuff

This commit is contained in:
LemmyCook 2025-08-24 10:46:28 -04:00
parent 9ba5abc047
commit 9666ce4f5a
3 changed files with 399 additions and 393 deletions

View file

@ -6,66 +6,68 @@ import QtQuick.Controls
import QtQuick.Layouts
NIconButton {
id: root
sizeMultiplier: 0.8
id: root
sizeMultiplier: 0.8
readonly property real scaling: ScalingService.scale(screen)
readonly property real scaling: ScalingService.scale(screen)
colorBg: Color.mSurfaceVariant
colorFg: Color.mOnSurface
colorBorder: Color.transparent
colorBorderHover: Color.transparent
colorBg: Color.mSurfaceVariant
colorFg: Color.mOnSurface
colorBorder: Color.transparent
colorBorderHover: Color.transparent
// Enhanced icon states with better visual feedback
icon: {
if (ArchUpdaterService.busy) return "sync"
if (ArchUpdaterService.updatePackages.length > 0) {
// Show different icons based on update count
const count = ArchUpdaterService.updatePackages.length
if (count > 50) return "system_update_alt" // Many updates
if (count > 10) return "system_update" // Moderate updates
return "system_update" // Few updates
}
return "task_alt"
// Enhanced icon states with better visual feedback
icon: {
if (ArchUpdaterService.busy)
return "sync"
if (ArchUpdaterService.updatePackages.length > 0) {
// Show different icons based on update count
const count = ArchUpdaterService.updatePackages.length
if (count > 50)
return "system_update_alt" // Many updates
if (count > 10)
return "system_update" // Moderate updates
return "system_update" // Few updates
}
return "task_alt"
}
// Enhanced tooltip with more information
tooltipText: {
if (ArchUpdaterService.busy)
return "Checking for updates…";
// Enhanced tooltip with more information
tooltipText: {
if (ArchUpdaterService.busy)
return "Checking for updates…"
var count = ArchUpdaterService.updatePackages.length;
if (count === 0)
return "System is up to date ✓";
var count = ArchUpdaterService.updatePackages.length
if (count === 0)
return "System is up to date ✓"
var header = count === 1 ? "One package can be upgraded:" : (count + " packages can be upgraded:");
var header = count === 1 ? "One package can be upgraded:" : (count + " packages can be upgraded:")
var list = ArchUpdaterService.updatePackages || [];
var s = "";
var limit = Math.min(list.length, 8); // Reduced to 8 for better readability
for (var i = 0; i < limit; ++i) {
var p = list[i];
s += (i ? "\n" : "") + (p.name + ": " + p.oldVersion + " → " + p.newVersion);
}
if (list.length > 8)
s += "\n… and " + (list.length - 8) + " more";
return header + "\n\n" + s + "\n\nClick to update system";
var list = ArchUpdaterService.updatePackages || []
var s = ""
var limit = Math.min(list.length, 8)
// Reduced to 8 for better readability
for (var i = 0; i < limit; ++i) {
var p = list[i]
s += (i ? "\n" : "") + (p.name + ": " + p.oldVersion + " → " + p.newVersion)
}
if (list.length > 8)
s += "\n… and " + (list.length - 8) + " more"
// Enhanced click behavior with confirmation
onClicked: {
if (ArchUpdaterService.busy)
return;
if (ArchUpdaterService.updatePackages.length > 0) {
// Show confirmation dialog for updates
PanelService.updatePanel.toggle(screen);
} else {
// Just refresh if no updates available
ArchUpdaterService.doPoll();
}
return header + "\n\n" + s + "\n\nClick to update system"
}
// Enhanced click behavior with confirmation
onClicked: {
if (ArchUpdaterService.busy)
return
if (ArchUpdaterService.updatePackages.length > 0) {
// Show confirmation dialog for updates
PanelService.updatePanel.toggle(screen)
} else {
// Just refresh if no updates available
ArchUpdaterService.doPoll()
}
}
}