[gtk+] Use gtk_popover_popdown/popup where appropriate
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Use gtk_popover_popdown/popup where appropriate
- Date: Tue, 16 Aug 2016 15:55:52 +0000 (UTC)
commit a985e62b25132c7f0043fa1073e371f19bbef4c5
Author: Timm Bäder <mail baedert org>
Date: Wed Aug 10 19:18:27 2016 +0200
Use gtk_popover_popdown/popup where appropriate
https://bugzilla.gnome.org/show_bug.cgi?id=769706
gtk/gtkcolorswatch.c | 2 +-
gtk/gtkentry.c | 6 +++---
gtk/gtkfilechooserwidget.c | 8 ++++----
gtk/gtkmenubutton.c | 4 ++--
gtk/gtkmodelbutton.c | 2 +-
gtk/gtkplacessidebar.c | 6 +++---
gtk/gtkscalebutton.c | 4 ++--
gtk/gtkshortcutswindow.c | 2 +-
gtk/gtktextview.c | 4 ++--
gtk/inspector/actions.c | 2 +-
gtk/inspector/css-node-tree.c | 2 +-
gtk/inspector/prop-list.c | 2 +-
12 files changed, 22 insertions(+), 22 deletions(-)
---
diff --git a/gtk/gtkcolorswatch.c b/gtk/gtkcolorswatch.c
index 9fe3ac1..106a19b 100644
--- a/gtk/gtkcolorswatch.c
+++ b/gtk/gtkcolorswatch.c
@@ -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
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 15a1588..530b551 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -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));
}
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index 0ff9813..87ab075 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -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 */
diff --git a/gtk/gtkmenubutton.c b/gtk/gtkmenubutton.c
index c27cff9..4534b4d 100644
--- a/gtk/gtkmenubutton.c
+++ b/gtk/gtkmenubutton.c
@@ -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)
diff --git a/gtk/gtkmodelbutton.c b/gtk/gtkmodelbutton.c
index 209f60d..9fe21e7 100644
--- a/gtk/gtkmodelbutton.c
+++ b/gtk/gtkmodelbutton.c
@@ -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));
}
}
diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c
index 595fd38..70f5e5e 100644
--- a/gtk/gtkplacessidebar.c
+++ b/gtk/gtkplacessidebar.c
@@ -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);
}
diff --git a/gtk/gtkscalebutton.c b/gtk/gtkscalebutton.c
index cdca312..78204e2 100644
--- a/gtk/gtkscalebutton.c
+++ b/gtk/gtkscalebutton.c
@@ -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
diff --git a/gtk/gtkshortcutswindow.c b/gtk/gtkshortcutswindow.c
index e106f15..02dfb0a 100644
--- a/gtk/gtkshortcutswindow.c
+++ b/gtk/gtkshortcutswindow.c
@@ -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
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 37b9cdf..403aad4 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -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);
diff --git a/gtk/inspector/actions.c b/gtk/inspector/actions.c
index a3d0b0b..cd6f413 100644
--- a/gtk/inspector/actions.c
+++ b/gtk/inspector/actions.c
@@ -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);
diff --git a/gtk/inspector/css-node-tree.c b/gtk/inspector/css-node-tree.c
index dde4089..fa9fcc2 100644
--- a/gtk/inspector/css-node-tree.c
+++ b/gtk/inspector/css-node-tree.c
@@ -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);
}
diff --git a/gtk/inspector/prop-list.c b/gtk/inspector/prop-list.c
index e946444..cf75d93 100644
--- a/gtk/inspector/prop-list.c
+++ b/gtk/inspector/prop-list.c
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]