Replace deprecated Gtk3.14 function gtk_arrow_new with an icon

Use icon 'go-down' as the arrow for the pop up selections.
This commit is contained in:
Robert Fewell 2017-07-02 10:00:35 +01:00
parent b513ab16f8
commit 66de41bd57
4 changed files with 32 additions and 3 deletions

View File

@ -410,9 +410,17 @@ static void go_option_menu_init(GOOptionMenu *option_menu)
option_menu->button_label = GTK_LABEL(gtk_label_new(""));
gtk_box_pack_start(GTK_BOX(box), GTK_WIDGET(option_menu->button_label), FALSE, TRUE, 0);
#if GTK_CHECK_VERSION(3,14,0)
arrow = gtk_image_new_from_icon_name ("go-down", GTK_ICON_SIZE_BUTTON);
#else
arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE);
#endif
#if GTK_CHECK_VERSION(3,12,0)
gtk_widget_set_margin_start (GTK_WIDGET(arrow), 5);
#else
gtk_widget_set_margin_left (GTK_WIDGET(arrow), 5);
#endif
arrow = gtk_arrow_new(GTK_ARROW_DOWN, GTK_SHADOW_NONE);
g_object_set(arrow, "xalign", 0.75, NULL);
gtk_box_pack_end(GTK_BOX(box), arrow, FALSE, FALSE, 0);
sep = gtk_separator_new (GTK_ORIENTATION_VERTICAL);

View File

@ -108,7 +108,11 @@ gnc_popup_entry_init (GncPopupEntry *widget)
widget->button = gtk_button_new ();
gtk_widget_show (widget->button);
#if GTK_CHECK_VERSION(3,14,0)
arrow = gtk_image_new_from_icon_name ("go-down", GTK_ICON_SIZE_BUTTON);
#else
arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_OUT);
#endif
gtk_widget_show (arrow);
gtk_container_add (GTK_CONTAINER (widget->button), arrow);
@ -298,7 +302,11 @@ gnc_popup_get_button_width (void)
gtk_widget_show (button);
gtk_container_add (GTK_CONTAINER (window), button);
#if GTK_CHECK_VERSION(3,14,0)
arrow = gtk_image_new_from_icon_name ("go-down", GTK_ICON_SIZE_BUTTON);
#else
arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_OUT);
#endif
gtk_widget_show (arrow);
gtk_container_add (GTK_CONTAINER (button), arrow);

View File

@ -225,7 +225,16 @@ gctt_init (GncCombott *combott)
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_set_homogeneous (GTK_BOX(hbox), FALSE);
arrow = gtk_arrow_new(GTK_ARROW_DOWN, GTK_SHADOW_OUT);
#if GTK_CHECK_VERSION(3,14,0)
arrow = gtk_image_new_from_icon_name ("go-down", GTK_ICON_SIZE_BUTTON);
#else
arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_OUT);
#endif
#if GTK_CHECK_VERSION(3,12,0)
gtk_widget_set_margin_start (GTK_WIDGET(arrow), 5);
#else
gtk_widget_set_margin_left (GTK_WIDGET(arrow), 5);
#endif
gtk_box_pack_end (GTK_BOX (hbox), arrow, FALSE, FALSE, 0);
sep = gtk_separator_new (GTK_ORIENTATION_VERTICAL);

View File

@ -900,7 +900,11 @@ create_children (GNCDateEdit *gde)
gtk_widget_show (GTK_WIDGET(gde->cal_label));
/* Graphic for the popup button. */
#if GTK_CHECK_VERSION(3,14,0)
arrow = gtk_image_new_from_icon_name ("go-down", GTK_ICON_SIZE_BUTTON);
#else
arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE);
#endif
gtk_box_pack_start (GTK_BOX (hbox), arrow, TRUE, FALSE, 0);
gtk_widget_show (GTK_WIDGET(arrow));