Compare commits
No commits in common. "618fc22e803418d922b303817c8af5d1988ecbb7" and "fe8261f7afb02489158eecda272eb43d7ca90780" have entirely different histories.
618fc22e80
...
fe8261f7af
7 changed files with 57 additions and 94 deletions
|
|
@ -1,46 +1,11 @@
|
||||||
import qs.config
|
import qs.config
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Hyprland
|
|
||||||
import Quickshell.Widgets
|
|
||||||
|
|
||||||
Drawer {
|
Drawer {
|
||||||
id: control
|
id: control
|
||||||
dim: false
|
dim: false
|
||||||
property bool focused: false
|
background: Rectangle {
|
||||||
|
|
||||||
onVisibleChanged: {
|
|
||||||
focused = visible;
|
|
||||||
}
|
|
||||||
|
|
||||||
HyprlandFocusGrab {
|
|
||||||
active: control.focused
|
|
||||||
windows: [QsWindow.window]
|
|
||||||
onCleared: {
|
|
||||||
control.focused = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
background: ClippingWrapperRectangle {
|
|
||||||
margin: 4
|
|
||||||
Component.onCompleted: {
|
|
||||||
if (control.edge == Qt.TopEdge) {
|
|
||||||
radius = 8;
|
|
||||||
} else if (control.edge == Qt.LeftEdge) {
|
|
||||||
topRightRadius = 8;
|
|
||||||
bottomRightRadius = 8;
|
|
||||||
} else if (control.edge == Qt.RightEdge) {
|
|
||||||
topLeftRadius = 8;
|
|
||||||
bottomLeftRadius = 8;
|
|
||||||
} else if (control.edge == Qt.BottomEdge) {
|
|
||||||
topLeftRadius = 8;
|
|
||||||
topRightRadius = 8;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
color: Styling.theme.base300
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
if (control.edge == Qt.TopEdge) {
|
if (control.edge == Qt.TopEdge) {
|
||||||
radius = 8;
|
radius = 8;
|
||||||
|
|
@ -58,4 +23,3 @@ Drawer {
|
||||||
color: Styling.theme.base100
|
color: Styling.theme.base100
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ RowLayout {
|
||||||
spacing: 4
|
spacing: 4
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
model: SystemTray.items.values
|
model: SystemTray.items
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
id: loader
|
id: loader
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,12 @@ import QtQuick
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Services.SystemTray
|
import Quickshell.Services.SystemTray
|
||||||
import Quickshell.Widgets
|
import Quickshell.Widgets
|
||||||
|
import "menu/"
|
||||||
|
|
||||||
StyledIconButton {
|
StyledIconButton {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
required property SystemTrayItem trayItem
|
property SystemTrayItem trayItem
|
||||||
|
|
||||||
onClicked: menu.toggle()
|
onClicked: menu.toggle()
|
||||||
|
|
||||||
|
|
@ -27,7 +28,7 @@ StyledIconButton {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TrayMenu {
|
Menu {
|
||||||
id: menu
|
id: menu
|
||||||
|
|
||||||
anchor.item: root
|
anchor.item: root
|
||||||
|
|
|
||||||
|
|
@ -1,49 +0,0 @@
|
||||||
pragma ComponentBehavior: Bound
|
|
||||||
|
|
||||||
import qs.components
|
|
||||||
import qs.config
|
|
||||||
import QtQuick
|
|
||||||
import QtQuick.Layouts
|
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Widgets
|
|
||||||
|
|
||||||
StyledPopupWindow {
|
|
||||||
id: window
|
|
||||||
|
|
||||||
required property QsMenuOpener menuOpener
|
|
||||||
|
|
||||||
content: ColumnLayout {
|
|
||||||
spacing: 4
|
|
||||||
Repeater {
|
|
||||||
model: window.menuOpener.children.values
|
|
||||||
delegate: Loader {
|
|
||||||
id: loader
|
|
||||||
required property QsMenuEntry modelData
|
|
||||||
|
|
||||||
active: true
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
console.log(modelData.text);
|
|
||||||
}
|
|
||||||
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.minimumWidth: 160
|
|
||||||
|
|
||||||
sourceComponent: modelData.isSeparator ? menuSeperator : menuItem
|
|
||||||
property Component menuSeperator: WrapperItem {
|
|
||||||
margin: 4
|
|
||||||
Rectangle {
|
|
||||||
implicitHeight: 2
|
|
||||||
|
|
||||||
color: Styling.theme.base200
|
|
||||||
}
|
|
||||||
}
|
|
||||||
property Component menuItem: StyledButton {
|
|
||||||
text: loader.modelData.text
|
|
||||||
|
|
||||||
onClicked: loader.modelData.triggered()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
39
modules/bar/components/tray/menu/Menu.qml
Normal file
39
modules/bar/components/tray/menu/Menu.qml
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
|
import qs.components
|
||||||
|
import qs.config
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import Quickshell
|
||||||
|
|
||||||
|
StyledPopupWindow {
|
||||||
|
id: window
|
||||||
|
|
||||||
|
property QsMenuOpener menuOpener
|
||||||
|
|
||||||
|
content: ColumnLayout {
|
||||||
|
spacing: 8
|
||||||
|
Repeater {
|
||||||
|
model: window.menuOpener.children
|
||||||
|
delegate: Loader {
|
||||||
|
id: loader
|
||||||
|
required property QsMenuEntry modelData
|
||||||
|
|
||||||
|
active: true
|
||||||
|
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.minimumWidth: 160
|
||||||
|
|
||||||
|
sourceComponent: modelData.isSeparator ? menuSeperator : menuItem
|
||||||
|
property Component menuSeperator: Rectangle {
|
||||||
|
implicitHeight: 2
|
||||||
|
|
||||||
|
color: Styling.theme.base100
|
||||||
|
}
|
||||||
|
property Component menuItem: MenuItem {
|
||||||
|
menuEntry: loader.modelData
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
12
modules/bar/components/tray/menu/MenuItem.qml
Normal file
12
modules/bar/components/tray/menu/MenuItem.qml
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
import qs.components
|
||||||
|
import Quickshell
|
||||||
|
|
||||||
|
StyledButton {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
property QsMenuEntry menuEntry
|
||||||
|
|
||||||
|
text: root.menuEntry.text
|
||||||
|
|
||||||
|
onClicked: menuEntry.triggered()
|
||||||
|
}
|
||||||
|
|
@ -12,10 +12,6 @@ StyledDrawer {
|
||||||
|
|
||||||
visible: Visibility.dashboard
|
visible: Visibility.dashboard
|
||||||
|
|
||||||
onFocusedChanged: {
|
|
||||||
Visibility.dashboard = focused;
|
|
||||||
}
|
|
||||||
|
|
||||||
WrapperItem {
|
WrapperItem {
|
||||||
margin: 32
|
margin: 32
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue