summaryrefslogtreecommitdiff
path: root/gtk/gtkradiobutton.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2002-10-17 20:20:52 +0000
committerOwen Taylor <otaylor@src.gnome.org>2002-10-17 20:20:52 +0000
commitde89785a28b0b141ff4c9ea5a7798320ed8082d9 (patch)
tree438704caefd7588b204d68dcdffd3d459d24ff8f /gtk/gtkradiobutton.c
parenta9d26e1478f33ca3d1aec25e7378feb7fc340022 (diff)
downloadgtk+-de89785a28b0b141ff4c9ea5a7798320ed8082d9.tar.gz
Make the widgets work reasonably when they don't have children -- draw the
Thu Oct 17 16:13:28 2002 Owen Taylor <otaylor@redhat.com> * gtk/gtkcheckbutton.c gtk/gtkradiobutton.c: Make the widgets work reasonably when they don't have children -- draw the focus around the indicator, and position the indicator symmetrically. (#74830, Dave Camp) * tests/testgtk.c: Add no-child portions to check and radio button tests.
Diffstat (limited to 'gtk/gtkradiobutton.c')
-rw-r--r--gtk/gtkradiobutton.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gtk/gtkradiobutton.c b/gtk/gtkradiobutton.c
index 57f1b178a0..f7feaf0e7c 100644
--- a/gtk/gtkradiobutton.c
+++ b/gtk/gtkradiobutton.c
@@ -599,6 +599,7 @@ gtk_radio_button_draw_indicator (GtkCheckButton *check_button,
GdkRectangle *area)
{
GtkWidget *widget;
+ GtkWidget *child;
GtkButton *button;
GtkToggleButton *toggle_button;
GtkStateType state_type;
@@ -626,7 +627,8 @@ gtk_radio_button_draw_indicator (GtkCheckButton *check_button,
x = widget->allocation.x + indicator_spacing + GTK_CONTAINER (widget)->border_width;
y = widget->allocation.y + (widget->allocation.height - indicator_size) / 2;
- if (!interior_focus)
+ child = GTK_BIN (check_button)->child;
+ if (!interior_focus || !(child && GTK_WIDGET_VISIBLE (child)))
x += focus_width + focus_pad;
if (toggle_button->inconsistent)