[gnome-terminal] profile: Add rewrap-on-resize pref



commit 53f322af985fd244a1a9a7a67c79e5263d0fc090
Author: Egmont Koblinger <egmont gmail com>
Date:   Mon Dec 16 22:29:36 2013 +0100

    profile: Add rewrap-on-resize pref
    
    https://bugzilla.gnome.org/show_bug.cgi?id=336238

 configure.ac                       |    2 +-
 src/org.gnome.Terminal.gschema.xml |    4 ++++
 src/profile-editor.c               |    4 ++++
 src/profile-preferences.ui         |   16 ++++++++++++++++
 src/terminal-schemas.h             |    1 +
 src/terminal-screen.c              |    4 ++++
 6 files changed, 30 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index bd47263..ea39750 100644
--- a/configure.ac
+++ b/configure.ac
@@ -56,7 +56,7 @@ case "$with_gtk" in
   3.0) GTK_API_VERSION=3.0
        GTK_REQUIRED=3.9.9
        VTE_PC_VERSION=-2.90
-       VTE_REQUIRED=0.35.0
+       VTE_REQUIRED=0.35.1
        ;;
 esac
 
diff --git a/src/org.gnome.Terminal.gschema.xml b/src/org.gnome.Terminal.gschema.xml
index 12a13f7..18b35e3 100644
--- a/src/org.gnome.Terminal.gschema.xml
+++ b/src/org.gnome.Terminal.gschema.xml
@@ -248,6 +248,10 @@
       <default>true</default>
       <summary>Whether to use the system monospace font</summary>
     </key>
+    <key name="rewrap-on-resize" type="b">
+      <default>true</default>
+      <_summary>Whether to rewrap the terminal contents on window resize</_summary>
+    </key>
     <key name="encoding" type="s">
       <choices>
         <choice value="current" />
diff --git a/src/profile-editor.c b/src/profile-editor.c
index 0489212..0c20763 100644
--- a/src/profile-editor.c
+++ b/src/profile-editor.c
@@ -991,6 +991,10 @@ terminal_profile_edit (GSettings  *profile,
                             gtk_builder_get_object (builder, "palette-box"),
                             "sensitive",
                             FALSE);
+  g_settings_bind (profile,
+                   TERMINAL_PROFILE_REWRAP_ON_RESIZE_KEY,
+                   gtk_builder_get_object (builder, "rewrap-on-resize-checkbutton"),
+                   "active", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
 
   terminal_util_bind_mnemonic_label_sensitivity (editor);
 
diff --git a/src/profile-preferences.ui b/src/profile-preferences.ui
index 21e4e9a..4263672 100644
--- a/src/profile-preferences.ui
+++ b/src/profile-preferences.ui
@@ -560,6 +560,22 @@
                     <property name="position">9</property>
                   </packing>
                 </child>
+                <child>
+                  <object class="GtkCheckButton" id="rewrap-on-resize-checkbutton">
+                    <property name="label" translatable="yes">_Rewrap on resize</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="xalign">0.5</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">10</property>
+                  </packing>
+                </child>
               </object>
             </child>
             <child type="tab">
diff --git a/src/terminal-schemas.h b/src/terminal-schemas.h
index 5a2e721..c64bbec 100644
--- a/src/terminal-schemas.h
+++ b/src/terminal-schemas.h
@@ -49,6 +49,7 @@ G_BEGIN_DECLS
 #define TERMINAL_PROFILE_LOGIN_SHELL_KEY                "login-shell"
 #define TERMINAL_PROFILE_NAME_KEY                       "name"
 #define TERMINAL_PROFILE_PALETTE_KEY                    "palette"
+#define TERMINAL_PROFILE_REWRAP_ON_RESIZE_KEY           "rewrap-on-resize"
 #define TERMINAL_PROFILE_SCROLLBACK_LINES_KEY           "scrollback-lines"
 #define TERMINAL_PROFILE_SCROLLBACK_UNLIMITED_KEY       "scrollback-unlimited"
 #define TERMINAL_PROFILE_SCROLLBAR_POLICY_KEY           "scrollbar-policy"
diff --git a/src/terminal-screen.c b/src/terminal-screen.c
index 4bc7e1c..f70dbfa 100644
--- a/src/terminal-screen.c
+++ b/src/terminal-screen.c
@@ -821,6 +821,10 @@ terminal_screen_profile_changed_cb (GSettings     *profile,
     vte_terminal_set_cursor_shape (vte_terminal,
                                    g_settings_get_enum (priv->profile, TERMINAL_PROFILE_CURSOR_SHAPE_KEY));
 
+  if (!prop_name || prop_name == I_(TERMINAL_PROFILE_REWRAP_ON_RESIZE_KEY))
+    vte_terminal_set_rewrap_on_resize (vte_terminal,
+                                       g_settings_get_boolean (profile, 
TERMINAL_PROFILE_REWRAP_ON_RESIZE_KEY));
+
   g_object_thaw_notify (object);
 }
 


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