Skip to content

fix(clock): display date, week, and year vertically in vertical bar.#6336

Open
heyssh wants to merge 4 commits into
basecamp:quattrofrom
heyssh:fix/clock-vertical-format
Open

fix(clock): display date, week, and year vertically in vertical bar.#6336
heyssh wants to merge 4 commits into
basecamp:quattrofrom
heyssh:fix/clock-vertical-format

Conversation

@heyssh

@heyssh heyssh commented Jul 21, 2026

Copy link
Copy Markdown

What

Fixes the clock widget's alt-format (triggered by clicking the clock)
when the bar is positioned vertically.

Why

Previously, activeFormat used the same single-line formatAlt string
regardless of bar orientation. On a horizontal bar this worked fine,
but on a vertical bar the text got cut off since there was no \n
to break it into lines that fit the narrow bar width.

Changes

  • Added a verticalFormatAlt setting so the alt view has its own
    multi-line format when the bar is vertical, instead of reusing
    the horizontal one.
  • Updated the format to include the year (yyyy), which was missing.
  • Minor spacing tweak in the vertical Column layout 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
screenshot-2026-07-21_18-34-51

After
screenshot-2026-07-21_19-04-23

Copilot AI review requested due to automatic review settings July 21, 2026 15:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 verticalFormatAlt setting (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.

Comment on lines 14 to 16
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"))
Comment on lines +85 to +87
fontSize: modelData.length > 3
? button.fontSize * 0.9
: button.fontSize
Comment thread shell/plugins/bar/widgets/Clock.qml Outdated
Copilot AI review requested due to automatic review settings July 21, 2026 15:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 index but never uses index. Keeping unused required properties makes the delegate API noisier and can lead to confusing initialization errors if the delegate is ever reused outside a Repeater context. 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>
Copilot AI review requested due to automatic review settings July 21, 2026 15:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment on lines 73 to 75
anchors.fill: parent

Repeater {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants