Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set minimum block clock size to 200px width #382

Closed
1 task done
GBKS opened this issue Dec 7, 2023 · 6 comments · Fixed by #385
Closed
1 task done

Set minimum block clock size to 200px width #382

GBKS opened this issue Dec 7, 2023 · 6 comments · Fixed by #385

Comments

@GBKS
Copy link
Contributor

GBKS commented Dec 7, 2023

Issues, reports or feature requests related to the GUI should be opened directly on the GUI repo

  • I still think this issue should be opened here

Report

On my Android phone, the clock is too small. Minimum size should be 200px width. It is ~131px wide.

image

@D33r-Gee
Copy link
Contributor

Hi @GBKS , what android device are you using?

@GBKS
Copy link
Contributor Author

GBKS commented Dec 18, 2023

It's a Galaxy A32 5G.

@D33r-Gee
Copy link
Contributor

It's a Galaxy A32 5G.

Great I will test with a virtual device...

Also to make sure I'm able to reproduce it, which build are you using? Latest on main branch?

@GBKS
Copy link
Contributor Author

GBKS commented Dec 19, 2023

The math that defines the width is located here.

Math.min((root.parentWidth * dial.scale), (root.parentHeight * dial.scale))

The Galaxy A32 has a logical resolution of 360x800. The dial scale is either 1/2 or 1/3. parentWidth is set here as the parent.width - 40. So that puts the width at (360-40)/2 = 160 or (360-40)/3 = ~107. Not exactly the ~131 I roughly measured in my screenshot above, but both values are below the 200 minimum that we want. So maybe we change the line above to this?

Math.max(200, Math.min((root.parentWidth * dial.scale), (root.parentHeight * dial.scale)))

But that misses the scenario where the clock is shown in a widget. So you really don't want to go smaller than the screen width minus some padding. So maybe something like this?

Math.max(Math.min(200, root.parentWidth - 30), Math.min((root.parentWidth * dial.scale), (root.parentHeight * dial.scale)))

I am probably missing something, since my math above doesn't totally add up with my screenshot measurement.

Thanks for looking into this. I believe I am on the latest main branch.

@D33r-Gee
Copy link
Contributor

D33r-Gee commented Dec 19, 2023

@GBKS, thanks for your comment above, made my life very easy :)

build and tested with the change you suggested:

Math.max(Math.min(200, root.parentWidth - 30), Math.min((root.parentWidth * dial.scale), (root.parentHeight * dial.scale)))

Results below:

Before change (this a screenshot of a Galaxy A32 5G virtual device):

Screenshot_1703024712

this is after the change:
Screenshot_1703024560

I'll go ahead a start a PR, unless there's more to consider?

@D33r-Gee
Copy link
Contributor

@GBKS just opened the PR with your fix #385

@hebasto hebasto closed this as completed in 533a9fc Jan 1, 2024
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 a pull request may close this issue.

2 participants