last 7 months of qs changes

This commit is contained in:
outfoxxed 2025-01-06 00:13:19 -08:00
parent 2c64563ade
commit 4b90113a54
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
103 changed files with 3467 additions and 1415 deletions

View file

@ -1,14 +1,15 @@
import QtQuick
import QtQuick.Layouts
import Quickshell
import Quickshell.Widgets
import Quickshell.DBusMenu
import "../.."
MouseArea {
id: root
required property var entry;
required property QsMenuEntry entry;
property alias expanded: childrenRevealer.expanded;
property bool animating: childrenRevealer.animating || childrenList.animating;
property bool animating: childrenRevealer.animating || (childMenuLoader?.item?.animating ?? false);
// appears it won't actually create the handler when only used from MenuItemList.
onExpandedChanged: {}
onAnimatingChanged: {}
@ -22,7 +23,7 @@ MouseArea {
onClicked: {
if (entry.hasChildren) childrenRevealer.expanded = !childrenRevealer.expanded
else {
entry.click();
entry.triggered();
if (entry.toggleType == ToggleButtonType.None) close();
}
}
@ -34,19 +35,21 @@ MouseArea {
spacing: 0
RowLayout {
id: innerRow
Item {
implicitWidth: 22
implicitHeight: 22
MenuCheckBox {
anchors.centerIn: parent
visible: entry.toggleType == ToggleButtonType.CheckBox
visible: entry.buttonType == QsMenuButtonType.CheckBox
checkState: entry.checkState
}
MenuRadioButton {
anchors.centerIn: parent
visible: entry.toggleType == ToggleButtonType.RadioButton
visible: entry.buttonType == QsMenuButtonType.RadioButton
checkState: entry.checkState
}
@ -59,7 +62,7 @@ MouseArea {
}
Text {
text: entry.cleanLabel
text: entry.text
color: entry.enabled ? "white" : "#bbbbbb"
}
@ -68,25 +71,32 @@ MouseArea {
implicitWidth: 22
implicitHeight: 22
Image {
IconImage {
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
visible: entry.icon != ""
source: entry.icon
sourceSize.height: parent.height
sourceSize.width: parent.height
visible: source != ""
implicitSize: parent.height
}
}
}
Item {
Loader {
id: childMenuLoader
Layout.fillWidth: true
implicitHeight: childrenList.implicitHeight * childrenRevealer.progress
Layout.preferredHeight: active ? item.implicitHeight * childrenRevealer.progress : 0
readonly property real widthDifference: {
Math.max(0, (item?.implicitWidth ?? 0) - innerRow.implicitWidth);
}
Layout.preferredWidth: active ? innerRow.implicitWidth + (widthDifference * childrenRevealer.progress) : 0
active: root.expanded || root.animating
clip: true
MenuItemList {
sourceComponent: MenuView {
id: childrenList
items: entry.children
menu: entry
onClose: root.close()
anchors {