diff options
author | Elliott Sales de Andrade <quantum.analyst@gmail.com> | 2022-08-22 21:43:13 -0500 |
---|---|---|
committer | Elliott Sales de Andrade <quantum.analyst@gmail.com> | 2022-08-22 21:43:13 -0500 |
commit | 1bee97214627cfe24dc2e9c3fe8da99aa4db659e (patch) | |
tree | 16ffa09db734d630487578b25a642a6825ae3d99 | |
parent | 7b73ee94feb6901003046eeae03246f9a54a7a45 (diff) | |
download | pidgin-1bee97214627cfe24dc2e9c3fe8da99aa4db659e.tar.gz |
Removed unused text combo box utility code
Testing Done:
Compile only; not much else to do here.
Reviewed at https://reviews.imfreedom.org/r/1617/
-rw-r--r-- | ChangeLog.API | 2 | ||||
-rw-r--r-- | pidgin/gtkutils.c | 59 | ||||
-rw-r--r-- | pidgin/gtkutils.h | 22 |
3 files changed, 2 insertions, 81 deletions
diff --git a/ChangeLog.API b/ChangeLog.API index 94d77ad334..a633e1b773 100644 --- a/ChangeLog.API +++ b/ChangeLog.API @@ -1075,6 +1075,8 @@ version 3.0.0 (??/??/????): * PIDGIN_TYPE_STOCK_ICON_THEME * PidginStockIconTheme * PidginStockIconThemeClass + * pidgin_text_combo_box_entry_new + * pidgin_text_combo_box_entry_get_text * pidgin_text_combo_box_entry_set_text * pidgin_theme_font_free * pidgin_theme_font_get_color diff --git a/pidgin/gtkutils.c b/pidgin/gtkutils.c index 3bb05b4543..96e8cf5615 100644 --- a/pidgin/gtkutils.c +++ b/pidgin/gtkutils.c @@ -859,65 +859,6 @@ gboolean pidgin_tree_view_search_equal_func(GtkTreeModel *model, gint column, return result; } -static void -combo_box_changed_cb(GtkComboBoxText *combo_box, GtkEntry *entry) -{ - char *text = gtk_combo_box_text_get_active_text(combo_box); - gtk_editable_set_text(GTK_EDITABLE(entry), text ? text : ""); - g_free(text); -} - -static gboolean -entry_key_pressed_cb(G_GNUC_UNUSED GtkEventControllerKey *controller, - guint keyval, G_GNUC_UNUSED guint keycode, - G_GNUC_UNUSED GdkModifierType state, - gpointer data) -{ - GtkComboBoxText *combo = data; - - if (keyval == GDK_KEY_Down || keyval == GDK_KEY_Up) { - gtk_combo_box_popup(GTK_COMBO_BOX(combo)); - return TRUE; - } - return FALSE; -} - -GtkWidget * -pidgin_text_combo_box_entry_new(const char *default_item, GList *items) -{ - GtkComboBoxText *ret = NULL; - GtkWidget *the_entry = NULL; - GtkEventController *controller = NULL; - - ret = GTK_COMBO_BOX_TEXT(gtk_combo_box_text_new_with_entry()); - the_entry = gtk_bin_get_child(GTK_BIN(ret)); - - if(default_item) { - gtk_editable_set_text(GTK_EDITABLE(the_entry), default_item); - } - - for (; items != NULL ; items = items->next) { - char *text = items->data; - if (text && *text) - gtk_combo_box_text_append_text(ret, text); - } - - g_signal_connect(G_OBJECT(ret), "changed", (GCallback)combo_box_changed_cb, the_entry); - - controller = gtk_event_controller_key_new(the_entry); - g_object_set_data_full(G_OBJECT(the_entry), "pidgin-event-controller", - controller, g_object_unref); - g_signal_connect_after(G_OBJECT(controller), "key-pressed", - G_CALLBACK(entry_key_pressed_cb), ret); - - return GTK_WIDGET(ret); -} - -const char * -pidgin_text_combo_box_entry_get_text(GtkWidget *widget) { - return gtk_editable_get_text(GTK_EDITABLE(gtk_bin_get_child(GTK_BIN((widget))))); -} - GtkWidget * pidgin_add_widget_to_vbox(GtkBox *vbox, const char *widget_label, GtkSizeGroup *sg, GtkWidget *widget, gboolean expand, GtkWidget **p_label) { diff --git a/pidgin/gtkutils.h b/pidgin/gtkutils.h index 905702ff2a..f8af08d1ba 100644 --- a/pidgin/gtkutils.h +++ b/pidgin/gtkutils.h @@ -203,28 +203,6 @@ gboolean pidgin_tree_view_search_equal_func(GtkTreeModel *model, gint column, const gchar *key, GtkTreeIter *iter, gpointer data); /** - * pidgin_text_combo_box_entry_new: - * @default_item: Initial contents of GtkEntry - * @items: (element-type utf8): GList containing strings to add to GtkComboBox - * - * Create a simple text GtkComboBoxEntry equivalent - * - * Returns: (transfer full): A newly created text GtkComboBox containing a GtkEntry - * child. - */ -GtkWidget *pidgin_text_combo_box_entry_new(const char *default_item, GList *items); - -/** - * pidgin_text_combo_box_entry_get_text: - * @widget: The simple text GtkComboBoxEntry equivalent widget - * - * Retrieve the text from the entry of the simple text GtkComboBoxEntry equivalent - * - * Returns: The text in the widget's entry. It must not be freed - */ -const char *pidgin_text_combo_box_entry_get_text(GtkWidget *widget); - -/** * pidgin_auto_parent_window: * @window: The window to make transient. * |