summaryrefslogtreecommitdiff
blob: 0b98c35cd1487ac7dc261fb635064e3935871efe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
From 7da7309d203e51fb03c002f87a9a6ddd8ee67978 Mon Sep 17 00:00:00 2001
From: Debarshi Ray <debarshir@gnome.org>
Date: Tue, 17 Feb 2015 13:22:11 +0100
Subject: [PATCH 1/2] Revert "prefs: Remove dark theme pref"

This reverts commit 5f6c514a8840a5d1b87a8c399defee3b5052ec18.
---
 src/org.gnome.Terminal.gschema.xml |  5 +++++
 src/preferences.ui                 | 16 ++++++++++++++++
 src/terminal-app.c                 |  4 ++++
 src/terminal-prefs.c               |  9 ++++++++-
 src/terminal-schemas.h             |  1 +
 5 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/src/org.gnome.Terminal.gschema.xml b/src/org.gnome.Terminal.gschema.xml
index 051bdc4..95c5405 100644
--- a/src/org.gnome.Terminal.gschema.xml
+++ b/src/org.gnome.Terminal.gschema.xml
@@ -656,6 +656,11 @@
       <summary>Whether to show the menubar in new windows</summary>
     </key>
 
+    <key name="dark-theme" type="b">
+      <default>false</default>
+      <summary>Whether to use a dark theme variant</summary>
+    </key>
+
     <key name="new-terminal-mode" enum="org.gnome.Terminal.NewTerminalMode">
       <default>'window'</default>
       <summary>Whether to open new terminals as windows or tabs</summary>
diff --git a/src/preferences.ui b/src/preferences.ui
index f64a11b..df82508 100644
--- a/src/preferences.ui
+++ b/src/preferences.ui
@@ -139,6 +139,22 @@
                   </packing>
                 </child>
                 <child>
+                  <object class="GtkCheckButton" id="dark-theme-checkbutton">
+                    <property name="label" translatable="yes">Use _dark theme variant</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="use_underline">True</property>
+                    <property name="xalign">0</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">3</property>
+                  </packing>
+                </child>
+                <child>
                   <object class="GtkBox" id="hbox140">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
diff --git a/src/terminal-app.c b/src/terminal-app.c
index 8a9434f..95302c5 100644
--- a/src/terminal-app.c
+++ b/src/terminal-app.c
@@ -362,6 +362,10 @@ terminal_app_init (TerminalApp *app)
 
   /* Terminal global settings */
   app->global_settings = g_settings_new (TERMINAL_SETTING_SCHEMA);
+  g_settings_bind (app->global_settings, TERMINAL_SETTING_DARK_THEME_KEY,
+                   gtk_settings_get_default (),
+                   "gtk-application-prefer-dark-theme",
+                   G_SETTINGS_BIND_GET);
 
   /* Check if we need to migrate from gconf to dconf */
   maybe_migrate_settings (app);
diff --git a/src/terminal-prefs.c b/src/terminal-prefs.c
index 97f6c33..a57dde6 100644
--- a/src/terminal-prefs.c
+++ b/src/terminal-prefs.c
@@ -562,7 +562,7 @@ terminal_prefs_show_preferences (GtkWindow *transient_parent,
   GtkWidget *show_menubar_button, *disable_mnemonics_button, *disable_menu_accel_button;
   GtkWidget *disable_shortcuts_button;
   GtkWidget *tree_view_container, *new_button, *edit_button, *clone_button, *remove_button;
-  GtkWidget *new_terminal_mode_combo;
+  GtkWidget *dark_theme_button, *new_terminal_mode_combo;
   GtkWidget *default_hbox, *default_label;
   GtkTreeSelection *selection;
   GSettings *settings;
@@ -583,6 +583,7 @@ terminal_prefs_show_preferences (GtkWindow *transient_parent,
                                        "preferences-dialog",
                                        "preferences-dialog", &dialog,
                                        "default-show-menubar-checkbutton", &show_menubar_button,
+                                       "dark-theme-checkbutton", &dark_theme_button,
                                        "new-terminal-mode-combobox", &new_terminal_mode_combo,
                                        "disable-mnemonics-checkbutton", &disable_mnemonics_button,
                                        "disable-shortcuts-checkbutton", &disable_shortcuts_button,
@@ -613,6 +614,12 @@ terminal_prefs_show_preferences (GtkWindow *transient_parent,
                    G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
 
   g_settings_bind (settings,
+                   TERMINAL_SETTING_DARK_THEME_KEY,
+                   dark_theme_button,
+                   "active",
+                   G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
+
+  g_settings_bind (settings,
                    TERMINAL_SETTING_NEW_TERMINAL_MODE_KEY,
                    new_terminal_mode_combo,
                    "active-id",
diff --git a/src/terminal-schemas.h b/src/terminal-schemas.h
index 0fcbf52..c6acd7c 100644
--- a/src/terminal-schemas.h
+++ b/src/terminal-schemas.h
@@ -69,6 +69,7 @@ G_BEGIN_DECLS
 
 #define TERMINAL_SETTING_CONFIRM_CLOSE_KEY              "confirm-close"
 #define TERMINAL_SETTING_DEFAULT_SHOW_MENUBAR_KEY       "default-show-menubar"
+#define TERMINAL_SETTING_DARK_THEME_KEY                 "dark-theme"
 #define TERMINAL_SETTING_ENABLE_MENU_BAR_ACCEL_KEY      "menu-accelerator-enabled"
 #define TERMINAL_SETTING_ENABLE_MNEMONICS_KEY           "mnemonics-enabled"
 #define TERMINAL_SETTING_ENABLE_SHORTCUTS_KEY           "shortcuts-enabled"
-- 
2.1.0


From 9fc68b087180e48cb4e2275f3134f66f2c43de14 Mon Sep 17 00:00:00 2001
From: Debarshi Ray <debarshir@gnome.org>
Date: Tue, 17 Feb 2015 13:22:21 +0100
Subject: [PATCH 2/2] Revert "help: Remove dark theme pref"

This reverts commit baaca6a4cc5ca78d7b0e02cfaee6c159bad7ce4b.
---
 help/C/pref-theme.page | 41 +++++++++++++++++++++++++++++++++++++++++
 help/Makefile.am       |  1 +
 2 files changed, 42 insertions(+)
 create mode 100644 help/C/pref-theme.page

diff --git a/help/C/pref-theme.page b/help/C/pref-theme.page
new file mode 100644
index 0000000..a997d14
--- /dev/null
+++ b/help/C/pref-theme.page
@@ -0,0 +1,41 @@
+<page xmlns="http://projectmallard.org/1.0/"
+      xmlns:its="http://www.w3.org/2005/11/its"
+      type="guide"
+      id="pref-theme">
+
+  <info>
+    <link type="guide" xref="index#appearance"/>
+    <revision pkgversion="3.12" date="2014-02-26" status="review"/>
+
+    <credit type="author copyright">
+      <name>Ekaterina Gerasimova</name>
+      <email its:translate="no">kittykat3756@gmail.com</email>
+      <years>2014</years>
+    </credit>
+    <!--<credit type="copyright editor">
+      <name></name>
+      <email its:translate="no"></email>
+      <years></years>
+    </credit>-->
+
+    <include href="legal.xml" xmlns="http://www.w3.org/2001/XInclude"/>
+
+    <desc>Use either the light or dark theme for <app>Terminal</app>.</desc>
+  </info>
+
+  <title>Chose the window theme</title>
+
+  <p>You can chose to use either the dark theme or the light theme for the
+  terminal window.</p>
+
+  <steps>
+    <item>
+      <p>Select
+      <guiseq><gui style="menu">Edit</gui><gui style="menuitem">Preferences</gui><gui style="tab">General</gui></guiseq>.</p>
+    </item>
+    <item>
+      <p>To use the dark theme, select <gui>Use dark theme variant</gui>.</p>
+    </item>
+  </steps>
+
+</page>
diff --git a/help/Makefile.am b/help/Makefile.am
index 33389c5..9c02a74 100644
--- a/help/Makefile.am
+++ b/help/Makefile.am
@@ -35,6 +35,7 @@ HELP_FILES = \
 	pref-profile-encoding.page \
 	pref-scrolling.page \
 	pref-tab-window.page \
+	pref-theme.page \
 	pref-user-input.page \
 	profile.page \
 	prob-reset.page \
-- 
2.1.0