feat: fontbuilder to streamline font styling

This commit is contained in:
2026-09-30 14:23:31 +02:00
parent 2c90339c77
commit f825e4d53b
115 changed files with 1687 additions and 916 deletions
+161 -141
View File
@@ -11,175 +11,195 @@ import qs.Services
import qs.Services
Item {
id: root
id: root
anchors.fill: parent
z: 998
visible: false
anchors.fill: parent
z: 998
visible: false
property real menuX: 0
property real menuY: 0
property real menuX: 0
property real menuY: 0
MouseArea {
anchors.fill: parent
onClicked: root.close()
}
MouseArea {
anchors.fill: parent
onClicked: root.close()
}
CustomClippingRect {
id: popupBackground
readonly property real padding: 4
CustomClippingRect {
id: popupBackground
readonly property real padding: 4
x: root.menuX
y: root.menuY
x: root.menuX
y: root.menuY
color: Colors.tPalette.m3surface
radius: Tokens.rounding.medium
color: Colors.tPalette.m3surface
radius: Tokens.rounding.medium
implicitWidth: menuLayout.implicitWidth + padding * 2
implicitHeight: menuLayout.implicitHeight + padding * 2
implicitWidth: menuLayout.implicitWidth + padding * 2
implicitHeight: menuLayout.implicitHeight + padding * 2
Behavior on opacity { Anim {} }
opacity: root.visible ? 1 : 0
Behavior on opacity {
Anim {}
}
opacity: root.visible ? 1 : 0
ColumnLayout {
id: menuLayout
anchors.centerIn: parent
spacing: 0
ColumnLayout {
id: menuLayout
anchors.centerIn: parent
spacing: 0
CustomRect {
Layout.preferredWidth: 200
radius: popupBackground.radius - popupBackground.padding
implicitHeight: openTerminalRow.implicitHeight + Tokens.padding.extraSmall * 2
CustomRect {
Layout.preferredWidth: 200
radius: popupBackground.radius - popupBackground.padding
implicitHeight: openTerminalRow.implicitHeight + Tokens.padding.extraSmall * 2
RowLayout {
id: openTerminalRow
spacing: 8
anchors.fill: parent
anchors.leftMargin: Tokens.padding.small
RowLayout {
id: openTerminalRow
spacing: 8
anchors.fill: parent
anchors.leftMargin: Tokens.padding.small
MaterialIcon { text: "terminal"; font.pointSize: 20 }
CustomText { text: "Open terminal"; Layout.fillWidth: true }
}
MaterialIcon {
text: "terminal"
fontStyle: Tokens.font.icon.medium
}
CustomText {
text: "Open terminal"
Layout.fillWidth: true
}
}
StateLayer {
anchors.fill: parent
StateLayer {
anchors.fill: parent
onClicked: {
Quickshell.execDetached([Config.general.apps.terminal, "--working-directory", FileUtils.trimFileProtocol(Paths.desktop)])
root.close()
}
}
}
onClicked: {
Quickshell.execDetached([Config.general.apps.terminal, "--working-directory", FileUtils.trimFileProtocol(Paths.desktop)]);
root.close();
}
}
}
CustomRect {
Layout.fillWidth: true
implicitHeight: 1
color: Colors.palette.m3outlineVariant
Layout.topMargin: 4
Layout.bottomMargin: 4
}
CustomRect {
Layout.fillWidth: true
implicitHeight: 1
color: Colors.palette.m3outlineVariant
Layout.topMargin: 4
Layout.bottomMargin: 4
}
CustomRect {
Layout.fillWidth: true
radius: popupBackground.radius - popupBackground.padding
implicitHeight: settingsRow.implicitHeight + Tokens.padding.extraSmall * 2
CustomRect {
Layout.fillWidth: true
radius: popupBackground.radius - popupBackground.padding
implicitHeight: settingsRow.implicitHeight + Tokens.padding.extraSmall * 2
RowLayout {
id: settingsRow
spacing: 8
anchors.fill: parent
anchors.leftMargin: Tokens.padding.small
RowLayout {
id: settingsRow
spacing: 8
anchors.fill: parent
anchors.leftMargin: Tokens.padding.small
MaterialIcon { text: "settings"; font.pointSize: 20 }
CustomText { text: "ZShell settings"; Layout.fillWidth: true }
}
MaterialIcon {
text: "settings"
fontStyle: Tokens.font.icon.medium
}
CustomText {
text: "ZShell settings"
Layout.fillWidth: true
}
}
StateLayer {
anchors.fill: parent
StateLayer {
anchors.fill: parent
onClicked: {
const state = ShellState.forActive();
onClicked: {
const state = ShellState.forActive();
state.settings = true;
root.close()
}
}
}
root.close();
}
}
}
CustomRect {
Layout.fillWidth: true
implicitHeight: 1
color: Colors.palette.m3outlineVariant
Layout.topMargin: 4
Layout.bottomMargin: 4
}
CustomRect {
Layout.fillWidth: true
implicitHeight: 1
color: Colors.palette.m3outlineVariant
Layout.topMargin: 4
Layout.bottomMargin: 4
}
CustomRect {
Layout.fillWidth: true
radius: popupBackground.radius - popupBackground.padding
implicitHeight: logoutRow.implicitHeight + Tokens.padding.extraSmall * 2
CustomRect {
Layout.fillWidth: true
radius: popupBackground.radius - popupBackground.padding
implicitHeight: logoutRow.implicitHeight + Tokens.padding.extraSmall * 2
RowLayout {
id: logoutRow
spacing: 8
anchors.fill: parent
anchors.leftMargin: Tokens.padding.small
RowLayout {
id: logoutRow
spacing: 8
anchors.fill: parent
anchors.leftMargin: Tokens.padding.small
MaterialIcon { text: "logout"; font.pointSize: 20 }
CustomText { text: "Logout"; Layout.fillWidth: true }
}
MaterialIcon {
text: "logout"
fontStyle: Tokens.font.icon.medium
}
CustomText {
text: "Logout"
Layout.fillWidth: true
}
}
StateLayer {
anchors.fill: parent
StateLayer {
anchors.fill: parent
onClicked: {
Hyprland.dispatch("global quickshell:sessionOpen")
root.close()
}
}
}
onClicked: {
Hyprland.dispatch("global quickshell:sessionOpen");
root.close();
}
}
}
// CustomRect {
// Layout.fillWidth: true
// implicitHeight: 1
// color: Colors.palette.m3outlineVariant
// Layout.topMargin: 4
// Layout.bottomMargin: 4
// }
//
// CustomRect {
// Layout.fillWidth: true
// radius: popupBackground.radius - popupBackground.padding
// implicitHeight: desktopIconsRow.implicitHeight + Tokens.padding.extraSmall * 2
//
// RowLayout {
// id: desktopIconsRow
// spacing: 8
// anchors.fill: parent
// anchors.leftMargin: Tokens.padding.small
//
// MaterialIcon { text: Config.options.background.showDesktopIcons ? "visibility_off" : "visibility"; font.pointSize: 20 }
// CustomText { text: Config.options.background.showDesktopIcons ? "Hide icons" : "Show icons"; Layout.fillWidth: true }
// }
//
// StateLayer {
// anchors.fill: parent
//
// onClicked: {
// Config.options.background.showDesktopIcons = !Config.options.background.showDesktopIcons
// root.close()
// }
// }
// }
}
}
// CustomRect {
// Layout.fillWidth: true
// implicitHeight: 1
// color: Colors.palette.m3outlineVariant
// Layout.topMargin: 4
// Layout.bottomMargin: 4
// }
//
// CustomRect {
// Layout.fillWidth: true
// radius: popupBackground.radius - popupBackground.padding
// implicitHeight: desktopIconsRow.implicitHeight + Tokens.padding.extraSmall * 2
//
// RowLayout {
// id: desktopIconsRow
// spacing: 8
// anchors.fill: parent
// anchors.leftMargin: Tokens.padding.small
//
// MaterialIcon { text: Config.options.background.showDesktopIcons ? "visibility_off" : "visibility"; font.pointSize: 20 }
// CustomText { text: Config.options.background.showDesktopIcons ? "Hide icons" : "Show icons"; Layout.fillWidth: true }
// }
//
// StateLayer {
// anchors.fill: parent
//
// onClicked: {
// Config.options.background.showDesktopIcons = !Config.options.background.showDesktopIcons
// root.close()
// }
// }
// }
}
}
function openAt(mouseX, mouseY, parentW, parentH) {
menuX = Math.floor(Math.min(mouseX, parentW - popupBackground.implicitWidth))
menuY = Math.floor(Math.min(mouseY, parentH - popupBackground.implicitHeight))
visible = true
}
function openAt(mouseX, mouseY, parentW, parentH) {
menuX = Math.floor(Math.min(mouseX, parentW - popupBackground.implicitWidth));
menuY = Math.floor(Math.min(mouseY, parentH - popupBackground.implicitHeight));
visible = true;
}
function close() {
visible = false
}
function close() {
visible = false;
}
}