SVGButton and enabled_when

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

SVGButton and enabled_when

Brad Buran
When I display a disabled SVGButton in my view, it appears the same as an enabled SVGButton.  Is there any way to get the button to appear greyed out or provide some hint that it's not active at the moment?

Brad

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: SVGButton and enabled_when

bryce hendrix-2
Brad Buran wrote:
> When I display a disabled SVGButton in my view, it appears the same as
> an enabled SVGButton.  Is there any way to get the button to appear
> greyed out or provide some hint that it's not active at the moment?

Its probably an oversight, I'll fix it today.

Bryce
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: SVGButton and enabled_when

bryce hendrix-2
bryce hendrix wrote:
Brad Buran wrote:
  
When I display a disabled SVGButton in my view, it appears the same as 
an enabled SVGButton.  Is there any way to get the button to appear 
greyed out or provide some hint that it's not active at the moment?
    

Its probably an oversight, I'll fix it today.
  

Its implemented in changeset 25404. I also updated the example so the paste button is disabled unless the clipboard contains something. I drew a rectangle on top of the icon using an alpha faded background color. It seems to look okay, but let me know how it looks in a real app.

Bryce

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: SVGButton and enabled_when

Brad Buran
This works extremely well, thanks!  I think it looks fine: most applications seem to change icons to greyscale when they are disabled but this would probably be harder to implement.

Attached is a PNG of how I'm using it: only the "apply" button is enabled.  All the others are disabled.  I know the icons aren't ideal but it's been difficult to find a set of icons with no more than two gradients.

Brad

On Tue, Mar 16, 2010 at 6:25 PM, bryce hendrix <[hidden email]> wrote:
bryce hendrix wrote:
Brad Buran wrote:
  
When I display a disabled SVGButton in my view, it appears the same as 
an enabled SVGButton.  Is there any way to get the button to appear 
greyed out or provide some hint that it's not active at the moment?
    
Its probably an oversight, I'll fix it today.
  

Its implemented in changeset 25404. I also updated the example so the paste button is disabled unless the clipboard contains something. I drew a rectangle on top of the icon using an alpha faded background color. It seems to look okay, but let me know how it looks in a real app.

Bryce

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev



_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev

toolbar.png (42K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SVGButton and enabled_when

bryce hendrix-2
Brad Buran wrote:
> This works extremely well, thanks!  I think it looks fine: most
> applications seem to change icons to greyscale when they are disabled
> but this would probably be harder to implement.

A different solution I had considered was using one of wx's patterns to
fill with, but was afraid wx would only make things uglier (as is often
the case)...

>
> Attached is a PNG of how I'm using it: only the "apply" button is
> enabled.  All the others are disabled.  I know the icons aren't ideal
> but it's been difficult to find a set of icons with no more than two
> gradients.

I understand the multi-stop gradient pain. What I usually do is start
with the Oxygyen icons, and if they don't look okay, open them in
inkscape & start removing gradients until the icon looks acceptable.

If you can use Qt, the ButtonEditor uses the Qt SVG renderer, which is
much, much better.

I've also considered re-writing the wx ButtonEditor to use the Kiva
backend renderer which does support multi-stop gradients, but still has
issues with some radial gradients. The reason I haven't gone that route
is it creates a larger set of dependencies on apps that may currently
only depend on Traits, TraitsGui and TraitsBackendWx.

Bryce
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: SVGButton and enabled_when

Brad Buran


On Thu, Mar 18, 2010 at 11:18 AM, bryce hendrix <[hidden email]> wrote:
I understand the multi-stop gradient pain. What I usually do is start
with the Oxygyen icons, and if they don't look okay, open them in
inkscape & start removing gradients until the icon looks acceptable.

If you can use Qt, the ButtonEditor uses the Qt SVG renderer, which is
much, much better.

I tried Qt.  Everything looks great.  Thanks for the tip!  The toggle and toggle_filename state don't seem to be working for Qt though.  Have they been implemented?

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: SVGButton and enabled_when

bryce hendrix-2
Brad Buran wrote:


On Thu, Mar 18, 2010 at 11:18 AM, bryce hendrix <[hidden email]> wrote:
I understand the multi-stop gradient pain. What I usually do is start
with the Oxygyen icons, and if they don't look okay, open them in
inkscape & start removing gradients until the icon looks acceptable.

If you can use Qt, the ButtonEditor uses the Qt SVG renderer, which is
much, much better.

I tried Qt.  Everything looks great.  Thanks for the tip!  The toggle and toggle_filename state don't seem to be working for Qt though.  Have they been implemented?

Probably not, though patches are welcome :)

Bryce

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: SVGButton and enabled_when

Brad Buran
Please disregard ... I just tested this on a clean install of ETS 3.4 and it is working :)

Brad

On Thu, Mar 18, 2010 at 6:17 PM, bryce hendrix <[hidden email]> wrote:
Brad Buran wrote:


On Thu, Mar 18, 2010 at 11:18 AM, bryce hendrix <[hidden email]> wrote:
I understand the multi-stop gradient pain. What I usually do is start
with the Oxygyen icons, and if they don't look okay, open them in
inkscape & start removing gradients until the icon looks acceptable.

If you can use Qt, the ButtonEditor uses the Qt SVG renderer, which is
much, much better.

I tried Qt.  Everything looks great.  Thanks for the tip!  The toggle and toggle_filename state don't seem to be working for Qt though.  Have they been implemented?

Probably not, though patches are welcome :)

Bryce

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev



_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: SVGButton and enabled_when

Brad Buran
Speaking of patches, I made a change to SVGButton to add an option to change the label as well in the toggle state.  For the sake of completeness I included an option to change the tooltip as well.  Perhaps you could incorporate this?  Attached is the patch file and a zip containing a brief demo.  Buttons in the zip file are from the Oxygen set.

Brad

On Thu, Mar 18, 2010 at 6:26 PM, Brad Buran <[hidden email]> wrote:
Please disregard ... I just tested this on a clean install of ETS 3.4 and it is working :)

Brad

On Thu, Mar 18, 2010 at 6:17 PM, bryce hendrix <[hidden email]> wrote:
Brad Buran wrote:


On Thu, Mar 18, 2010 at 11:18 AM, bryce hendrix <[hidden email]> wrote:
I understand the multi-stop gradient pain. What I usually do is start
with the Oxygyen icons, and if they don't look okay, open them in
inkscape & start removing gradients until the icon looks acceptable.

If you can use Qt, the ButtonEditor uses the Qt SVG renderer, which is
much, much better.

I tried Qt.  Everything looks great.  Thanks for the tip!  The toggle and toggle_filename state don't seem to be working for Qt though.  Have they been implemented?

Probably not, though patches are welcome :)

Bryce

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev




_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev

svg_button_toggle_label.patch (7K) Download Attachment
toggle_demo.zip (13K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SVGButton and enabled_when

bryce hendrix-2
Brad Buran wrote:
> Speaking of patches, I made a change to SVGButton to add an option to
> change the label as well in the toggle state.  For the sake of
> completeness I included an option to change the tooltip as well.  
> Perhaps you could incorporate this?  Attached is the patch file and a
> zip containing a brief demo.  Buttons in the zip file are from the
> Oxygen set.
>

I've committed a variation of the patch and added your demo to the
examples. Thanks!

Bryce

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev