[gnome-builder/wip/gtk4-port: 390/736] plugins/editorui: add toggle for line numbers




commit edd2edd02e1062f3121dc60e0ce38f699513808b
Author: Christian Hergert <chergert redhat com>
Date:   Mon Apr 4 16:22:00 2022 -0700

    plugins/editorui: add toggle for line numbers

 src/plugins/editorui/gbp-editorui-preferences-addin.c | 9 +++++++--
 src/plugins/editorui/gbp-editorui-preview.c           | 3 +++
 2 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/editorui/gbp-editorui-preferences-addin.c 
b/src/plugins/editorui/gbp-editorui-preferences-addin.c
index 3889ccf3b..8cf13e14c 100644
--- a/src/plugins/editorui/gbp-editorui-preferences-addin.c
+++ b/src/plugins/editorui/gbp-editorui-preferences-addin.c
@@ -51,17 +51,22 @@ static const IdePreferenceGroupEntry groups[] = {
 };
 
 static const IdePreferenceItemEntry items[] = {
+  { "appearance", "accessories", "show-line-numbers", 0, ide_preferences_window_toggle,
+    N_("Show Line Numbers"),
+    N_("Display line numbers next to each line of source code"),
+    "org.gnome.builder.editor", NULL, "show-line-numbers" },
+
   { "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,
+  { "appearance", "accessories", "highlight-current-line", 20, 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,
+  { "appearance", "accessories", "highlight-matching-brackets", 30, 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" },
diff --git a/src/plugins/editorui/gbp-editorui-preview.c b/src/plugins/editorui/gbp-editorui-preview.c
index de25af9fd..62e0c8919 100644
--- a/src/plugins/editorui/gbp-editorui-preview.c
+++ b/src/plugins/editorui/gbp-editorui-preview.c
@@ -124,6 +124,9 @@ gbp_editorui_preview_constructed (GObject *object)
   g_settings_bind (self->editor_settings,
                    "highlight-matching-brackets", buffer, "highlight-matching-brackets",
                    G_SETTINGS_BIND_GET);
+  g_settings_bind (self->editor_settings,
+                   "show-line-numbers", self, "show-line-numbers",
+                   G_SETTINGS_BIND_GET);
 
   gbp_editorui_preview_load_text (self);
 }


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