Ticket #11220 (closed enhancement: fixed)

Opened 12 months ago

Last modified 12 months ago

mono theme: Don't cross out a disabled wxStaticText

Reported by: alarsen Owned by:
Priority: normal Milestone: 2.9.1
Component: wxUniv (any port) Version: 2.9-svn
Keywords: mono Cc:
Blocked By: Patch: yes
Blocking:

Description

The mono theme shows a disabled wxButton by crossing it out.
Unfortunately, the same happens to disabled wxStaticText which looks really ugly: When a modal dialogue is shown, (partly) visible wxStaticText labels on the underlying wxFrame are crossed out.

The attached patch disables the crossing completely, since the renderer does not distinguish between wxButton and wxStaticText (wxStdRenderer::DrawLabel() calls wxMonoRenderer::DrawButtonLabel() to render the label)

Attachments

wxUnivMonoDisable.patch download (1.2 KB) - added by alarsen 12 months ago.

Change History

Changed 12 months ago by alarsen

follow-up: ↓ 2   Changed 12 months ago by vadz

  • status changed from new to infoneeded_new

We could override (virtual) DrawLabel() in wxMonoRenderer to distinguish between drawing generic labels and buttons, so we could easily keep the current way of showing the disabled buttons. This doesn't change the fact that it is ugly though so if you think it's really preferable to not do it like this even for buttons, I'd follow your opinion as you have more experience with making UIs using this theme. So just please let me know what do you think: should we keep the buttons crossed or not?

Thanks!

in reply to: ↑ 1 ; follow-up: ↓ 3   Changed 12 months ago by alarsen

  • owner vadz deleted
  • status changed from infoneeded_new to new

Replying to vadz:

please let me know what do you think: should we keep the buttons crossed or not?

Being able to distinguish between enabled and disabled buttons is a Good Thing(tm), so please keep crossing them out (I don't have any better idea how to show the state).
It's just that it doesn't make much sense for wxStaticText.

(BTW: Neither wxMSW nor wxGTK changes the visual appearance of buttons when a modal dialogue pops up, only wxUniv does)

in reply to: ↑ 2   Changed 12 months ago by vadz

Replying to alarsen:

Replying to vadz:

please let me know what do you think: should we keep the buttons crossed or not?


Being able to distinguish between enabled and disabled buttons is a Good Thing(tm), so please keep crossing them out (I don't have any better idea how to show the state).

Ok, will commit soon (took me longer than I thought because wxX11 with which I tested this turned out to be broken in the latest trunk so I had to fix it first).

It's just that it doesn't make much sense for wxStaticText.

(BTW: Neither wxMSW nor wxGTK changes the visual appearance of buttons when a modal dialogue pops up, only wxUniv does)

This is because wxUniv lacks real implementation of modal dialogs and so emulates it by disabling all the other windows. This is bad but unfortunately it's not something really trivial to fix.

  Changed 12 months ago by VZ

(In [62004]) Add a separate wxControlRenderer::DrawButtonLabel() too.

wxControlRenderer::DrawLabel() was used by both wxStaticText and wxButton but
their labels may need to be drawn differently and wxRenderer does have
different DrawLabel() and DrawButtonLabel() to do it. Now also add a separate
method for the buttons to wxControlRenderer.

See #11220.

  Changed 12 months ago by VZ

  • status changed from new to closed
  • resolution set to fixed

(In [62005]) Override DrawLabel() to avoid crossing out disabled labels in mono theme.

DrawButtonLabel() crosses out the buttons to indicate that they are disabled
(for lack of any other options in mono renderer) but this looks really bad for
the labels, so don't do it.

Closes #11220.

Note: See TracTickets for help on using tickets.