AndyObtiva / glimmer-dsl-tk

Glimmer DSL for Tk (Ruby Tk Desktop Development GUI Library)
MIT License
30 stars 5 forks source link

hello_contextual_menu.rb #10

Closed rubyFeedback closed 2 years ago

rubyFeedback commented 2 years ago

I just tested gimmer-dsl-tk/samples/hello/hello_contextual_menu.rb

I have a few small suggestions to make; not sure if these are very useful but small suggestions are good - less work. :D

(1) When clicking on a flag, for a country, perhaps there can be output shown e. g. "german" or "mexican" or something, just to show how to also display the current selection?

(2) Is it possible to start the main widget in the center or top left? I had it start at the bottom left. But I guess this depends on the user, so not sure ... maybe "center" would be better.

(3) Can the font be a bit smaller? Not much just a bit. Normally I like large fonts but it seemed almost a huge font :D (Actually I noticed the last entry changes the font size ... so perhaps (3) is a redundant suggestion since the user can change it anyway)

(4) In country, would it be possible to left-pad the text a bit? Right now the string is very close to the image; let me show an example at imgur what I mean:

https://i.imgur.com/h4l3aLO.png

Don't mind the black background and other coloured font-text, that is just KDE konsole. What I refer to is e. g. the flag of Finland and then Finland - could there be a bit more padding between the image and the text/label?

Anyway, these are not hugely example, I am just randomly stalking for activity really ... :D

AndyObtiva commented 2 years ago

Thank you for the feedback.

1) Done in v0.0.51. I updated Hello, Contextual Menu! & Hello, Menu Bar! to display a message box upon selecting a Language or Country. Keep in mind though that even without a message box, you could tell what happened upon selecting a Language or Country by re-opening menu and seeing the selected Language/Country (has a dot or checkmark next to it depending on OS/Theme)

2) Done in v0.0.51. Windows (root/toplevel) now start in the center of the screen by default (unless x/y attributes are specified to move window elsewhere) [see Hello, Contextual Menu! centered in screenshot below]. By the way, that is the same default that Glimmer DSL for SWT has. It just took me a while to apply in Glimmer DSL for Tk. Thank you for reminding me to do it.

Screen Shot 2021-12-12 at 10 22 08 PM

3) About the font, I would not care to change because this is only meant as a demo for menus. The label font is irrelevant and is intentionally exagerated to emphasize the demo, not to look good. Looking good would be pointless in this case. As such, i don't see a benefit in changing it.

4) About the country, it is only using the standard Tk compound image/text option in menu item, and Tk does not offer any configuration of its look beyond that. One nice thing about desktop applications is that they have common conventions and a specific repeatable predictable look that makes them easier to use than web apps for the average user, and makes them a lot quicker to develop. So, I wouldn't try to customize the look too much beyond what the standard toolkit provides (except in perhaps very rare scenarios that demand pixel-perfect canvas graphics)

In any case, this is only a minor thing caused by the Linux 'clam' theme. For example, it looks perfectly fine with enough spacing on Mac:

Screen Shot 2021-12-12 at 9 47 12 PM

As such, this is not a Glimmer DSL for Tk issue, and you may report directly to the Tcl/Tk folks if you want to get them to improve the Linux 'clam' theme. In the meantime, you could try other Linux themes, like 'alt' by running ::Tk::Tile::Style.theme_use 'alt' (though in my experience 'clam' looks best on Linux, albeit not perfect). You may list themes in girb with puts ::Tk::Tile::Style.theme_names

Cheers.