]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkcheckbutton.c
filechooserbutton: whitespace fixes
[~andy/gtk] / gtk / gtkcheckbutton.c
index e058571c65daba1078d20566b582e76b56b606c9..d7df5a914e98f9c71ba306b063bf294af767b64a 100644 (file)
@@ -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 <http://www.gnu.org/licenses/>.
  */
 
 /*
@@ -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);
 }
 
 /**