dolphinsmalltalk / Dolphin

Dolphin Smalltalk Core Image
MIT License
301 stars 58 forks source link

Method mode option "instance" in ClassBrowser/SystemBrowser cut off when using larger font (Dolphin 7.1.24) #1178

Closed bernhardkohlhaas closed 1 year ago

bernhardkohlhaas commented 1 year ago

Is your feature request related to a problem? Please describe. Since my eyesight is not the greatest, I have enlarged the default fonts for text, list, and tree controls to 12 points in my development image with the following script:

(OrderedCollection new
   add: SmalltalkSystem current;                " Default font in list and tree controls"
   add: SmalltalkSystem current workspaceClass; "Default font for workspaces (text controls)"
   yourself)
     do: [: option |     | currentFont newFont |
          currentFont := option defaultFont.
          newFont := Font name: currentFont name pointSize: 12.
          newFont ifNotNil: [:value | option defaultFont: newFont ].

This works great, except for "mode" pane in the class browser (as well as other tools like the system browser), there the word "instance" is wrapped over, since the choice button for "class" is very close. Screenshot with issue highlighted: image

This is admittedly a small issue and I have fixed it in my own development image by editing the views of all subclasses of ClassBrowserAbstract, but it might be nice to have a solution in the standard image as well.

Describe the solution you'd like Since there is enough screen real estate for the radio button control for "method /class", giving more width to the "method option" would simply shift the "class" option to the right. This could easily be done by increasing the x-extent of the view element instanceMode to something higher than 65. ( "80" works for 12 point size fonts, but one might as well give it a bit more width, since the screen real estate is there ).

As more sophisticated solution (if even possible in the first place) would be to determine the x-extent of the instanceMode view element dynamically on the extent it actually needs (by having some sort of preferredExtent perhaps?).

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context View structure for the ClassBrowserShell: image

I understand that it is probably not possible to find a general solution for all cutoff issues, when using larger fonts, but here the fix actually seems very simple and I haven't encountered any other issues so far.

If there is any interest in having this changed in the standard image, I'd be happy to provide the change, however I am currently only using the 7.1 version of Dolphin (since a pre-compiled VM for 8.0 is not yet available apparently). I assuming though that this would be a change for Dolphin 8.0 (since I can fix it myself in my own image for the time being), so I can't provide that at the moment.

bernhardkohlhaas commented 1 year ago

Thank you, @blairmcg , the fix works great. I pulled the 7.1 branch and tested the Class Browser, System Browser and Environment Browser with font sizes of 12 and 16 and just for giggles with font size 20 as well.

Feel free to close this, whenever you are ready.