Opened 8 years ago

Last modified 8 years ago

#14522 confirmed enhancement

Use different appearance for disabled ribbon bar labels

Reported by: wxBen Owned by:
Priority: low Milestone:
Component: GUI-all Version: stable-latest
Keywords: ribbonbar disabled label color colour Cc:
Blocked By: Blocking:
Patch: no

Description

The ribbon bar has an existing label colour associated with wxRIBBON_ART_BUTTON_BAR_LABEL_COLOUR. This patch adds wxRIBBON_ART_BUTTON_BAR_LABEL_DISABLED_COLOUR which allows a ribbonbar user to specify a different text colour to be used for text associated with disabled toolbar buttons.

Why? If disabled bitmaps are not provided, the ribbon bar automatically creates them by calling ConvertToGreyScale. Nice, but if the bitmaps are not very colourful to start with, it is not clear which ones are disabled and which ones not. The user can create a disabled bitmap themselves by calling ConvertToDisabled, which makes disabled bitmaps very clearly disabled. But the disabled buttons still get the same black colour for their labels, even when disabled. This patch fixes that and allows disabled buttons to also have disabled looking colour labels.

The functionality is demonstrated in the ribbonbar sample.

The behavior defaults to the old behavior, which is to use the same text colour for the normal and disabled labels. So existing applications are unaffected, but now have the option of using a different disabled label colour for disabled items.

Attachments (1)

RBDisabledTextColour.patch download (6.0 KB) - added by wxBen 8 years ago.
RBDisabledTextColour.patch

Download all attachments as: .zip

Change History (3)

Changed 8 years ago by wxBen

RBDisabledTextColour.patch

comment:1 Changed 8 years ago by wxBen

  • Version set to 2.9-svn

comment:2 Changed 8 years ago by vadz

  • Patch unset
  • Priority changed from normal to low
  • Status changed from new to confirmed
  • Summary changed from Added disabled label colour to the ribbonbar to Use different appearance for disabled ribbon bar labels

I agree that the text should indicate that a tool is disabled but I don't think it should be done by changing its colour. Instead, we should do the same thing that wxStdRenderer::DrawButtonLabel() in src/univ/stdrend.cpp does in wxCONTROL_DISABLED case and draw it greyed out.

We probably need to put this somewhere in common code, probably wxRendererNative::DrawLabel() as I think the exact way of drawing a disabled label might vary among platforms and having it there would allow us to respect each platform look and feel even if have only the single implementation for now.

Could you please rework your patch to do it like this? TIA!

Note: See TracTickets for help on using tickets.