fix(clock): display date, week, and year vertically in vertical bar.#6336
fix(clock): display date, week, and year vertically in vertical bar.#6336heyssh wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the bar clock widget’s alt-format rendering so it displays cleanly when the bar is vertical, by introducing a dedicated multi-line vertical alt format and adjusting vertical layout rendering.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Changes:
- Add a
verticalFormatAltsetting (with a multi-line default) for the vertical bar’s alt view instead of reusing the horizontal alt format. - Adjust vertical rendering by repeating split lines and slightly reducing font size for longer line segments.
- Minor layout whitespace tweak in the vertical
Column.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| readonly property string activeFormat: alt | ||
| ? setting("formatAlt", "d MMMM 'W'ww yyyy") | ||
| ? (bar && bar.vertical ? setting("verticalFormatAlt", "dd\nMMM\n'W'ww\nyyyy") : setting("formatAlt", "d MMMM 'W'ww yyyy")) | ||
| : (bar && bar.vertical ? setting("verticalFormat", "HH\n—\nmm") : setting("format", "dddd HH:mm")) |
| fontSize: modelData.length > 3 | ||
| ? button.fontSize * 0.9 | ||
| : button.fontSize |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (2)
shell/plugins/bar/widgets/Clock.qml:80
- This delegate declares
required property int indexbut never usesindex. Keeping unused required properties makes the delegate API noisier and can lead to confusing initialization errors if the delegate is ever reused outside aRepeatercontext. Remove it unless it’s actually needed.
required property string modelData
required property int index
shell/plugins/bar/widgets/Clock.qml:87
- This ternary indentation includes a tab character (visible in the current alignment before
?). The rest of the QML uses spaces, and tabs can render inconsistently across editors and formatters. Re-indent using spaces only.
fontSize: modelData.length > 3
? button.fontSize * 0.9
: button.fontSize
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
shell/plugins/bar/widgets/Clock.qml:86
- The conditional fontSize block introduces a tab/misaligned indentation. This breaks the repo’s two-space indentation convention and can render inconsistently in editors.
fontSize: modelData.length > 3
? button.fontSize * 0.9
: button.fontSize
| anchors.fill: parent | ||
|
|
||
| Repeater { |
What
Fixes the clock widget's alt-format (triggered by clicking the clock)
when the bar is positioned vertically.
Why
Previously,
activeFormatused the same single-lineformatAltstringregardless of bar orientation. On a horizontal bar this worked fine,
but on a vertical bar the text got cut off since there was no
\nto break it into lines that fit the narrow bar width.
Changes
verticalFormatAltsetting so the alt view has its ownmulti-line format when the bar is vertical, instead of reusing
the horizontal one.
yyyy), which was missing.Columnlayout for readability.Testing
Tested by dragging the bar to a vertical position (left side of screen),
clicking the clock to toggle alt view, and confirming the date, week
number, and year all display fully without being cut off.
Before

After
