Compare commits
No commits in common. "f8369a340ba0184b59b2354378050160d610ad77" and "c4f0fbc1ee4d537a98c57e2678d4cae4348bad17" have entirely different histories.
f8369a340b
...
c4f0fbc1ee
10 changed files with 47 additions and 210 deletions
|
|
@ -11,7 +11,6 @@ Singleton {
|
||||||
property Bar bar: Bar {}
|
property Bar bar: Bar {}
|
||||||
property Mpris mpris: Mpris {}
|
property Mpris mpris: Mpris {}
|
||||||
property Clock clock: Clock {}
|
property Clock clock: Clock {}
|
||||||
property Caffeine caffeine: Caffeine {}
|
|
||||||
property Workspace workspace: Workspace {}
|
property Workspace workspace: Workspace {}
|
||||||
property Tray tray: Tray {}
|
property Tray tray: Tray {}
|
||||||
property TrayMenu trayMenu: TrayMenu {}
|
property TrayMenu trayMenu: TrayMenu {}
|
||||||
|
|
@ -46,15 +45,6 @@ Singleton {
|
||||||
property int verticalPadding: 6
|
property int verticalPadding: 6
|
||||||
}
|
}
|
||||||
|
|
||||||
component Caffeine: QtObject {
|
|
||||||
id: clock
|
|
||||||
|
|
||||||
property int iconSize: 14
|
|
||||||
property int height: 30
|
|
||||||
property int horizontalPadding: 8
|
|
||||||
property int verticalPadding: 6
|
|
||||||
}
|
|
||||||
|
|
||||||
component Workspace: QtObject {
|
component Workspace: QtObject {
|
||||||
id: workspace
|
id: workspace
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ pragma Singleton
|
||||||
import Quickshell
|
import Quickshell
|
||||||
|
|
||||||
Singleton {
|
Singleton {
|
||||||
property string coffee: "\u{E09a}"
|
|
||||||
property string triangle: "\u{E192}"
|
property string triangle: "\u{E192}"
|
||||||
property string triangleDashed: "\u{E642}"
|
property string triangleDashed: "\u{E642}"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -75,9 +75,7 @@ Scope {
|
||||||
|
|
||||||
spacing: Dimensions.bar.spacing
|
spacing: Dimensions.bar.spacing
|
||||||
|
|
||||||
Mpris {
|
Mpris {}
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
|
|
@ -92,13 +90,7 @@ Scope {
|
||||||
|
|
||||||
spacing: Dimensions.bar.spacing
|
spacing: Dimensions.bar.spacing
|
||||||
|
|
||||||
Caffeine {
|
Clock {}
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Clock {
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,46 +0,0 @@
|
||||||
import QtQuick
|
|
||||||
import Quickshell.Io
|
|
||||||
import "../../../config/"
|
|
||||||
import "../../../constants/"
|
|
||||||
import "../../../styled/"
|
|
||||||
|
|
||||||
Clickable {
|
|
||||||
id: clickable
|
|
||||||
|
|
||||||
implicitWidth: text.width
|
|
||||||
implicitHeight: Dimensions.caffeine.height
|
|
||||||
|
|
||||||
border.color: process.running ? Theme.palette.secondary : 'transparent'
|
|
||||||
border.width: 2
|
|
||||||
|
|
||||||
onClicked: {
|
|
||||||
if (process.running) {
|
|
||||||
process.signal(888);
|
|
||||||
process.running = false;
|
|
||||||
} else {
|
|
||||||
process.running = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
id: text
|
|
||||||
|
|
||||||
font.family: Theme.lucide.font.family
|
|
||||||
font.pixelSize: Dimensions.workspace.iconSize
|
|
||||||
font.bold: true
|
|
||||||
text: Icons.coffee
|
|
||||||
|
|
||||||
color: clickable.containsMouse ? Theme.palette.base300 : Theme.palette.basecontent
|
|
||||||
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
topPadding: Dimensions.mpris.verticalPadding
|
|
||||||
bottomPadding: Dimensions.mpris.verticalPadding
|
|
||||||
leftPadding: Dimensions.mpris.horizontalPadding
|
|
||||||
rightPadding: Dimensions.mpris.horizontalPadding
|
|
||||||
}
|
|
||||||
|
|
||||||
Process {
|
|
||||||
id: process
|
|
||||||
command: ["sh", "-c", "systemd-inhibit --what=idle --who=Caffeine --why=Caffeine --mode=block sleep inf"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,11 +1,19 @@
|
||||||
import Quickshell
|
import Quickshell
|
||||||
|
import Quickshell.Io
|
||||||
|
import QtQuick
|
||||||
import "../../../styled/"
|
import "../../../styled/"
|
||||||
import "../../../config/"
|
import "../../../config/"
|
||||||
|
|
||||||
StyledLabel {
|
Item {
|
||||||
|
id: root
|
||||||
|
|
||||||
implicitWidth: childrenRect.width
|
implicitWidth: childrenRect.width
|
||||||
implicitHeight: Dimensions.clock.height
|
implicitHeight: Dimensions.clock.height
|
||||||
|
|
||||||
|
StyledLabel {
|
||||||
|
anchors.fill: parent
|
||||||
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
id: text
|
id: text
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ Row {
|
||||||
|
|
||||||
sourceComponent: item
|
sourceComponent: item
|
||||||
property Component item: TrayItem {
|
property Component item: TrayItem {
|
||||||
trayItem: modelData
|
trayItem: modelData
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,17 +38,32 @@ Clickable {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
}
|
}
|
||||||
|
|
||||||
Menu {
|
PopupWindow {
|
||||||
id: menu
|
id: popup
|
||||||
|
|
||||||
opened: root.menuOpened
|
visible: root.menuOpened
|
||||||
|
|
||||||
|
color: 'transparent'
|
||||||
|
|
||||||
anchor.item: root
|
anchor.item: root
|
||||||
anchor.rect.x: root.width / 2 - width / 2
|
anchor.rect.x: root.width / 2 - width / 2
|
||||||
anchor.rect.y: root.height + 8
|
anchor.rect.y: root.height + 8
|
||||||
|
|
||||||
menuOpener: QsMenuOpener {
|
implicitWidth: menu.width
|
||||||
menu: trayItem.menu
|
implicitHeight: menu.height
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
anchors.fill: parent
|
||||||
|
color: Theme.palette.base300
|
||||||
|
radius: 8
|
||||||
|
}
|
||||||
|
|
||||||
|
Menu {
|
||||||
|
id: menu
|
||||||
|
|
||||||
|
menuOpener: QsMenuOpener {
|
||||||
|
menu: trayItem.menu
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,145 +1,29 @@
|
||||||
pragma ComponentBehavior: Bound
|
|
||||||
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import "../../../../../config/"
|
import "../../../../../config/"
|
||||||
import "../../../../../styled/"
|
import "../../../../../styled/"
|
||||||
|
|
||||||
PopupWindow {
|
ColumnLayout {
|
||||||
id: window
|
id: menu
|
||||||
|
|
||||||
property QsMenuOpener menuOpener
|
property QsMenuOpener menuOpener
|
||||||
property bool opened: false
|
|
||||||
|
|
||||||
color: 'transparent'
|
anchors.margins: 8
|
||||||
|
|
||||||
implicitWidth: menu.width
|
Repeater {
|
||||||
implicitHeight: menu.height
|
model: menuOpener.children
|
||||||
|
delegate: Loader {
|
||||||
|
required property QsMenuEntry modelData
|
||||||
|
active: true
|
||||||
|
|
||||||
Rectangle {
|
sourceComponent: modelData.isSeparator ? menuSeperator : menuItem
|
||||||
id: background
|
property Component menuSeperator: Rectangle {
|
||||||
|
implicitHeight: 1
|
||||||
anchors.fill: menu
|
implicitWidth: menu.width
|
||||||
color: Theme.palette.base300
|
color: Theme.palette.basecontent
|
||||||
border.color: Theme.palette.base200
|
|
||||||
border.width: 2
|
|
||||||
radius: 8
|
|
||||||
|
|
||||||
opacity: 0
|
|
||||||
|
|
||||||
states: State {
|
|
||||||
name: "opened"
|
|
||||||
when: window.opened
|
|
||||||
PropertyChanges {
|
|
||||||
background {
|
|
||||||
opacity: 1
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
property Component menuItem: MenuItem {
|
||||||
|
menuEntry: modelData
|
||||||
transitions: [
|
|
||||||
Transition {
|
|
||||||
from: ""
|
|
||||||
to: "opened"
|
|
||||||
SequentialAnimation {
|
|
||||||
ScriptAction {
|
|
||||||
script: window.visible = true
|
|
||||||
}
|
|
||||||
NumberAnimation {
|
|
||||||
property: "background.opacity"
|
|
||||||
duration: 200
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
Transition {
|
|
||||||
from: "opened"
|
|
||||||
to: ""
|
|
||||||
SequentialAnimation {
|
|
||||||
PauseAnimation {
|
|
||||||
duration: repeater.count * 15
|
|
||||||
}
|
|
||||||
NumberAnimation {
|
|
||||||
property: "background.opacity"
|
|
||||||
duration: 200
|
|
||||||
}
|
|
||||||
ScriptAction {
|
|
||||||
script: window.visible = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
ColumnLayout {
|
|
||||||
id: menu
|
|
||||||
|
|
||||||
anchors.margins: 30
|
|
||||||
|
|
||||||
Repeater {
|
|
||||||
id: repeater
|
|
||||||
model: window.menuOpener.children
|
|
||||||
delegate: Loader {
|
|
||||||
id: loader
|
|
||||||
|
|
||||||
required property QsMenuEntry modelData
|
|
||||||
required property int index
|
|
||||||
|
|
||||||
active: true
|
|
||||||
|
|
||||||
opacity: 0
|
|
||||||
|
|
||||||
Layout.minimumWidth: 120
|
|
||||||
|
|
||||||
sourceComponent: modelData.isSeparator ? menuSeperator : menuItem
|
|
||||||
property Component menuSeperator: Rectangle {
|
|
||||||
implicitWidth: menu.width
|
|
||||||
implicitHeight: 2
|
|
||||||
|
|
||||||
color: Theme.palette.base100
|
|
||||||
}
|
|
||||||
property Component menuItem: MenuItem {
|
|
||||||
menuEntry: modelData
|
|
||||||
}
|
|
||||||
|
|
||||||
states: State {
|
|
||||||
name: "opened"
|
|
||||||
when: window.opened
|
|
||||||
PropertyChanges {
|
|
||||||
loader {
|
|
||||||
opacity: 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
transitions: [
|
|
||||||
Transition {
|
|
||||||
from: ""
|
|
||||||
to: "opened"
|
|
||||||
SequentialAnimation {
|
|
||||||
PauseAnimation {
|
|
||||||
duration: 15 * loader.index
|
|
||||||
}
|
|
||||||
NumberAnimation {
|
|
||||||
property: "opacity"
|
|
||||||
duration: 100
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
Transition {
|
|
||||||
from: "opened"
|
|
||||||
to: ""
|
|
||||||
SequentialAnimation {
|
|
||||||
PauseAnimation {
|
|
||||||
duration: 15 * (repeater.count - loader.index)
|
|
||||||
}
|
|
||||||
NumberAnimation {
|
|
||||||
property: "opacity"
|
|
||||||
duration: 200
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,6 @@ Clickable {
|
||||||
StyledText {
|
StyledText {
|
||||||
id: text
|
id: text
|
||||||
|
|
||||||
opacity: item.opacity
|
|
||||||
|
|
||||||
font.pixelSize: Dimensions.clock.fontSize
|
font.pixelSize: Dimensions.clock.fontSize
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
topPadding: Dimensions.clock.verticalPadding
|
topPadding: Dimensions.clock.verticalPadding
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,8 @@ MouseArea {
|
||||||
|
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
property alias color: rectangle.color
|
|
||||||
property alias border: rectangle.border
|
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: rectangle
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
radius: Dimensions.radius
|
radius: Dimensions.radius
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue