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 723793 - Use header bars for dialogs
Use header bars for dialogs
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-02-06 20:13 UTC by William Jon McCann
Modified: 2014-02-07 14:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use header bars for dialogs (15.70 KB, patch)
2014-02-06 20:13 UTC, William Jon McCann
needs-work Details | Review
Use header bars for dialogs (16.46 KB, patch)
2014-02-07 14:14 UTC, William Jon McCann
reviewed Details | Review
Use header bars for dialogs (18.35 KB, patch)
2014-02-07 14:29 UTC, William Jon McCann
committed Details | Review

Description William Jon McCann 2014-02-06 20:13:10 UTC
Here is a patch to use header bars in the dialogs used by Nautilus.
Comment 1 William Jon McCann 2014-02-06 20:13:12 UTC
Created attachment 268336 [details] [review]
Use header bars for dialogs
Comment 2 Cosimo Cecchi 2014-02-07 11:54:16 UTC
Review of attachment 268336 [details] [review]:

Thanks! Looks mostly good - I left some comments below.

::: libnautilus-private/nautilus-file-conflict-dialog.c
@@ +626,3 @@
 	dialog = GTK_WIDGET (g_object_new (NAUTILUS_TYPE_FILE_CONFLICT_DIALOG,
+					   "use-header-bar", TRUE,
+					   "modal", TRUE,

Should this really be modal? You might want to use the window behind to get more information about the files conflicting

::: src/nautilus-connect-server-dialog.c
@@ -45,3 @@
 	GtkWidget *remove_menu_item;
 	GtkWidget *clear_menu_item;
-	GtkWidget *browse_button;

Why did you remove this?

::: src/nautilus-file-management-properties.ui
@@ -1300,3 @@
-      <action-widget response="-11">helpbutton1</action-widget>
-      <action-widget response="-7">closebutton1</action-widget>
-    </action-widgets>

You should also remove the code that connects to the "response" signal inside nautilus-file-management-properties.c then.

::: src/nautilus-properties-window.c
@@ +4849,3 @@
 
+	window = NAUTILUS_PROPERTIES_WINDOW (gtk_widget_new (NAUTILUS_TYPE_PROPERTIES_WINDOW,
+							     "modal", TRUE,

Not sure I agree this should be modal... you sometimes want to e.g. compare properties for two similar files or folders in the same directory.

@@ +4925,3 @@
 	}
 
+	gtk_container_set_border_width (GTK_CONTAINER (window), 0);

Hmm, the border width should be 0 by default, so I think this is not needed (same below)
Comment 3 William Jon McCann 2014-02-07 13:55:32 UTC
Review of attachment 268336 [details] [review]:

::: libnautilus-private/nautilus-file-conflict-dialog.c
@@ +626,3 @@
 	dialog = GTK_WIDGET (g_object_new (NAUTILUS_TYPE_FILE_CONFLICT_DIALOG,
+					   "use-header-bar", TRUE,
+					   "modal", TRUE,

OK, I've removed it for now.

::: src/nautilus-connect-server-dialog.c
@@ -45,3 @@
 	GtkWidget *remove_menu_item;
 	GtkWidget *clear_menu_item;
-	GtkWidget *browse_button;

The connect to server option is now placed beside the browse network item in the sidebar. From the command line the browse was disabled anyway. The browse feature isn't that useful at the moment for a few reasons. And it complicates the actions available in the header bar - and it isn't completely clear what browse means there (eg. if it acts on the current data entered or not). Better to just make the dialog do one thing I think.

::: src/nautilus-file-management-properties.ui
@@ -1300,3 @@
-      <action-widget response="-11">helpbutton1</action-widget>
-      <action-widget response="-7">closebutton1</action-widget>
-    </action-widgets>

Done.

::: src/nautilus-properties-window.c
@@ +4925,3 @@
 	}
 
+	gtk_container_set_border_width (GTK_CONTAINER (window), 0);

Right, the only one needed is the content area one it seems.
Comment 4 William Jon McCann 2014-02-07 14:14:04 UTC
Created attachment 268413 [details] [review]
Use header bars for dialogs
Comment 5 Cosimo Cecchi 2014-02-07 14:23:03 UTC
Review of attachment 268413 [details] [review]:

::: libnautilus-private/nautilus-file-conflict-dialog.c
@@ +626,3 @@
 	dialog = GTK_WIDGET (g_object_new (NAUTILUS_TYPE_FILE_CONFLICT_DIALOG,
+					   "use-header-bar", TRUE,
+					   "modal", TRUE,

Didn't you agree to drop this one?

::: src/nautilus-file-management-properties.c
@@ -737,3 @@
 	dialog = GTK_WIDGET (gtk_builder_get_object (builder, "file_management_dialog"));
-	g_signal_connect_data (dialog, "response",
-			       G_CALLBACK (nautilus_file_management_properties_dialog_response_cb),

The callback body should be removed too, this is the only place where it was referenced AFAICS
Comment 6 William Jon McCann 2014-02-07 14:29:26 UTC
Created attachment 268415 [details] [review]
Use header bars for dialogs
Comment 7 William Jon McCann 2014-02-07 14:32:29 UTC
Sorry, too many patches flying around here...

I removed the modal from the properties dialog. I got confused with the commenting in splinter. I don't want to remove modal from the conflict dialog. It presents context directly in the dialog and if it isn't enough we should add to it. The action is inherently modal. It stops so you don't mess up your files. And if there is any concern it should be canceled or skipped.
Comment 8 Cosimo Cecchi 2014-02-07 14:37:04 UTC
Review of attachment 268415 [details] [review]:

Cool; your rationale about the file conflict dialog makes sense, and this looks good now.
Comment 9 William Jon McCann 2014-02-07 14:38:15 UTC
Attachment 268415 [details] pushed as d8a8ab3 - Use header bars for dialogs