Skip to content

RemorseTimer: Limit content to a square so the gauge stays square#114

Open
moWerk wants to merge 1 commit into
AsteroidOS:masterfrom
moWerk:remorsetimer-drop-dims
Open

RemorseTimer: Limit content to a square so the gauge stays square#114
moWerk wants to merge 1 commit into
AsteroidOS:masterfrom
moWerk:remorsetimer-drop-dims

Conversation

@moWerk

@moWerk moWerk commented Jul 5, 2026

Copy link
Copy Markdown
Member

On beluga the remorse countdown gauge was stretched into an oval. This wraps the arc + labels in a centered Math.min(width, height) square and sizes them against that square instead of te former Dims, so it renders as a proper circle again.

It drops Dims from this component, which is the direction Dodo outlined in #44: Dims assumes fullscreen and breaks as soon as a component is sized any other way (e.g. the watchface/settings preview).

Tested on beluga.

Fixes: #96

Comment thread src/controls/qml/RemorseTimer.qml Outdated
Item {
id: gaugeArea
anchors.centerIn: parent
height: Math.min(parent.width, parent.height)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should that be parent.height + flatTireHeight?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ow, good catch. Thanks for checking thoroughly.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah I'm surprised you don't have to use DeviceSpec. as prefix, did you test that it works like that?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ugh, got me, i was not testing the last pushed before suspending.
Correcting and testing soon.

…a circle

On non-square screens the countdown gauge got stretched into an oval.
This wraps the arc and labels in a centered Math.min(width, height) square so it stays circular also when the component is not fullscreen.
Re AsteroidOS#44.
@moWerk
moWerk force-pushed the remorsetimer-drop-dims branch from 37e02ae to 4bc9b21 Compare July 5, 2026 21:15
// parent is not full-screen.
Item {
id: gaugeArea
anchors.centerIn: parent

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Actually now that I think about it some more, if we have a 400x300 screen (flat tire of 100px) this would create a 400x400 square and then center it onto a 400x300 screen so the square would be offset by 50 pixels out of screen.

When it comes to the flat tire we should use a different method. Iirc we typically use the anchors offsets for this.

Anyway, this is hairy and complex enough that I feel qml-asteroid should provide abstractions for all these layout cases. This needs extra thinking (and documentation) but there are UI patterns that keep popping up to account for round/boxy, flattire/none, rectangular/square. Maybe we would need a clever Layout item that has a few attributes like "ignoreFlatTire" or "fitAsSquareInCircles" or "fitAsSquareInRectangle" and what not (those proposed attribute names are bad but you get the idea...) then we should be able to rationalize all of those weird edge cases and avoid having to think about those extra offsets ever again. I feel that we keep getting them wrong over and over again.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good discovery. Happy now my confusion served as a pointer, ha.
Shall we move this into an issue and involve @dodoradio since he worked on that a lot already?
I am eager to act on this swiftly tbh.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sure :)

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.

RemorseTimer is oval on beluga

2 participants