feat: fontbuilder to streamline font styling
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,8 +54,7 @@ Item {
|
||||
y: contextMenu.menuY
|
||||
|
||||
Behavior on opacity {
|
||||
Anim {
|
||||
}
|
||||
Anim {}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
@@ -77,7 +76,7 @@ Item {
|
||||
spacing: 8
|
||||
|
||||
MaterialIcon {
|
||||
font.pointSize: 20
|
||||
fontStyle: Tokens.font.icon.medium
|
||||
text: "open_in_new"
|
||||
}
|
||||
|
||||
@@ -120,7 +119,7 @@ Item {
|
||||
spacing: 8
|
||||
|
||||
MaterialIcon {
|
||||
font.pointSize: 20
|
||||
fontStyle: Tokens.font.icon.medium
|
||||
text: contextMenu.targetIsDir ? "terminal" : "apps"
|
||||
}
|
||||
|
||||
@@ -165,7 +164,7 @@ Item {
|
||||
spacing: 8
|
||||
|
||||
MaterialIcon {
|
||||
font.pointSize: 20
|
||||
fontStyle: Tokens.font.icon.medium
|
||||
text: "content_copy"
|
||||
}
|
||||
|
||||
@@ -199,7 +198,7 @@ Item {
|
||||
spacing: 8
|
||||
|
||||
MaterialIcon {
|
||||
font.pointSize: 20
|
||||
fontStyle: Tokens.font.icon.medium
|
||||
text: "edit"
|
||||
}
|
||||
|
||||
@@ -241,7 +240,7 @@ Item {
|
||||
|
||||
MaterialIcon {
|
||||
color: deleteButton.hovered ? Colors.palette.m3onError : Colors.palette.m3error
|
||||
font.pointSize: 20
|
||||
fontStyle: Tokens.font.icon.medium
|
||||
text: "delete"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user