From 912be5ce979b585cf4cc067745f400bfa62bdfde Mon Sep 17 00:00:00 2001 From: Jens Granseuer Date: Sat, 5 May 2007 11:14:54 +0000 Subject: set button images via code instead of relying on glade, so they respect 2007-05-05 Jens Granseuer * at-enable-dialog.glade: * main.c: (create_dialog): set button images via code instead of relying on glade, so they respect the gtk-button-images xsetting (closes bug #362880) svn path=/trunk/; revision=7556 --- capplets/accessibility/at-properties/ChangeLog | 7 + .../at-properties/at-enable-dialog.glade | 266 +-------------------- capplets/accessibility/at-properties/main.c | 63 +++-- 3 files changed, 52 insertions(+), 284 deletions(-) (limited to 'capplets/accessibility') diff --git a/capplets/accessibility/at-properties/ChangeLog b/capplets/accessibility/at-properties/ChangeLog index b9159e1d2..ef0d4671a 100644 --- a/capplets/accessibility/at-properties/ChangeLog +++ b/capplets/accessibility/at-properties/ChangeLog @@ -1,3 +1,10 @@ +2007-05-05 Jens Granseuer + + * at-enable-dialog.glade: + * main.c: (create_dialog): set button images via code instead of + relying on glade, so they respect the gtk-button-images xsetting + (closes bug #362880) + 2007-05-05 Jens Granseuer * at-enable-dialog.glade: fix critical warning diff --git a/capplets/accessibility/at-properties/at-enable-dialog.glade b/capplets/accessibility/at-properties/at-enable-dialog.glade index 0e61ebdf7..3264c6717 100644 --- a/capplets/accessibility/at-properties/at-enable-dialog.glade +++ b/capplets/accessibility/at-properties/at-enable-dialog.glade @@ -52,68 +52,8 @@ GTK_RELIEF_NORMAL True 0 - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - Close and _Log Out - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - + Close and _Log Out + True @@ -216,74 +156,11 @@ True GTK_RELIEF_NORMAL True + _Preferred Applications + True Jump to Preferred Applications dialog - - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-jump-to - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - _Preferred Applications - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - 0 @@ -418,75 +295,11 @@ True GTK_RELIEF_NORMAL True + _Keyboard Accessibility + True - Keyboard Accessibility Jump to the Keyboard Accessibility dialog - - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-jump-to - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - _Keyboard Accessibility - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - 5 @@ -501,74 +314,11 @@ True GTK_RELIEF_NORMAL True + Accessible Lo_gin + True - Accessible Login Jump to the Accessible Login dialog - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-jump-to - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - Accessible Lo_gin - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - 0 diff --git a/capplets/accessibility/at-properties/main.c b/capplets/accessibility/at-properties/main.c index b00b62d71..83ed0f07e 100644 --- a/capplets/accessibility/at-properties/main.c +++ b/capplets/accessibility/at-properties/main.c @@ -11,7 +11,7 @@ #define ACCESSIBILITY_KEY "/desktop/gnome/interface/accessibility" #define ACCESSIBILITY_KEY_DIR "/desktop/gnome/interface" -static AtStartupState at_startup_state, at_startup_state_initial; +static AtStartupState at_startup_state; static GladeXML * create_dialog (void) @@ -21,8 +21,19 @@ create_dialog (void) dialog = glade_xml_new (GLADEDIR "/at-enable-dialog.glade", "at_properties_dialog", NULL); if (dialog) { - gtk_image_set_from_stock (GTK_IMAGE (WID ("at_close_and_logout_image")), - GTK_STOCK_QUIT, GTK_ICON_SIZE_BUTTON); + GtkWidget *image; + + image = gtk_image_new_from_stock (GTK_STOCK_QUIT, GTK_ICON_SIZE_BUTTON); + gtk_button_set_image (GTK_BUTTON (WID ("at_close_logout_button")), image); + + image = gtk_image_new_from_stock (GTK_STOCK_JUMP_TO, GTK_ICON_SIZE_BUTTON); + gtk_button_set_image (GTK_BUTTON (WID ("at_pref_button")), image); + + image = gtk_image_new_from_stock (GTK_STOCK_JUMP_TO, GTK_ICON_SIZE_BUTTON); + gtk_button_set_image (GTK_BUTTON (WID ("keyboard_button")), image); + + image = gtk_image_new_from_stock (GTK_STOCK_JUMP_TO, GTK_ICON_SIZE_BUTTON); + gtk_button_set_image (GTK_BUTTON (WID ("login_button")), image); gtk_image_set_from_file (GTK_IMAGE (WID ("at_enable_image")), PIXMAPDIR "/at-startup.png"); @@ -65,10 +76,10 @@ cb_dialog_response (GtkDialog *dialog, gint response_id) else { g_message ("CLOSE AND LOGOUT!"); if (!(client = gnome_master_client ())) { - + gtk_main_quit (); } - gnome_client_request_save (client, GNOME_SAVE_GLOBAL, TRUE, + gnome_client_request_save (client, GNOME_SAVE_GLOBAL, TRUE, GNOME_INTERACT_ANY, FALSE, TRUE); } } @@ -84,12 +95,12 @@ close_logout_update (GladeXML *dialog) } static void -at_enable_toggled (GtkToggleButton *toggle_button, +at_enable_toggled (GtkToggleButton *toggle_button, GladeXML *dialog) { GConfClient *client = gconf_client_get_default (); gboolean is_enabled = gtk_toggle_button_get_active (toggle_button); - + gconf_client_set_bool (client, ACCESSIBILITY_KEY, is_enabled, NULL); @@ -102,10 +113,10 @@ at_enable_update (GConfClient *client, GladeXML *dialog) { gboolean is_enabled = gconf_client_get_bool (client, ACCESSIBILITY_KEY, NULL); - + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("at_enable_toggle")), is_enabled); - + gtk_widget_set_sensitive (WID ("at_pref_button"), is_enabled); } @@ -116,7 +127,7 @@ at_enable_changed (GConfClient *client, gpointer user_data) { at_enable_update (client, user_data); - close_logout_update (user_data); + close_logout_update (user_data); } static void @@ -125,27 +136,27 @@ setup_dialog (GladeXML *dialog) GConfClient *client; GtkWidget *widget; GObject *peditor; - + client = gconf_client_get_default (); - - gconf_client_add_dir (client, ACCESSIBILITY_KEY_DIR, + + gconf_client_add_dir (client, ACCESSIBILITY_KEY_DIR, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL); - + widget = WID ("at_enable_toggle"); g_signal_connect (widget, "toggled", - G_CALLBACK (at_enable_toggled), + G_CALLBACK (at_enable_toggled), dialog); - + peditor = gconf_peditor_new_boolean (NULL, ACCESSIBILITY_KEY, widget, NULL); - + at_enable_update (client, dialog); - + gconf_client_notify_add (client, ACCESSIBILITY_KEY_DIR, at_enable_changed, dialog, NULL, NULL); - + g_signal_connect (G_OBJECT (WID("at_pref_button")), "clicked", G_CALLBACK (cb_at_preferences), NULL); @@ -160,13 +171,13 @@ setup_dialog (GladeXML *dialog) widget = WID ("at_properties_dialog"); capplet_set_icon (widget, "gnome-settings-accessibility-technologies"); - + g_signal_connect (G_OBJECT (widget), "response", G_CALLBACK (cb_dialog_response), NULL); - + gtk_widget_show (widget); - + g_object_unref (client); } @@ -175,18 +186,18 @@ main (int argc, char *argv[]) { GnomeProgram *program; GladeXML *dialog; - + bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); - + program = gnome_program_init ("gnome-at-properties", VERSION, LIBGNOMEUI_MODULE, argc, argv, GNOME_PARAM_APP_DATADIR, GNOMECC_DATA_DIR, NULL); - + activate_settings_daemon (); - + dialog = create_dialog (); if (dialog) { -- cgit v1.2.1