Closed
Bug 1259433
Opened 9 years ago
Closed 9 years ago
remove gtk_widget_style_get() from gtk3drawing
Categories
(Core :: Widget: Gtk, defect)
Tracking
()
RESOLVED
FIXED
mozilla48
Tracking | Status | |
---|---|---|
firefox48 | --- | fixed |
People
(Reporter: stransky, Unassigned)
References
Details
Attachments
(1 file, 2 obsolete files)
24.90 KB,
patch
|
Details | Diff | Splinter Review |
Follow up from Bug 1234158 comment 26
This patch replaces gtk_widget_style_get() with gtk_style_context_get_style() for all widgets in gtk3drawing.
From my testing there's no regression in appearance. I suppose to check-in this patch to nightly as a test for upcoming changes in Bug 1234158.
If there's no regression we can replace the widgets here with styles.
Reporter | ||
Comment 1•9 years ago
|
||
Attachment #8734349 -
Flags: review?(karlt)
Comment 2•9 years ago
|
||
Comment on attachment 8734349 [details] [diff] [review]
patch
>+ gtk_style_context_get_style(gtk_widget_get_style_context(scrollbar),
>+ "arrow-scaling", &arrow_scaling, NULL);
>
> gdouble arrow_size = MIN(rect->width, rect->height) * arrow_scaling;
> arrow_rect.x = rect->x + (rect->width - arrow_size) / 2;
> arrow_rect.y = rect->y + (rect->height - arrow_size) / 2;
>
> if (state_flags & GTK_STATE_FLAG_ACTIVE) {
>- gtk_widget_style_get(scrollbar,
>- "arrow-displacement-x", &arrow_displacement_x,
>- "arrow-displacement-y", &arrow_displacement_y,
>- NULL);
>+ gtk_style_context_get_style(gtk_widget_get_style_context(scrollbar),
>+ "arrow-displacement-x", &arrow_displacement_x,
>+ "arrow-displacement-y", &arrow_displacement_y,
>+ NULL);
This function already has the |style| variable with the result of
gtk_widget_get_style_context(scrollbar), so please use that instead of calling
gtk_widget_get_style_context() each time.
> style = gtk_widget_get_style_context(gComboBoxSeparatorWidget);
>+ gtk_style_context_get_style(gtk_widget_get_style_context(gComboBoxSeparatorWidget),
>+ "wide-separators", &wide_separators,
>+ "separator-width", &separator_width,
>+ NULL);
> style = gtk_widget_get_style_context(gTabWidget);
>+ gtk_style_context_get_style(gtk_widget_get_style_context(gTabWidget),
>+ "initial-gap", &initial_gap, NULL);
> gtk_style_context_add_class(style, GTK_STYLE_CLASS_SEPARATOR);
>+ gtk_style_context_get_style(gtk_widget_get_style_context(gMenuSeparatorWidget),
>+ "wide-separators", &wide_separators,
>+ "separator-height", &separator_height,
>+ NULL);
>+ gtk_style_context_get_style(gtk_widget_get_style_context(gCheckMenuItemWidget),
>+ "indicator-size", &indicator_size,
>+ "horizontal-padding", &horizontal_padding,
>+ NULL);
>
> style = gtk_widget_get_style_context(gCheckMenuItemWidget);
>+ gtk_style_context_get_style(gtk_widget_get_style_context(gComboBoxSeparatorWidget),
>+ "wide-separators", &wide_separators,
>+ "separator-width", &separator_width,
>+ NULL);
>
> if (!wide_separators) {
> style = gtk_widget_get_style_context(gComboBoxSeparatorWidget);
> style = gtk_widget_get_style_context(gTabWidget);
>+ gtk_style_context_get_style(gtk_widget_get_style_context (gTabWidget),
>+ "tab-curvature", &tab_curvature, NULL);
> *left += tab_curvature;
> *right += tab_curvature;
>
> if (flags & MOZ_GTK_TAB_FIRST) {
> int initial_gap;
>+ gtk_style_context_get_style(gtk_widget_get_style_context(gTabWidget),
>+ "initial-gap", &initial_gap, NULL);
> style = gtk_widget_get_style_context(gToolbarWidget);
>
>+ gtk_style_context_get_style(gtk_widget_get_style_context(gToolbarWidget),
> style = gtk_widget_get_style_context(gMenuSeparatorWidget);
> gtk_style_context_get_padding(style, 0, &padding);
>
> gtk_style_context_save(style);
> gtk_style_context_add_class(style, GTK_STYLE_CLASS_SEPARATOR);
>
>+ gtk_style_context_get_style(gtk_widget_get_style_context(gMenuSeparatorWidget),
And these places, too.
Attachment #8734349 -
Flags: review?(karlt) → review+
Reporter | ||
Comment 3•9 years ago
|
||
Attachment #8734349 -
Attachment is obsolete: true
Reporter | ||
Comment 4•9 years ago
|
||
Comment on attachment 8735814 [details] [diff] [review]
v.3 patch for check-in
Try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=83e6300b198c
Reporter | ||
Comment 5•9 years ago
|
||
An updated patch for gtk3drawing change from c to cpp file.
Attachment #8735814 -
Attachment is obsolete: true
Reporter | ||
Comment 6•9 years ago
|
||
Comment on attachment 8735867 [details] [diff] [review]
patch v.4 for check-in
Try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=2e6a844cb63c
Reporter | ||
Updated•9 years ago
|
Keywords: checkin-needed
Comment 7•9 years ago
|
||
bugherder landing |
Keywords: checkin-needed
Comment 8•9 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
You need to log in
before you can comment on or make changes to this bug.
Description
•