mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-16 21:50:34 +00:00
entry: Avoid bubblewindow popup/popdown API
Besides setting all positioning properties at once, popup() would just show the widget, so do that directly after just updating the position.
This commit is contained in:
parent
1813c8391c
commit
8384ef961e
@ -9361,7 +9361,7 @@ activate_bubble_cb (GtkWidget *item,
|
||||
{
|
||||
const gchar *signal = g_object_get_data (G_OBJECT (item), "gtk-signal");
|
||||
g_signal_emit_by_name (entry, signal);
|
||||
_gtk_bubble_window_popdown (GTK_BUBBLE_WINDOW (entry->priv->selection_bubble));
|
||||
gtk_widget_hide (entry->priv->selection_bubble);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -9406,6 +9406,9 @@ bubble_targets_received (GtkClipboard *clipboard,
|
||||
gtk_widget_destroy (priv->selection_bubble);
|
||||
|
||||
priv->selection_bubble = _gtk_bubble_window_new (GTK_WIDGET (entry));
|
||||
_gtk_bubble_window_set_position (GTK_BUBBLE_WINDOW (priv->selection_bubble),
|
||||
GTK_POS_TOP);
|
||||
|
||||
toolbar = GTK_WIDGET (gtk_toolbar_new ());
|
||||
gtk_toolbar_set_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_TEXT);
|
||||
gtk_toolbar_set_show_arrow (GTK_TOOLBAR (toolbar), FALSE);
|
||||
@ -9453,8 +9456,9 @@ bubble_targets_received (GtkClipboard *clipboard,
|
||||
rect.width = 0;
|
||||
}
|
||||
|
||||
_gtk_bubble_window_popup (GTK_BUBBLE_WINDOW (priv->selection_bubble),
|
||||
GTK_WIDGET (entry), &rect, GTK_POS_TOP);
|
||||
_gtk_bubble_window_set_pointing_to (GTK_BUBBLE_WINDOW (priv->selection_bubble),
|
||||
&rect);
|
||||
gtk_widget_show (priv->selection_bubble);
|
||||
|
||||
priv->selection_bubble_timeout_id = 0;
|
||||
}
|
||||
@ -9479,7 +9483,7 @@ gtk_entry_selection_bubble_popup_unset (GtkEntry *entry)
|
||||
priv = entry->priv;
|
||||
|
||||
if (priv->selection_bubble)
|
||||
_gtk_bubble_window_popdown (GTK_BUBBLE_WINDOW (priv->selection_bubble));
|
||||
gtk_widget_hide (priv->selection_bubble);
|
||||
|
||||
if (priv->selection_bubble_timeout_id)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user