HaikuArchives / FontBoy

A small application to show your installed fonts in Haiku
Other
2 stars 10 forks source link

FontBoy: get initial window height and horizontal scrollbar right #30

Closed owenca closed 6 years ago

owenca commented 6 years ago

Fixes #18 and #29

humdingerb commented 6 years ago

I didn't see an obvious issue with the window before this change. But with these changes, after removing the FontBoy_prefs, I get a very tall window that's higher than the screen and can't be vertically resized...

owenca commented 6 years ago

Here is the "After" screenshot, with ~/config/settings/Frontboy_prefs removed first:

screen shot 2018-01-01 at 12 12 10 am

owenca commented 6 years ago

The "Before" screenshot is here.

humdingerb commented 6 years ago

I have over 200 ttf fonts (most different styles of a font family). This is the window height I got with hey FontBoy get Frame of Window 0: 5123. That's too high. :)

owenca commented 6 years ago

I see. How many rows did you have? I need to limit the number of rows or do something about it.

janus2 commented 6 years ago

I have a huge tall window and the space at the bottom is still there. 4 columns with one with 4 elements. You can't use the rows as a measure because the user can change the font size in the settings and I haven't check the code but I am pretty sure the system menu font size matter.

owenca commented 6 years ago

If you are talking about the menu bar, then it's accounted for. The issue is probably related to the number of rows being calculated twice by the ListView and/or its base class. Will dig more into this later. Closing it for now...

janus2 commented 6 years ago

Yes I'am talking about the menu bar and it is a problem...

Menu 12pt

menu12pt

Menu 24pt

menu24pt

owenca commented 6 years ago

What you saw is the symptom, not the cause. ;) Like I said, the height of the menu bar was accounted for.

janus2 commented 6 years ago

Do you mean in ListWindow.cpp:49 fontframe.top = menu_bar->Bounds().bottom +1.0; This is only to compute the frame of the listview in relation to the window... The resizing you are talking doesn't happen very often the majority of the time the size of the window is the saved one. So, in this case, I have resized the window to fit the font matrix with the menubar with font sets to 12pt. Close and reopen the window with a bigger font. Now the size of the window is the same but the frame of the list is a little smaller we miss a row that is the cause for the area under the fonts. Hope this clarifies.