move and add menu
This commit is contained in:
parent
87e9941e0a
commit
f8e4852e6b
3 changed files with 47 additions and 4 deletions
|
|
@ -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 {
|
||||||
|
|
|
||||||
34
modules/bar/components/notifications/NotificationMenu.qml
Normal file
34
modules/bar/components/notifications/NotificationMenu.qml
Normal 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Reference in a new issue