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 692174 - Use a GNOME 3 style titlebar/toolbar
Use a GNOME 3 style titlebar/toolbar
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
: 676557 692304 (view as bug list)
Depends on:
Blocks: 689611 694041 694043
 
 
Reported: 2013-01-21 08:42 UTC by William Jon McCann
Modified: 2013-02-18 15:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Refactor the shell (17.19 KB, patch)
2013-02-17 15:57 UTC, William Jon McCann
needs-work Details | Review
Make CcShell an interface (28.34 KB, patch)
2013-02-17 15:57 UTC, William Jon McCann
needs-work Details | Review
Rename shell window to CcWindow (26.49 KB, patch)
2013-02-17 15:57 UTC, William Jon McCann
needs-work Details | Review
Don't use gtkbuilder for constructing the shell (26.86 KB, patch)
2013-02-17 15:57 UTC, William Jon McCann
reviewed Details | Review
Use GdHeaderBar in the shell (4.09 KB, patch)
2013-02-17 15:57 UTC, William Jon McCann
none Details | Review
shell: put the panel title in the header instead of the window title (1.50 KB, patch)
2013-02-17 15:57 UTC, William Jon McCann
none Details | Review
Use GdHeaderBar in the shell (4.08 KB, patch)
2013-02-17 19:18 UTC, William Jon McCann
committed Details | Review
shell: put the panel title in the header instead of the window title (1.53 KB, patch)
2013-02-17 19:18 UTC, William Jon McCann
committed Details | Review
shell: make the application a GtkApplication subclass (17.37 KB, patch)
2013-02-18 14:30 UTC, William Jon McCann
committed Details | Review
shell: make the main app window a subclass of GtkApplicationWindow (28.51 KB, patch)
2013-02-18 14:30 UTC, William Jon McCann
committed Details | Review
shell: rename shell window to CcWindow (26.43 KB, patch)
2013-02-18 14:30 UTC, William Jon McCann
committed Details | Review
shell: don't use gtkbuilder for constructing the shell (27.07 KB, patch)
2013-02-18 14:30 UTC, William Jon McCann
committed Details | Review

Description William Jon McCann 2013-01-21 08:42:08 UTC
I think we should use a GNOME 3 style titlebar for the panels.

 * Always use Settings for the window title
 * Put the panel title in the center position of the titlebar/toolbar

 * Remove the "Enabled" label from the Search panel switch
 * Remove the Bluetooth label from the bluetooth panel switch 
 * etc
Comment 1 William Jon McCann 2013-01-22 15:56:36 UTC
*** Bug 692304 has been marked as a duplicate of this bug. ***
Comment 2 William Jon McCann 2013-02-17 15:57:07 UTC
Created attachment 236458 [details] [review]
Refactor the shell
Comment 3 William Jon McCann 2013-02-17 15:57:10 UTC
Created attachment 236459 [details] [review]
Make CcShell an interface

on an instance of an application window
Comment 4 William Jon McCann 2013-02-17 15:57:13 UTC
Created attachment 236460 [details] [review]
Rename shell window to CcWindow
Comment 5 William Jon McCann 2013-02-17 15:57:16 UTC
Created attachment 236461 [details] [review]
Don't use gtkbuilder for constructing the shell
Comment 6 William Jon McCann 2013-02-17 15:57:18 UTC
Created attachment 236462 [details] [review]
Use GdHeaderBar in the shell
Comment 7 William Jon McCann 2013-02-17 15:57:21 UTC
Created attachment 236463 [details] [review]
shell: put the panel title in the header instead of the window title
Comment 8 William Jon McCann 2013-02-17 19:18:36 UTC
Created attachment 236482 [details] [review]
Use GdHeaderBar in the shell
Comment 9 William Jon McCann 2013-02-17 19:18:38 UTC
Created attachment 236483 [details] [review]
shell: put the panel title in the header instead of the window title
Comment 10 William Jon McCann 2013-02-18 06:49:56 UTC
*** Bug 676557 has been marked as a duplicate of this bug. ***
Comment 11 Bastien Nocera 2013-02-18 08:15:15 UTC
Review of attachment 236458 [details] [review]:

Missing "shell: " prefix to the commit subject.

The cc-application.h/control-center.c pairing is bad, rename control-center.c

It would be good to explain in the commit message *why* you're doing this. Looks like shuffling code around from this end.

::: shell/control-center.c
@@ +186,2 @@
       if (start_panels[1])
+        g_debug ("Extra argument: %s", start_panels[1]);

Why are those lines changed?

@@ +188,2 @@
       else
+        g_debug ("No extra argument");

I don't see any differences. Spaces cleanups?

@@ +226,3 @@
 }
 
+

Line feeds.
Comment 12 Bastien Nocera 2013-02-18 08:21:01 UTC
Review of attachment 236459 [details] [review]:

Missing "shell: " prefix in subject line.

I don't understand why those changes are needed again.

::: shell/cc-shell.h
@@ +62,3 @@
 GType           cc_shell_get_type                 (void) G_GNUC_CONST;
 
+CcPanel *       cc_shell_get_active_panel         (CcShell      *shell);

Indentation fixes can go in a separate patch.

::: shell/gnome-control-center.c
@@ +59,3 @@
 #define MIN_ICON_VIEW_HEIGHT 300
 
+#define DEFAULT_WINDOW_TITLE _("Settings")

That should be:
N_("Settings");
and you'd call _(DEFAULT_WINDOW_TITLE) when used.

@@ +264,3 @@
   /* reset window title and icon */
+  gtk_window_set_role (GTK_WINDOW (self), NULL);
+  gtk_window_set_title (GTK_WINDOW (self), DEFAULT_WINDOW_TITLE);

Changing how the window defaults are set should be a separate patch.

@@ -1352,3 @@
 
-#ifdef HAVE_CHEESE
-  if (gtk_clutter_init (NULL, NULL) != CLUTTER_INIT_SUCCESS)

And that just disappears?
Comment 13 Bastien Nocera 2013-02-18 08:22:43 UTC
Review of attachment 236460 [details] [review]:

Missing prefix on subject line.

Again, why?

::: shell/gnome-control-center.c
@@ +1363,2 @@
   str = g_strdup_printf ("%u", (guint) GDK_WINDOW_XID (window));
+  g_setenv ("CC_WINDOW_XID", str, TRUE);

Excessive sed job.
Comment 14 Bastien Nocera 2013-02-18 08:23:20 UTC
Review of attachment 236461 [details] [review]:

Why?
Comment 15 Bastien Nocera 2013-02-18 08:23:57 UTC
Review of attachment 236482 [details] [review]:

Looks fine.
Comment 16 Bastien Nocera 2013-02-18 08:24:54 UTC
Review of attachment 236483 [details] [review]:

Looks fine.
Comment 17 William Jon McCann 2013-02-18 14:17:19 UTC
Review of attachment 236458 [details] [review]:

I will fix the commit comment but I think the other comments are because splinter isn't understanding that I did in fact rename control-center.c to cc-application.c.

::: shell/control-center.c
@@ +188,2 @@
       else
+        g_debug ("No extra argument");

I think splinter has a bug. These really aren't changed. The file was renamed from control-center.c to cc-application.c. I guess it confused it.
Comment 18 William Jon McCann 2013-02-18 14:21:14 UTC
Review of attachment 236459 [details] [review]:

::: shell/gnome-control-center.c
@@ +59,3 @@
 #define MIN_ICON_VIEW_HEIGHT 300
 
+#define DEFAULT_WINDOW_TITLE _("Settings")

Oops.

@@ +264,3 @@
   /* reset window title and icon */
+  gtk_window_set_role (GTK_WINDOW (self), NULL);
+  gtk_window_set_title (GTK_WINDOW (self), DEFAULT_WINDOW_TITLE);

It isn't easily separable. The reason it set the title in the way it did was because it was trying to pull the default title out of the child window from the uibuilder. Once we make the class a window itself we no longer need this.

@@ -1352,3 @@
 
-#ifdef HAVE_CHEESE
-  if (gtk_clutter_init (NULL, NULL) != CLUTTER_INIT_SUCCESS)

It was being done in two places for some reason. It is removed from here but left in the application initialization where it probably belongs.
Comment 19 William Jon McCann 2013-02-18 14:30:22 UTC
Created attachment 236592 [details] [review]
shell: make the application a GtkApplication subclass

This promotes better encapsulation and allows us to move
application logic out of main() and rename the confusingly
named control-center.c to main.c
Comment 20 William Jon McCann 2013-02-18 14:30:25 UTC
Created attachment 236593 [details] [review]
shell: make the main app window a subclass of GtkApplicationWindow

This allows for better encapsulation of window logic. In order to
do this CcShell was made an interface instead of an abstract base
class. Which makes much more sense anyway.
Comment 21 William Jon McCann 2013-02-18 14:30:28 UTC
Created attachment 236595 [details] [review]
shell: rename shell window to CcWindow

This avoids the confusion of the name gnome-control-center.c and
is consistent with all the other classes/files in the project.
Comment 22 William Jon McCann 2013-02-18 14:30:31 UTC
Created attachment 236596 [details] [review]
shell: don't use gtkbuilder for constructing the shell

So that we can more easily add GdHeaderBar in the following
patches.

Much of the advantage of using gtkbuilder was lost anyway because
we couldn't really use it from glade without corrupting the file.