polymorph theme feedback

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

polymorph theme feedback

Tudor Girba
Hi again,

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?

- How to control a Splitter drawing?
It looks like it does not matter what we specify in  
separatorFillStyleFor:, it is still drawn embossed.

- 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).

- How to control the menu rendering?
I would like to be able to control the fill style of the menu.

- 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.

- How to control the padding of a panel, groupbox, or tab?

- 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.

- How to control the menu close button after the menu was pinned?

- 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.

- MorphTreeMorph needs to work with Theme (e.g., in adoptPaneColor:)

- 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.

- 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.

- It is unclear what the ThemeSettings is for. What goes here and what  
goes in the Theme?

- Some icons are defined in the Theme instance variables, and some are  
defined in the ThemeIcons.

- Is it intended for the ThemeSettings to be subclassed?

- Some preferences from ThemeSettings are hardcoded. For example:  
menuShadowColor or menuTitleBorderColor.

- 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

Cheers,
Doru


--
www.tudorgirba.com

"We cannot reach the flow of things unless we let go."




_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: polymorph theme feedback

Tudor Girba
Another point: the tab button should be different from the regular  
button.

Right now, I added a hack in the button drawing that goes like this:
buttonNormalFillStyleFor: aButton
        "Return the normal button fillStyle for the given button."
       
        (aButton valueOfProperty: #noFill ifAbsent: [false]) ifTrue: [^  
SolidFillStyle color: Color transparent ].
        ^ self glamorousNormalFillStyleFor: aButton height: aButton height

And when I create the tab button, I populate the #noFill property:

        (aWin
                        newButtonFor: each
                        getState: nil
                        action: #actOn:
                        arguments: {aBrowser}
                        getEnabled: nil
                        labelForm: each icon
                        help: each title)
                        valueOfProperty: #noBorder ifAbsentPut: [true];
                        valueOfProperty: #noFill ifAbsentPut: [true];
                        yourself

Still, this is a hack :).

Cheers,
Doru


On 4 Sep 2010, at 23:25, Tudor Girba wrote:

> Hi again,
>
> 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?
>
> - How to control a Splitter drawing?
> It looks like it does not matter what we specify in  
> separatorFillStyleFor:, it is still drawn embossed.
>
> - 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).
>
> - How to control the menu rendering?
> I would like to be able to control the fill style of the menu.
>
> - 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.
>
> - How to control the padding of a panel, groupbox, or tab?
>
> - 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.
>
> - How to control the menu close button after the menu was pinned?
>
> - 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.
>
> - MorphTreeMorph needs to work with Theme (e.g., in adoptPaneColor:)
>
> - 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.
>
> - 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.
>
> - It is unclear what the ThemeSettings is for. What goes here and  
> what goes in the Theme?
>
> - Some icons are defined in the Theme instance variables, and some  
> are defined in the ThemeIcons.
>
> - Is it intended for the ThemeSettings to be subclassed?
>
> - Some preferences from ThemeSettings are hardcoded. For example:  
> menuShadowColor or menuTitleBorderColor.
>
> - 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
>
> Cheers,
> Doru
>
>
> --
> www.tudorgirba.com
>
> "We cannot reach the flow of things unless we let go."
>
>
>

--
www.tudorgirba.com

"Obvious things are difficult to teach."




_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: polymorph theme feedback

Gary Chambers-4
In reply to this post by Tudor Girba
Hi Doru, some help...

Regards, Gary


----- Original Message -----
From: "Tudor Girba" <[hidden email]>
To: "pharo-project Development" <[hidden email]>
Sent: Saturday, September 04, 2010 10:25 PM
Subject: [Pharo-project] polymorph theme feedback


> Hi again,
>
> 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)

> - 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.

> - 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).


> - How to control the padding of a panel, groupbox, or tab?

Standard means of #layoutInset:, #cellInset: etc.

> - 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.

> - 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 ;-) )

> - 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.

> - 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).

> - 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...

>
> - Is it intended for the ThemeSettings to be subclassed?

Yes, see VistaryThemeIcons.

> - Some preferences from ThemeSettings are hardcoded. For example:
> menuShadowColor or menuTitleBorderColor.

Feel free to improve.

> - 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.

>
> Cheers,
> Doru
>
>
> --
> www.tudorgirba.com
>
> "We cannot reach the flow of things unless we let go."
>
>
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project 


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: polymorph theme feedback

Tudor Girba
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."


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project