UimStateIndicator::UimStateIndicator( QWidget *parent ) : QFrame( parent ) { m_layout = new QHBoxLayout; m_layout->setMargin( 0 ); m_layout->setSpacing( 0 ); if ( !fallbackButton ) { fallbackButton = new QHelperToolbarButton( this ); m_layout->addWidget( fallbackButton ); QPixmap icon = QPixmap( ICONDIR + '/' + "uim-icon.png" ); if ( !icon.isNull() ) { QPixmap scaledIcon = icon.scaled( ICON_SIZE, ICON_SIZE, Qt::IgnoreAspectRatio, Qt::SmoothTransformation ); fallbackButton->setIcon( QIcon( scaledIcon ) ); } else { fallbackButton->setText( "?" ); } fallbackButton->show(); } clearButtons(); uim_fd = -1; checkHelperConnection(); uim_helper_client_get_prop_list(); popupMenuShowing = false; setLayout( m_layout ); }
static void embedded_cb(GtkWidget *widget, gpointer user_data) { uim_toolbar_check_helper_connection(user_data); uim_helper_client_get_prop_list(); uim_toolbar_get_im_list(); gtk_widget_show_all(user_data); }
static GtkWidget * toolbar_new(gint type) { GtkWidget *button; GtkWidget *hbox; GList *prop_buttons = NULL; GtkSizeGroup *sg; /* * Set uim-toolbar-save-default-im? #t in ~/.uim enable this if you'd like to * save default IM into ~/.uim.d/custom/custom-global.scm upon system global * IM switch. However, using uim-custom consumes quite amount of memory, and * requires additional startup time. */ if (uim_scm_symbol_value_bool("uim-toolbar-save-default-im?")) custom_enabled = (gboolean)uim_custom_enable(); helper_toolbar_check_custom(); init_icon(); /* create widgets */ #if GTK_CHECK_VERSION(3, 2, 0) hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); #else hbox = gtk_hbox_new(FALSE, 0); #endif im_menu = gtk_menu_new(); prop_menu = gtk_menu_new(); right_click_menu = right_click_menu_create(); sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); /* prop menu button */ button = button_create(hbox, sg, "uim-icon", " x", type); gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); prop_buttons = g_list_append(prop_buttons, button); g_object_set_data(G_OBJECT(hbox), OBJECT_DATA_PROP_BUTTONS, prop_buttons); g_object_set_data(G_OBJECT(hbox), OBJECT_DATA_SIZE_GROUP, sg); g_object_set_data(G_OBJECT(hbox), OBJECT_DATA_TOOLBAR_TYPE, GINT_TO_POINTER(type)); uim_fd = -1; if (type != TYPE_ICON) { /* delay initialization until getting "embedded" signal */ uim_toolbar_check_helper_connection(hbox); uim_helper_client_get_prop_list(); uim_toolbar_get_im_list(); } return hbox; }