diff --git a/data/builder-dark.style-scheme.xml b/data/builder-dark.style-scheme.xml
index 3421b4ac8f22114b709b03737369bb8d7fb1802f..d0802d144762b3b20b4450fe973a7f049a9eb0ca 100644
--- a/data/builder-dark.style-scheme.xml
+++ b/data/builder-dark.style-scheme.xml
@@ -59,12 +59,14 @@
-
-
+
+
+
+
-
+
@@ -72,23 +74,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -125,16 +111,29 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
-
+
+
+
@@ -184,14 +195,4 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/data/builder.style-scheme.xml b/data/builder.style-scheme.xml
new file mode 100644
index 0000000000000000000000000000000000000000..4227ec470c35b64f6dffeb12165be5c8c8953679
--- /dev/null
+++ b/data/builder.style-scheme.xml
@@ -0,0 +1,188 @@
+
+
+
+ Christian Hergert
+ The default color scheme for Builder
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/data/meson.build b/data/meson.build
index 3f34d509e7aa74a700f093641b010fd47e01c953..084b626c4cedf8dceb1a1762e5f0efd2f605277c 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -17,6 +17,11 @@ i18n.merge_file(
install_dir: join_paths(datadir, 'metainfo')
)
+install_data(
+ 'builder.style-scheme.xml',
+ install_dir: join_paths(pkgdatadir, 'gtksourceview-4/styles')
+)
+
install_data(
'builder-dark.style-scheme.xml',
install_dir: join_paths(pkgdatadir, 'gtksourceview-4/styles')
diff --git a/src/ui/application.js b/src/ui/application.js
index 53fe2b40a398d715fee54f2b18d8217ecb2e2854..601510dc875e89f57c3840494b2ddb46ca6b0c71 100644
--- a/src/ui/application.js
+++ b/src/ui/application.js
@@ -84,8 +84,6 @@ var NautilusPreviewer2Skeleton = class extends NautilusPreviewerSkeleton {
var Application = GObject.registerClass(class Application extends Gtk.Application {
vfunc_startup() {
super.vfunc_startup();
-
- this._defineStyleAndThemes();
}
vfunc_dbus_register(connection, path) {
@@ -123,11 +121,6 @@ var Application = GObject.registerClass(class Application extends Gtk.Applicatio
});
}
- _defineStyleAndThemes() {
- let settings = Gtk.Settings.get_default();
- settings.gtk_application_prefer_dark_theme = true;
- }
-
close() {
if (this._mainWindow)
this._mainWindow.destroy();
diff --git a/src/viewers/text.js b/src/viewers/text.js
index 4c16fb5ddee866d1b4c58084b306eaa985d50dfc..84e5dd3921cf0aef58d52704d0c86c3359ca4d3d 100644
--- a/src/viewers/text.js
+++ b/src/viewers/text.js
@@ -68,7 +68,10 @@ var Klass = GObject.registerClass({
'styles']);
styleManager.prepend_search_path(stylePath);
- let scheme = styleManager.get_scheme('builder-dark');
+ let settings = Gtk.Settings.get_default();
+ let scheme = styleManager.get_scheme(settings.gtk_application_prefer_dark_theme
+ ? 'builder-dark'
+ : 'builder');
buffer.set_style_scheme(scheme);
let langManager = GtkSource.LanguageManager.get_default();