diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-04-29 10:53:54 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-04-29 10:53:54 +1000 |
| commit | 01d9c318593e1bf4eb81dc6e71dc4c20e8c9fa6a (patch) | |
| tree | 23b0bd7eeedcef0cede66b38426d9e8ba1a04af1 /widgets/AnchorText.qml | |
| parent | refactor: use anchors instead of layouts (diff) | |
| download | caelestia-shell-01d9c318593e1bf4eb81dc6e71dc4c20e8c9fa6a.tar.gz caelestia-shell-01d9c318593e1bf4eb81dc6e71dc4c20e8c9fa6a.tar.bz2 caelestia-shell-01d9c318593e1bf4eb81dc6e71dc4c20e8c9fa6a.zip | |
bar: fix alignment
Also refactor box -> styledrect + paddedrect
Diffstat (limited to 'widgets/AnchorText.qml')
| -rw-r--r-- | widgets/AnchorText.qml | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/widgets/AnchorText.qml b/widgets/AnchorText.qml new file mode 100644 index 0000000..a0342e8 --- /dev/null +++ b/widgets/AnchorText.qml @@ -0,0 +1,17 @@ +import "root:/config" +import QtQuick + +StyledText { + id: root + + required property Item prevAnchor + property bool vertical + + anchors.left: vertical ? undefined : prevAnchor.right + anchors.leftMargin: vertical ? 0 : Appearance.padding.smaller + anchors.top: vertical ? prevAnchor.bottom : undefined + anchors.topMargin: vertical ? Appearance.padding.smaller : 0 + + anchors.horizontalCenter: vertical ? prevAnchor.horizontalCenter : undefined + anchors.verticalCenter: vertical ? undefined : prevAnchor.verticalCenter +} |