X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=gtk%2Fgtkcheckbutton.c;h=d7df5a914e98f9c71ba306b063bf294af767b64a;hb=1074aa0c49f647ed4b2a969618051c59da5aad01;hp=e058571c65daba1078d20566b582e76b56b606c9;hpb=c9bbfb5e9b21d46000d32f9a9c9d9e175c1bad0c;p=~andy%2Fgtk diff --git a/gtk/gtkcheckbutton.c b/gtk/gtkcheckbutton.c index e058571c6..d7df5a914 100644 --- a/gtk/gtkcheckbutton.c +++ b/gtk/gtkcheckbutton.c @@ -12,9 +12,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ /* @@ -107,12 +105,25 @@ gtk_check_button_class_init (GtkCheckButtonClass *class) GTK_PARAM_READABLE)); } +static void +draw_indicator_changed (GObject *object, + GParamSpec *pspec, + gpointer user_data) +{ + GtkButton *button = GTK_BUTTON (object); + + if (gtk_toggle_button_get_mode (GTK_TOGGLE_BUTTON (button))) + gtk_button_set_alignment (button, 0.0, 0.5); + else + gtk_button_set_alignment (button, 0.5, 0.5); +} + static void gtk_check_button_init (GtkCheckButton *check_button) { gtk_widget_set_receives_default (GTK_WIDGET (check_button), FALSE); + g_signal_connect (check_button, "notify::draw-indicator", G_CALLBACK (draw_indicator_changed), NULL); gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (check_button), TRUE); - gtk_button_set_alignment (GTK_BUTTON (check_button), 0.0, 0.5); } /**