After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 724826 - Side panel switcher: no popover menu when only one panel
Side panel switcher: no popover menu when only one panel
Status: RESOLVED FIXED
Product: gedit
Classification: Applications
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: Gedit maintainers
Gedit maintainers
Depends on:
Blocks:
 
 
Reported: 2014-02-20 20:12 UTC by sébastien lafargue
Modified: 2014-02-22 11:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Side panel switcher: no popover menu when only one panel (2.89 KB, patch)
2014-02-20 20:14 UTC, sébastien lafargue
none Details | Review
Side panel switcher: no popover menu when only one panel (6.55 KB, patch)
2014-02-21 22:18 UTC, sébastien lafargue
needs-work Details | Review
Side panel switcher: no popover menu when only one panel (6.54 KB, patch)
2014-02-21 23:03 UTC, sébastien lafargue
none Details | Review
Side panel switcher: no popover menu when only one panel (5.56 KB, patch)
2014-02-21 23:33 UTC, sébastien lafargue
none Details | Review

Description sébastien lafargue 2014-02-20 20:12:54 UTC
When there's only one page in side-panel, we don't want popover menu to appear
Comment 1 sébastien lafargue 2014-02-20 20:14:07 UTC
Created attachment 269831 [details] [review]
Side panel switcher: no popover menu when only one panel
Comment 2 sébastien lafargue 2014-02-21 22:18:10 UTC
Created attachment 269954 [details] [review]
Side panel switcher: no popover menu when only one panel
Comment 3 Paolo Borelli 2014-02-21 22:57:06 UTC
Review of attachment 269954 [details] [review]:

::: gedit/gedit-window.c
@@ +2422,2 @@
 static void
+on_side_panel_stack_child_title_changed (GtkWidget   *widget,

I am not sure we need to be so fancy: we know for sure that if there is only one child, then it is the documents pane since that one is not removable, so we can just put the "Documents" label in the ui file and do not update it dynamically

@@ +2460,3 @@
+{
+	GeditWindowPrivate *priv = window->priv;
+

You are leaking the list

@@ +2479,3 @@
+                                GeditWindow *window)
+{
+	priv->side_stack_switcher = priv->side_stack_switcher_tmp;

nitpick: one arg per line in g_signal_connect (I dp not 100% like this rule, but most of gedit-window.c is like that)

@@ +2498,3 @@
 {
 	GtkWidget *documents_panel;
+	GeditWindowPrivate *priv = window->priv;

nitpick: make priv the first var

@@ +2511,3 @@
+
+	g_object_ref (priv->side_stack_switcher_tmp);
+	g_object_ref (priv->side_stack_switcher);

you need to ref_sink the widget that is not added to the container

@@ +2516,3 @@
+	                                      GTK_STACK (priv->side_panel));
+
+	g_object_ref (priv->side_stack_switcher);

indentation is off
Comment 4 sébastien lafargue 2014-02-21 23:03:39 UTC
Created attachment 269956 [details] [review]
Side panel switcher: no popover menu when only one panel
Comment 5 sébastien lafargue 2014-02-21 23:33:06 UTC
Created attachment 269960 [details] [review]
Side panel switcher: no popover menu when only one panel
Comment 6 Paolo Borelli 2014-02-22 11:29:45 UTC
amended the patch a bit to use headerbar title property instead of manually using a label.