added services page + rename barConfig json property to bar, migration helper function
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 10s
Python / lint-format (pull_request) Successful in 16s
Python / test (pull_request) Successful in 29s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m6s

This commit is contained in:
2026-06-24 15:30:33 +02:00
parent 5c6882d2a8
commit 4df31d7564
41 changed files with 963 additions and 561 deletions
+18
View File
@@ -4,12 +4,30 @@ import qs.Helpers
Flickable {
id: root
property bool doneFakeFlick
interactive: !Visibilities.getForActive().isDrawing
maximumFlickVelocity: 3000
rebound: Transition {
onRunningChanged: {
if (!running && !root.doneFakeFlick) {
root.doneFakeFlick = true;
root.flick(1, 1);
root.flick(-1, -1);
Qt.callLater(() => root.cancelFlick());
}
}
Anim {
properties: "x,y"
}
}
Timer {
interval: 10
running: root.doneFakeFlick
onTriggered: root.doneFakeFlick = false
}
}
+6
View File
@@ -72,6 +72,12 @@ JsonObject {
property bool upower: true
}
component Tray: JsonObject {
property bool showAudio: true
property bool showBluetooth: false
property bool showMicrophone: true
property bool showNetwork: false
property bool showPower: true
property bool showWifi: false
property int trayIconSize: 24
}
}
+48 -364
View File
@@ -12,7 +12,7 @@ Singleton {
property alias appearance: adapter.appearance
property alias background: adapter.background
property alias barConfig: adapter.barConfig
property alias bar: adapter.bar
property alias clipboard: adapter.clipboard
property alias colors: adapter.colors
property alias dashboard: adapter.dashboard
@@ -20,6 +20,7 @@ Singleton {
property alias general: adapter.general
property alias launcher: adapter.launcher
property alias lock: adapter.lock
property bool migratingLegacyBar: false
property alias notifs: adapter.notifs
property alias osd: adapter.osd
property alias overview: adapter.overview
@@ -29,6 +30,41 @@ Singleton {
property alias sidebar: adapter.sidebar
property alias utilities: adapter.utilities
function applyLegacyBarConfig(legacy): void {
const tray = legacy.tray ?? {};
const popouts = legacy.popouts ?? {};
bar.autoHide = pick(legacy.autoHide, bar.autoHide);
bar.hideWhenNotif = pick(legacy.hideWhenNotif, bar.hideWhenNotif);
bar.rounding = pick(legacy.rounding, bar.rounding);
bar.border = pick(legacy.border, bar.border);
bar.smoothing = pick(legacy.smoothing, bar.smoothing);
bar.height = pick(legacy.height, bar.height);
bar.tray.trayIconSize = pick(tray.trayIconSize, bar.tray.trayIconSize);
bar.popouts.tray = pick(popouts.tray, bar.popouts.tray);
bar.popouts.audio = pick(popouts.audio, bar.popouts.audio);
bar.popouts.activeWindow = pick(popouts.activeWindow, bar.popouts.activeWindow);
bar.popouts.resources = pick(popouts.resources, bar.popouts.resources);
bar.popouts.clock = pick(popouts.clock, bar.popouts.clock);
bar.popouts.network = pick(popouts.network, bar.popouts.network);
bar.popouts.upower = pick(popouts.upower, bar.popouts.upower);
bar.entries = pick(legacy.entries, bar.entries);
}
function migrateLegacyBarConfig(raw): bool {
if (raw.bar !== undefined || raw.barConfig === undefined)
return false;
migratingLegacyBar = true;
applyLegacyBarConfig(raw.barConfig);
migratingLegacyBar = false;
return true;
}
function pick(value, fallback) {
return value === undefined ? fallback : value;
}
function save(): void {
saveTimer.restart();
recentlySaved = true;
@@ -39,353 +75,6 @@ Singleton {
saveTimer.restart();
}
function serializeAppearance(): var {
return {
rounding: {
scale: appearance.rounding.scale
},
spacing: {
scale: appearance.spacing.scale
},
padding: {
scale: appearance.padding.scale
},
deform: {
scale: appearance.deform.scale
},
font: {
family: {
sans: appearance.font.family.sans,
mono: appearance.font.family.mono,
material: appearance.font.family.material,
clock: appearance.font.family.clock
},
size: {
scale: appearance.font.size.scale
}
},
anim: {
mediaGifSpeedAdjustment: appearance.anim.mediaGifSpeedAdjustment,
sessionGifSpeed: appearance.anim.sessionGifSpeed,
durations: {
scale: appearance.anim.durations.scale
}
},
transparency: {
enabled: appearance.transparency.enabled,
base: appearance.transparency.base,
layers: appearance.transparency.layers
}
};
}
function serializeBackground(): var {
return {
wallFadeDuration: background.wallFadeDuration,
enabled: background.enabled,
alignX: background.alignX,
sourceClipX: background.sourceClipX,
sourceClipY: background.sourceClipY,
sourceClipW: background.sourceClipW,
sourceClipH: background.sourceClipH,
alignY: background.alignY,
zoom: background.zoom
};
}
function serializeBar(): var {
return {
autoHide: barConfig.autoHide,
hideWhenNotif: barConfig.hideWhenNotif,
rounding: barConfig.rounding,
border: barConfig.border,
smoothing: barConfig.smoothing,
height: barConfig.height,
tray: {
trayIconSize: barConfig.tray.trayIconSize
},
popouts: {
tray: barConfig.popouts.tray,
audio: barConfig.popouts.audio,
activeWindow: barConfig.popouts.activeWindow,
resources: barConfig.popouts.resources,
clock: barConfig.popouts.clock,
network: barConfig.popouts.network,
upower: barConfig.popouts.upower
},
entries: barConfig.entries
};
}
function serializeClipboard(): var {
return {
enabled: clipboard.enabled,
maxEntriesShown: clipboard.maxEntriesShown,
sizes: {
width: clipboard.sizes.width,
previewWidth: clipboard.sizes.previewWidth,
minPreviewWidth: clipboard.sizes.minPreviewWidth,
itemHeight: clipboard.sizes.itemHeight
}
};
}
function serializeColors(): var {
return {
schemeType: colors.schemeType,
presets: {
name: colors.presets.name,
variant: colors.presets.variant,
accent: colors.presets.accent
}
};
}
function serializeConfig(): var {
return {
barConfig: serializeBar(),
lock: serializeLock(),
general: serializeGeneral(),
services: serializeServices(),
notifs: serializeNotifs(),
sidebar: serializeSidebar(),
utilities: serializeUtilities(),
dashboard: serializeDashboard(),
appearance: serializeAppearance(),
osd: serializeOsd(),
background: serializeBackground(),
launcher: serializeLauncher(),
colors: serializeColors(),
dock: serializeDock(),
screenshot: serializeScreenshot(),
clipboard: serializeClipboard()
};
}
function serializeDashboard(): var {
return {
enabled: dashboard.enabled,
mediaUpdateInterval: dashboard.mediaUpdateInterval,
resourceUpdateInterval: dashboard.resourceUpdateInterval,
performance: {
showBattery: dashboard.performance.showBattery,
showGpu: dashboard.performance.showGpu,
showCpu: dashboard.performance.showCpu,
showMemory: dashboard.performance.showMemory,
showStorage: dashboard.performance.showStorage,
showNetwork: dashboard.performance.showNetwork
},
sizes: {
tabIndicatorHeight: dashboard.sizes.tabIndicatorHeight,
tabIndicatorSpacing: dashboard.sizes.tabIndicatorSpacing,
infoWidth: dashboard.sizes.infoWidth,
infoIconSize: dashboard.sizes.infoIconSize,
dateTimeWidth: dashboard.sizes.dateTimeWidth,
mediaWidth: dashboard.sizes.mediaWidth,
mediaProgressSweep: dashboard.sizes.mediaProgressSweep,
mediaProgressThickness: dashboard.sizes.mediaProgressThickness,
resourceProgessThickness: dashboard.sizes.resourceProgessThickness,
weatherWidth: dashboard.sizes.weatherWidth,
mediaCoverArtSize: dashboard.sizes.mediaCoverArtSize,
mediaVisualizerSize: dashboard.sizes.mediaVisualizerSize,
resourceSize: dashboard.sizes.resourceSize
}
};
}
function serializeDock(): var {
return {
enable: dock.enable,
height: dock.height,
hoverToReveal: dock.hoverToReveal,
pinnedApps: dock.pinnedApps,
pinnedOnStartup: dock.pinnedOnStartup,
ignoredAppRegexes: dock.ignoredAppRegexes
};
}
function serializeGeneral(): var {
return {
logo: general.logo,
wallpaperPath: general.wallpaperPath,
showOverFullscreen: general.showOverFullscreen,
desktopIcons: general.desktopIcons,
dateFormat: general.dateFormat,
color: {
mode: general.color.mode,
smart: general.color.smart,
scheduleDark: general.color.scheduleDark,
scheduleHyprsunset: general.color.scheduleHyprsunset,
scheduleHyprsunsetStart: general.color.scheduleHyprsunsetStart,
hyprsunsetTemp: general.color.hyprsunsetTemp,
scheduleHyprsunsetEnd: general.color.scheduleHyprsunsetEnd,
schemeGeneration: general.color.schemeGeneration,
scheduleDarkStart: general.color.scheduleDarkStart,
scheduleDarkEnd: general.color.scheduleDarkEnd,
neovimColors: general.color.neovimColors
},
apps: {
terminal: general.apps.terminal,
audio: general.apps.audio,
playback: general.apps.playback,
explorer: general.apps.explorer
},
idle: {
timeouts: general.idle.timeouts
},
battery: {
popupThresholds: general.battery.popupThresholds,
critPerc: general.battery.critPerc
}
};
}
function serializeLauncher(): var {
return {
maxAppsShown: launcher.maxAppsShown,
maxWallpapers: launcher.maxWallpapers,
dragThreshold: launcher.dragThreshold,
enableDangerousActions: launcher.enableDangerousActions,
enabled: launcher.enabled,
hiddenApps: launcher.hiddenApps,
favoriteApps: launcher.favoriteApps,
uwsm: launcher.uwsm,
actionPrefix: launcher.actionPrefix,
specialPrefix: launcher.specialPrefix,
useFuzzy: {
apps: launcher.useFuzzy.apps,
actions: launcher.useFuzzy.actions,
schemes: launcher.useFuzzy.schemes,
variants: launcher.useFuzzy.variants,
wallpapers: launcher.useFuzzy.wallpapers
},
sizes: {
itemWidth: launcher.sizes.itemWidth,
itemHeight: launcher.sizes.itemHeight,
wallpaperWidth: launcher.sizes.wallpaperWidth,
wallpaperHeight: launcher.sizes.wallpaperHeight
},
actions: launcher.actions
};
}
function serializeLock(): var {
return {
recolorLogo: lock.recolorLogo,
enableFprint: lock.enableFprint,
showNotifContent: lock.showNotifContent,
showNotifIcon: lock.showNotifIcon,
maxFprintTries: lock.maxFprintTries,
blurAmount: lock.blurAmount,
sizes: {
heightMult: lock.sizes.heightMult,
ratio: lock.sizes.ratio,
centerWidth: lock.sizes.centerWidth
}
};
}
function serializeNotifs(): var {
return {
expire: notifs.expire,
defaultExpireTimeout: notifs.defaultExpireTimeout,
appNotifCooldown: notifs.appNotifCooldown,
clearThreshold: notifs.clearThreshold,
expandThreshold: notifs.expandThreshold,
actionOnClick: notifs.actionOnClick,
groupPreviewNum: notifs.groupPreviewNum,
sizes: {
width: notifs.sizes.width,
image: notifs.sizes.image,
badge: notifs.sizes.badge
}
};
}
function serializeOsd(): var {
return {
enabled: osd.enabled,
hideDelay: osd.hideDelay,
enableBrightness: osd.enableBrightness,
enableMicrophone: osd.enableMicrophone,
allMonBrightness: osd.allMonBrightness,
sizes: {
sliderWidth: osd.sizes.sliderWidth,
sliderHeight: osd.sizes.sliderHeight
}
};
}
function serializeScreenshot(): var {
return {
enable_pp: screenshot.enable_pp,
mode: screenshot.mode,
radius: screenshot.radius,
shadow: screenshot.shadow,
rounding: screenshot.rounding,
shadow_blur: screenshot.shadow_blur,
shadow_color: screenshot.shadow_color,
shadow_offset_x: screenshot.shadow_offset_x,
shadow_offset_y: screenshot.shadow_offset_y
};
}
function serializeServices(): var {
return {
weatherLocation: services.weatherLocation,
updates: services.updates,
useFahrenheit: services.useFahrenheit,
minBrightness: services.minBrightness,
ddcutilService: services.ddcutilService,
useTwelveHourClock: services.useTwelveHourClock,
gpuType: services.gpuType,
audioIncrement: services.audioIncrement,
brightnessIncrement: services.brightnessIncrement,
maxVolume: services.maxVolume,
defaultPlayer: services.defaultPlayer,
playerAliases: services.playerAliases,
visualizerBars: services.visualizerBars
};
}
function serializeSidebar(): var {
return {
enabled: sidebar.enabled,
dragThreshold: sidebar.dragThreshold,
sizes: {
width: sidebar.sizes.width
}
};
}
function serializeUtilities(): var {
return {
enabled: utilities.enabled,
maxToasts: utilities.maxToasts,
sizes: {
width: utilities.sizes.width,
toastWidth: utilities.sizes.toastWidth
},
toasts: {
configLoaded: utilities.toasts.configLoaded,
chargingChanged: utilities.toasts.chargingChanged,
gameModeChanged: utilities.toasts.gameModeChanged,
dndChanged: utilities.toasts.dndChanged,
audioOutputChanged: utilities.toasts.audioOutputChanged,
audioInputChanged: utilities.toasts.audioInputChanged,
capsLockChanged: utilities.toasts.capsLockChanged,
numLockChanged: utilities.toasts.numLockChanged,
kbLayoutChanged: utilities.toasts.kbLayoutChanged,
vpnChanged: utilities.toasts.vpnChanged,
nowPlaying: utilities.toasts.nowPlaying
},
vpn: {
enabled: utilities.vpn.enabled,
provider: utilities.vpn.provider
}
};
}
ElapsedTimer {
id: timer
}
@@ -397,20 +86,7 @@ Singleton {
onTriggered: {
timer.restart();
try {
let config = {};
try {
config = JSON.parse(fileView.text());
} catch (e) {
config = {};
}
config = root.serializeConfig();
fileView.setText(JSON.stringify(config, null, 4));
} catch (e) {
Toaster.toast(qsTr("Failed to serialize config"), e.message, "settings_alert", Toast.Error);
}
fileView.writeAdapter();
}
}
@@ -430,6 +106,10 @@ Singleton {
path: `${Paths.config}/config.json`
watchChanges: true
onAdapterUpdated: {
if (!root.migratingLegacyBar)
root.save();
}
onFileChanged: {
if (!root.recentlySaved) {
timer.restart();
@@ -446,7 +126,11 @@ Singleton {
ModeScheduler.checkStartup();
Hyprsunset.checkStartup();
try {
JSON.parse(text());
const raw = JSON.parse(text());
const migrated = root.migrateLegacyBarConfig(raw);
if (migrated)
root.save();
const elapsed = timer.elapsedMs();
if (adapter.utilities.toasts.configLoaded && !root.recentlySaved) {
@@ -467,7 +151,7 @@ Singleton {
}
property BackgroundConfig background: BackgroundConfig {
}
property BarConfig barConfig: BarConfig {
property BarConfig bar: BarConfig {
}
property ClipboardConfig clipboard: ClipboardConfig {
}
+1
View File
@@ -10,6 +10,7 @@ JsonObject {
}
component Performance: JsonObject {
property bool enabled: true
property bool showBattery: true
property bool showCpu: true
property bool showGpu: true
+1
View File
@@ -9,6 +9,7 @@ JsonObject {
property bool expire: true
property int groupPreviewNum: 3
property bool openExpanded: false
property bool showInFullscreen: true
property Sizes sizes: Sizes {
}
+1 -6
View File
@@ -25,7 +25,7 @@ Singleton {
property alias server: server
function shouldThrottle(appName: string): bool {
if (props.dnd)
if (props.dnd || [...Visibilities.screens.values()].some(v => v.sidebar))
return false;
const key = (appName || "unknown").trim().toLowerCase();
@@ -49,11 +49,6 @@ Singleton {
if (loaded) {
saveTimer.restart();
}
if (root.list.length > 0) {
HasNotifications.hasNotifications = true;
} else {
HasNotifications.hasNotifications = false;
}
}
Timer {
+1 -1
View File
@@ -44,7 +44,7 @@ Scope {
}
component ExclusionZone: CustomWindow {
exclusiveZone: Config.barConfig.border
exclusiveZone: Config.bar.border
implicitHeight: 1
implicitWidth: 1
name: "Bar-Exclusion"
+10 -10
View File
@@ -21,15 +21,15 @@ Item {
required property PersistentProperties visibilities
function inBottomPanel(panel: Item, x: real, y: real): bool {
return y > root.height - panel.height - Config.barConfig.border && withinPanelWidth(panel, x, y);
return y > root.height - panel.height - Config.bar.border && withinPanelWidth(panel, x, y);
}
function inLeftPanel(panel: Item, x: real, y: real): bool {
return x < panel.x + panel.width + Config.barConfig.border && withinPanelHeight(panel, x, y);
return x < panel.x + panel.width + Config.bar.border && withinPanelHeight(panel, x, y);
}
function inRightPanel(panel: Item, x: real, y: real): bool {
return x > panel.x - Config.barConfig.border && withinPanelHeight(panel, x, y);
return x > panel.x - Config.bar.border && withinPanelHeight(panel, x, y);
}
function inTopPanel(panel: Item, x: real, y: real): bool {
@@ -75,7 +75,7 @@ Item {
const dragX = x - centroid.pressPosition.x;
const dragY = y - centroid.pressPosition.y;
if (centroid.pressPosition.y >= root.screen.height - Config.barConfig.border && centroid.pressPosition.x > root.screen.width / 5 && dragY < -Config.launcher.dragThreshold)
if (centroid.pressPosition.y >= root.screen.height - Config.bar.border && centroid.pressPosition.x > root.screen.width / 5 && dragY < -Config.launcher.dragThreshold)
root.visibilities.launcher = true;
if (root.singleGestureTriggered)
@@ -91,7 +91,7 @@ Item {
}
}
if (centroid.pressPosition.y > root.screen.height - Config.barConfig.border && centroid.pressPosition.x < root.screen.width / 5 && dragY < -50)
if (centroid.pressPosition.y > root.screen.height - Config.bar.border && centroid.pressPosition.x < root.screen.width / 5 && dragY < -50)
root.visibilities.clipboard = true;
if (!Config.dock.hoverToReveal && centroid.pressPosition.y > root.screen.height - root.bar.implicitHeight && centroid.pressPosition.x > root.screen.width / 5 && !root.visibilities.launcher)
@@ -100,17 +100,17 @@ Item {
root.singleGestureTriggered = true;
}
if (centroid.pressPosition.x > root.screen.width - Config.barConfig.border && centroid.pressPosition.y < (root.screen.height / 2) && dragX < -Config.sidebar.dragThreshold) {
if (centroid.pressPosition.x > root.screen.width - Config.bar.border && centroid.pressPosition.y < (root.screen.height / 2) && dragX < -Config.sidebar.dragThreshold) {
root.visibilities.sidebar = true;
root.singleGestureTriggered = true;
}
if (centroid.pressPosition.x >= root.screen.width - Config.barConfig.border && centroid.pressPosition.y > (root.screen.height / 2) && dragX < -20) {
if (centroid.pressPosition.x >= root.screen.width - Config.bar.border && centroid.pressPosition.y > (root.screen.height / 2) && dragX < -20) {
Hypr.dispatch(`hl.dsp.focus({ workspace = 'r+1', on_current_monitor = true })`);
root.singleGestureTriggered = true;
}
if (centroid.pressPosition.x <= Config.barConfig.border && dragX > 20) {
if (centroid.pressPosition.x <= Config.bar.border && dragX > 20) {
Hypr.dispatch(`hl.dsp.focus({ workspace = 'r-1', on_current_monitor = true })`);
root.singleGestureTriggered = true;
}
@@ -174,7 +174,7 @@ Item {
root.popouts.hasCurrent = false;
}
if (Config.barConfig.autoHide)
if (Config.bar.autoHide)
root.bar.isHovered = false;
}
}
@@ -193,7 +193,7 @@ Item {
return;
}
if (!root.visibilities.bar && Config.barConfig.autoHide && y < root.bar.implicitHeight)
if (!root.visibilities.bar && Config.bar.autoHide && y < root.bar.implicitHeight)
root.bar.isHovered = true;
if (root.panels.sidebar.width === 0) {
+7 -7
View File
@@ -18,9 +18,9 @@ CustomWindow {
id: root
readonly property alias bar: bar
readonly property real borderLayoutThickness: hasFullscreen ? 0 : Config.barConfig.border
readonly property real borderRounding: Config.barConfig.rounding * (1 - fsTransitionProg)
readonly property real borderThickness: Config.barConfig.border * (1 - fsTransitionProg)
readonly property real borderLayoutThickness: hasFullscreen ? 0 : Config.bar.border
readonly property real borderRounding: Config.bar.rounding * (1 - fsTransitionProg)
readonly property real borderThickness: Config.bar.border * (1 - fsTransitionProg)
readonly property int dragMaskPadding: {
if (focusGrab.active)
return 0;
@@ -69,7 +69,7 @@ CustomWindow {
}
contentItem.Keys.onEscapePressed: {
if (Config.barConfig.autoHide)
if (Config.bar.autoHide)
visibilities.bar = false;
visibilities.launcher = false;
visibilities.sidebar = false;
@@ -190,8 +190,8 @@ CustomWindow {
Binding {
property: "bar"
target: visibilities
value: visibilities.sidebar || visibilities.dashboard || visibilities.osd || (!Config.barConfig.hideWhenNotif && visibilities.notif) || visibilities.resources || visibilities.settings || bar.isHovered
when: Config.barConfig.autoHide
value: visibilities.sidebar || visibilities.dashboard || visibilities.osd || (!Config.bar.hideWhenNotif && visibilities.notif) || visibilities.resources || visibilities.settings || bar.isHovered
when: Config.bar.autoHide
}
Item {
@@ -211,7 +211,7 @@ CustomWindow {
id: blobGroup
color: root.surfaceColor
smoothing: Config.barConfig.smoothing
smoothing: Config.bar.smoothing
}
BlobInvertedRect {
-16
View File
@@ -1,16 +0,0 @@
pragma Singleton
import Quickshell
import Quickshell.Io
Singleton {
id: root
property alias hasNotifications: adapter.hasNotifications
JsonObject {
id: adapter
property bool hasNotifications: false
}
}
+5 -5
View File
@@ -57,15 +57,15 @@ RowLayout {
const item = ch.item;
const itemWidth = item.implicitWidth;
if (id === "audio" && Config.barConfig.popouts.audio) {
if (id === "audio" && Config.bar.popouts.audio) {
popouts.currentName = "audio";
popouts.currentCenter = Qt.binding(() => item.mapToItem(root, itemWidth / 2, 0).x);
popouts.hasCurrent = true;
} else if (id === "network" && Config.barConfig.popouts.network) {
} else if (id === "network" && Config.bar.popouts.network) {
popouts.currentName = "network";
popouts.currentCenter = Qt.binding(() => item.mapToItem(root, itemWidth / 2, 0).x);
popouts.hasCurrent = true;
} else if (id === "upower" && Config.barConfig.popouts.upower) {
} else if (id === "upower" && Config.bar.popouts.upower) {
popouts.currentName = "upower";
popouts.currentCenter = Qt.binding(() => item.mapToItem(root, itemWidth / 2, 0).x);
popouts.hasCurrent = true;
@@ -81,8 +81,8 @@ RowLayout {
Repeater {
id: repeater
// model: Config.barConfig.entries.filted(n => n.index > 50).sort(n => n.index)
model: Config.barConfig.entries
// model: Config.bar.entries.filted(n => n.index > 50).sort(n => n.index)
model: Config.bar.entries
DelegateChooser {
role: "id"
+6 -6
View File
@@ -15,15 +15,15 @@ import qs.Modules.Network
Item {
id: root
readonly property int contentHeight: Config.barConfig.height + padding * 2
readonly property int exclusiveZone: Config.barConfig.autoHide ? Config.barConfig.border : contentHeight
readonly property int contentHeight: Config.bar.height + padding * 2
readonly property int exclusiveZone: Config.bar.autoHide ? Config.bar.border : contentHeight
required property bool fullscreen
property bool isHovered
readonly property int padding: Math.max(Appearance.padding.smaller, Config.barConfig.border)
readonly property int padding: Math.max(Appearance.padding.smaller, Config.bar.border)
required property Wrapper popouts
required property ClipWrapper popoutsWrapper
required property ShellScreen screen
readonly property bool shouldBeVisible: !fullscreen && (!Config.barConfig.autoHide || visibilities.bar || isHovered)
readonly property bool shouldBeVisible: !fullscreen && (!Config.bar.autoHide || visibilities.bar || isHovered)
readonly property int vPadding: 6
required property PersistentProperties visibilities
@@ -31,8 +31,8 @@ Item {
content.item?.checkPopout(x);
}
implicitHeight: fullscreen ? 0 : Config.barConfig.border
visible: height > Config.barConfig.border
implicitHeight: fullscreen ? 0 : Config.bar.border
visible: height > Config.bar.border
states: State {
name: "visible"
+4 -4
View File
@@ -38,11 +38,11 @@ Item {
Rectangle {
anchors.fill: parent
anchors.margins: Config.barConfig.border + 1
anchors.margins: Config.bar.border + 1
anchors.topMargin: root.bar.implicitHeight + 1
radius: Config.barConfig.border > 0 ? Config.barConfig.rounding : 0
topLeftRadius: Config.barConfig.rounding
topRightRadius: Config.barConfig.rounding
radius: Config.bar.border > 0 ? Config.bar.rounding : 0
topLeftRadius: Config.bar.rounding
topRightRadius: Config.bar.rounding
}
}
}
+1 -1
View File
@@ -14,7 +14,7 @@ CustomRect {
required property PersistentProperties visibilities
color: visibilities.dashboard ? DynamicColors.palette.m3primary : DynamicColors.tPalette.m3surfaceContainer
implicitHeight: Config.barConfig.height + Appearance.padding.smallest * 2
implicitHeight: Config.bar.height + Appearance.padding.smallest * 2
implicitWidth: timeText.contentWidth + Appearance.padding.normal * 2
radius: Appearance.rounding.full
+1 -1
View File
@@ -9,7 +9,7 @@ CustomRect {
property bool tempEnabled: Hyprsunset.enabled
color: root.tempEnabled ? DynamicColors.palette.m3primary : DynamicColors.tPalette.m3surfaceContainer
implicitHeight: Config.barConfig.height + Appearance.padding.smallest * 2
implicitHeight: Config.bar.height + Appearance.padding.smallest * 2
implicitWidth: implicitHeight
radius: Appearance.rounding.full
+1 -1
View File
@@ -22,7 +22,7 @@ PathView {
let outerMargins = 0;
if ((visibilities.utilities || visibilities.sidebar) && panels.utilities.implicitWidth > outerMargins)
outerMargins = panels.utilities.implicitWidth;
const maxWidth = screen.width - Config.barConfig.rounding * 4 - (barMargins + outerMargins) * 2;
const maxWidth = screen.width - Config.bar.rounding * 4 - (barMargins + outerMargins) * 2;
if (maxWidth <= 0)
return 0;
+1 -1
View File
@@ -12,7 +12,7 @@ CustomRect {
readonly property int textWidth: Math.min(metrics.width, 200)
color: DynamicColors.tPalette.m3surfaceContainer
implicitHeight: Config.barConfig.height + Appearance.padding.smallest * 2
implicitHeight: Config.bar.height + Appearance.padding.smallest * 2
implicitWidth: layout.implicitWidth + Appearance.padding.normal * 2
radius: Appearance.rounding.full
+3 -4
View File
@@ -1,8 +1,7 @@
import Quickshell
import Quickshell.Hyprland
import QtQuick
import qs.Config
import qs.Helpers
import qs.Daemons
import qs.Components
CustomRect {
@@ -12,7 +11,7 @@ CustomRect {
required property PersistentProperties visibilities
color: visibilities.sidebar ? DynamicColors.palette.m3primary : DynamicColors.tPalette.m3surfaceContainer
implicitHeight: Config.barConfig.height + Appearance.padding.smallest * 2
implicitHeight: Config.bar.height + Appearance.padding.smallest * 2
implicitWidth: implicitHeight
radius: Appearance.rounding.full
@@ -24,7 +23,7 @@ CustomRect {
fill: root.visibilities.sidebar ? 1 : 0
font.family: "Material Symbols Rounded"
font.pointSize: Appearance.font.size.larger
text: HasNotifications.hasNotifications ? "\uf4fe" : "\ue7f4"
text: NotifServer.list.length ? "\uf4fe" : "\ue7f4"
Behavior on color {
CAnim {
+13 -4
View File
@@ -1,11 +1,12 @@
pragma ComponentBehavior: Bound
import qs.Components
import qs.Config
import qs.Daemons
import Quickshell
import Quickshell.Widgets
import QtQuick
import qs.Components
import qs.Config
import qs.Daemons
import qs.Helpers
Item {
id: root
@@ -72,7 +73,15 @@ Item {
}
}
model: ScriptModel {
values: NotifServer.popups.filter(n => !n.closed)
values: {
const popups = NotifServer.popups.filter(n => !n.closed);
if (!Config.notifs.showInFullscreen) {
if (Hypr.monitorFor(root.panels.screen).activeWorkspace?.toplevels.values.some(t => t.lastIpcObject.fullscreen > 1) ?? false)
return [];
}
return popups;
}
}
move: Transition {
Anim {
@@ -7,7 +7,7 @@ ShapePath {
id: root
readonly property bool flatten: wrapper.height < rounding * 2
readonly property real rounding: Config.barConfig.rounding
readonly property real rounding: Config.bar.rounding
readonly property real roundingY: flatten ? wrapper.height / 2 : rounding
required property var sidebar
required property Wrapper wrapper
+1 -1
View File
@@ -16,7 +16,7 @@ CustomRect {
clip: true
color: visibilities.resources ? DynamicColors.palette.m3primary : DynamicColors.tPalette.m3surfaceContainer
implicitHeight: Config.barConfig.height + Appearance.padding.smallest * 2
implicitHeight: Config.bar.height + Appearance.padding.smallest * 2
implicitWidth: rowLayout.implicitWidth + Appearance.padding.larger * 2
radius: Appearance.rounding.full
+14 -14
View File
@@ -11,7 +11,7 @@ SettingsPage {
SettingSwitch {
name: "Auto hide"
object: Config.barConfig
object: Config.bar
setting: "autoHide"
}
@@ -21,7 +21,7 @@ SettingsPage {
SettingSpinBox {
min: 1
name: "Height"
object: Config.barConfig
object: Config.bar
setting: "height"
}
@@ -31,7 +31,7 @@ SettingsPage {
SettingSpinBox {
min: 0
name: "Rounding"
object: Config.barConfig
object: Config.bar
setting: "rounding"
}
@@ -41,7 +41,7 @@ SettingsPage {
SettingSpinBox {
min: 0
name: "Border"
object: Config.barConfig
object: Config.bar
setting: "border"
}
@@ -51,7 +51,7 @@ SettingsPage {
SettingSpinBox {
min: 0
name: "Smoothing"
object: Config.barConfig
object: Config.bar
setting: "smoothing"
}
}
@@ -66,7 +66,7 @@ SettingsPage {
SettingSpinBox {
min: 16
name: "Tray icon size"
object: Config.barConfig.tray
object: Config.bar.tray
setting: "trayIconSize"
}
}
@@ -80,7 +80,7 @@ SettingsPage {
SettingSwitch {
name: "Tray"
object: Config.barConfig.popouts
object: Config.bar.popouts
setting: "tray"
}
@@ -89,7 +89,7 @@ SettingsPage {
SettingSwitch {
name: "Audio"
object: Config.barConfig.popouts
object: Config.bar.popouts
setting: "audio"
}
@@ -98,7 +98,7 @@ SettingsPage {
SettingSwitch {
name: "Active window"
object: Config.barConfig.popouts
object: Config.bar.popouts
setting: "activeWindow"
}
@@ -107,7 +107,7 @@ SettingsPage {
SettingSwitch {
name: "Resources"
object: Config.barConfig.popouts
object: Config.bar.popouts
setting: "resources"
}
@@ -116,7 +116,7 @@ SettingsPage {
SettingSwitch {
name: "Clock"
object: Config.barConfig.popouts
object: Config.bar.popouts
setting: "clock"
}
@@ -125,7 +125,7 @@ SettingsPage {
SettingSwitch {
name: "Network"
object: Config.barConfig.popouts
object: Config.bar.popouts
setting: "network"
}
@@ -134,7 +134,7 @@ SettingsPage {
SettingSwitch {
name: "Power"
object: Config.barConfig.popouts
object: Config.bar.popouts
setting: "upower"
}
}
@@ -148,7 +148,7 @@ SettingsPage {
SettingBarEntryList {
name: "Bar entries"
object: Config.barConfig
object: Config.bar
setting: "entries"
}
}
+3 -3
View File
@@ -9,8 +9,8 @@ ConnectedRect {
id: root
property alias icon: icon.text
property alias label: label.text
property alias status: status.text
property alias text: label.text
signal clicked
@@ -28,13 +28,13 @@ ConnectedRect {
anchors.leftMargin: Appearance.padding.largeIncreased
anchors.margins: Appearance.padding.normal
anchors.rightMargin: Appearance.padding.largeIncreased
spacing: Appearance.spacing.small
spacing: Appearance.spacing.normal
MaterialIcon {
id: icon
color: DynamicColors.palette.m3onSurfaceVariant
font.pointSize: Appearance.font.size.medium
font.pointSize: Appearance.font.size.large
}
ColumnLayout {
+3 -3
View File
@@ -11,9 +11,9 @@ ConnectedRect {
default required property Item content
property alias icon: icon.text
property bool keepPopupAsChild
property alias label: label.text
readonly property alias popup: popup
property alias status: status.text
property alias text: label.text
Layout.fillWidth: true
implicitHeight: navLayout.implicitHeight + navLayout.anchors.margins * 2
@@ -33,13 +33,13 @@ ConnectedRect {
anchors.leftMargin: Appearance.padding.largeIncreased
anchors.margins: Appearance.padding.normal
anchors.rightMargin: Appearance.padding.largeIncreased
spacing: Appearance.spacing.small
spacing: Appearance.spacing.normal
MaterialIcon {
id: icon
color: DynamicColors.palette.m3onSurfaceVariant
font.pointSize: Appearance.font.size.medium
font.pointSize: Appearance.font.size.larger
}
ColumnLayout {
+41 -1
View File
@@ -10,6 +10,8 @@ import qs.Modules.SettingsNew.Pages.Wallpaper
import qs.Modules.SettingsNew.Pages.Audio
import qs.Modules.SettingsNew.Pages.Apps
import qs.Modules.SettingsNew.Pages.Panels
import qs.Modules.SettingsNew.Pages.Panels.Bar
import qs.Modules.SettingsNew.Pages.Services
QtObject {
id: root
@@ -72,13 +74,18 @@ QtObject {
}
}
Component {
BarPanel {
}
}
Component {
DashboardPanel {
}
}
Component {
BarPanel {
ResourcesPanel {
}
}
@@ -91,8 +98,26 @@ QtObject {
SidebarPanel {
}
}
// Bar sub pages
Component {
BarTray {
}
}
Component {
BarStatusIcons {
}
}
Component {
BarClock {
}
}
}
},
// Apps
Component {
StackPage {
Component {
@@ -110,6 +135,21 @@ QtObject {
}
}
}
},
// Services
Component {
StackPage {
Component {
ServicesPage {
}
}
Component {
NotificationsPage {
}
}
}
}
]
readonly property Component placeholderComp: Component {
+5 -5
View File
@@ -30,33 +30,33 @@ PageBase {
DefaultRow {
first: true
icon: "terminal"
label: qsTr("Terminal")
status: Config.general.apps.terminal.join(" ")
text: qsTr("Terminal")
onSelected: app => Config.general.apps.terminal = app.command
}
DefaultRow {
icon: "volume_up"
label: qsTr("Audio")
status: Config.general.apps.audio.join(" ")
text: qsTr("Audio")
onSelected: app => Config.general.apps.audio = app.command
}
DefaultRow {
icon: "play_circle"
label: qsTr("Media playback")
status: Config.general.apps.playback.join(" ")
text: qsTr("Media playback")
onSelected: app => Config.general.apps.playback = app.command
}
DefaultRow {
icon: "folder"
label: qsTr("File manager")
last: true
status: Config.general.apps.explorer.join(" ")
text: qsTr("File manager")
onSelected: app => Config.general.apps.explorer = app.command
}
@@ -69,9 +69,9 @@ PageBase {
NavRow {
first: true
icon: "apps"
label: qsTr("All apps")
last: true
status: qsTr("Browse installed apps, set favorites and hidden")
text: qsTr("All apps")
onClicked: root.sState.openSubPage(1)
}
@@ -0,0 +1,61 @@
pragma ComponentBehavior: Bound
import QtQuick.Layouts
import qs.Config
import qs.Components
import qs.Modules.SettingsNew.Common
PageBase {
id: root
readonly property list<MenuItem> clockFormats: [
MenuItem {
text: qsTr("Long format")
value: "dddd d MMM - hh:mm"
},
MenuItem {
text: qsTr("Short format")
value: "ddd d MMM - hh:mm"
},
MenuItem {
text: qsTr("Time only")
value: "hh:mm"
},
MenuItem {
text: qsTr("Long format seconds")
value: "dddd d MMM - hh:mm:ss"
},
MenuItem {
text: qsTr("Short format seconds")
value: "ddd d MMM - hh:mm:ss"
},
MenuItem {
text: qsTr("Time only seconds")
value: "hh:mm:ss"
}
]
isSubPage: true
title: qsTr("Clock")
ColumnLayout {
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
spacing: Appearance.spacing.extraSmall / 2
width: root.cappedWidth
SelectRow {
Layout.topMargin: Appearance.spacing.extraSmall / 2 - parent.spacing
active: root.clockFormats.find(item => item.value === Config.general.dateFormat)
first: true
last: true
menuItems: root.clockFormats
subtext: qsTr("Change how time is displayed in the widget")
text: qsTr("Time format")
onSelected: item => {
Config.general.dateFormat = item.value;
}
}
}
}
@@ -0,0 +1,93 @@
pragma ComponentBehavior: Bound
import QtQuick.Layouts
import qs.Config
import qs.Modules.SettingsNew.Common
PageBase {
id: root
isSubPage: true
title: qsTr("System icons")
ColumnLayout {
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
spacing: Appearance.spacing.extraSmall / 2
width: root.cappedWidth
// Visible icons
SectionHeader {
first: true
text: qsTr("Visible icons")
}
ToggleRow {
checked: Config.bar.tray.showAudio
first: true
text: qsTr("Speakers")
onToggled: Config.bar.tray.showAudio = checked
}
ToggleRow {
checked: Config.bar.tray.showMicrophone
text: qsTr("Microphone")
onToggled: Config.bar.tray.showMicrophone = checked
}
//////// FOR LATER:
// ToggleRow {
// checked: Config.bar.tray.showNetwork
// text: qsTr("Network")
//
// onToggled: Config.bar.tray.showNetwork = checked
// }
//
// ToggleRow {
// checked: Config.bar.tray.showWifi
// text: qsTr("Wi-Fi")
//
// onToggled: Config.bar.tray.showWifi = checked
// }
//
// ToggleRow {
// checked: Config.bar.tray.showBluetooth
// text: qsTr("Bluetooth")
//
// onToggled: Config.bar.tray.showBluetooth = checked
// }
ToggleRow {
checked: Config.bar.tray.showPower
last: true
text: qsTr("Battery")
onToggled: Config.bar.tray.showPower = checked
}
// Behaviour
SectionHeader {
text: qsTr("Behavior")
}
ToggleRow {
checked: Config.bar.popouts.audio
first: true
subtext: qsTr("Show a details popout when hovering the audio icons")
text: qsTr("Audio popout on hover")
onToggled: Config.bar.popouts.audio = checked
}
ToggleRow {
checked: Config.bar.popouts.upower
last: true
subtext: qsTr("Show a details popout when hovering the power icon")
text: qsTr("Power popout on hover")
onToggled: Config.bar.popouts.upower = checked
}
}
}
@@ -0,0 +1,31 @@
pragma ComponentBehavior: Bound
import QtQuick.Layouts
import qs.Config
import qs.Modules.SettingsNew.Common
PageBase {
id: root
isSubPage: true
title: qsTr("Tray")
ColumnLayout {
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
spacing: Appearance.spacing.extraSmall / 2
width: root.cappedWidth
SpinRow {
first: true
from: 12
last: true
stepSize: 1
text: qsTr("Icon size")
to: 24
value: Config.bar.tray.trayIconSize
onMoved: value => Config.bar.tray.trayIconSize = value
}
}
}
+12 -28
View File
@@ -23,13 +23,13 @@ PageBase {
}
ToggleRow {
checked: Config.barConfig.autoHide
checked: Config.bar.autoHide
first: true
last: true
subtext: qsTr("Hide the bar, reveal on hover")
text: qsTr("Auto hide")
onToggled: Config.barConfig.autoHide = checked
onToggled: Config.bar.autoHide = checked
}
// Components
@@ -39,44 +39,28 @@ PageBase {
NavRow {
first: true
icon: "workspaces"
label: qsTr("Workspaces")
status: qsTr("Indicators, window icons")
icon: "widgets"
status: qsTr("System tray icons")
text: qsTr("Tray")
onClicked: root.sState.openSubPage(5)
}
NavRow {
icon: "web_asset"
label: qsTr("Active window")
status: qsTr("Title display, popout")
icon: "signal_cellular_alt"
status: qsTr("Visible indicators")
text: qsTr("Status icons")
onClicked: root.sState.openSubPage(6)
}
NavRow {
icon: "widgets"
label: qsTr("Tray")
status: qsTr("System tray icons")
icon: "schedule"
last: true
status: qsTr("Date, icon, background")
text: qsTr("Clock")
onClicked: root.sState.openSubPage(7)
}
NavRow {
icon: "signal_cellular_alt"
label: qsTr("Status icons")
status: qsTr("Visible indicators")
onClicked: root.sState.openSubPage(8)
}
NavRow {
icon: "schedule"
label: qsTr("Clock")
last: true
status: qsTr("Date, icon, background")
onClicked: root.sState.openSubPage(9)
}
}
}
@@ -32,54 +32,5 @@ PageBase {
onToggled: Config.dashboard.enabled = checked
}
// Performance widgets
SectionHeader {
text: qsTr("Performance widgets")
}
ToggleRow {
checked: Config.dashboard.performance.showBattery
first: true
text: qsTr("Battery")
onToggled: Config.dashboard.performance.showBattery = checked
}
ToggleRow {
checked: Config.dashboard.performance.showGpu
text: qsTr("GPU")
onToggled: Config.dashboard.performance.showGpu = checked
}
ToggleRow {
checked: Config.dashboard.performance.showCpu
text: qsTr("CPU")
onToggled: Config.dashboard.performance.showCpu = checked
}
ToggleRow {
checked: Config.dashboard.performance.showMemory
text: qsTr("Memory")
onToggled: Config.dashboard.performance.showMemory = checked
}
ToggleRow {
checked: Config.dashboard.performance.showStorage
text: qsTr("Storage")
onToggled: Config.dashboard.performance.showStorage = checked
}
ToggleRow {
checked: Config.dashboard.performance.showNetwork
last: true
text: qsTr("Network")
onToggled: Config.dashboard.performance.showNetwork = checked
}
}
}
@@ -0,0 +1,85 @@
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import qs.Config
import qs.Components
import qs.Modules.SettingsNew.Common
PageBase {
id: root
isSubPage: true
title: qsTr("Resources")
ColumnLayout {
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
spacing: Appearance.spacing.extraSmall / 2
width: root.cappedWidth
// General
SectionHeader {
first: true
text: qsTr("General")
}
ToggleRow {
checked: Config.dashboard.performance.enabled
first: true
last: true
text: qsTr("Enabled")
onToggled: Config.dashboard.performance.enabled = checked
}
// Performance widgets
SectionHeader {
text: qsTr("Performance widgets")
}
ToggleRow {
checked: Config.dashboard.performance.showBattery
first: true
text: qsTr("Battery")
onToggled: Config.dashboard.performance.showBattery = checked
}
ToggleRow {
checked: Config.dashboard.performance.showGpu
text: qsTr("GPU")
onToggled: Config.dashboard.performance.showGpu = checked
}
ToggleRow {
checked: Config.dashboard.performance.showCpu
text: qsTr("CPU")
onToggled: Config.dashboard.performance.showCpu = checked
}
ToggleRow {
checked: Config.dashboard.performance.showMemory
text: qsTr("Memory")
onToggled: Config.dashboard.performance.showMemory = checked
}
ToggleRow {
checked: Config.dashboard.performance.showStorage
text: qsTr("Storage")
onToggled: Config.dashboard.performance.showStorage = checked
}
ToggleRow {
checked: Config.dashboard.performance.showNetwork
last: true
text: qsTr("Network")
onToggled: Config.dashboard.performance.showNetwork = checked
}
}
}
+21 -13
View File
@@ -15,36 +15,44 @@ PageBase {
NavRow {
first: true
icon: "dashboard"
label: qsTr("Dashboard")
status: Config.dashboard.enabled ? qsTr("Enabled") : qsTr("Disabled")
icon: "dock_to_bottom"
status: !Config.bar.autoHide ? qsTr("Always visible") : qsTr("Reveal on hover")
text: qsTr("Bar")
onClicked: root.sState.openSubPage(1)
}
NavRow {
icon: "dock_to_bottom"
label: qsTr("Taskbar")
status: !Config.barConfig.autoHide ? qsTr("Always visible") : qsTr("Reveal on hover")
icon: "dashboard"
status: Config.dashboard.enabled ? qsTr("Enabled") : qsTr("Disabled")
text: qsTr("Dashboard")
onClicked: root.sState.openSubPage(2)
}
NavRow {
icon: "apps"
label: qsTr("Launcher")
status: Config.launcher.enabled ? qsTr("Enabled") : qsTr("Disabled")
icon: "insert_chart"
status: Config.dashboard.performance.enabled ? qsTr("Enabled") : qsTr("Disabled")
text: qsTr("Resources")
onClicked: root.sState.openSubPage(3)
}
NavRow {
icon: "dock_to_right"
label: qsTr("Sidebar")
last: true
status: Config.sidebar.enabled ? qsTr("Enabled") : qsTr("Disabled")
icon: "apps"
status: Config.launcher.enabled ? qsTr("Enabled") : qsTr("Disabled")
text: qsTr("Launcher")
onClicked: root.sState.openSubPage(4)
}
NavRow {
icon: "dock_to_right"
last: true
status: Config.sidebar.enabled ? qsTr("Enabled") : qsTr("Disabled")
text: qsTr("Sidebar")
onClicked: root.sState.openSubPage(5)
}
}
}
@@ -0,0 +1,162 @@
import QtQuick
import QtQuick.Layouts
import qs.Config
import qs.Components
import qs.Modules.SettingsNew.Common
PageBase {
id: root
isSubPage: true
title: qsTr("Notifications")
ColumnLayout {
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
spacing: Appearance.spacing.extraSmall / 2
width: root.cappedWidth
// Notifications
SectionHeader {
first: true
text: qsTr("Notifications")
}
ToggleRow {
checked: Config.notifs.showInFullscreen
first: true
subtext: qsTr("Whether notifications appear over fullscreen apps")
text: qsTr("Show in fullscreen")
onToggled: Config.notifs.showInFullscreen = checked
}
ToggleRow {
checked: Config.notifs.expire
subtext: qsTr("Dismiss notifications after their timeout")
text: qsTr("Expire automatically")
onToggled: Config.notifs.expire = checked
}
ToggleRow {
checked: Config.notifs.openExpanded
subtext: qsTr("Show notifications expanded by default")
text: qsTr("Open expanded")
onToggled: Config.notifs.openExpanded = checked
}
SpinRow {
from: 1000
stepSize: 500
subtext: qsTr("Time before a notification dismisses (ms)")
text: qsTr("Default timeout")
to: 60000
value: Config.notifs.defaultExpireTimeout
onMoved: v => Config.notifs.defaultExpireTimeout = Math.round(v)
}
SpinRow {
from: 1
last: true
stepSize: 1
subtext: qsTr("Notifications shown per group before collapsing")
text: qsTr("Group preview count")
to: 10
value: Config.notifs.groupPreviewNum
onMoved: v => Config.notifs.groupPreviewNum = Math.round(v)
}
// Toasts
SectionHeader {
text: qsTr("Toasts")
}
SpinRow {
first: true
from: 1
stepSize: 1
subtext: qsTr("Maximum number of toasts shown at once")
text: qsTr("Visible toasts")
to: 10
value: Config.utilities.maxToasts
onMoved: v => Config.utilities.maxToasts = Math.round(v)
}
ToggleRow {
checked: Config.utilities.toasts.chargingChanged
text: qsTr("Charging changes")
onToggled: Config.utilities.toasts.chargingChanged = checked
}
ToggleRow {
checked: Config.utilities.toasts.gameModeChanged
text: qsTr("Game mode changes")
onToggled: Config.utilities.toasts.gameModeChanged = checked
}
// ToggleRow {
// checked: Config.utilities.toasts.dndChanged
// text: qsTr("Do not disturb changes")
//
// onToggled: Config.utilities.toasts.dndChanged = checked
// }
ToggleRow {
checked: Config.utilities.toasts.audioOutputChanged
text: qsTr("Audio output changes")
onToggled: Config.utilities.toasts.audioOutputChanged = checked
}
ToggleRow {
checked: Config.utilities.toasts.audioInputChanged
last: true
text: qsTr("Audio input changes")
onToggled: Config.utilities.toasts.audioInputChanged = checked
}
// ToggleRow {
// checked: Config.utilities.toasts.capsLockChanged
// text: qsTr("Caps lock changes")
//
// onToggled: Config.utilities.toasts.capsLockChanged = checked
// }
//
// ToggleRow {
// checked: Config.utilities.toasts.numLockChanged
// text: qsTr("Num lock changes")
//
// onToggled: Config.utilities.toasts.numLockChanged = checked
// }
//
// ToggleRow {
// checked: Config.utilities.toasts.kbLayoutChanged
// text: qsTr("Keyboard layout changes")
//
// onToggled: Config.utilities.toasts.kbLayoutChanged = checked
// }
//
// ToggleRow {
// checked: Config.utilities.toasts.vpnChanged
// text: qsTr("VPN changes")
//
// onToggled: Config.utilities.toasts.vpnChanged = checked
// }
//
// ToggleRow {
// checked: Config.utilities.toasts.nowPlaying
// last: true
// text: qsTr("Now playing")
//
// onToggled: Config.utilities.toasts.nowPlaying = checked
// }
}
}
+214
View File
@@ -0,0 +1,214 @@
import QtQuick
import QtQuick.Layouts
import Quickshell
import ZShell.Services
import qs.Components
import qs.Helpers
import qs.Config
import qs.Modules.SettingsNew.Common
PageBase {
id: root
// GPU options + the config string each maps to (see Gpu::parseType)
readonly property list<MenuItem> gpuItems: [
MenuItem {
text: qsTr("Auto")
},
MenuItem {
text: "NVIDIA"
},
MenuItem {
text: qsTr("Generic")
},
MenuItem {
text: qsTr("None")
}
]
readonly property list<string> gpuValues: ["", "NVIDIA", "GENERIC", "None"]
function gpuKeyToIndex(key: string): int {
const u = (key ?? "").trim().toUpperCase();
if (u === "")
return 0; // Auto
if (u === "NVIDIA")
return 1;
if (u === "GENERIC")
return 2;
return 3; // None
}
title: qsTr("Services")
ColumnLayout {
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
spacing: Appearance.spacing.extraSmall / 2
width: root.cappedWidth
// Detected running players, used as default-player options
Variants {
id: playerVariants
model: [...new Set(Players.list.map(p => Players.getIdentity(p)).filter(id => id))]
MenuItem {
required property string modelData
activeIcon: "music_note"
icon: modelData === Config.services.defaultPlayer ? "check" : ""
text: modelData
}
}
// Notifications
SectionHeader {
first: true
text: qsTr("Notifications")
}
NavRow {
first: true
icon: "notifications"
last: true
status: qsTr("Notifications, toasts, timeouts")
text: qsTr("Notifications")
onClicked: root.sState.openSubPage(1)
}
// Polling
SectionHeader {
text: qsTr("Polling")
}
SpinRow {
first: true
from: 100
stepSize: 50
subtext: qsTr("How often the media position updates (ms)")
text: qsTr("Media refresh")
to: 2000
value: Config.dashboard.mediaUpdateInterval
onMoved: v => Config.dashboard.mediaUpdateInterval = v
}
SpinRow {
from: 0.5
last: true
stepSize: 0.5
subtext: qsTr("CPU, memory and GPU update interval (seconds)")
text: qsTr("System stats refresh")
to: 10
value: Config.dashboard.resourceUpdateInterval / 1000
onMoved: v => Config.dashboard.resourceUpdateInterval = Math.round(v * 1000)
}
// Media & lyrics
SectionHeader {
text: qsTr("Media")
}
SelectRow {
active: menuItems.find(i => i.text === Config.services.defaultPlayer) ?? null
fallbackIcon: "music_note"
fallbackText: Config.services.defaultPlayer || qsTr("Auto")
first: true
last: true
menuItems: playerVariants.instances
subtext: qsTr("Preferred media player when several are open")
text: qsTr("Default player")
onSelected: item => Config.services.defaultPlayer = item.text
}
// Input increments
SectionHeader {
text: qsTr("Input increments")
}
SpinRow {
first: true
from: 1
stepSize: 1
subtext: qsTr("Amount the volume changes per input (%)")
text: qsTr("Volume step")
to: 50
value: Math.round(Config.services.audioIncrement * 100)
onMoved: v => Config.services.audioIncrement = v / 100
}
SpinRow {
from: 1
stepSize: 1
subtext: qsTr("Amount the brightness changes per input (%)")
text: qsTr("Brightness step")
to: 50
value: Math.round(Config.services.brightnessIncrement * 100)
onMoved: v => Config.services.brightnessIncrement = v / 100
}
SpinRow {
from: 1
stepSize: 1
subtext: qsTr("Lowest allowed brightness (%)")
text: qsTr("Brightness minimum")
to: 20
value: Math.round(Config.services.minBrightness * 100)
onMoved: v => Config.services.minBrightness = v / 100
}
SpinRow {
from: 50
last: true
stepSize: 5
subtext: qsTr("Upper limit for output volume (%)")
text: qsTr("Max volume")
to: 200
value: Math.round(Config.services.maxVolume * 100)
onMoved: v => Config.services.maxVolume = v / 100
}
// Service tuning
SectionHeader {
text: qsTr("Service tuning")
}
SpinRow {
first: true
from: 10
stepSize: 2
subtext: qsTr("Resolution of the audio visualizer")
text: qsTr("Visualizer resolution")
to: 120
value: Config.services.visualizerBars
onMoved: v => Config.services.visualiserBars = v
}
ToggleRow {
checked: Config.general.color.smart
subtext: qsTr("Derive theme mode from the wallpaper")
text: qsTr("Smart color scheme")
onToggled: Config.general.color.smart = checked
}
SelectRow {
active: root.gpuItems[root.gpuKeyToIndex(Config.services.gpuType)]
last: true
menuItems: root.gpuItems
menuOnTop: true
subtext: Gpu.name ? qsTr("Monitoring: %1").arg(Gpu.name) : qsTr("Override for GPU type")
text: qsTr("GPU")
onSelected: item => Config.services.gpuType = root.gpuValues[root.gpuItems.indexOf(item)]
}
}
}
+2 -2
View File
@@ -57,7 +57,7 @@ Item {
if (mouse.button === Qt.LeftButton) {
root.item.activate();
console.log(icon.source + "\n" + root.item.id);
} else if (mouse.button === Qt.RightButton && Config.barConfig.popouts.tray) {
} else if (mouse.button === Qt.RightButton && Config.bar.popouts.tray) {
root.popouts.currentName = `traymenu${root.ind}`;
root.popouts.currentCenter = Qt.binding(() => root.mapToItem(root.loader, root.implicitWidth / 2, 0).x);
root.popouts.hasCurrent = true;
@@ -77,7 +77,7 @@ Item {
anchors.centerIn: parent
antialiasing: true
color: root.current ? DynamicColors.palette.m3onPrimary : DynamicColors.palette.m3onSurface
implicitSize: Config.barConfig.tray.trayIconSize * root.dpr
implicitSize: Config.bar.tray.trayIconSize * root.dpr
layer.enabled: Config.general.color.smart || Config.general.color.scheduleDark
scale: 1 / root.dpr
source: root.resolveIcon(root.item.id, root.item.icon)
+17 -8
View File
@@ -47,12 +47,12 @@ RowLayout {
let modRowPos = sysTrayMod.mapToItem(sysModRow, modPos.x, modPos.y);
let child = closestRowChild(sysModRow, modRowPos.x);
if (child) {
if (child.objectName === "audioWidget" && Config.barConfig.popouts.audio)
if (child.objectName === "audioWidget" && Config.bar.popouts.audio)
return {
id: "audio",
item: child
};
if (child.objectName === "upowerWidget" && Config.barConfig.popouts.upower)
if (child.objectName === "upowerWidget" && Config.bar.popouts.upower)
return {
id: "upower",
item: child
@@ -75,7 +75,7 @@ RowLayout {
return null;
}
height: Config.barConfig.height + Appearance.padding.smallest * 2
height: Config.bar.height + Appearance.padding.smallest * 2
spacing: Appearance.padding.small
width: sysTray.implicitWidth + sysTrayMod.implicitWidth + Appearance.padding.small
@@ -123,22 +123,31 @@ RowLayout {
Layout.fillHeight: true
bottomLeftRadius: Appearance.rounding.smallest / 2
color: DynamicColors.tPalette.m3surfaceContainer
implicitWidth: sysModRow.width + Appearance.padding.smaller * 2
implicitWidth: sysModRow.implicitWidth + Appearance.padding.smaller + Appearance.padding.normal
radius: Appearance.rounding.full
topLeftRadius: Appearance.rounding.smallest / 2
Row {
RowLayout {
id: sysModRow
anchors.centerIn: parent
spacing: Appearance.padding.small
anchors.fill: parent
anchors.leftMargin: Appearance.padding.smaller
anchors.rightMargin: Appearance.padding.normal
AudioWidget {
Layout.fillHeight: true
Layout.rightMargin: hasContent ? Appearance.spacing.extraSmall : 0
objectName: "audioWidget"
Behavior on Layout.rightMargin {
Anim {
type: Anim.FastEffects
}
}
}
UPowerWidget {
height: parent.height
Layout.fillHeight: true
objectName: "upowerWidget"
}
}
+43
View File
@@ -11,25 +11,68 @@ RowLayout {
id: root
property color barColor: DynamicColors.palette.m3primary
readonly property bool hasContent: mic.visible || speaker.visible
property color textColor: DynamicColors.palette.m3onSurface
width: hasContent ? implicitWidth : 0
MaterialIcon {
id: mic
readonly property bool shouldBeVisible: Config.bar.tray.showMicrophone
Layout.alignment: Qt.AlignVCenter
Layout.maximumWidth: shouldBeVisible ? implicitWidth : 0
animate: true
color: (Audio.sourceMuted ?? false) ? DynamicColors.palette.m3error : root.textColor
fill: 1
font.pointSize: Appearance.font.size.larger
opacity: shouldBeVisible ? 1 : 0
scale: shouldBeVisible ? 1 : 0
text: Audio.sourceMuted ? "mic_off" : "mic"
visible: opacity > 0
Behavior on Layout.maximumWidth {
Anim {
}
}
Behavior on opacity {
Anim {
}
}
Behavior on scale {
Anim {
}
}
}
MaterialIcon {
id: speaker
readonly property bool shouldBeVisible: Config.bar.tray.showAudio
Layout.alignment: Qt.AlignVCenter
Layout.maximumWidth: shouldBeVisible ? implicitWidth : 0
animate: true
color: Audio.muted ? DynamicColors.palette.m3error : root.textColor
fill: 1
font.pointSize: Appearance.font.size.larger
opacity: shouldBeVisible ? 1 : 0
scale: shouldBeVisible ? 1 : 0
text: Audio.muted ? "volume_off" : "volume_up"
visible: opacity > 0
Behavior on Layout.maximumWidth {
Anim {
}
}
Behavior on opacity {
Anim {
}
}
Behavior on scale {
Anim {
}
}
}
}
+24
View File
@@ -8,8 +8,32 @@ import qs.Helpers
Item {
id: root
readonly property bool shouldBeActive: Config.bar.tray.showPower
Layout.preferredHeight: shouldBeActive ? implicitHeight : 0
Layout.preferredWidth: shouldBeActive ? implicitWidth : 0
implicitHeight: Battery.isLaptop ? batteryIconLoader.item.implicitHeight : upowerIconLoader.item.implicitHeight
implicitWidth: Battery.isLaptop ? batteryIconLoader.item.implicitWidth : upowerIconLoader.item.implicitWidth
opacity: shouldBeActive ? 1 : 0
scale: shouldBeActive ? 1 : 0
visible: opacity > 0
Behavior on Layout.preferredHeight {
Anim {
}
}
Behavior on Layout.preferredWidth {
Anim {
}
}
Behavior on opacity {
Anim {
}
}
Behavior on scale {
Anim {
}
}
Loader {
id: batteryIconLoader
+1 -1
View File
@@ -12,7 +12,7 @@ CustomRect {
property color textColor: DynamicColors.palette.m3onSurface
color: DynamicColors.tPalette.m3surfaceContainer
implicitHeight: Config.barConfig.height + Appearance.padding.smallest * 2
implicitHeight: Config.bar.height + Appearance.padding.smallest * 2
implicitWidth: contentRow.implicitWidth + Appearance.spacing.small * 2
radius: Appearance.rounding.full
+1 -1
View File
@@ -21,7 +21,7 @@ Item {
readonly property int workspacesShown: workspaces.length
height: implicitHeight
implicitHeight: Config.barConfig.height + Appearance.padding.smaller * 2
implicitHeight: Config.bar.height + Appearance.padding.smaller * 2
implicitWidth: (root.workspaceButtonWidth * root.workspacesShown) + root.activeWorkspaceMargin * 2
Behavior on implicitWidth {