diff options
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | src/gtkext/easygtk.c | 77 | ||||
-rw-r--r-- | src/gtkext/easygtk.h | 3 | ||||
-rw-r--r-- | src/gui/editor.c | 4 | ||||
-rw-r--r-- | src/gui/panels/bookmarks.c | 2 | ||||
-rw-r--r-- | src/gui/panels/regedit.c | 2 | ||||
-rw-r--r-- | src/gui/panels/strings.c | 2 |
7 files changed, 16 insertions, 86 deletions
@@ -1,5 +1,17 @@ 17-07-28 Cyrille Bagard <nocbos@gmail.com> + * src/gtkext/easygtk.c: + * src/gtkext/easygtk.h: + Remove useless code. + + * src/gui/editor.c: + * src/gui/panels/bookmarks.c: + * src/gui/panels/regedit.c: + * src/gui/panels/strings.c: + Replace all calls to the deprecated gtk_menu_popup() function. + +17-07-28 Cyrille Bagard <nocbos@gmail.com> + * src/gui/editor.c: Fix another bug by removing another nested function. diff --git a/src/gtkext/easygtk.c b/src/gtkext/easygtk.c index 4543934..05e93b2 100644 --- a/src/gtkext/easygtk.c +++ b/src/gtkext/easygtk.c @@ -1263,83 +1263,6 @@ gint qck_show_question(GtkWindow *parent, const char *title, const char *questio /****************************************************************************** * * -* Paramètres : menu = menu GTK à placer à l'écran. * -* x = abscisse absolue du coin supérieur du menu. [OUT] * -* y = ordonnée absolue du coin supérieur du menu. [OUT] * -* push = indique les relations avec les bordures. [OUT] * -* widget = composant auquel le menu doit être attaché. * -* * -* Description : Détermine la position d'un menu associé à un composant. * -* * -* Retour : - * -* * -* Remarques : - * -* * -******************************************************************************/ - -void attach_popup_menu_to_widget(GtkMenu *menu, gint *x, gint *y, gboolean *push, GtkWidget *widget) -{ - GtkTextDirection dir; /* Direction de l'affichage */ - GtkAllocation alloc; /* Emplacement alloué */ - GtkStyleContext *context; /* Style associé pour le rendu */ - GtkStateFlags state; /* Etat courant du composant */ - GtkBorder border; /* Bordure #1 à considérer */ - GtkBorder padding; /* Bordure #2 à considérer */ - GtkRequisition req; /* Taille requis */ - - *x = 0; - *y = 0; - - dir = gtk_widget_get_direction(widget); - - /* Emplacement du composant */ - - gtk_widget_get_allocation(widget, &alloc); - - if (!gtk_widget_get_has_window(widget)) - { - *x += alloc.x; - *y += alloc.y; - } - - gdk_window_get_root_coords(gtk_widget_get_window(widget), *x, *y, x, y); - - /* Extension supplémentaire */ - - context = gtk_widget_get_style_context(widget); - state = gtk_style_context_get_state(context); - - gtk_style_context_get_border(context, state, &border); - gtk_style_context_get_padding(context, state, &padding); - - if (dir == GTK_TEXT_DIR_RTL) - *x += border.left + padding.left; - else - *x -= (border.left + padding.left); - - *y += border.top + padding.top; - - /* Sens de lecture */ - - if (dir == GTK_TEXT_DIR_RTL) - { - gtk_widget_get_preferred_size(GTK_WIDGET(menu), NULL, &req); - - *x += alloc.width - req.width; - - } - - /* Finalisation... */ - - *y += alloc.height; - - *push = TRUE; - -} - - -/****************************************************************************** -* * * Paramètres : treeview = représentation graphique d'une liste à traiter. * * model = gestionnaire des données de la liste. * * iter = point à considérer pour l'opération. * diff --git a/src/gtkext/easygtk.h b/src/gtkext/easygtk.h index fee45db..f274301 100644 --- a/src/gtkext/easygtk.h +++ b/src/gtkext/easygtk.h @@ -127,9 +127,6 @@ GtkWidget *qck_create_tool_separator(GObject *, const char *); /* Affiche une boîte de dialogue offrant un choix "Oui/Non". */ gint qck_show_question(GtkWindow *, const char *, const char *); -/* Détermine la position d'un menu associé à un composant. */ -void attach_popup_menu_to_widget(GtkMenu *, gint *, gint *, gboolean *, GtkWidget *); - /* Fait défiler une liste jusqu'à un point donné. */ void scroll_to_treeview_iter(GtkTreeView *, GtkTreeModel *, GtkTreeIter *); diff --git a/src/gui/editor.c b/src/gui/editor.c index 5bab5d3..d042acd 100644 --- a/src/gui/editor.c +++ b/src/gui/editor.c @@ -1503,9 +1503,7 @@ static void on_dock_menu_request(GtkDockStation *station, GtkWidget *button, GOb /* Affichage du menu */ - gtk_menu_popup(GTK_MENU(menu), NULL, NULL, - (GtkMenuPositionFunc)attach_popup_menu_to_widget, button, - 0, gtk_get_current_event_time()); + gtk_menu_popup_at_widget(GTK_MENU(menu), button, GDK_GRAVITY_SOUTH_WEST, GDK_GRAVITY_NORTH_WEST, NULL); } diff --git a/src/gui/panels/bookmarks.c b/src/gui/panels/bookmarks.c index 5eb018b..9b360f3 100644 --- a/src/gui/panels/bookmarks.c +++ b/src/gui/panels/bookmarks.c @@ -1071,7 +1071,7 @@ static gboolean on_button_press_over_bookmarks(GtkWidget *widget, GdkEventButton break; case 3: - gtk_menu_popup(panel->menu, NULL, NULL, NULL, NULL, event->button, event->time); + gtk_menu_popup_at_pointer(panel->menu, (GdkEvent *)event); break; } diff --git a/src/gui/panels/regedit.c b/src/gui/panels/regedit.c index 501bd2f..0975c9e 100644 --- a/src/gui/panels/regedit.c +++ b/src/gui/panels/regedit.c @@ -911,7 +911,7 @@ static bool is_param_filtered(GRegeditPanel *panel, const char *name) static gboolean on_button_press_over_params(GtkWidget *widget, GdkEventButton *event, GRegeditPanel *panel) { if (event->button == 3) - gtk_menu_popup(panel->menu, NULL, NULL, NULL, NULL, event->button, event->time); + gtk_menu_popup_at_pointer(panel->menu, (GdkEvent *)event); return FALSE; diff --git a/src/gui/panels/strings.c b/src/gui/panels/strings.c index 60c53f4..8e7c702 100644 --- a/src/gui/panels/strings.c +++ b/src/gui/panels/strings.c @@ -846,7 +846,7 @@ static gboolean on_button_event_over_strings(GtkWidget *widget, GdkEventButton * case 3: if (event->type == GDK_BUTTON_RELEASE) - gtk_menu_popup(panel->menu, NULL, NULL, NULL, NULL, event->button, event->time); + gtk_menu_popup_at_pointer(panel->menu, (GdkEvent *)event); break; } |