forked from AuroraMiddleware/gtk
button: don't read focus padding property
We're going to deprecate it.
This commit is contained in:
parent
b03c22e0c9
commit
8b068e996f
@ -1696,7 +1696,7 @@ gtk_button_get_full_border (GtkButton *button,
|
|||||||
GtkWidget *widget = GTK_WIDGET (button);
|
GtkWidget *widget = GTK_WIDGET (button);
|
||||||
GtkStyleContext *context;
|
GtkStyleContext *context;
|
||||||
GtkBorder default_border, padding, border;
|
GtkBorder default_border, padding, border;
|
||||||
int focus_width, focus_pad;
|
int focus_width;
|
||||||
|
|
||||||
context = gtk_widget_get_style_context (widget);
|
context = gtk_widget_get_style_context (widget);
|
||||||
|
|
||||||
@ -1704,13 +1704,12 @@ gtk_button_get_full_border (GtkButton *button,
|
|||||||
&padding, &border);
|
&padding, &border);
|
||||||
gtk_style_context_get_style (context,
|
gtk_style_context_get_style (context,
|
||||||
"focus-line-width", &focus_width,
|
"focus-line-width", &focus_width,
|
||||||
"focus-padding", &focus_pad,
|
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
full_border->left = padding.left + border.left + focus_width + focus_pad;
|
full_border->left = padding.left + border.left + focus_width;
|
||||||
full_border->right = padding.right + border.right + focus_width + focus_pad;
|
full_border->right = padding.right + border.right + focus_width;
|
||||||
full_border->top = padding.top + border.top + focus_width + focus_pad;
|
full_border->top = padding.top + border.top + focus_width;
|
||||||
full_border->bottom = padding.bottom + border.bottom + focus_width + focus_pad;
|
full_border->bottom = padding.bottom + border.bottom + focus_width;
|
||||||
|
|
||||||
if (gtk_widget_get_can_default (GTK_WIDGET (button)))
|
if (gtk_widget_get_can_default (GTK_WIDGET (button)))
|
||||||
{
|
{
|
||||||
@ -1788,7 +1787,6 @@ gtk_button_draw (GtkWidget *widget,
|
|||||||
GtkBorder default_border;
|
GtkBorder default_border;
|
||||||
GtkBorder default_outside_border;
|
GtkBorder default_outside_border;
|
||||||
gint focus_width;
|
gint focus_width;
|
||||||
gint focus_pad;
|
|
||||||
GtkAllocation allocation;
|
GtkAllocation allocation;
|
||||||
GtkStyleContext *context;
|
GtkStyleContext *context;
|
||||||
GtkStateFlags state;
|
GtkStateFlags state;
|
||||||
@ -1801,7 +1799,6 @@ gtk_button_draw (GtkWidget *widget,
|
|||||||
gtk_button_get_props (button, &default_border, &default_outside_border, NULL, NULL);
|
gtk_button_get_props (button, &default_border, &default_outside_border, NULL, NULL);
|
||||||
gtk_style_context_get_style (context,
|
gtk_style_context_get_style (context,
|
||||||
"focus-line-width", &focus_width,
|
"focus-line-width", &focus_width,
|
||||||
"focus-padding", &focus_pad,
|
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
gtk_widget_get_allocation (widget, &allocation);
|
gtk_widget_get_allocation (widget, &allocation);
|
||||||
@ -1852,10 +1849,10 @@ gtk_button_draw (GtkWidget *widget,
|
|||||||
NULL);
|
NULL);
|
||||||
gtk_style_context_get_border (context, state, &border);
|
gtk_style_context_get_border (context, state, &border);
|
||||||
|
|
||||||
x += border.left + focus_pad;
|
x += border.left;
|
||||||
y += border.top + focus_pad;
|
y += border.top;
|
||||||
width -= (2 * focus_pad) + border.left + border.right;
|
width -= border.left + border.right;
|
||||||
height -= (2 * focus_pad) + border.top + border.bottom;
|
height -= border.top + border.bottom;
|
||||||
|
|
||||||
if (priv->depressed && displace_focus)
|
if (priv->depressed && displace_focus)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user