summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/org.mate.pluma.gschema.xml.in9
-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
-rw-r--r--pluma/pluma-settings.h1
-rw-r--r--pluma/pluma-view.c6
6 files changed, 128 insertions, 0 deletions
diff --git a/data/org.mate.pluma.gschema.xml.in b/data/org.mate.pluma.gschema.xml.in
index ca03f2dc..45dd196e 100644
--- a/data/org.mate.pluma.gschema.xml.in
+++ b/data/org.mate.pluma.gschema.xml.in
@@ -5,6 +5,10 @@
<value nick="show-trailing" value="1"/>
<value nick="show-all" value="2"/>
</enum>
+ <enum id="org.mate.pluma.BackgroundPatternType">
+ <value nick="none" value="0"/>
+ <value nick="grid" value="1"/>
+ </enum>
<schema id="org.mate.pluma" path="/org/mate/pluma/">
<key name="use-default-font" type="b">
<default>true</default>
@@ -106,6 +110,11 @@
<summary>Right Margin Position</summary>
<description>Specifies the position of the right margin.</description>
</key>
+ <key name="background-pattern" enum="org.mate.pluma.BackgroundPatternType">
+ <default>'none'</default>
+ <summary>Document background pattern type</summary>
+ <description>Whether the document will get a background pattern painted.</description>
+ </key>
<key name="display-overview-map" type="b">
<default>false</default>
<summary>Display Overview Map</summary>
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
diff --git a/pluma/pluma-settings.h b/pluma/pluma-settings.h
index 1796f978..464ddaeb 100644
--- a/pluma/pluma-settings.h
+++ b/pluma/pluma-settings.h
@@ -141,6 +141,7 @@ GSList * pluma_settings_get_writable_vfs_schemes (GSettings *sett
#define PLUMA_SETTINGS_DRAWER_NEWLINE "enable-space-drawer-newline"
#define PLUMA_SETTINGS_DRAWER_NBSP "enable-space-drawer-nbsp"
#define PLUMA_SETTINGS_DISPLAY_OVERVIEW_MAP "display-overview-map"
+#define PLUMA_SETTINGS_BACKGROUND_PATTERN "background-pattern"
/* White list of writable mate-vfs methods */
#define PLUMA_SETTINGS_WRITABLE_VFS_SCHEMES "writable-vfs-schemes"
diff --git a/pluma/pluma-view.c b/pluma/pluma-view.c
index 1c376877..9c8098b9 100644
--- a/pluma/pluma-view.c
+++ b/pluma/pluma-view.c
@@ -552,6 +552,12 @@ pluma_view_init (PlumaView *view)
"indent_on_tab", TRUE,
NULL);
+ g_settings_bind (view->priv->editor_settings,
+ PLUMA_SETTINGS_BACKGROUND_PATTERN,
+ view,
+ "background-pattern",
+ G_SETTINGS_BIND_DEFAULT);
+
pluma_set_source_space_drawer (view->priv->editor_settings, GTK_SOURCE_VIEW (view));
view->priv->typeselect_flush_timeout = 0;