move and add menu

This commit is contained in:
Benjamin Palko 2025-08-02 21:08:18 -04:00
parent 87e9941e0a
commit f8e4852e6b
3 changed files with 47 additions and 4 deletions

View file

@ -5,6 +5,7 @@ import Quickshell
import "components" import "components"
import "components/bluetooth" import "components/bluetooth"
import "components/hyprland" import "components/hyprland"
import "components/notifications"
import "components/tray" import "components/tray"
Scope { Scope {

View file

@ -0,0 +1,34 @@
pragma ComponentBehavior: Bound
import qs.config
import qs.widgets
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Quickshell
import Quickshell.Services.Notifications
import Quickshell.Widgets
StyledPopupWindow {
id: root
backgroundColor: Theme.palette.base300
margins: 16
radius: 8
content: ColumnLayout {
spacing: 8
RowLayout {
StyledText {
text: "Enabled"
}
Switch {
checkable: !!Notifications
checked: Bluetooth.defaultAdapter?.enabled ?? false
onClicked: Bluetooth.defaultAdapter.enabled = checked
}
}
}
}

View file

@ -5,10 +5,10 @@ import qs.widgets
import QtQuick import QtQuick
StyledButton { StyledButton {
id: clickable id: root
onClicked: { onClicked: {
Notifications.clear(); menu.toggle();
} }
content: StyledText { content: StyledText {
@ -19,16 +19,24 @@ StyledButton {
font.bold: true font.bold: true
text: Icons.bell text: Icons.bell
color: clickable.containsMouse ? Theme.palette.base300 : Theme.palette.basecontent color: root.containsMouse ? Theme.palette.base300 : Theme.palette.basecontent
states: State { states: State {
when: Notifications.hasNotifications when: Notifications.hasNotifications
PropertyChanges { PropertyChanges {
text { text {
text: Icons.bellRing text: Icons.bellRing
color: clickable.containsMouse ? Theme.palette.base300 : Theme.palette.secondary color: root.containsMouse ? Theme.palette.base300 : Theme.palette.secondary
} }
} }
} }
} }
NotificationMenu {
id: menu
anchor.item: root
anchor.rect.x: root.width / 2 - width / 2
anchor.rect.y: root.height + 8
}
} }