[gnome-terminal] profile: Change the size UI according to latest designs



commit a575783d4cd9326994485bb5f1e6bbf00edc96e5
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Apr 17 11:44:47 2014 +0200

    profile: Change the size UI according to latest designs
    
    The check button to enable using a custom size has been replaced by a
    reset button to restore the default size of 80x24. The labels were
    tweaked and the entire row has been moved higher up in the dialog.
    
    As a result of this, the 'use-custom-default-size' key is no longer
    used and has been removed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=724110

 src/migration.c                    |    4 -
 src/org.gnome.Terminal.gschema.xml |    6 -
 src/profile-editor.c               |   22 ++--
 src/profile-preferences.ui         |  240 +++++++++++++++++-------------------
 src/terminal-schemas.h             |    1 -
 src/terminal-screen.c              |    9 +-
 6 files changed, 131 insertions(+), 151 deletions(-)
---
diff --git a/src/migration.c b/src/migration.c
index ecd1493..6cdd573 100644
--- a/src/migration.c
+++ b/src/migration.c
@@ -88,7 +88,6 @@ enum {
 #define KEY_SILENT_BELL "silent_bell"
 #define KEY_UPDATE_RECORDS "update_records"
 #define KEY_USE_CUSTOM_COMMAND "use_custom_command"
-#define KEY_USE_CUSTOM_DEFAULT_SIZE "use_custom_default_size"
 #define KEY_USE_SYSTEM_FONT "use_system_font"
 #define KEY_USE_THEME_COLORS "use_theme_colors"
 #define KEY_VISIBLE_NAME "visible_name"
@@ -400,9 +399,6 @@ migrate_profile (TerminalSettingsList *list,
   migrate_bool (client, path, KEY_SILENT_BELL,
                 settings, TERMINAL_PROFILE_AUDIBLE_BELL_KEY,
                 TRUE);
-  migrate_bool (client, path, KEY_USE_CUSTOM_DEFAULT_SIZE,
-                settings, TERMINAL_PROFILE_USE_CUSTOM_DEFAULT_SIZE_KEY,
-                FALSE);
   migrate_int (client, path, KEY_DEFAULT_SIZE_COLUMNS,
                settings, TERMINAL_PROFILE_DEFAULT_SIZE_COLUMNS_KEY);
   migrate_int (client, path, KEY_DEFAULT_SIZE_ROWS,
diff --git a/src/org.gnome.Terminal.gschema.xml b/src/org.gnome.Terminal.gschema.xml
index af7f418..011bb34 100644
--- a/src/org.gnome.Terminal.gschema.xml
+++ b/src/org.gnome.Terminal.gschema.xml
@@ -130,12 +130,6 @@
       <summary>Whether to show menubar in new windows/tabs</summary>
       <description>True if the menubar should be shown in new window</description>
     </key>
-    <!-- FIXMEchpe!!! -->
-    <key name="use-custom-default-size" type="b">
-      <default>false</default>
-      <summary>Whether to use custom terminal size for new windows</summary>
-      <description>If true, newly created terminal windows will have custom size specified by 
default_size_columns and default_size_rows.</description>
-    </key>
     <key name="default-size-columns" type="i">
       <default>80</default>
       <summary>Default number of columns</summary>
diff --git a/src/profile-editor.c b/src/profile-editor.c
index 70a1afa..2b2a250 100644
--- a/src/profile-editor.c
+++ b/src/profile-editor.c
@@ -431,6 +431,14 @@ custom_command_entry_changed_cb (GtkEntry *entry)
 }
 
 static void
+default_size_reset_cb (GtkWidget *button,
+                       GSettings *profile)
+{
+  g_settings_reset (profile, TERMINAL_PROFILE_DEFAULT_SIZE_COLUMNS_KEY);
+  g_settings_reset (profile, TERMINAL_PROFILE_DEFAULT_SIZE_ROWS_KEY);
+}
+
+static void
 reset_compat_defaults_cb (GtkWidget *button,
                           GSettings *profile)
 {
@@ -801,6 +809,11 @@ terminal_profile_edit (GSettings  *profile,
   gtk_label_set_text (GTK_LABEL (gtk_builder_get_object (builder, "profile-uuid")),
                       uuid);
 
+  g_signal_connect (gtk_builder_get_object  (builder, "default-size-reset-button"),
+                    "clicked",
+                    G_CALLBACK (default_size_reset_cb),
+                    profile);
+
   w = (GtkWidget *) gtk_builder_get_object  (builder, "color-scheme-combobox");
   init_color_scheme_menu (w);
 
@@ -1022,10 +1035,6 @@ terminal_profile_edit (GSettings  *profile,
                    gtk_builder_get_object (builder,
                                            "use-custom-command-checkbutton"),
                    "active", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
-  g_settings_bind (profile, TERMINAL_PROFILE_USE_CUSTOM_DEFAULT_SIZE_KEY,
-                   gtk_builder_get_object (builder,
-                                           "use-custom-default-size-checkbutton"),
-                   "active", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
   g_settings_bind (profile, TERMINAL_PROFILE_USE_THEME_COLORS_KEY,
                    gtk_builder_get_object (builder,
                                            "use-theme-colors-checkbutton"),
@@ -1047,11 +1056,6 @@ terminal_profile_edit (GSettings  *profile,
                    G_SETTINGS_BIND_GET | G_SETTINGS_BIND_INVERT_BOOLEAN |
                    G_SETTINGS_BIND_NO_SENSITIVITY);
   g_settings_bind (profile,
-                   TERMINAL_PROFILE_USE_CUSTOM_DEFAULT_SIZE_KEY,
-                   gtk_builder_get_object (builder, "default-size-hbox"),
-                   "sensitive",
-                   G_SETTINGS_BIND_GET | G_SETTINGS_BIND_NO_SENSITIVITY);
-  g_settings_bind (profile,
                    TERMINAL_PROFILE_USE_THEME_COLORS_KEY,
                    gtk_builder_get_object (builder, "colors-box"),
                    "sensitive",
diff --git a/src/profile-preferences.ui b/src/profile-preferences.ui
index e730681..b8740a2 100644
--- a/src/profile-preferences.ui
+++ b/src/profile-preferences.ui
@@ -213,11 +213,11 @@
                 <property name="border_width">12</property>
                 <property name="spacing">6</property>
                 <child>
-                  <object class="GtkTable" id="profile-id-table">
+                  <object class="GtkTable" id="general-table">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="n_rows">2</property>
-                    <property name="n_columns">2</property>
+                    <property name="n_rows">3</property>
+                    <property name="n_columns">4</property>
                     <property name="column_spacing">12</property>
                     <property name="row_spacing">6</property>
                     <child>
@@ -228,7 +228,7 @@
                       </object>
                       <packing>
                         <property name="left_attach">1</property>
-                        <property name="right_attach">2</property>
+                        <property name="right_attach">4</property>
                         <property name="top_attach">1</property>
                         <property name="bottom_attach">2</property>
                       </packing>
@@ -269,7 +269,118 @@
                       </object>
                       <packing>
                         <property name="left_attach">1</property>
+                        <property name="right_attach">4</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="default-size-label">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">Initial terminal si_ze:</property>
+                        <property name="use_underline">True</property>
+                        <property name="mnemonic_widget">default-size-columns-spinbutton</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">0</property>
+                        <property name="right_attach">1</property>
+                        <property name="top_attach">2</property>
+                        <property name="bottom_attach">3</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkHBox" id="default-size-columns-box">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="spacing">6</property>
+                        <child>
+                          <object class="GtkSpinButton" id="default-size-columns-spinbutton">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="adjustment">adjustment1</property>
+                            <property name="climb_rate">1</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="default-size-columns-label">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">columns</property>
+                            <style>
+                              <class name="dim-label"/>
+                            </style>
+                          </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">2</property>
+                        <property name="bottom_attach">3</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkHBox" id="default-size-rows-box">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="spacing">6</property>
+                        <child>
+                          <object class="GtkSpinButton" id="default-size-rows-spinbutton">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="adjustment">adjustment2</property>
+                            <property name="climb_rate">1</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">True</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkLabel" id="default-size-rows-label">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="label" translatable="yes">rows</property>
+                            <style>
+                              <class name="dim-label"/>
+                            </style>
+                          </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">2</property>
+                        <property name="bottom_attach">3</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkButton" id="default-size-reset-button">
+                        <property name="label" translatable="yes">Reset</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">3</property>
+                        <property name="right_attach">4</property>
+                        <property name="top_attach">2</property>
+                        <property name="bottom_attach">3</property>
                       </packing>
                     </child>
                   </object>
@@ -422,127 +533,6 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkCheckButton" id="use-custom-default-size-checkbutton">
-                    <property name="label" translatable="yes">Use custom default terminal si_ze</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">8</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkAlignment" id="alignment10110">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="left_padding">12</property>
-                    <child>
-                      <object class="GtkHBox" id="default-size-hbox">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="spacing">12</property>
-                        <child>
-                          <object class="GtkLabel" id="default-size-label">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="label" translatable="yes">Default size:</property>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">False</property>
-                            <property name="position">0</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkHBox" id="default-size-columns-box">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="spacing">6</property>
-                            <child>
-                              <object class="GtkSpinButton" id="default-size-columns-spinbutton">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="adjustment">adjustment1</property>
-                                <property name="climb_rate">1</property>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">0</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkLabel" id="default-size-columns-label">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="label" translatable="yes">columns</property>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">False</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>
-                        <child>
-                          <object class="GtkHBox" id="default-size-rows-box">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="spacing">6</property>
-                            <child>
-                              <object class="GtkSpinButton" id="default-size-rows-spinbutton">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="adjustment">adjustment2</property>
-                                <property name="climb_rate">1</property>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">0</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkLabel" id="default-size-rows-label">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="label" translatable="yes">rows</property>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">False</property>
-                                <property name="position">1</property>
-                              </packing>
-                            </child>
-                          </object>
-                          <packing>
-                            <property name="expand">False</property>
-                            <property name="fill">True</property>
-                            <property name="position">2</property>
-                          </packing>
-                        </child>
-                      </object>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="expand">False</property>
-                    <property name="fill">True</property>
-                    <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>
diff --git a/src/terminal-schemas.h b/src/terminal-schemas.h
index 0bddcab..ce92340 100644
--- a/src/terminal-schemas.h
+++ b/src/terminal-schemas.h
@@ -58,7 +58,6 @@ G_BEGIN_DECLS
 #define TERMINAL_PROFILE_SCROLL_ON_OUTPUT_KEY           "scroll-on-output"
 #define TERMINAL_PROFILE_UPDATE_RECORDS_KEY             "update-records"
 #define TERMINAL_PROFILE_USE_CUSTOM_COMMAND_KEY         "use-custom-command"
-#define TERMINAL_PROFILE_USE_CUSTOM_DEFAULT_SIZE_KEY    "use-custom-default-size"
 #define TERMINAL_PROFILE_USE_SKEY_KEY                   "use-skey"
 #define TERMINAL_PROFILE_USE_SYSTEM_FONT_KEY            "use-system-font"
 #define TERMINAL_PROFILE_USE_THEME_COLORS_KEY           "use-theme-colors"
diff --git a/src/terminal-screen.c b/src/terminal-screen.c
index e35914c..7aa4464 100644
--- a/src/terminal-screen.c
+++ b/src/terminal-screen.c
@@ -621,12 +621,9 @@ terminal_screen_new (GSettings       *profile,
   priv = screen->priv;
 
   terminal_screen_set_profile (screen, profile);
-
-  if (g_settings_get_boolean (profile, TERMINAL_PROFILE_USE_CUSTOM_DEFAULT_SIZE_KEY)) {
-    vte_terminal_set_size (VTE_TERMINAL (screen),
-                          g_settings_get_int (profile, TERMINAL_PROFILE_DEFAULT_SIZE_COLUMNS_KEY),
-                          g_settings_get_int (profile, TERMINAL_PROFILE_DEFAULT_SIZE_ROWS_KEY));
-  }
+  vte_terminal_set_size (VTE_TERMINAL (screen),
+                         g_settings_get_int (profile, TERMINAL_PROFILE_DEFAULT_SIZE_COLUMNS_KEY),
+                         g_settings_get_int (profile, TERMINAL_PROFILE_DEFAULT_SIZE_ROWS_KEY));
 
   priv->initial_working_directory = g_strdup (working_dir);
 


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