forked from AuroraMiddleware/gtk
checkbutton: Remove excessive is_drawable() check
This commit is contained in:
parent
6a0c31143f
commit
66bd7c1578
@ -135,59 +135,55 @@ gtk_check_button_paint (GtkWidget *widget,
|
||||
GdkRectangle *area)
|
||||
{
|
||||
GtkCheckButton *check_button = GTK_CHECK_BUTTON (widget);
|
||||
gint border_width;
|
||||
gint interior_focus;
|
||||
gint focus_width;
|
||||
gint focus_pad;
|
||||
|
||||
if (gtk_widget_is_drawable (widget))
|
||||
gtk_widget_style_get (widget,
|
||||
"interior-focus", &interior_focus,
|
||||
"focus-line-width", &focus_width,
|
||||
"focus-padding", &focus_pad,
|
||||
NULL);
|
||||
|
||||
gtk_check_button_draw_indicator (check_button, area);
|
||||
|
||||
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
|
||||
if (gtk_widget_has_focus (widget))
|
||||
{
|
||||
gint border_width;
|
||||
gint interior_focus;
|
||||
gint focus_width;
|
||||
gint focus_pad;
|
||||
GtkStateType state;
|
||||
GtkStyle *style;
|
||||
GtkWidget *child = gtk_bin_get_child (GTK_BIN (widget));
|
||||
GdkWindow *window;
|
||||
|
||||
gtk_widget_style_get (widget,
|
||||
"interior-focus", &interior_focus,
|
||||
"focus-line-width", &focus_width,
|
||||
"focus-padding", &focus_pad,
|
||||
NULL);
|
||||
style = gtk_widget_get_style (widget);
|
||||
window = gtk_widget_get_window (widget);
|
||||
state = gtk_widget_get_state (widget);
|
||||
|
||||
gtk_check_button_draw_indicator (check_button, area);
|
||||
if (interior_focus && child && gtk_widget_get_visible (child))
|
||||
{
|
||||
GtkAllocation child_allocation;
|
||||
|
||||
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
|
||||
if (gtk_widget_has_focus (widget))
|
||||
{
|
||||
GtkStateType state;
|
||||
GtkStyle *style;
|
||||
GtkWidget *child = gtk_bin_get_child (GTK_BIN (widget));
|
||||
GdkWindow *window;
|
||||
gtk_widget_get_allocation (child, &child_allocation);
|
||||
gtk_paint_focus (style, window, state,
|
||||
area, widget, "checkbutton",
|
||||
child_allocation.x - focus_width - focus_pad,
|
||||
child_allocation.y - focus_width - focus_pad,
|
||||
child_allocation.width + 2 * (focus_width + focus_pad),
|
||||
child_allocation.height + 2 * (focus_width + focus_pad));
|
||||
}
|
||||
else
|
||||
{
|
||||
GtkAllocation allocation;
|
||||
|
||||
style = gtk_widget_get_style (widget);
|
||||
window = gtk_widget_get_window (widget);
|
||||
state = gtk_widget_get_state (widget);
|
||||
|
||||
if (interior_focus && child && gtk_widget_get_visible (child))
|
||||
{
|
||||
GtkAllocation child_allocation;
|
||||
|
||||
gtk_widget_get_allocation (child, &child_allocation);
|
||||
gtk_paint_focus (style, window, state,
|
||||
area, widget, "checkbutton",
|
||||
child_allocation.x - focus_width - focus_pad,
|
||||
child_allocation.y - focus_width - focus_pad,
|
||||
child_allocation.width + 2 * (focus_width + focus_pad),
|
||||
child_allocation.height + 2 * (focus_width + focus_pad));
|
||||
}
|
||||
else
|
||||
{
|
||||
GtkAllocation allocation;
|
||||
|
||||
gtk_widget_get_allocation (widget, &allocation);
|
||||
gtk_paint_focus (style, window, state,
|
||||
area, widget, "checkbutton",
|
||||
allocation.x + border_width,
|
||||
allocation.y + border_width,
|
||||
allocation.width - 2 * border_width,
|
||||
allocation.height - 2 * border_width);
|
||||
}
|
||||
}
|
||||
gtk_widget_get_allocation (widget, &allocation);
|
||||
gtk_paint_focus (style, window, state,
|
||||
area, widget, "checkbutton",
|
||||
allocation.x + border_width,
|
||||
allocation.y + border_width,
|
||||
allocation.width - 2 * border_width,
|
||||
allocation.height - 2 * border_width);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user