diff options
-rw-r--r-- | docs/reference/gtk/Makefile.am | 1 | ||||
-rw-r--r-- | docs/reference/gtk/getting_started.xml | 32 | ||||
-rw-r--r-- | docs/reference/gtk/images/getting-started-app10.png | bin | 0 -> 102678 bytes | |||
-rw-r--r-- | examples/application10/exampleappwin.c | 1 |
4 files changed, 32 insertions, 2 deletions
diff --git a/docs/reference/gtk/Makefile.am b/docs/reference/gtk/Makefile.am index c1afc06c55..848bcd731c 100644 --- a/docs/reference/gtk/Makefile.am +++ b/docs/reference/gtk/Makefile.am @@ -421,6 +421,7 @@ HTML_IMAGES = \ $(srcdir)/images/getting-started-app7.png \ $(srcdir)/images/getting-started-app8.png \ $(srcdir)/images/getting-started-app9.png \ + $(srcdir)/images/getting-started-app10.png \ $(srcdir)/images/exampleapp.png \ $(srcdir)/images/flow-box.png diff --git a/docs/reference/gtk/getting_started.xml b/docs/reference/gtk/getting_started.xml index 3ba58e80d7..ee86358c04 100644 --- a/docs/reference/gtk/getting_started.xml +++ b/docs/reference/gtk/getting_started.xml @@ -959,7 +959,7 @@ example_app_window_init (ExampleAppWindow *win) <ulink url="https://git.gnome.org/browse/gtk+/tree/examples/application9/exampleappwin.c">full source</ulink> if you are interested in the details.</para> - <para>This brings our example application to its final appearance:</para> + <para>This brings our example application to this appearance:</para> <informalfigure> <mediaobject> @@ -969,5 +969,35 @@ example_app_window_init (ExampleAppWindow *win) </mediaobject> </informalfigure> </section> + <section> + <title>Header bar</title> + + <para>Our application already uses a GtkHeaderBar, but so far it + still gets a 'normal' window titlebar on top of that. This is a + bit redundant, and we will now tell GTK+ to use the header bar + as replacement for the titlebar. To do so, we move it around to + be a direct child of the window, and set its type to be titlebar.</para> + + <informalexample> + <programlisting><xi:include href="../../../../examples/application10/window.ui" parse="text"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting> + </informalexample> + + <para>A small extra refinement that we have added here is to allow + the header bar to provide a fallback application menu, by setting + the show-fallback-app-menu property to TRUE. Here is how the + application now looks, if this fallback is used.</para> + + <informalfigure> + <mediaobject> + <imageobject> + <imagedata fileref="getting-started-app10.png" format="PNG"/> + </imageobject> + </mediaobject> + </informalfigure> + + <para>If we set up the window icon for our window, the menu button + will use that instead of the generic placeholder icon you see + here. + </section> </section> </chapter> diff --git a/docs/reference/gtk/images/getting-started-app10.png b/docs/reference/gtk/images/getting-started-app10.png Binary files differnew file mode 100644 index 0000000000..5e11c4ca7b --- /dev/null +++ b/docs/reference/gtk/images/getting-started-app10.png diff --git a/examples/application10/exampleappwin.c b/examples/application10/exampleappwin.c index 5e7a2784e2..4c0efc65e0 100644 --- a/examples/application10/exampleappwin.c +++ b/examples/application10/exampleappwin.c @@ -241,7 +241,6 @@ example_app_window_init (ExampleAppWindow *win) priv->lines_label, "visible", G_BINDING_DEFAULT); - gtk_window_set_icon_name (GTK_WINDOW (win), "sunny"); g_object_set (gtk_settings_get_default (), "gtk-shell-shows-app-menu", FALSE, NULL); gtk_application_window_set_show_menubar (GTK_APPLICATION_WINDOW (win), TRUE); } |