[gnome-builder/wip/gtk4-port: 389/736] plugins/editorui: add more accessories to preferences




commit 09d662f5a584a0f815cde2eb374c691400d778f8
Author: Christian Hergert <chergert redhat com>
Date:   Mon Apr 4 16:13:30 2022 -0700

    plugins/editorui: add more accessories to preferences

 src/plugins/editorui/gbp-editorui-preferences-addin.c | 12 +++++++++++-
 src/plugins/editorui/gbp-editorui-preview.c           |  9 +++++++++
 2 files changed, 20 insertions(+), 1 deletion(-)
---
diff --git a/src/plugins/editorui/gbp-editorui-preferences-addin.c 
b/src/plugins/editorui/gbp-editorui-preferences-addin.c
index 3e1f60c7b..3889ccf3b 100644
--- a/src/plugins/editorui/gbp-editorui-preferences-addin.c
+++ b/src/plugins/editorui/gbp-editorui-preferences-addin.c
@@ -51,11 +51,21 @@ static const IdePreferenceGroupEntry groups[] = {
 };
 
 static const IdePreferenceItemEntry items[] = {
-  { "appearance", "accessories", "grid", 0, ide_preferences_window_toggle,
+  { "appearance", "accessories", "show-grid-lines", 10, ide_preferences_window_toggle,
     N_("Show Grid Pattern"),
     N_("Display a grid pattern underneath source code"),
     "org.gnome.builder.editor", NULL, "show-grid-lines" },
 
+  { "appearance", "accessories", "highlight-current-line", 0, ide_preferences_window_toggle,
+    N_("Highlight Current Line"),
+    N_("Make current line stand out with highlights"),
+    "org.gnome.builder.editor", NULL, "highlight-current-line" },
+
+  { "appearance", "accessories", "highlight-matching-brackets", 0, ide_preferences_window_toggle,
+    N_("Highlight Matching Brackets"),
+    N_("Use cursor position to highlight matching brackets, braces, parenthesis, and more"),
+    "org.gnome.builder.editor", NULL, "highlight-matching-brackets" },
+
   { "completion", "general", "interactive", 10, ide_preferences_window_toggle,
     N_("Suggest Completions While Typing"),
     N_("Automatically suggest completions while typing within the file"),
diff --git a/src/plugins/editorui/gbp-editorui-preview.c b/src/plugins/editorui/gbp-editorui-preview.c
index c2189e7b5..de25af9fd 100644
--- a/src/plugins/editorui/gbp-editorui-preview.c
+++ b/src/plugins/editorui/gbp-editorui-preview.c
@@ -100,9 +100,12 @@ static void
 gbp_editorui_preview_constructed (GObject *object)
 {
   GbpEditoruiPreview *self = (GbpEditoruiPreview *)object;
+  GtkTextBuffer *buffer;
 
   G_OBJECT_CLASS (gbp_editorui_preview_parent_class)->constructed (object);
 
+  buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (self));
+
   g_signal_connect_object (IDE_APPLICATION_DEFAULT,
                            "notify::style-scheme",
                            G_CALLBACK (notify_style_scheme_cb),
@@ -115,6 +118,12 @@ gbp_editorui_preview_constructed (GObject *object)
                                 "show-grid-lines", self, "background-pattern",
                                 G_SETTINGS_BIND_GET,
                                 show_grid_lines_to_bg, NULL, NULL, NULL);
+  g_settings_bind (self->editor_settings,
+                   "highlight-current-line", self, "highlight-current-line",
+                   G_SETTINGS_BIND_GET);
+  g_settings_bind (self->editor_settings,
+                   "highlight-matching-brackets", buffer, "highlight-matching-brackets",
+                   G_SETTINGS_BIND_GET);
 
   gbp_editorui_preview_load_text (self);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]