Use GtkBuilder to construct the Properties window
Problem definition
The Properties dialog is an fundamental feature of Files. It exposes information that wouldn't fit in the main views and allows to edit some attributes and permissions. Secondarily, it acts as an extension point.
Despite that, its design is showing its age. It doesn't make use of modern design patterns nor applies the layout best practices from the HIG.
The Properties dialog's UI is 100% constructed from the C source code in src/nautilus-properties-window.c
, intertwined with business logic. This makes it very cumbersome to modify the UI and, therefore, to apply design improvements.
Proposed solution
Quoting from https://developer.gnome.org/gtk3/stable/ch01s03.html
GTK+ supports the separation of user interface layout from your business logic, by using UI descriptions in an XML format that can be parsed by the GtkBuilder class.
UI definitions are already used in other parts of this application. They can be edited with GNOME/glade> and even from GNOME/gnome-builder> .
Scope and constraints
The porting to GtkBuilder UI definitions can be done by parts, or all at once.
Major UI redesign is not in scope of this issue, since we don't have mockups yet.
Minor UI design changes (such as paddings, alignments, etc.) are okay, particularly if they improve compliance with the HIG.
Extensions can provide custom tabs in Properties that we are still going to add programmatically. See libnautilus-extension/nautilus-property-page[-provider].{c,h}
We also need to keep in mind that we may change how these extension tabs are created: !248 (closed)
Related tasks
Cleanup
-
Remove now-dead code. -
Stop setting "inconsistent_string" data; use the macro instead of getting the data. -
Stop setting "use_original" data; refactor and merge value_field_update()
withvalue_field_update_internal()
to assumeFALSE
for all except the"where"
attribute. -
Stop setting the "help-uri" data. -
Remove struct members set by gtk_widget_class_bind_template_child()
which are not used. -
Remove unused macros. - ...
Modernization
-
Use modern GLib macros ( g_autofree
,g_autoptr()
,g_autolist()
,g_steal_pointer()
,g_clear_pointer()
,g_clear_object()
,g_set_object()
,...) whenever it simplifies the code. -
Use self
as symbol name for theNautilusPropertiesWindow *
parameter of every method found inside properties-window.c and .h. - ...
HIG compliance tasks
-
Apply the HIG's advice on visual layout -
"Label alignment" section for grid labels -
6px─12px─18px rule for grids. -
18px general padding between content and window borders
-
-
Set dim-label
style class on title labels. -
Drop colons ( :
) from the title labels. - ...
Bugfix tasks
-
Allow closing the Properties window using Esc. - ...