[gnome-text-editor] preferences: unify dark style scheme check
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-text-editor] preferences: unify dark style scheme check
- Date: Fri, 3 Dec 2021 21:03:07 +0000 (UTC)
commit ae6aa266ce7e783227fd9e74811ff4c39577820c
Author: Christian Hergert <chergert redhat com>
Date: Fri Dec 3 12:56:53 2021 -0800
preferences: unify dark style scheme check
src/editor-preferences-dialog.c | 18 ++----------------
1 file changed, 2 insertions(+), 16 deletions(-)
---
diff --git a/src/editor-preferences-dialog.c b/src/editor-preferences-dialog.c
index e621a46..b95660e 100644
--- a/src/editor-preferences-dialog.c
+++ b/src/editor-preferences-dialog.c
@@ -25,6 +25,7 @@
#include "editor-page.h"
#include "editor-preferences-dialog-private.h"
+#include "editor-recoloring-private.h"
#include "editor-session.h"
#include "editor-window.h"
#include "editor-utils-private.h"
@@ -174,21 +175,6 @@ update_style_scheme_selection (EditorPreferencesDialog *self)
}
}
-static gboolean
-scheme_is_dark (GtkSourceStyleScheme *scheme)
-{
- const char *id = gtk_source_style_scheme_get_id (scheme);
- const char *variant = gtk_source_style_scheme_get_metadata (scheme, "variant");
-
- if (strstr (id, "-dark") != NULL)
- return TRUE;
-
- if (g_strcmp0 (variant, "dark") == 0)
- return TRUE;
-
- return FALSE;
-}
-
static void
update_style_schemes (EditorPreferencesDialog *self)
{
@@ -213,7 +199,7 @@ update_style_schemes (EditorPreferencesDialog *self)
scheme = gtk_source_style_scheme_manager_get_scheme (sm, scheme_ids[i]);
- if (is_dark != scheme_is_dark (scheme))
+ if (is_dark != _editor_source_style_scheme_is_dark (scheme))
continue;
preview = gtk_source_style_scheme_preview_new (scheme);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]