Branch: refs/heads/master Author: Enrico Tröger enrico.troeger@uvena.de Committer: GitHub noreply@github.com Date: Sun, 23 Jun 2024 20:51:47 UTC Commit: 820fd93a17c92e9e1a77d07205b585055f28e3b7 https://github.com/geany/geany-plugins/commit/820fd93a17c92e9e1a77d07205b585...
Log Message: ----------- Addons: Remove obsolete GTK_CHECK_VERSION checks (#1358)
Modified Paths: -------------- addons/src/addons.c addons/src/ao_doclist.c addons/src/ao_systray.c
Modified: addons/src/addons.c 4 lines changed, 0 insertions(+), 4 deletions(-) =================================================================== @@ -652,10 +652,6 @@ static GtkWidget *plugin_addons_configure(G_GNUC_UNUSED GeanyPlugin *plugin, Gtk
gtk_widget_show_all(vbox);
-#if ! GTK_CHECK_VERSION(2, 10, 0) - gtk_widget_hide(check_systray); -#endif - return vbox; }
Modified: addons/src/ao_doclist.c 17 lines changed, 0 insertions(+), 17 deletions(-) =================================================================== @@ -141,13 +141,8 @@ static void ao_popup_position_menu(GtkMenu *menu, gint *x, gint *y, gboolean *pu /* Get the root coordinates of the toolbar's window */ int wx_root, wy_root, width; window = gtk_widget_get_window (gtk_widget_get_ancestor(widget, GTK_TYPE_TOOLBAR)); -#if GTK_CHECK_VERSION(3, 0, 0) gdk_window_get_geometry(window, &wx, &wy, &width, NULL); gtk_widget_get_preferred_size(widget, &widget_req, NULL); -#else - gdk_window_get_geometry(window, &wx, &wy, &width, NULL, NULL); - gtk_widget_size_request(widget, &widget_req); -#endif gdk_window_get_root_coords(window, wx, wy, &wx_root, &wy_root);
/* Approximate the horizontal location of the overflow menu button */ @@ -173,11 +168,7 @@ static void ao_popup_position_menu(GtkMenu *menu, gint *x, gint *y, gboolean *pu else gdk_window_get_origin(window, &wx, &wy); } -#if GTK_CHECK_VERSION(3, 0, 0) gtk_widget_get_preferred_size(widget, &widget_req, NULL); -#else - gtk_widget_size_request(widget, &widget_req); -#endif widget_height = widget_req.height; /* Better than allocation.height */
/* Calculate menu position */ @@ -270,13 +261,7 @@ static gboolean ao_create_proxy_menu_cb(GtkToolItem *widget, gpointer data) /* Create the menu item if needed */ if (priv->overflow_menu_item == NULL) { -#if GTK_CHECK_VERSION(3, 0, 0) priv->overflow_menu_item = gtk_menu_item_new_with_label("Document List"); -#else - GtkWidget *menu_image = gtk_image_new_from_icon_name(GTK_STOCK_INDEX, GTK_ICON_SIZE_MENU); - priv->overflow_menu_item = gtk_image_menu_item_new_with_label("Document List"); - gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(priv->overflow_menu_item), menu_image); -#endif g_signal_connect(priv->overflow_menu_item, "activate", G_CALLBACK(ao_toolbar_item_doclist_clicked_cb), data); } @@ -306,10 +291,8 @@ static void ao_toolbar_update(AoDocList *self) if (priv->toolbar_doclist_button == NULL) { priv->toolbar_doclist_button = gtk_tool_button_new_from_stock(GTK_STOCK_INDEX); -#if GTK_CHECK_VERSION(2, 12, 0) gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(priv->toolbar_doclist_button), _("Show Document List")); -#endif plugin_add_toolbar_item(geany_plugin, priv->toolbar_doclist_button); ui_add_document_sensitive(GTK_WIDGET(priv->toolbar_doclist_button));
Modified: addons/src/ao_systray.c 16 lines changed, 1 insertions(+), 15 deletions(-) =================================================================== @@ -45,9 +45,7 @@ struct _AoSystrayPrivate gboolean enable_systray;
GtkWidget *popup_menu; -#if GTK_CHECK_VERSION(2, 10, 0) GtkStatusIcon *icon; -#endif };
enum @@ -68,12 +66,10 @@ G_DEFINE_TYPE(AoSystray, ao_systray, G_TYPE_OBJECT)
static void ao_systray_finalize(GObject *object) { -#if GTK_CHECK_VERSION(2, 10, 0) AoSystrayPrivate *priv = AO_SYSTRAY_GET_PRIVATE(object);
g_object_unref(priv->icon); g_object_unref(priv->popup_menu); -#endif
G_OBJECT_CLASS(ao_systray_parent_class)->finalize(object); } @@ -88,9 +84,7 @@ static void ao_systray_set_property(GObject *object, guint prop_id, { case PROP_ENABLE_SYSTRAY: priv->enable_systray = g_value_get_boolean(value); -#if GTK_CHECK_VERSION(2, 10, 0) gtk_status_icon_set_visible(priv->icon, priv->enable_systray); -#endif break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); @@ -121,7 +115,6 @@ static void ao_systray_class_init(AoSystrayClass *klass) }
-#if GTK_CHECK_VERSION(2, 10, 0) static void icon_activate_cb(GtkStatusIcon *status_icon, gpointer data) { if (gtk_window_is_active(GTK_WINDOW(geany->main_widgets->window))) @@ -135,7 +128,7 @@ static void icon_popup_menu_cmd_clicked_cb(GtkMenuItem *item, gpointer data) { GtkWidget *widget; const gchar *widget_name = NULL; - + switch (GPOINTER_TO_INT(data)) { case WIDGET_OPEN: @@ -178,12 +171,10 @@ static void icon_popup_menu_cb(GtkStatusIcon *status_icon, guint button, guint a if (button == 3) gtk_menu_popup(GTK_MENU(priv->popup_menu), NULL, NULL, NULL, NULL, button, activate_time); } -#endif
static void ao_systray_init(AoSystray *self) { -#if GTK_CHECK_VERSION(2, 10, 0) AoSystrayPrivate *priv = AO_SYSTRAY_GET_PRIVATE(self); GtkWidget *item; const gchar *icon_name; @@ -196,11 +187,7 @@ static void ao_systray_init(AoSystray *self) gtk_status_icon_set_from_pixbuf(priv->icon, gtk_window_get_icon( GTK_WINDOW(geany->main_widgets->window)));
-#if GTK_CHECK_VERSION(2, 16, 0) gtk_status_icon_set_tooltip_text(priv->icon, "Geany"); -#else - gtk_status_icon_set_tooltip(priv->icon, "Geany"); -#endif
priv->popup_menu = gtk_menu_new(); g_object_ref_sink(priv->popup_menu); @@ -238,7 +225,6 @@ static void ao_systray_init(AoSystray *self)
g_signal_connect(priv->icon, "activate", G_CALLBACK(icon_activate_cb), NULL); g_signal_connect(priv->icon, "popup-menu", G_CALLBACK(icon_popup_menu_cb), self); -#endif }
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).