summaryrefslogtreecommitdiff
path: root/pluma/dialogs
diff options
context:
space:
mode:
Diffstat (limited to 'pluma/dialogs')
-rw-r--r--pluma/dialogs/pluma-preferences-dialog.c30
-rw-r--r--pluma/dialogs/pluma-preferences-dialog.ui80
-rw-r--r--pluma/dialogs/ui-a11y.suppr2
3 files changed, 112 insertions, 0 deletions
diff --git a/pluma/dialogs/pluma-preferences-dialog.c b/pluma/dialogs/pluma-preferences-dialog.c
index 4ba26378..178c54bc 100644
--- a/pluma/dialogs/pluma-preferences-dialog.c
+++ b/pluma/dialogs/pluma-preferences-dialog.c
@@ -130,6 +130,9 @@ struct _PlumaPreferencesDialogPrivate
/* Highlight matching bracket */
GtkWidget *bracket_matching_checkbutton;
+ /* Display grid pattern */
+ GtkWidget *display_grid_checkbutton;
+
/* Display overview map */
GtkWidget *display_overview_map_checkbutton;
@@ -464,9 +467,24 @@ right_margin_checkbutton_toggled (GtkToggleButton *button,
}
static void
+grid_checkbutton_toggled (GtkToggleButton *button,
+ PlumaPreferencesDialog *dlg)
+{
+ GtkSourceBackgroundPatternType background_type;
+
+ background_type = gtk_toggle_button_get_active (button) ?
+ GTK_SOURCE_BACKGROUND_PATTERN_TYPE_GRID :
+ GTK_SOURCE_BACKGROUND_PATTERN_TYPE_NONE;
+ g_settings_set_enum (dlg->priv->editor_settings,
+ PLUMA_SETTINGS_BACKGROUND_PATTERN,
+ background_type);
+}
+
+static void
setup_view_page (PlumaPreferencesDialog *dlg)
{
GtkWrapMode wrap_mode;
+ GtkSourceBackgroundPatternType background_pattern;
gboolean display_right_margin;
pluma_debug (DEBUG_PREFS);
@@ -479,6 +497,9 @@ setup_view_page (PlumaPreferencesDialog *dlg)
wrap_mode = pluma_settings_get_wrap_mode (dlg->priv->editor_settings,
PLUMA_SETTINGS_WRAP_MODE);
+ background_pattern = g_settings_get_enum (dlg->priv->editor_settings,
+ PLUMA_SETTINGS_BACKGROUND_PATTERN);
+
switch (wrap_mode)
{
case GTK_WRAP_WORD:
@@ -506,6 +527,10 @@ setup_view_page (PlumaPreferencesDialog *dlg)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dlg->priv->right_margin_checkbutton),
display_right_margin);
+ gtk_toggle_button_set_active (
+ GTK_TOGGLE_BUTTON (dlg->priv->display_grid_checkbutton),
+ background_pattern == GTK_SOURCE_BACKGROUND_PATTERN_TYPE_GRID);
+
/* Set widgets sensitivity */
gtk_widget_set_sensitive (dlg->priv->split_checkbutton, (wrap_mode != GTK_WRAP_NONE));
@@ -549,6 +574,10 @@ setup_view_page (PlumaPreferencesDialog *dlg)
"toggled",
G_CALLBACK (right_margin_checkbutton_toggled),
dlg);
+ g_signal_connect (dlg->priv->display_grid_checkbutton,
+ "toggled",
+ G_CALLBACK (grid_checkbutton_toggled),
+ dlg);
}
static void
@@ -1231,6 +1260,7 @@ pluma_preferences_dialog_init (PlumaPreferencesDialog *dlg)
"highlight_current_line_checkbutton", &dlg->priv->highlight_current_line_checkbutton,
"bracket_matching_checkbutton", &dlg->priv->bracket_matching_checkbutton,
"display_overview_map_checkbutton", &dlg->priv->display_overview_map_checkbutton,
+ "display_grid_checkbutton", &dlg->priv->display_grid_checkbutton,
"wrap_text_checkbutton", &dlg->priv->wrap_text_checkbutton,
"split_checkbutton", &dlg->priv->split_checkbutton,
diff --git a/pluma/dialogs/pluma-preferences-dialog.ui b/pluma/dialogs/pluma-preferences-dialog.ui
index 7825e305..fd03f283 100644
--- a/pluma/dialogs/pluma-preferences-dialog.ui
+++ b/pluma/dialogs/pluma-preferences-dialog.ui
@@ -645,6 +645,86 @@
<property name="position">5</property>
</packing>
</child>
+ <child>
+ <object class="GtkBox" id="vbox4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label7">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">Grid pattern</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="hbox5">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkLabel" id="label8">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes"> </property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="vbox5">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkCheckButton" id="display_grid_checkbutton">
+ <property name="label" translatable="yes">Display _grid pattern</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="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">6</property>
+ </packing>
+ </child>
</object>
</child>
<child type="tab">
diff --git a/pluma/dialogs/ui-a11y.suppr b/pluma/dialogs/ui-a11y.suppr
index 30900bc7..1bef4a9c 100644
--- a/pluma/dialogs/ui-a11y.suppr
+++ b/pluma/dialogs/ui-a11y.suppr
@@ -28,6 +28,8 @@ pluma-preferences-dialog.ui://GtkLabel[@id='label798'] orphan-label
pluma-preferences-dialog.ui://GtkLabel[@id='label797'] orphan-label
pluma-preferences-dialog.ui://GtkLabel[@id='label5'] orphan-label
pluma-preferences-dialog.ui://GtkLabel[@id='label6'] orphan-label
+pluma-preferences-dialog.ui://GtkLabel[@id='label7'] orphan-label
+pluma-preferences-dialog.ui://GtkLabel[@id='label8'] orphan-label
pluma-preferences-dialog.ui://GtkTreeView[@id='schemes_treeview'] no-labelled-by
pluma-search-dialog.ui://GtkLabel[@id='search_label'] orphan-label
pluma-search-dialog.ui://GtkLabel[@id='replace_with_label'] orphan-label