forked from Shinonome/dots-hyprland
waffles: start menu: add the right arrow thingy
This commit is contained in:
@@ -17,8 +17,8 @@ Singleton {
|
||||
property string iconsPath: `${Directories.assetsPath}/icons/fluent`
|
||||
property bool dark: Appearance.m3colors.darkmode
|
||||
|
||||
property real backgroundTransparency: 0.13
|
||||
property real panelBackgroundTransparency: 0.12
|
||||
property real backgroundTransparency: 0.16
|
||||
property real panelBackgroundTransparency: 0.14
|
||||
property real panelLayerTransparency: root.dark ? 0.9 : 0.7
|
||||
property real contentTransparency: root.dark ? 0.87 : 0.5
|
||||
function applyBackgroundTransparency(col) {
|
||||
|
||||
@@ -125,6 +125,10 @@ RowLayout {
|
||||
entry: modelData
|
||||
firstEntry: index === 0
|
||||
width: ListView.view?.width
|
||||
checked: resultListView.currentIndex === index
|
||||
onRequestFocus: {
|
||||
root.forceCurrentIndex(index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import qs.modules.waffle.looks
|
||||
RowLayout {
|
||||
id: root
|
||||
property StartMenuContext context
|
||||
|
||||
|
||||
WPanelIconButton {
|
||||
implicitWidth: 36
|
||||
implicitHeight: 36
|
||||
@@ -27,6 +27,7 @@ RowLayout {
|
||||
orientation: Qt.Horizontal
|
||||
spacing: 4
|
||||
model: root.context.categories
|
||||
clip: true
|
||||
delegate: WBorderedButton {
|
||||
id: tagButton
|
||||
required property var modelData
|
||||
@@ -38,7 +39,7 @@ RowLayout {
|
||||
if (modelData.prefix != "") {
|
||||
return LauncherSearch.query.startsWith(modelData.prefix);
|
||||
} else {
|
||||
return !tagListView.model.some(i => (i.prefix != "" && LauncherSearch.query.startsWith(i.prefix)))
|
||||
return !tagListView.model.some(i => (i.prefix != "" && LauncherSearch.query.startsWith(i.prefix)));
|
||||
}
|
||||
}
|
||||
contentItem: Item {
|
||||
@@ -54,9 +55,27 @@ RowLayout {
|
||||
}
|
||||
}
|
||||
WPanelIconButton {
|
||||
id: optionsButton
|
||||
implicitWidth: 36
|
||||
implicitHeight: 36
|
||||
iconSize: 24
|
||||
iconName: "more-horizontal"
|
||||
|
||||
onClicked: accountsMenu.open()
|
||||
|
||||
WMenu {
|
||||
id: accountsMenu
|
||||
x: -accountsMenu.implicitWidth + optionsButton.implicitWidth
|
||||
y: optionsButton.height + 10
|
||||
downDirection: true
|
||||
Action {
|
||||
icon.name: "people-settings"
|
||||
text: Translation.tr("Manage accounts")
|
||||
onTriggered: {
|
||||
Quickshell.execDetached(["bash", "-c", Config.options.apps.manageUser])
|
||||
GlobalStates.searchOpen = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,8 @@ WChoiceButton {
|
||||
required property LauncherSearchResult entry
|
||||
property bool firstEntry: false
|
||||
|
||||
signal requestFocus()
|
||||
|
||||
checked: focus
|
||||
animateChoiceHighlight: false
|
||||
implicitWidth: contentLayout.implicitWidth + leftPadding + rightPadding
|
||||
@@ -29,17 +31,65 @@ WChoiceButton {
|
||||
root.entry.execute();
|
||||
}
|
||||
|
||||
horizontalPadding: 0
|
||||
verticalPadding: 0
|
||||
|
||||
contentItem: RowLayout {
|
||||
id: contentLayout
|
||||
spacing: 8
|
||||
spacing: 0
|
||||
|
||||
SearchEntryIcon {
|
||||
entry: root.entry
|
||||
iconSize: 24
|
||||
}
|
||||
EntryNameColumn {
|
||||
WButton {
|
||||
id: launchButton
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
Layout.fillHeight: true
|
||||
horizontalPadding: 10
|
||||
verticalPadding: 11
|
||||
implicitHeight: root.firstEntry ? 62 : 36
|
||||
implicitWidth: entryContentRow.implicitWidth + leftPadding + rightPadding
|
||||
topRightRadius: 0
|
||||
bottomRightRadius: 0
|
||||
onClicked: root.click()
|
||||
contentItem: Item {
|
||||
RowLayout {
|
||||
id: entryContentRow
|
||||
anchors {
|
||||
left: parent.left
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
spacing: 8
|
||||
|
||||
SearchEntryIcon {
|
||||
entry: root.entry
|
||||
iconSize: 24
|
||||
}
|
||||
EntryNameColumn {
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
id: separator
|
||||
opacity: (root.hovered && !root.checked) ? 1 : 0
|
||||
Layout.fillHeight: true
|
||||
implicitWidth: 1
|
||||
color: ColorUtils.transparentize(Looks.colors.fg, 0.75)
|
||||
}
|
||||
WButton {
|
||||
visible: !root.checked
|
||||
Layout.fillHeight: true
|
||||
implicitWidth: 47
|
||||
topLeftRadius: 0
|
||||
bottomLeftRadius: 0
|
||||
onClicked: root.requestFocus()
|
||||
contentItem: Item {
|
||||
FluentIcon {
|
||||
anchors.centerIn: parent
|
||||
icon: "chevron-right"
|
||||
implicitSize: 14
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user