Gtk3 - added fix for button/entry focus sizes

This commit is contained in:
Martin Stransky 2015-01-12 11:31:12 +01:00
parent 83ad3587a3
commit d3440514d5
2 changed files with 81 additions and 0 deletions

View File

@ -153,6 +153,7 @@ Patch406: mozilla-1073117-color.patch
Patch407: mozilla-1097592.patch
Patch408: mozilla-1110211.patch
Patch409: mozilla-1073117-entry-button-size.patch
Patch410: mozilla-1073117-button-focus.patch
%if %{official_branding}
# Required by Mozilla Corporation
@ -308,6 +309,7 @@ cd %{tarballdir}
%patch407 -p1 -b .1097592
%patch408 -p2 -b .1110211
%patch409 -p1 -b .1073117-entry-button-size
%patch410 -p1 -b .1073117-button-focus
%endif
%if %{official_branding}
@ -774,6 +776,7 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
* Fri Jan 12 2015 Martin Stransky <stransky@redhat.com> - 35.0-2
- Update to 35.0 Build 3
- Gtk3 - added fix for button/entry box sizes
- Gtk3 - added fix for button/entry focus sizes
* Tue Jan 6 2015 Martin Stransky <stransky@redhat.com> - 35.0-1
- Update to 35.0 Build 1

View File

@ -0,0 +1,78 @@
# HG changeset patch
# Parent ee674865d97716b0334559abb8eec54eb5c72cb0
# User Martin Stransky <stransky@redhat.com>
Bug 1073117 - Fixed Theme issues with GTK 3.14 - GtkButtons - use border style
property for focus rendering. Don't follow interior-focus which is always true in Gtk 3.14.
r=?karlt
diff --git a/widget/gtk/gtk3drawing.c b/widget/gtk/gtk3drawing.c
--- a/widget/gtk/gtk3drawing.c
+++ b/widget/gtk/gtk3drawing.c
@@ -903,29 +903,18 @@ moz_gtk_button_paint(cairo_t *cr, GdkRec
GtkWidgetState* state,
GtkReliefStyle relief, GtkWidget* widget,
GtkTextDirection direction)
{
GtkStateFlags state_flags = GetStateFlagsFromGtkWidgetState(state);
GtkStyleContext* style = gtk_widget_get_style_context(widget);
gint x = rect->x, y=rect->y, width=rect->width, height=rect->height;
- gboolean interior_focus;
- gint focus_width, focus_pad;
-
- moz_gtk_widget_get_focus(widget, &interior_focus, &focus_width, &focus_pad);
gtk_widget_set_direction(widget, direction);
-
- if (!interior_focus && state->focused) {
- x += focus_width + focus_pad;
- y += focus_width + focus_pad;
- width -= 2 * (focus_width + focus_pad);
- height -= 2 * (focus_width + focus_pad);
- }
-
+
gtk_style_context_save(style);
gtk_style_context_set_state(style, state_flags);
if (state->isDefault && relief == GTK_RELIEF_NORMAL) {
/* handle default borders both outside and inside the button */
gint default_top, default_left, default_bottom, default_right;
moz_gtk_button_get_default_overflow(&default_top, &default_left,
&default_bottom, &default_right);
@@ -948,30 +937,22 @@ moz_gtk_button_paint(cairo_t *cr, GdkRec
/* the following line can trigger an assertion (Crux theme)
file ../../gdk/gdkwindow.c: line 1846 (gdk_window_clear_area):
assertion `GDK_IS_WINDOW (window)' failed */
gtk_render_background(style, cr, x, y, width, height);
gtk_render_frame(style, cr, x, y, width, height);
}
if (state->focused) {
- if (interior_focus) {
- GtkBorder border;
- gtk_style_context_get_border(style, state_flags, &border);
- x += border.left + focus_pad;
- y += border.top + focus_pad;
- width -= 2 * (border.left + focus_pad);
- height -= 2 * (border.top + focus_pad);
- } else {
- x -= focus_width + focus_pad;
- y -= focus_width + focus_pad;
- width += 2 * (focus_width + focus_pad);
- height += 2 * (focus_width + focus_pad);
- }
-
+ GtkBorder border;
+ gtk_style_context_get_border(style, state_flags, &border);
+ x += border.left;
+ y += border.top;
+ width -= (border.left + border.right);
+ height -= (border.top + border.bottom);
gtk_render_focus(style, cr, x, y, width, height);
}
gtk_style_context_restore(style);
return MOZ_GTK_SUCCESS;
}
static gint
moz_gtk_toggle_paint(cairo_t *cr, GdkRectangle* rect,