Closed Bug 1168578 Opened 9 years ago Closed 9 years ago

GTK3: Checkboxes do not indicate hover or pressed states

Categories

(Core :: Widget: Gtk, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla41
Tracking Status
firefox41 --- fixed

People

(Reporter: acomminos, Assigned: acomminos)

References

Details

Attachments

(1 file)

Using GTK 3.14, checkboxes in forms do not show any visual indication that they are being pressed or hovered over.

See gtk3-widget-factory for correct behaviour.
The proper state flags to use would be GTK_STATE_FLAG_PRELIGHT for hover and GTK_STATE_FLAG_ACTIVE for being pressed.

As noted in bug 1073117, check boxes had no active state before 3.14, where ACTIVE means checked. Since 3.14, check boxes can be active, and the checked state has been moved to CHECKED.
This works as an unintrusive solution, but it might be worth moving the widget state setup to nsNativeThemeGTK instead.

Any thoughts would be appreciated; thanks!
Attachment #8611472 - Flags: review?(karlt)
Comment on attachment 8611472 [details] [diff] [review]
Use widget state in GTK3 toggles' style context.

This looks good to me, thanks.

(In reply to Andrew Comminos [:acomminos] from comment #2)
> but it might be worth moving the
> widget state setup to nsNativeThemeGTK instead.

I'm not sure.  If it means lots of special cases in nsNativeThemeGTK it wouldn't be a win.

> Any thoughts would be appreciated; thanks!

I wonder why we have both GtkWidgetState::depressed and the selected parameter.  I don't know what distinction there is between those, if any.
Attachment #8611472 - Flags: review?(karlt) → review+
Try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=266985552c95

(In reply to Karl Tomlinson (ni?:karlt) from comment #3)
> I wonder why we have both GtkWidgetState::depressed and the selected
> parameter.  I don't know what distinction there is between those, if any.

They're inconsistent at the moment, but GtkWidgetState::depressed appears to be intended to describe activated toggle-able widgets. Currently the selected state is fetched from a 'flags' argument set in nsNativeThemeGTK::GetGtkWidgetAndState instead.
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/73103204e24e
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: