Commit a985e62b authored by Timm Bäder's avatar Timm Bäder 👎 Committed by Matthias Clasen

Use gtk_popover_popdown/popup where appropriate

https://bugzilla.gnome.org/show_bug.cgi?id=769706
parent a6b9b364
......@@ -365,7 +365,7 @@ do_popup (GtkColorSwatch *swatch)
gtk_widget_show_all (box);
}
gtk_widget_show (swatch->priv->popover);
gtk_popover_popup (GTK_POPOVER (swatch->priv->popover));
}
static gboolean
......
......@@ -4582,7 +4582,7 @@ gtk_entry_show_magnifier (GtkEntry *entry,
rect.y + rect.height / 2);
gtk_popover_set_pointing_to (GTK_POPOVER (priv->magnifier_popover),
&rect);
gtk_widget_show (priv->magnifier_popover);
gtk_popover_popup (GTK_POPOVER (priv->magnifier_popover));
}
static void
......@@ -4736,7 +4736,7 @@ gtk_entry_drag_gesture_end (GtkGestureDrag *gesture,
priv->in_drag = FALSE;
if (priv->magnifier_popover)
gtk_widget_hide (priv->magnifier_popover);
gtk_popover_popdown (GTK_POPOVER (priv->magnifier_popover));
/* Check whether the drag was cancelled rather than finished */
if (!gtk_gesture_handles_sequence (GTK_GESTURE (gesture), sequence))
......@@ -6627,7 +6627,7 @@ gtk_entry_handle_drag_finished (GtkTextHandle *handle,
}
if (priv->magnifier_popover)
gtk_widget_hide (priv->magnifier_popover);
gtk_popover_popdown (GTK_POPOVER (priv->magnifier_popover));
}
......
......@@ -1150,7 +1150,7 @@ new_folder_create_clicked (GtkButton *button,
name = gtk_entry_get_text (GTK_ENTRY (priv->new_folder_name_entry));
file = g_file_get_child_for_display_name (priv->current_folder, name, &error);
gtk_widget_hide (priv->new_folder_popover);
gtk_popover_popdown (GTK_POPOVER (priv->new_folder_popover));
if (file)
{
......@@ -1592,7 +1592,7 @@ rename_file_rename_clicked (GtkButton *button,
GFile *dest;
const gchar* new_name;
gtk_widget_hide (priv->rename_file_popover);
gtk_popover_popdown (GTK_POPOVER (priv->rename_file_popover));
new_name = gtk_entry_get_text (GTK_ENTRY (priv->rename_file_name_entry));
dest = g_file_get_parent (priv->rename_file_source_file);
......@@ -1642,7 +1642,7 @@ rename_selected_cb (GtkTreeModel *model,
g_free (filename);
gtk_popover_set_pointing_to (GTK_POPOVER (priv->rename_file_popover), &rect);
gtk_widget_show (priv->rename_file_popover);
gtk_popover_popup (GTK_POPOVER (priv->rename_file_popover));
gtk_widget_grab_focus (priv->rename_file_popover);
}
......@@ -2362,7 +2362,7 @@ file_list_show_popover (GtkFileChooserWidget *impl,
}
gtk_popover_set_pointing_to (GTK_POPOVER (priv->browse_files_popover), &rect);
gtk_widget_show (priv->browse_files_popover);
gtk_popover_popup (GTK_POPOVER (priv->browse_files_popover));
}
/* Callback used for the GtkWidget::popup-menu signal of the file list */
......
......@@ -422,9 +422,9 @@ gtk_menu_button_toggled (GtkToggleButton *button)
else if (priv->popover)
{
if (active)
gtk_widget_show (priv->popover);
gtk_popover_popup (GTK_POPOVER (priv->popover));
else
gtk_widget_hide (priv->popover);
gtk_popover_popdown (GTK_POPOVER (priv->popover));
}
if (GTK_TOGGLE_BUTTON_CLASS (gtk_menu_button_parent_class)->toggled)
......
......@@ -1047,7 +1047,7 @@ gtk_model_button_clicked (GtkButton *button)
popover = gtk_widget_get_ancestor (GTK_WIDGET (button), GTK_TYPE_POPOVER);
if (popover != NULL)
gtk_widget_hide (popover);
gtk_popover_popdown (GTK_POPOVER (popover));
}
}
......
......@@ -2475,7 +2475,7 @@ do_rename (GtkButton *button,
g_clear_pointer (&sidebar->rename_uri, g_free);
if (sidebar->rename_popover)
gtk_widget_hide (sidebar->rename_popover);
gtk_popover_popdown (GTK_POPOVER (sidebar->rename_popover));
}
static void
......@@ -2615,7 +2615,7 @@ show_rename_popover (GtkSidebarRow *row)
gtk_popover_set_relative_to (GTK_POPOVER (sidebar->rename_popover), GTK_WIDGET (row));
setup_popover_shadowing (sidebar->rename_popover);
gtk_widget_show (sidebar->rename_popover);
gtk_popover_popup (GTK_POPOVER (sidebar->rename_popover));
gtk_widget_grab_focus (sidebar->rename_entry);
g_free (name);
......@@ -3478,7 +3478,7 @@ show_row_popover (GtkSidebarRow *row)
gtk_popover_set_relative_to (GTK_POPOVER (sidebar->popover), GTK_WIDGET (row));
sidebar->context_row = row;
gtk_widget_show (sidebar->popover);
gtk_popover_popup (GTK_POPOVER (sidebar->popover));
g_object_unref (sidebar);
}
......
......@@ -824,7 +824,7 @@ gtk_scale_popup (GtkWidget *widget)
gint w, h;
gint size;
gtk_widget_show (priv->dock);
gtk_popover_popup (GTK_POPOVER (priv->dock));
toplevel = gtk_widget_get_toplevel (widget);
_gtk_window_get_shadow_width (GTK_WINDOW (toplevel), &border);
......@@ -849,7 +849,7 @@ gtk_scale_button_popdown (GtkWidget *widget)
GtkScaleButton *button = GTK_SCALE_BUTTON (widget);
GtkScaleButtonPrivate *priv = button->priv;
gtk_widget_hide (priv->dock);
gtk_popover_popdown (GTK_POPOVER (priv->dock));
}
static void
......
......@@ -511,7 +511,7 @@ gtk_shortcuts_window__list_box__row_activated (GtkShortcutsWindow *self,
section = g_object_get_data (G_OBJECT (row), "gtk-shortcuts-section");
gtk_stack_set_visible_child (priv->stack, section);
gtk_widget_hide (GTK_WIDGET (priv->popover));
gtk_popover_popdown (priv->popover);
}
static gboolean
......
......@@ -5173,7 +5173,7 @@ gtk_text_view_show_magnifier (GtkTextView *text_view,
gtk_popover_set_pointing_to (GTK_POPOVER (priv->magnifier_popover),
&rect);
gtk_widget_show (priv->magnifier_popover);
gtk_popover_popup (GTK_POPOVER (priv->magnifier_popover));
#undef N_LINES
}
......@@ -5317,7 +5317,7 @@ gtk_text_view_handle_drag_finished (GtkTextHandle *handle,
}
if (priv->magnifier_popover)
gtk_widget_hide (priv->magnifier_popover);
gtk_popover_popdown (GTK_POPOVER (priv->magnifier_popover));
}
static gboolean cursor_visible (GtkTextView *text_view);
......
......@@ -263,7 +263,7 @@ row_activated (GtkTreeView *tv,
editor = gtk_inspector_action_editor_new (group, prefix, name);
gtk_container_add (GTK_CONTAINER (popover), editor);
gtk_widget_show (popover);
gtk_popover_popup (GTK_POPOVER (popover));
g_signal_connect (popover, "hide", G_CALLBACK (gtk_widget_destroy), NULL);
......
......@@ -102,7 +102,7 @@ show_node_prop_editor (NodePropEditor *npe)
if (gtk_inspector_prop_editor_should_expand (GTK_INSPECTOR_PROP_EDITOR (editor)))
gtk_widget_set_vexpand (popover, TRUE);
gtk_widget_show (popover);
gtk_popover_popup (GTK_POPOVER (popover));
g_signal_connect (popover, "unmap", G_CALLBACK (gtk_widget_destroy), NULL);
}
......
......@@ -236,7 +236,7 @@ row_activated (GtkTreeView *tv,
g_signal_connect (editor, "show-object", G_CALLBACK (show_object), pl);
gtk_widget_show (popover);
gtk_popover_popup (GTK_POPOVER (popover));
g_signal_connect (popover, "unmap", G_CALLBACK (gtk_widget_destroy), NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment