[gnome-terminal] profile: editor: Add "Cell spacing" preferences



commit 3e5e27ca1043301a094502ce93872dafea41ba1b
Author: Egmont Koblinger <egmont gmail com>
Date:   Sun Dec 31 17:34:26 2017 +0100

    profile: editor: Add "Cell spacing" preferences
    
    https://bugzilla.gnome.org/show_bug.cgi?id=791968

 src/profile-editor.c       |   24 ++++++++
 src/profile-preferences.ui |  141 +++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 164 insertions(+), 1 deletions(-)
---
diff --git a/src/profile-editor.c b/src/profile-editor.c
index 9439b6a..68220a7 100644
--- a/src/profile-editor.c
+++ b/src/profile-editor.c
@@ -458,6 +458,14 @@ default_size_reset_cb (GtkWidget *button,
 }
 
 static void
+cell_scale_reset_cb (GtkWidget *button,
+                     GSettings *profile)
+{
+  g_settings_reset (profile, TERMINAL_PROFILE_CELL_HEIGHT_SCALE_KEY);
+  g_settings_reset (profile, TERMINAL_PROFILE_CELL_WIDTH_SCALE_KEY);
+}
+
+static void
 reset_compat_defaults_cb (GtkWidget *button,
                           GSettings *profile)
 {
@@ -867,6 +875,10 @@ terminal_profile_edit (GSettings  *profile,
                     "clicked",
                     G_CALLBACK (default_size_reset_cb),
                     profile);
+  g_signal_connect (gtk_builder_get_object  (builder, "cell-scale-reset-button"),
+                    "clicked",
+                    G_CALLBACK (cell_scale_reset_cb),
+                    profile);
 
   w = (GtkWidget *) gtk_builder_get_object  (builder, "color-scheme-combobox");
   init_color_scheme_menu (w);
@@ -992,6 +1004,18 @@ terminal_profile_edit (GSettings  *profile,
                                 (GSettingsBindGetMapping) s_to_rgba,
                                 (GSettingsBindSetMapping) rgba_to_s,
                                 NULL, NULL);
+  g_settings_bind (profile, TERMINAL_PROFILE_CELL_HEIGHT_SCALE_KEY,
+                   gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON
+                                                   (gtk_builder_get_object
+                                                    (builder,
+                                                     "cell-height-scale-spinbutton"))),
+                   "value", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
+  g_settings_bind (profile, TERMINAL_PROFILE_CELL_WIDTH_SCALE_KEY,
+                   gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON
+                                                   (gtk_builder_get_object
+                                                    (builder,
+                                                     "cell-width-scale-spinbutton"))),
+                   "value", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
   g_settings_bind (profile, TERMINAL_PROFILE_CURSOR_COLORS_SET_KEY,
                    gtk_builder_get_object (builder,
                                            "cursor-colors-checkbutton"),
diff --git a/src/profile-preferences.ui b/src/profile-preferences.ui
index aa4be4a..d2f2e2e 100644
--- a/src/profile-preferences.ui
+++ b/src/profile-preferences.ui
@@ -23,6 +23,20 @@
     <property name="step_increment">1</property>
     <property name="page_increment">100</property>
   </object>
+  <object class="GtkAdjustment" id="adjustment5">
+    <property name="lower">1.0</property>
+    <property name="upper">2.0</property>
+    <property name="value">1.0</property>
+    <property name="step_increment">0.05</property>
+    <property name="page_increment">0.25</property>
+  </object>
+  <object class="GtkAdjustment" id="adjustment6">
+    <property name="lower">1.0</property>
+    <property name="upper">2.0</property>
+    <property name="value">1.0</property>
+    <property name="step_increment">0.05</property>
+    <property name="page_increment">0.25</property>
+  </object>
   <object class="GtkListStore" id="cjk-ambiguous-width-model">
     <columns>
       <!-- column-name gchararray -->
@@ -211,7 +225,7 @@
                   <object class="GtkTable" id="general-table">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="n_rows">10</property>
+                    <property name="n_rows">11</property>
                     <property name="n_columns">4</property>
                     <property name="column_spacing">12</property>
                     <property name="row_spacing">6</property>
@@ -594,6 +608,131 @@
                         <property name="y_options">GTK_FILL</property>
                       </packing>
                     </child>
+                    <child>
+                      <object class="GtkLabel">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">Cell spaci_ng:</property>
+                        <property name="use_underline">True</property>
+                        <property name="margin_left">12</property>
+                        <property name="mnemonic_widget">cell-width-scale-spinbutton</property>
+                        <property name="xalign">0</property>
+                      </object>
+                      <packing>
+                        <property name="top_attach">10</property>
+                        <property name="bottom_attach">11</property>
+                        <property name="y_options">GTK_FILL</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkHBox">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="spacing">6</property>
+                        <child>
+                          <object class="GtkSpinButton" id="cell-width-scale-spinbutton">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="adjustment">adjustment5</property>
+                            <property name="digits">2</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">× width</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="right_attach">2</property>
+                        <property name="top_attach">10</property>
+                        <property name="bottom_attach">11</property>
+                        <property name="x_options">GTK_FILL</property>
+                        <property name="y_options">GTK_FILL</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkHBox">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="spacing">6</property>
+                        <child>
+                          <object class="GtkSpinButton" id="cell-height-scale-spinbutton">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="adjustment">adjustment6</property>
+                            <property name="digits">2</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">× height</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="left_attach">2</property>
+                        <property name="right_attach">3</property>
+                        <property name="top_attach">10</property>
+                        <property name="bottom_attach">11</property>
+                        <property name="x_options">GTK_FILL</property>
+                        <property name="y_options">GTK_FILL</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkButtonBox">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="layout_style">end</property>
+                        <child>
+                          <object class="GtkButton" id="cell-scale-reset-button">
+                            <property name="label" translatable="yes">R_eset</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">True</property>
+                            <property name="use_underline">True</property>
+                            <property name="focus_on_click">False</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                      </object>
+                      <packing>
+                        <property name="left_attach">3</property>
+                        <property name="right_attach">4</property>
+                        <property name="top_attach">10</property>
+                        <property name="bottom_attach">11</property>
+                        <property name="y_options">GTK_FILL</property>
+                      </packing>
+                    </child>
                   </object>
                   <packing>
                     <property name="expand">False</property>


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