Use WidgetCache to get colors at nsLookAndFeel

NEW
Assigned to

Status

()

Core
Widget: Gtk
P3
normal
a year ago
a year ago

People

(Reporter: stransky, Assigned: stransky)

Tracking

(Depends on: 1 bug)

Trunk
x86_64
Linux
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: tpi:+)

Attachments

(1 attachment)

(Assignee)

Description

a year ago
nsLookAndFeel should use styles from WidgetCache instead of creating its own widgets. It will help to implement multiple themes needed for Bug 1158076.
(Assignee)

Updated

a year ago
Depends on: 1282753
(Assignee)

Comment 1

a year ago
We also need Bug 1282753 fixed to use comboboxes color here.
(Assignee)

Comment 2

a year ago
Created attachment 8792843 [details] [diff] [review]
patch

That's a patch which depends on the Bug 1282753 (ComboBox code update). I checked the style classes that they are still present when get by WidgetCache. WidgetCache also provides some new widget types to support text colors.
Attachment #8792843 - Flags: review?(karlt)

Updated

a year ago
Assignee: nobody → stransky
Priority: -- → P3
Whiteboard: tpi:+
Comment on attachment 8792843 [details] [diff] [review]
patch

Reusing WidgetStyleCache at least where there is an existing entry is good, thanks.

For the foreground colors on labels and the link button, the color is fetched
only once and so there may be no need to cache the widget, or even the style
context.  If and where the labels are never going to be drawn or measured, I'd
prefer the CreateStyleForWidget() approach, as used for the tooltip label.
However, tooltip labels are now measured for bug 1308936 (and so would be better off using WidgetStyleCache), so maybe other labels should be measured also, in which case using WidgetStyleCache make sense.

There are some unrelated whitespace changes, so please remove these.

MOZ_GTK_TEXTMENUITEM would be better named MOZ_GTK_MENUITEM_LABEL, for
consistency with the other names.

Is MOZ_GTK_COMBOBOX_LABEL the same as MOZ_GTK_COMBOBOX_ENTRY_TEXTAREA?

Please call GetWidget() only once on MOZ_GTK_ENTRY.

>     case eColorID__moz_buttondefault:

>+        {

Please place these opening parentheses after the case label, as in case 1 of
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style#Control_Structures
I expect that will help some editors with the indentation of the subsequent
lines.  Given the indentation of the case statements already differs from the
style guide, positioning of the closing brace is less clear.  I don't mind
whether you leave them as they are aligned with the previous statement or
align them with the case statement, as in the style guide.  (Don't realign the whole switch block to change the case statement indentation.)
Attachment #8792843 - Flags: review?(karlt)
(In reply to Martin Stránský from comment #0)
> It will help to implement multiple themes needed for Bug 1158076.

I don't think we need to support multiple themes in one process.
e10s means that each process is either chrome or content.

An adjustment to make attachment 8753289 [details] [diff] [review] work should be possible and would be much simpler.
(Assignee)

Updated

a year ago
Depends on: 1319066
(Assignee)

Updated

a year ago
Depends on: 1319075
(Assignee)

Updated

a year ago
Depends on: 1319753
(Assignee)

Updated

a year ago
Depends on: 1320686
You need to log in before you can comment on or make changes to this bug.