[gnome-dictionary] gdict: Use a symbolic icon in DatabaseChooserButton
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-dictionary] gdict: Use a symbolic icon in DatabaseChooserButton
- Date: Wed, 31 Aug 2016 16:16:16 +0000 (UTC)
commit eb65bfa21b24a0c4d8ce0c8c2796042081ced2f0
Author: Emmanuele Bassi <ebassi gnome org>
Date: Wed Aug 31 17:12:01 2016 +0100
gdict: Use a symbolic icon in DatabaseChooserButton
Using text is going to break it, especially when we're using the
internal database name from the dictionary context, which may or may not
be a meaningful, or even translatable string.
Additionally, the DICT protocol specifies special names that would need
to be converted internally to something that is user readable.
Instead of this insanity, let's just a simple symbolic icon for lists of
things — which is appropriate in the case of a list of databases.
libgdict/gdict-database-chooser-button.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/libgdict/gdict-database-chooser-button.c b/libgdict/gdict-database-chooser-button.c
index 1638ce7..e9efa63 100644
--- a/libgdict/gdict-database-chooser-button.c
+++ b/libgdict/gdict-database-chooser-button.c
@@ -230,7 +230,6 @@ database_activated_cb (GdictDatabaseChooser *chooser,
{
GdictDatabaseChooserButton *chooser_button = user_data;
- gtk_button_set_label (GTK_BUTTON (chooser_button), name);
gtk_widget_set_tooltip_text (GTK_WIDGET (chooser_button), description);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (chooser_button), FALSE);
@@ -423,12 +422,17 @@ gdict_database_chooser_button_init (GdictDatabaseChooserButton *chooser_button)
{
GdictDatabaseChooserButtonPrivate *priv;
- chooser_button->priv = priv = GDICT_DATABASE_CHOOSER_BUTTON_GET_PRIVATE (chooser_button);
+ chooser_button->priv = priv =
+ gdict_database_chooser_button_get_instance_private (chooser_button);
priv->start_id = 0;
priv->end_id = 0;
priv->error_id = 0;
+ gtk_button_set_image (GTK_BUTTON (chooser_button),
+ gtk_image_new_from_icon_name ("view-list-symbolic",
+ GTK_ICON_SIZE_BUTTON));
+
priv->popover = gtk_popover_new (GTK_WIDGET (chooser_button));
gtk_menu_button_set_direction (GTK_MENU_BUTTON (chooser_button), GTK_ARROW_NONE);
gtk_menu_button_set_popover (GTK_MENU_BUTTON (chooser_button), priv->popover);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]