Merge lp:~midori/midori/preferences-headerbar into lp:midori

Proposed by Christian Dywan
Status: Needs review
Proposed branch: lp:~midori/midori/preferences-headerbar
Merge into: lp:midori
Prerequisite: lp:~midori/midori/webKit2Gtk3only
Diff against target: 58 lines (+16/-0)
2 files modified
katze/katze-preferences.c (+13/-0)
midori/midori-preferences.c (+3/-0)
To merge this branch: bzr merge lp:~midori/midori/preferences-headerbar
Reviewer Review Type Date Requested Status
Midori Devs Pending
Review via email: mp+333296@code.launchpad.net

This proposal supersedes a proposal from 2017-10-05.

Commit message

Use HeaderBar in preferences dialog

To post a comment you must log in.

Unmerged revisions

7167. By Christian Dywan

Merge lp:~midori/midori/webKit2Gtk3only

7166. By Christian Dywan

Use HeaderBar in preferences dialog

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'katze/katze-preferences.c'
2--- katze/katze-preferences.c 2017-11-07 01:26:47 +0000
3+++ katze/katze-preferences.c 2017-11-07 01:26:47 +0000
4@@ -71,6 +71,8 @@
5 g_free (dialog_title);
6
7 #if !HAVE_OSX
8+ if (g_strcmp0 (g_getenv ("GTK_CSD"), "1"))
9+ {
10 gtk_dialog_add_buttons (GTK_DIALOG (preferences),
11 GTK_STOCK_HELP, GTK_RESPONSE_HELP,
12 NULL);
13@@ -80,6 +82,7 @@
14 gtk_dialog_add_buttons (GTK_DIALOG (preferences),
15 GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
16 NULL);
17+ }
18 #endif
19
20 g_object_connect (preferences,
21@@ -154,6 +157,16 @@
22 priv->toolbar = gtk_stack_switcher_new ();
23 gtk_stack_switcher_set_stack (GTK_STACK_SWITCHER (priv->toolbar), GTK_STACK (priv->notebook));
24 gtk_widget_set_halign (priv->toolbar, GTK_ALIGN_CENTER);
25+ if (!g_strcmp0 (g_getenv ("GTK_CSD"), "1"))
26+ {
27+ GtkWidget* headerbar = gtk_header_bar_new ();
28+ gtk_header_bar_set_show_close_button (GTK_HEADER_BAR (headerbar), TRUE);
29+ gtk_header_bar_set_custom_title (GTK_HEADER_BAR (headerbar), priv->toolbar);
30+ gtk_widget_show (headerbar);
31+ gtk_window_set_titlebar (GTK_WINDOW (preferences), headerbar);
32+ gtk_widget_show (priv->toolbar);
33+ }
34+ else
35 gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (preferences))),
36 priv->toolbar, FALSE, FALSE, 0);
37 #endif
38
39=== modified file 'midori/midori-preferences.c'
40--- midori/midori-preferences.c 2015-07-06 21:26:46 +0000
41+++ midori/midori-preferences.c 2017-11-07 01:26:47 +0000
42@@ -262,6 +262,8 @@
43
44 g_object_get (preferences, "transient-for", &parent, NULL);
45 icon_name = parent ? gtk_window_get_icon_name (parent) : NULL;
46+ if (g_strcmp0 (g_getenv ("GTK_CSD"), "1"))
47+ {
48 if ((header = sokoke_xfce_header_new (icon_name,
49 gtk_window_get_title (GTK_WINDOW (preferences)))))
50 {
51@@ -269,6 +271,7 @@
52 gtk_box_pack_start (GTK_BOX (vbox), header, FALSE, FALSE, 0);
53 gtk_widget_show_all (header);
54 }
55+ }
56 _preferences = KATZE_PREFERENCES (preferences);
57
58 #define PAGE_NEW(__icon, __label) \

Subscribers

People subscribed via source and target branches

to all changes: