Compare commits
6 commits
main
...
unify-wind
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
11d0e4a838 | ||
|
|
3074bcae38 | ||
|
|
75f780753f | ||
|
|
37dfd1255a | ||
|
|
a40f7666dc | ||
|
|
4011f4b5c8 |
9 changed files with 235 additions and 304 deletions
|
|
@ -1,28 +0,0 @@
|
||||||
import qs.config
|
|
||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
|
|
||||||
Menu {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
palette.window: Theme.palette.base100
|
|
||||||
palette.base: Theme.palette.base100
|
|
||||||
|
|
||||||
focus: true
|
|
||||||
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent
|
|
||||||
|
|
||||||
enter: Transition {
|
|
||||||
NumberAnimation {
|
|
||||||
property: "opacity"
|
|
||||||
from: 0.0
|
|
||||||
to: 1.0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exit: Transition {
|
|
||||||
NumberAnimation {
|
|
||||||
property: "opacity"
|
|
||||||
from: 1.0
|
|
||||||
to: 0.0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
import qs.config
|
|
||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
|
|
||||||
MenuItem {
|
|
||||||
palette.text: Theme.palette.basecontent
|
|
||||||
palette.highlight: Theme.palette.primary
|
|
||||||
palette.highlightedText: Theme.palette.primarycontent
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
import qs.config
|
|
||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
|
|
||||||
MenuSeparator {
|
|
||||||
palette.text: Theme.palette.basecontent
|
|
||||||
palette.highlight: Theme.palette.primary
|
|
||||||
palette.highlightedText: Theme.palette.primarycontent
|
|
||||||
}
|
|
||||||
|
|
@ -6,9 +6,10 @@ import Quickshell.Hyprland
|
||||||
PopupWindow {
|
PopupWindow {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
implicitWidth: background.implicitWidth
|
implicitWidth: contentItem.children.reduce((prev, child) => Math.max(prev, child.width), 0)
|
||||||
implicitHeight: background.implicitHeight
|
implicitHeight: contentItem.children.reduce((prev, child) => prev + child.height, 0)
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
contentItem.focus: visible
|
||||||
|
|
||||||
function open() {
|
function open() {
|
||||||
visible = true;
|
visible = true;
|
||||||
|
|
@ -18,8 +19,10 @@ PopupWindow {
|
||||||
visible = false;
|
visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WlrLayershell.layer: WlrLayer.Top
|
||||||
|
// WlrLayershell.keyboardFocus: root.visible ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None
|
||||||
HyprlandFocusGrab {
|
HyprlandFocusGrab {
|
||||||
id: grab
|
active: root.visible
|
||||||
windows: [root]
|
windows: [root]
|
||||||
onCleared: {
|
onCleared: {
|
||||||
root.close();
|
root.close();
|
||||||
|
|
@ -28,9 +31,7 @@ PopupWindow {
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: background
|
id: background
|
||||||
anchors.centerIn: root
|
anchors.fill: parent
|
||||||
implicitWidth: root.contentItem.children.reduce((prev, child) => Math.max(prev, child.width), 0)
|
|
||||||
implicitHeight: root.contentItem.children.reduce((prev, child) => prev + child.height, 0)
|
|
||||||
color: Theme.palette.base200
|
color: Theme.palette.base200
|
||||||
radius: 8
|
radius: 8
|
||||||
}
|
}
|
||||||
|
|
@ -4,8 +4,9 @@ import "launcher"
|
||||||
import "pomodoro"
|
import "pomodoro"
|
||||||
import "powermenu"
|
import "powermenu"
|
||||||
import "storybook"
|
import "storybook"
|
||||||
import Quickshell
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
|
import Quickshell
|
||||||
|
import Quickshell.Wayland
|
||||||
|
|
||||||
Variants {
|
Variants {
|
||||||
model: Quickshell.screens
|
model: Quickshell.screens
|
||||||
|
|
@ -15,11 +16,73 @@ Variants {
|
||||||
|
|
||||||
required property ShellScreen modelData
|
required property ShellScreen modelData
|
||||||
|
|
||||||
Bar {}
|
PanelWindow {
|
||||||
|
id: exclusionZone
|
||||||
|
|
||||||
|
anchors.top: true
|
||||||
|
anchors.left: true
|
||||||
|
anchors.right: true
|
||||||
|
|
||||||
|
implicitWidth: bar.width
|
||||||
|
implicitHeight: bar.height
|
||||||
|
|
||||||
|
color: "transparent"
|
||||||
|
}
|
||||||
|
|
||||||
|
PanelWindow {
|
||||||
|
id: topWindow
|
||||||
|
|
||||||
|
anchors.top: true
|
||||||
|
anchors.left: true
|
||||||
|
anchors.right: true
|
||||||
|
anchors.bottom: true
|
||||||
|
|
||||||
|
color: 'transparent'
|
||||||
|
|
||||||
|
WlrLayershell.exclusionMode: ExclusionMode.Ignore
|
||||||
|
WlrLayershell.layer: WlrLayer.Top
|
||||||
|
|
||||||
|
mask: Region {
|
||||||
|
width: topWindow.width
|
||||||
|
height: topWindow.height
|
||||||
|
intersection: Intersection.Xor
|
||||||
|
regions: regions.instances
|
||||||
|
}
|
||||||
|
|
||||||
|
Variants {
|
||||||
|
id: regions
|
||||||
|
|
||||||
|
model: panels.children
|
||||||
|
|
||||||
|
Region {
|
||||||
|
required property Item modelData
|
||||||
|
|
||||||
|
x: modelData.x
|
||||||
|
y: modelData.y
|
||||||
|
width: modelData.width
|
||||||
|
height: modelData.height
|
||||||
|
intersection: Intersection.Subtract
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: panels
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
|
Bar {
|
||||||
|
id: bar
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Launcher {}
|
Launcher {}
|
||||||
Pomodoro {}
|
Pomodoro {}
|
||||||
PowerMenu {}
|
PowerMenu {}
|
||||||
Storybook {}
|
Storybook {
|
||||||
|
anchor.window: topWindow
|
||||||
|
anchor.rect.x: topWindow.width / 2 - width / 2
|
||||||
|
anchor.rect.y: topWindow.height / 4
|
||||||
|
}
|
||||||
Drawers {}
|
Drawers {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,55 +3,29 @@ import "components/bluetooth"
|
||||||
import "components/hyprland"
|
import "components/hyprland"
|
||||||
import "components/notifications"
|
import "components/notifications"
|
||||||
import "components/tray"
|
import "components/tray"
|
||||||
|
import qs.components
|
||||||
import qs.config
|
import qs.config
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import Quickshell
|
|
||||||
import Quickshell.Wayland
|
|
||||||
|
|
||||||
PanelWindow {
|
StyledWrapperRectangle {
|
||||||
id: parentWindow
|
id: root
|
||||||
|
|
||||||
anchors.top: true
|
anchors.left: parent.left
|
||||||
anchors.left: true
|
anchors.right: parent.right
|
||||||
anchors.right: true
|
anchors.top: parent.top
|
||||||
|
|
||||||
implicitHeight: Dimensions.bar.height
|
|
||||||
color: 'transparent'
|
|
||||||
|
|
||||||
WlrLayershell.layer: WlrLayer.Top
|
|
||||||
|
|
||||||
Item {
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.leftMargin: Dimensions.bar.horizontalMargins
|
anchors.leftMargin: Dimensions.bar.horizontalMargins
|
||||||
anchors.rightMargin: Dimensions.bar.horizontalMargins
|
anchors.rightMargin: Dimensions.bar.horizontalMargins
|
||||||
anchors.topMargin: Dimensions.bar.verticalMargins
|
anchors.topMargin: Dimensions.bar.verticalMargins
|
||||||
anchors.bottomMargin: Dimensions.bar.verticalMargins
|
anchors.bottomMargin: Dimensions.bar.verticalMargins
|
||||||
|
|
||||||
Rectangle {
|
margin: 6
|
||||||
id: background
|
|
||||||
anchors.fill: parent
|
|
||||||
color: Theme.palette.base300
|
|
||||||
radius: Dimensions.radius
|
|
||||||
|
|
||||||
border {
|
RowLayout {
|
||||||
color: Theme.palette.base100
|
|
||||||
width: Dimensions.bar.border
|
|
||||||
pixelAligned: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: leftbar
|
id: leftbar
|
||||||
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
anchors.leftMargin: Dimensions.bar.horizontalPadding
|
|
||||||
anchors.topMargin: Dimensions.bar.verticalPadding
|
|
||||||
anchors.bottomMargin: Dimensions.bar.verticalPadding
|
|
||||||
|
|
||||||
spacing: Dimensions.bar.spacing
|
spacing: Dimensions.bar.spacing
|
||||||
|
|
||||||
SystemLogo {
|
SystemLogo {
|
||||||
|
|
@ -66,11 +40,7 @@ PanelWindow {
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: centerbar
|
id: centerbar
|
||||||
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
anchors.topMargin: Dimensions.bar.verticalPadding
|
|
||||||
anchors.bottomMargin: Dimensions.bar.verticalPadding
|
|
||||||
|
|
||||||
spacing: Dimensions.bar.spacing
|
spacing: Dimensions.bar.spacing
|
||||||
|
|
||||||
|
|
@ -80,12 +50,7 @@ PanelWindow {
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: rightbar
|
id: rightbar
|
||||||
|
|
||||||
anchors.right: parent.right
|
Layout.alignment: Qt.AlignRight
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
anchors.rightMargin: Dimensions.bar.horizontalPadding
|
|
||||||
anchors.topMargin: Dimensions.bar.verticalPadding
|
|
||||||
anchors.bottomMargin: Dimensions.bar.verticalPadding
|
|
||||||
|
|
||||||
spacing: Dimensions.bar.spacing
|
spacing: Dimensions.bar.spacing
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,10 +55,10 @@ StyledWindow {
|
||||||
id: circle
|
id: circle
|
||||||
radius: 150
|
radius: 150
|
||||||
borderColor: Theme.palette.base100
|
borderColor: Theme.palette.base100
|
||||||
strokeColor: Pomodoro.state == "timer" ? Theme.palette.primary : Theme.palette.warning
|
strokeColor: PomodoroService.state == "timer" ? Theme.palette.primary : Theme.palette.warning
|
||||||
strokeWidth: 12
|
strokeWidth: 12
|
||||||
fillColor: button.hovered ? Theme.palette.primary : "transparent"
|
fillColor: button.hovered ? Theme.palette.primary : "transparent"
|
||||||
percentage: (Pomodoro.state == "timer" ? (Pomodoro.initialTime - Pomodoro.remainingTime) : Pomodoro.remainingTime) / Pomodoro.initialTime % 1
|
percentage: (PomodoroService.state == "timer" ? (PomodoroService.initialTime - PomodoroService.remainingTime) : PomodoroService.remainingTime) / PomodoroService.initialTime % 1
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledIconButton {
|
StyledIconButton {
|
||||||
|
|
@ -69,17 +69,17 @@ StyledWindow {
|
||||||
radius: 9999
|
radius: 9999
|
||||||
|
|
||||||
focus: root.visible
|
focus: root.visible
|
||||||
text: Pomodoro.running ? Icons.square : Icons.play
|
text: PomodoroService.running ? Icons.square : Icons.play
|
||||||
font.pixelSize: 48
|
font.pixelSize: 48
|
||||||
|
|
||||||
background: undefined
|
background: undefined
|
||||||
onClicked: {
|
onClicked: {
|
||||||
Pomodoro.toggle();
|
PomodoroService.toggle();
|
||||||
}
|
}
|
||||||
|
|
||||||
Keys.onSpacePressed: event => {
|
Keys.onSpacePressed: event => {
|
||||||
event.accepted = true;
|
event.accepted = true;
|
||||||
Pomodoro.toggle();
|
PomodoroService.toggle();
|
||||||
}
|
}
|
||||||
Keys.onEscapePressed: event => {
|
Keys.onEscapePressed: event => {
|
||||||
event.accepted = true;
|
event.accepted = true;
|
||||||
|
|
@ -87,7 +87,7 @@ StyledWindow {
|
||||||
}
|
}
|
||||||
Keys.onTabPressed: event => {
|
Keys.onTabPressed: event => {
|
||||||
event.accepted = true;
|
event.accepted = true;
|
||||||
Pomodoro.reset();
|
PomodoroService.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -95,7 +95,7 @@ StyledWindow {
|
||||||
StyledText {
|
StyledText {
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
text: {
|
text: {
|
||||||
const date = new Date(Pomodoro.remainingTime);
|
const date = new Date(PomodoroService.remainingTime);
|
||||||
return `${date.getMinutes().toString().padStart(2, "0")}:${(date.getSeconds() % 3600).toString().padStart(2, "0")}`;
|
return `${date.getMinutes().toString().padStart(2, "0")}:${(date.getSeconds() % 3600).toString().padStart(2, "0")}`;
|
||||||
}
|
}
|
||||||
font.pixelSize: 16
|
font.pixelSize: 16
|
||||||
|
|
@ -108,7 +108,7 @@ StyledWindow {
|
||||||
text: "Reset"
|
text: "Reset"
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
Pomodoro.reset();
|
PomodoroService.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,35 +4,14 @@ import qs.components
|
||||||
import qs.config
|
import qs.config
|
||||||
import qs.constants
|
import qs.constants
|
||||||
import qs.services
|
import qs.services
|
||||||
import Quickshell.Hyprland
|
|
||||||
import Quickshell.Wayland
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
|
||||||
StyledWindow {
|
StyledPopupWindow {
|
||||||
id: root
|
id: root
|
||||||
name: "storybook"
|
|
||||||
|
|
||||||
visible: Visibility.storybook
|
visible: Visibility.storybook
|
||||||
implicitWidth: rect.width
|
|
||||||
implicitHeight: rect.height
|
|
||||||
|
|
||||||
WlrLayershell.layer: WlrLayer.Top
|
|
||||||
WlrLayershell.keyboardFocus: root.visible ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None
|
|
||||||
|
|
||||||
HyprlandFocusGrab {
|
|
||||||
active: Visibility.storybook
|
|
||||||
windows: [root]
|
|
||||||
onCleared: {
|
|
||||||
Visibility.storybook = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledWrapperRectangle {
|
|
||||||
id: rect
|
|
||||||
|
|
||||||
margin: 48
|
|
||||||
|
|
||||||
GridLayout {
|
GridLayout {
|
||||||
id: grid
|
id: grid
|
||||||
|
|
@ -152,36 +131,6 @@ StyledWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
|
||||||
StyledText {
|
|
||||||
text: "Popup"
|
|
||||||
font.pixelSize: 18
|
|
||||||
}
|
|
||||||
Button {
|
|
||||||
id: fileButton
|
|
||||||
text: "File"
|
|
||||||
onPressed: menu.visible ? menu.close() : menu.open()
|
|
||||||
|
|
||||||
StyledPopup {
|
|
||||||
id: menu
|
|
||||||
|
|
||||||
anchor.item: fileButton
|
|
||||||
|
|
||||||
Column {
|
|
||||||
StyledButton {
|
|
||||||
text: "New..."
|
|
||||||
}
|
|
||||||
StyledButton {
|
|
||||||
text: "Open..."
|
|
||||||
}
|
|
||||||
StyledText {
|
|
||||||
text: "Close"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
StyledText {
|
StyledText {
|
||||||
text: "Drawer"
|
text: "Drawer"
|
||||||
|
|
@ -227,7 +176,6 @@ StyledWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
StyledDrawer {
|
StyledDrawer {
|
||||||
id: drawer
|
id: drawer
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue