new style
This commit is contained in:
parent
849e4d0aa2
commit
7b85ec95a4
@ -8,16 +8,29 @@ Variants {
|
||||
|
||||
delegate: PanelWindow {
|
||||
id: root
|
||||
required property var modelData
|
||||
implicitHeight: Settings.config.barHeight
|
||||
aboveWindows: true
|
||||
required property var modelData
|
||||
color: Qt.rgba(Colors.background.r, Colors.background.g, Colors.background.b, 0.6)
|
||||
screen: modelData
|
||||
margins {
|
||||
top: Settings.config.margins
|
||||
left: Settings.config.margins
|
||||
right: Settings.config.margins
|
||||
}
|
||||
|
||||
anchors {
|
||||
top: true
|
||||
left: true
|
||||
right: true
|
||||
}
|
||||
color: "transparent"
|
||||
Rectangle {
|
||||
id: container
|
||||
implicitHeight: Settings.config.barHeight
|
||||
anchors.fill: parent
|
||||
color: Colors.background
|
||||
radius: implicitHeight / 2
|
||||
|
||||
Row {
|
||||
id: leftStuff
|
||||
leftPadding: 10
|
||||
@ -48,3 +61,4 @@ Variants {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,9 +2,18 @@ import Quickshell
|
||||
import QtQuick
|
||||
import "../../reusables/"
|
||||
import "../../settings/"
|
||||
import "../../"
|
||||
|
||||
Rectangle {
|
||||
id: container
|
||||
radius: implicitHeight / 2
|
||||
color: Colors.color0
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
implicitHeight: Settings.config.barHeight - 10
|
||||
implicitWidth: root.implicitWidth + 20
|
||||
Item {
|
||||
id: root
|
||||
anchors.centerIn: parent
|
||||
implicitWidth: clockText.implicitWidth
|
||||
implicitHeight: Settings.config.barHeight
|
||||
SystemClock {
|
||||
@ -17,3 +26,4 @@ Item {
|
||||
text: Qt.formatDateTime(clock.date, "hh:mm")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,19 +1,26 @@
|
||||
import QtQuick
|
||||
import "../../reusables/"
|
||||
import "../../settings/"
|
||||
import Quickshell.Hyprland
|
||||
import "../../"
|
||||
import Quickshell.Wayland
|
||||
|
||||
Rectangle {
|
||||
id: container
|
||||
radius: implicitHeight / 2
|
||||
color: Colors.color0
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
implicitWidth: root.implicitWidth
|
||||
implicitHeight: Settings.config.barHeight - 10
|
||||
Item {
|
||||
id: root
|
||||
readonly property var activeWindow: Hyprland.activeToplevel
|
||||
implicitWidth: Math.min(text.implicitWidth, 500)
|
||||
readonly property var activeWindow: ToplevelManager.activeToplevel
|
||||
implicitWidth:titleText.implicitWidth + 20
|
||||
implicitHeight: Settings.config.barHeight
|
||||
CustomText {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
id: text
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: root.activeWindow ? Hyprland.activeToplevel.title : "Desktop"
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
id: titleText
|
||||
text: root.activeWindow.activated ? root.activeWindow.appId : "Desktop"
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,8 +6,16 @@ import "../../reusables/"
|
||||
import "../../settings/"
|
||||
import "../../"
|
||||
|
||||
Rectangle {
|
||||
id: container
|
||||
radius: implicitHeight / 2
|
||||
color: Colors.color0
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
implicitWidth: root.implicitWidth + 20
|
||||
implicitHeight: Settings.config.barHeight - 10
|
||||
Item {
|
||||
id: root
|
||||
anchors.centerIn: parent
|
||||
implicitWidth: textRow.width
|
||||
implicitHeight: Settings.config.barHeight
|
||||
property var sink: Pipewire.defaultAudioSink
|
||||
@ -63,3 +71,4 @@ Item {
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,13 +2,7 @@ pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Wayland
|
||||
import Quickshell.Hyprland
|
||||
import "."
|
||||
import "../../"
|
||||
import QtQuick.Layouts
|
||||
import Quickshell.Widgets
|
||||
import "../../settings/"
|
||||
import "../../reusables/"
|
||||
|
||||
Variants {
|
||||
model: Quickshell.screens
|
||||
@ -23,7 +17,7 @@ Variants {
|
||||
bottom: true
|
||||
}
|
||||
margins {
|
||||
top: Settings.config.barHeight + 10
|
||||
top: Settings.config.barHeight + Settings.config.margins + 10
|
||||
right: 10
|
||||
left: 10
|
||||
}
|
||||
@ -48,80 +42,7 @@ Variants {
|
||||
height: contentHeight
|
||||
|
||||
model: NotiServer.trackedNotifications
|
||||
delegate: Item {
|
||||
id: notifyItem
|
||||
required property var index
|
||||
required property var modelData
|
||||
anchors.right: parent ? parent.right : root.anchors.right
|
||||
implicitWidth: root.modelData.width / 8
|
||||
implicitHeight: notiIcon.implicitHeight + 20
|
||||
Timer {
|
||||
id: dismissTimer
|
||||
interval: 5000
|
||||
running: true
|
||||
onTriggered: parent.modelData.dismiss()
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: Colors.background
|
||||
border.color: Colors.color5
|
||||
border.width: 2
|
||||
|
||||
RowLayout {
|
||||
id: fullLayout
|
||||
anchors.margins: 10
|
||||
anchors.fill: parent
|
||||
spacing: 10
|
||||
|
||||
ClippingWrapperRectangle {
|
||||
id: notiIcon
|
||||
radius: 0
|
||||
implicitWidth: 64
|
||||
implicitHeight: 64
|
||||
visible: notifyItem.modelData.image !== ""
|
||||
IconImage {
|
||||
source: notifyItem.modelData.image
|
||||
visible: notifyItem.modelData.image !== ""
|
||||
implicitSize: 30
|
||||
asynchronous: true
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
id: textLayout
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignTop
|
||||
spacing: 2
|
||||
|
||||
CustomText {
|
||||
text: notifyItem.modelData.summary
|
||||
font.bold: true
|
||||
elide: Text.ElideRight
|
||||
Layout.fillWidth: true
|
||||
onTextChanged: dismissTimer.restart()
|
||||
}
|
||||
|
||||
CustomText {
|
||||
text: notifyItem.modelData.body
|
||||
|
||||
maximumLineCount: 3
|
||||
wrapMode: Text.WordWrap
|
||||
elide: Text.ElideRight
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
acceptedButtons: Qt.LeftButton
|
||||
onClicked: notifyItem.modelData.dismiss()
|
||||
}
|
||||
}
|
||||
}
|
||||
delegate: NotificationCard {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
77
modules/notifications/NotificationCard.qml
Normal file
77
modules/notifications/NotificationCard.qml
Normal file
@ -0,0 +1,77 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import "../../"
|
||||
import "../../reusables"
|
||||
import Quickshell.Widgets
|
||||
|
||||
Rectangle {
|
||||
id: notifyItem
|
||||
required property var modelData
|
||||
implicitWidth: ListView.view ? ListView.view.width : 300
|
||||
implicitHeight: fullLayout.implicitHeight + 20
|
||||
color: Colors.background
|
||||
border.color: dismissArea.containsMouse ? Colors.foreground : Colors.color8
|
||||
radius: 24
|
||||
Timer {
|
||||
id: dismissTimer
|
||||
interval: 5000
|
||||
running: true
|
||||
onTriggered: notifyItem.modelData.dismiss()
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
id: fullLayout
|
||||
anchors.margins: 10
|
||||
anchors.fill: parent
|
||||
spacing: 10
|
||||
|
||||
ClippingWrapperRectangle {
|
||||
id: notiIcon
|
||||
radius: notifyItem.radius - notifyItem.radius / 3
|
||||
implicitWidth: 64
|
||||
implicitHeight: 64
|
||||
visible: notifyItem.modelData.image !== ""
|
||||
IconImage {
|
||||
source: notifyItem.modelData.image
|
||||
visible: notifyItem.modelData.image !== ""
|
||||
implicitSize: 30
|
||||
asynchronous: true
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
id: textLayout
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignTop
|
||||
spacing: 2
|
||||
|
||||
CustomText {
|
||||
id: summary
|
||||
text: notifyItem.modelData.summary
|
||||
font.bold: true
|
||||
elide: Text.ElideRight
|
||||
Layout.fillWidth: true
|
||||
onTextChanged: {
|
||||
dismissTimer.restart();
|
||||
}
|
||||
}
|
||||
|
||||
CustomText {
|
||||
text: notifyItem.modelData.body
|
||||
maximumLineCount: 2
|
||||
wrapMode: Text.WordWrap
|
||||
elide: Text.ElideRight
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: dismissArea
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.LeftButton
|
||||
onClicked: notifyItem.modelData.dismiss()
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
hoverEnabled: true
|
||||
}
|
||||
}
|
||||
@ -1,2 +1,4 @@
|
||||
singleton NotiServer 1.0 NotiServer.qml
|
||||
Notification 1.0 Notification.qml
|
||||
NotificationCard 1.0 NotificationCard.qml
|
||||
|
||||
|
||||
5
modules/polkit/Polkit.qml
Normal file
5
modules/polkit/Polkit.qml
Normal file
@ -0,0 +1,5 @@
|
||||
import Quickshell
|
||||
import Quickshell.Services.Polkit
|
||||
|
||||
|
||||
|
||||
@ -21,6 +21,7 @@ Singleton {
|
||||
|
||||
adapter: JsonAdapter {
|
||||
id: settingsAdapter
|
||||
property var margins: 10
|
||||
property var currentWall: ""
|
||||
property var barHeight: 28
|
||||
property var font: "Google Sans"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user