format: conform to qml coding conventions
This commit is contained in:
parent
cba440bcfc
commit
f7b0e4665b
9 changed files with 40 additions and 40 deletions
|
|
@ -7,25 +7,26 @@ import QtQuick.Layouts
|
||||||
|
|
||||||
ClippingBoxLayout {
|
ClippingBoxLayout {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
readonly property color colour: Appearance.colours.pink
|
readonly property color colour: Appearance.colours.pink
|
||||||
|
|
||||||
animated: true
|
animated: true
|
||||||
|
|
||||||
MaterialIcon {
|
MaterialIcon {
|
||||||
Layout.alignment: Qt.AlignCenter
|
|
||||||
text: Icons.getAppCategoryIcon(Hyprland.activeClient?.class) ?? "desktop_windows"
|
text: Icons.getAppCategoryIcon(Hyprland.activeClient?.class) ?? "desktop_windows"
|
||||||
color: root.colour
|
color: root.colour
|
||||||
|
|
||||||
|
Layout.alignment: Qt.AlignCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
Layout.alignment: Qt.AlignCenter
|
|
||||||
|
|
||||||
text: Hyprland.activeClient?.title ?? "Desktop"
|
text: Hyprland.activeClient?.title ?? "Desktop"
|
||||||
font.pointSize: Appearance.font.size.smaller
|
font.pointSize: Appearance.font.size.smaller
|
||||||
font.family: Appearance.font.family.mono
|
font.family: Appearance.font.family.mono
|
||||||
color: root.colour
|
color: root.colour
|
||||||
|
|
||||||
rotation: root.vertical ? 90 : 0
|
rotation: root.vertical ? 90 : 0
|
||||||
|
|
||||||
|
Layout.alignment: Qt.AlignCenter
|
||||||
Layout.maximumWidth: root.vertical ? this.implicitHeight : this.implicitWidth
|
Layout.maximumWidth: root.vertical ? this.implicitHeight : this.implicitWidth
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,15 +15,12 @@ Variants {
|
||||||
|
|
||||||
screen: modelData
|
screen: modelData
|
||||||
namespace: "caelestia-bar"
|
namespace: "caelestia-bar"
|
||||||
// color: Appearance.alpha(Appearance.colours.base, false)
|
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|
||||||
anchors {
|
anchors.top: true
|
||||||
top: true
|
anchors.left: true
|
||||||
left: true
|
anchors.right: !vertical
|
||||||
right: !vertical
|
anchors.bottom: vertical
|
||||||
bottom: vertical
|
|
||||||
}
|
|
||||||
|
|
||||||
width: contents.implicitWidth
|
width: contents.implicitWidth
|
||||||
height: contents.implicitHeight
|
height: contents.implicitHeight
|
||||||
|
|
|
||||||
|
|
@ -6,21 +6,23 @@ import QtQuick.Layouts
|
||||||
|
|
||||||
BoxLayout {
|
BoxLayout {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
readonly property color colour: Appearance.colours.peach
|
readonly property color colour: Appearance.colours.peach
|
||||||
|
|
||||||
MaterialIcon {
|
MaterialIcon {
|
||||||
Layout.alignment: Qt.AlignCenter
|
|
||||||
text: "calendar_month"
|
text: "calendar_month"
|
||||||
color: root.colour
|
color: root.colour
|
||||||
|
|
||||||
|
Layout.alignment: Qt.AlignCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
Layout.alignment: Qt.AlignCenter
|
|
||||||
horizontalAlignment: Text.AlignJustify
|
horizontalAlignment: Text.AlignJustify
|
||||||
|
|
||||||
text: root.vertical ? Time.format("hh\nmm") : Time.format("dd/MM/yy hh:mm")
|
text: root.vertical ? Time.format("hh\nmm") : Time.format("dd/MM/yy hh:mm")
|
||||||
font.pointSize: Appearance.font.size.smaller
|
font.pointSize: Appearance.font.size.smaller
|
||||||
font.family: Appearance.font.family.mono
|
font.family: Appearance.font.family.mono
|
||||||
color: root.colour
|
color: root.colour
|
||||||
|
|
||||||
|
Layout.alignment: Qt.AlignCenter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,11 @@ import QtQuick.Layouts
|
||||||
|
|
||||||
Box {
|
Box {
|
||||||
Label {
|
Label {
|
||||||
Layout.alignment: Qt.AlignCenter
|
|
||||||
|
|
||||||
text: Icons.osIcon
|
text: Icons.osIcon
|
||||||
font.pointSize: Appearance.font.size.smaller
|
font.pointSize: Appearance.font.size.smaller
|
||||||
font.family: Appearance.font.family.mono
|
font.family: Appearance.font.family.mono
|
||||||
color: Appearance.colours.yellow
|
color: Appearance.colours.yellow
|
||||||
|
|
||||||
|
Layout.alignment: Qt.AlignCenter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,6 @@ Singleton {
|
||||||
property HyprlandWorkspace activeWorkspace: null
|
property HyprlandWorkspace activeWorkspace: null
|
||||||
property HyprlandMonitor focusedMonitor: Hyprland.monitors.values.find(m => m.lastIpcObject.focused) ?? null
|
property HyprlandMonitor focusedMonitor: Hyprland.monitors.values.find(m => m.lastIpcObject.focused) ?? null
|
||||||
|
|
||||||
Component.onCompleted: reload()
|
|
||||||
|
|
||||||
function reload() {
|
function reload() {
|
||||||
Hyprland.refreshWorkspaces();
|
Hyprland.refreshWorkspaces();
|
||||||
Hyprland.refreshMonitors();
|
Hyprland.refreshMonitors();
|
||||||
|
|
@ -29,6 +27,8 @@ Singleton {
|
||||||
Hyprland.dispatch(request);
|
Hyprland.dispatch(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: reload()
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: Hyprland
|
target: Hyprland
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,11 +17,6 @@ Rectangle {
|
||||||
readonly property int paddingX: getRealPadding().x
|
readonly property int paddingX: getRealPadding().x
|
||||||
readonly property int paddingY: getRealPadding().y
|
readonly property int paddingY: getRealPadding().y
|
||||||
|
|
||||||
color: "transparent"
|
|
||||||
|
|
||||||
implicitWidth: childrenRect.width + paddingX
|
|
||||||
implicitHeight: childrenRect.height + paddingY
|
|
||||||
|
|
||||||
function getRealPadding() {
|
function getRealPadding() {
|
||||||
const pad = {};
|
const pad = {};
|
||||||
|
|
||||||
|
|
@ -49,6 +44,11 @@ Rectangle {
|
||||||
return pad;
|
return pad;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
color: "transparent"
|
||||||
|
|
||||||
|
implicitWidth: childrenRect.width + paddingX
|
||||||
|
implicitHeight: childrenRect.height + paddingY
|
||||||
|
|
||||||
onChildrenChanged: {
|
onChildrenChanged: {
|
||||||
for (const child of children) {
|
for (const child of children) {
|
||||||
child.x = Qt.binding(() => paddingLeft);
|
child.x = Qt.binding(() => paddingLeft);
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ import QtQuick.Layouts
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
|
default property alias children: layout.children
|
||||||
|
|
||||||
property bool vertical: false
|
property bool vertical: false
|
||||||
property bool homogenous: false
|
property bool homogenous: false
|
||||||
property bool animated: false
|
property bool animated: false
|
||||||
|
|
@ -18,11 +20,6 @@ Rectangle {
|
||||||
readonly property int paddingX: getRealPadding().x
|
readonly property int paddingX: getRealPadding().x
|
||||||
readonly property int paddingY: getRealPadding().y
|
readonly property int paddingY: getRealPadding().y
|
||||||
|
|
||||||
color: "transparent"
|
|
||||||
|
|
||||||
implicitWidth: layout.implicitWidth + paddingX
|
|
||||||
implicitHeight: layout.implicitHeight + paddingY
|
|
||||||
|
|
||||||
function getRealPadding() {
|
function getRealPadding() {
|
||||||
const pad = {};
|
const pad = {};
|
||||||
|
|
||||||
|
|
@ -50,7 +47,10 @@ Rectangle {
|
||||||
return pad;
|
return pad;
|
||||||
}
|
}
|
||||||
|
|
||||||
default property alias children: layout.children
|
color: "transparent"
|
||||||
|
|
||||||
|
implicitWidth: layout.implicitWidth + paddingX
|
||||||
|
implicitHeight: layout.implicitHeight + paddingY
|
||||||
|
|
||||||
GridLayout {
|
GridLayout {
|
||||||
id: layout
|
id: layout
|
||||||
|
|
|
||||||
|
|
@ -18,11 +18,6 @@ ClippingRectangle {
|
||||||
readonly property int paddingX: getRealPadding().x
|
readonly property int paddingX: getRealPadding().x
|
||||||
readonly property int paddingY: getRealPadding().y
|
readonly property int paddingY: getRealPadding().y
|
||||||
|
|
||||||
color: "transparent"
|
|
||||||
|
|
||||||
implicitWidth: childrenRect.width + paddingX
|
|
||||||
implicitHeight: childrenRect.height + paddingY
|
|
||||||
|
|
||||||
function getRealPadding() {
|
function getRealPadding() {
|
||||||
const pad = {};
|
const pad = {};
|
||||||
|
|
||||||
|
|
@ -50,6 +45,11 @@ ClippingRectangle {
|
||||||
return pad;
|
return pad;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
color: "transparent"
|
||||||
|
|
||||||
|
implicitWidth: childrenRect.width + paddingX
|
||||||
|
implicitHeight: childrenRect.height + paddingY
|
||||||
|
|
||||||
onChildrenChanged: {
|
onChildrenChanged: {
|
||||||
for (const child of children) {
|
for (const child of children) {
|
||||||
child.x = Qt.binding(() => paddingLeft);
|
child.x = Qt.binding(() => paddingLeft);
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@ import QtQuick.Layouts
|
||||||
ClippingRectangle {
|
ClippingRectangle {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
|
default property alias children: layout.children
|
||||||
|
|
||||||
property bool vertical: false
|
property bool vertical: false
|
||||||
property bool homogenous: false
|
property bool homogenous: false
|
||||||
property bool animated: false
|
property bool animated: false
|
||||||
|
|
@ -19,11 +21,6 @@ ClippingRectangle {
|
||||||
readonly property int paddingX: getRealPadding().x
|
readonly property int paddingX: getRealPadding().x
|
||||||
readonly property int paddingY: getRealPadding().y
|
readonly property int paddingY: getRealPadding().y
|
||||||
|
|
||||||
color: "transparent"
|
|
||||||
|
|
||||||
implicitWidth: layout.implicitWidth + paddingX
|
|
||||||
implicitHeight: layout.implicitHeight + paddingY
|
|
||||||
|
|
||||||
function getRealPadding() {
|
function getRealPadding() {
|
||||||
const pad = {};
|
const pad = {};
|
||||||
|
|
||||||
|
|
@ -51,7 +48,10 @@ ClippingRectangle {
|
||||||
return pad;
|
return pad;
|
||||||
}
|
}
|
||||||
|
|
||||||
default property alias children: layout.children
|
color: "transparent"
|
||||||
|
|
||||||
|
implicitWidth: layout.implicitWidth + paddingX
|
||||||
|
implicitHeight: layout.implicitHeight + paddingY
|
||||||
|
|
||||||
GridLayout {
|
GridLayout {
|
||||||
id: layout
|
id: layout
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue