Thanks Gary. It would be great to get some things moving in this area. I will try to do some bits as I go along. Some comments inlined.
Hi Doru, some help...
Regards, Gary
While working on the Glamorous Theme, I basically had to learn the design of polymorph and or the theme system. I think the structure is pretty nice, but it still requires work to offer more flexibility. I list here some of the notes I took. I would be happy to provide more feedback and even work with someone on this:
- How to control the rounded/square corners of the droplist, normal list and text boxes?
#textEntryCornerStyleIn: should work for (single line) text fields and editable drop lists. Could do with an equivalent for (multi-line) text editors and lists (currently handled by subclassing the #newXYZ methods when controls are created via a builder).
- How to control a Splitter drawing? It looks like it does not matter what we specify in separatorFillStyleFor:, it is still drawn embossed.
Splitters are not the same as separators (SeparatorMorph). Their appearance can be controlled by #splitterNormalFillStyleFor: and #splitterPressedFillStyleFor: (likewise, menu separators are not separators... might be nice to unify these things)
Sorry, I meant separators. I managed to get Splitters to work properly, but the separators are still drawn embossed and with a hardcoded width.
- How to control the menu title? I would like to be able to control the color of the title of the menu (the one that appears for example in the world menu).
#menuTitleColorFor: will do for the title background... currently there is no way of specifying the text colour. MenuMorph could do with a LOT more refactoring, really.
Right.
- How to control the menu rendering? I would like to be able to control the fill style of the menu.
#menuFillStyleFor: should work for that.
- How to control the color of the PanelMorph when the Window is not active? Right now it just gets lighter. I would like to be able to control it, but it looks impossible from the Theme.
Will need some work (#panelFillStyleFor: perhaps, taking the #isActive of the window (if any) into account).
As far as I see, this method does not exist. It should be created, right? But, I am still not sure where the lighter color magic happens.
- How to control the padding of a panel, groupbox, or tab?
Standard means of #layoutInset:, #cellInset: etc.
Thanks.
- How to control the space between buttons in a toolbar?
- How to control the menu button in a toolbar? When there is a button with a menu in a toolbar, a default button is created with a gradient that cannot be controlled from the theme.
Try #menuItemInDockingBarSelectedFillStyleFor:
- How to control the menu close button after the menu was pinned?
Not sure what you mean. As said above, MenuMorph would benefit from refactoring anyway.
When you pin a menu with title (like the world menu), it should behave like a normal window, and when I switch the focus away, the close button should be drawn as disabled, like for the normal window.
- How to control the display of a splitter in a menu? The MenuLineMorph hardcodes the minWidth and minHeight. It should be delegated to the Theme.
See refactoring/unification above.
- MorphTreeMorph needs to work with Theme (e.g., in adoptPaneColor:)
Yep, go for it (I'm sure Alain wouldn't mind ;-) )
I will try some things :).
- How to control the arrows of scrollbars? In particular, we would need to be able to define the forms in the theme, not just the vertices.
Indeed, a hangover from the old days.
I thought so.
- The settings for the menu rendering seem to affect the rendering of the progress bars. There should be separate entries for the two in the Theme.
Indeed.
- It is unclear what the ThemeSettings is for. What goes here and what goes in the Theme?
Ideally, user customisable stuff would go there (may be tied with Settings browser).
I am not sure. I think we should limit as much as possible these settings because they are too expensive (from the point of view of complexity) with respect to the limited benefits they provide. I mean, I guess that in practice only a handful of people will ever change anything in the settings.
- Some icons are defined in the Theme instance variables, and some are defined in the ThemeIcons.
Typically only "application" style icons are in ThemeIcons, rather than bits for controls. May be better to put all in ThemeIcons...
I think so. Right now, I put them in MenuIcons, but I will create a subclass of ThemeIcons and add them there.
- Is it intended for the ThemeSettings to be subclassed?
Yes, see VistaryThemeIcons.
Ok.
- Some preferences from ThemeSettings are hardcoded. For example: menuShadowColor or menuTitleBorderColor.
Feel free to improve.
I will try :).
- How to control the tick of a checkbox or of a radio button? Right now, there is a tick that gets drawn even if I specify the radioButtonSelectedForm or checkboxSelectedForm
See #checkboxMarkerForm and #radioButtonMarkerForm.
Thanks, I somehow missed these :) Cheers, Doru -- www.tudorgirba.com "It's not how it is, it is how we see it."