bitcoin-core/gui-qml

Set minimum block clock size to 200px width

GBKS opened this issue · 6 comments

GBKS commented

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

Hi @GBKS , what android device are you using?

GBKS commented

It's a Galaxy A32 5G.

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 commented

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.

@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?

@GBKS just opened the PR with your fix #385