[uim-commit] r451 - trunk/helper
tkng at freedesktop.org
tkng at freedesktop.org
Mon Jan 31 22:01:09 PST 2005
Author: tkng
Date: 2005-01-31 22:01:06 -0800 (Mon, 31 Jan 2005)
New Revision: 451
Modified:
trunk/helper/toolbar-common-gtk.c
Log:
* helper/toolbar-common-gtk.c:
-(switcher_button_create): Return NULL if switcher button is not
required.
-(pref_button_create): Return NULL if pref button is not required.
Modified: trunk/helper/toolbar-common-gtk.c
===================================================================
--- trunk/helper/toolbar-common-gtk.c 2005-02-01 05:59:31 UTC (rev 450)
+++ trunk/helper/toolbar-common-gtk.c 2005-02-01 06:01:06 UTC (rev 451)
@@ -41,6 +41,7 @@
#include <uim/uim.h>
#include "uim/config.h"
#include "uim/uim-helper.h"
+#include "uim-compat-scm.h"
#include "uim/gettext.h"
#define BUTTON_WIDTH 22
@@ -217,13 +218,15 @@
/* create button for exec switcher */
button = switcher_button_create();
- gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
- menu_buttons = g_list_append(menu_buttons, button);
-
+ if(button) {
+ gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
+ menu_buttons = g_list_append(menu_buttons, button);
+ }
button = pref_button_create();
- gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
- menu_buttons = g_list_append(menu_buttons, button);
-
+ if(button) {
+ gtk_box_pack_start(GTK_BOX(hbox), button, TRUE, TRUE, 0);
+ menu_buttons = g_list_append(menu_buttons, button);
+ }
gtk_widget_show_all(hbox);
if(charset)
@@ -536,6 +539,12 @@
GtkTooltips *tooltip;
GtkWidget *img;
gchar *path;
+ uim_bool show_switcher;
+
+ show_switcher = uim_scm_symbol_value_bool("toolbar-show-switcher-button?");
+ if(show_switcher == UIM_FALSE)
+ return NULL;
+
button = gtk_button_new();
path = g_strconcat(UIM_PIXMAPSDIR, "/switcher-icon.png", NULL);
img = gtk_image_new_from_file(path);
@@ -574,6 +583,12 @@
GtkWidget *button;
GtkTooltips *tooltip;
GtkWidget *img;
+ uim_bool show_pref;
+
+ show_pref = uim_scm_symbol_value_bool("toolbar-show-pref-button?");
+ if(show_pref == UIM_FALSE)
+ return NULL;
+
button = gtk_button_new();
img = gtk_image_new_from_stock(GTK_STOCK_PREFERENCES, GTK_ICON_SIZE_MENU);
gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
More information about the Uim-commit
mailing list