[gnome-terminal] prefs: Implement dark theme checkbox
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-terminal] prefs: Implement dark theme checkbox
- Date: Thu, 20 Jun 2013 20:29:29 +0000 (UTC)
commit 2bbb088eb7a1dc82870af5a5c73ebe7b42813b7a
Author: Christian Persch <chpe gnome org>
Date: Mon Feb 18 14:08:05 2013 +0100
prefs: Implement dark theme checkbox
https://bugzilla.gnome.org/show_bug.cgi?id=649358
Conflicts:
src/terminal-prefs.c
src/terminal-schemas.h
src/org.gnome.Terminal.gschema.xml.in | 5 +++++
src/preferences.ui | 21 +++++++++++++++++++--
src/terminal-app.c | 4 ++++
src/terminal-prefs.c | 8 ++++++++
src/terminal-schemas.h | 1 +
5 files changed, 37 insertions(+), 2 deletions(-)
---
diff --git a/src/org.gnome.Terminal.gschema.xml.in b/src/org.gnome.Terminal.gschema.xml.in
index 39e1077..35a4d67 100644
--- a/src/org.gnome.Terminal.gschema.xml.in
+++ b/src/org.gnome.Terminal.gschema.xml.in
@@ -617,6 +617,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>
+
<!-- <child name="profiles" schema="org.gnome.Terminal.ProfilesList" /> -->
<child name="keybindings" schema="org.gnome.Terminal.Legacy.Keybindings" />
diff --git a/src/preferences.ui b/src/preferences.ui
index 0b5b879..c1067a3 100644
--- a/src/preferences.ui
+++ b/src/preferences.ui
@@ -67,6 +67,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">12</property>
+ <property name="spacing">6</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkCheckButton" id="default-show-menubar-checkbutton">
@@ -85,6 +86,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">1</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkCheckButton" id="disable-mnemonics-checkbutton">
<property name="label" translatable="yes">_Enable mnemonics (such as Alt+F to open the
File menu)</property>
<property name="use_action_appearance">False</property>
@@ -99,7 +116,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">1</property>
+ <property name="position">2</property>
</packing>
</child>
<child>
@@ -117,7 +134,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">2</property>
+ <property name="position">3</property>
</packing>
</child>
</object>
diff --git a/src/terminal-app.c b/src/terminal-app.c
index 6d6fbe9..10672fd 100644
--- a/src/terminal-app.c
+++ b/src/terminal-app.c
@@ -361,6 +361,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 9150ffd..692a941 100644
--- a/src/terminal-prefs.c
+++ b/src/terminal-prefs.c
@@ -591,6 +591,7 @@ terminal_prefs_show_preferences (GtkWindow *transient_parent,
GtkWidget *dialog, *tree_view;
GtkWidget *show_menubar_button, *disable_mnemonics_button, *disable_menu_accel_button;
GtkWidget *tree_view_container, *new_button, *edit_button, *clone_button, *remove_button;
+ GtkWidget *dark_theme_button;
GtkWidget *default_hbox, *default_label;
GtkTreeSelection *selection;
GSettings *settings;
@@ -611,6 +612,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,
"disable-mnemonics-checkbutton", &disable_mnemonics_button,
"disable-menu-accel-checkbutton", &disable_menu_accel_button,
"accelerators-treeview", &tree_view,
@@ -638,6 +640,12 @@ terminal_prefs_show_preferences (GtkWindow *transient_parent,
"active",
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);
+
/* Keybindings tab */
g_settings_bind (settings,
diff --git a/src/terminal-schemas.h b/src/terminal-schemas.h
index 45051c8..86f66bd 100644
--- a/src/terminal-schemas.h
+++ b/src/terminal-schemas.h
@@ -67,6 +67,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_ENCODINGS_KEY "encodings"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]