[gitg] Remove NO_SENSITIVITY "hack"
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg] Remove NO_SENSITIVITY "hack"
- Date: Sun, 7 Jul 2013 09:27:33 +0000 (UTC)
commit 2a87c054f66d27be3db3b3913b67488608e57003
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Sun Jul 7 11:21:25 2013 +0200
Remove NO_SENSITIVITY "hack"
For this we add new container where the sensitivity is set.
gitg/preferences/gitg-preferences-commit.vala | 45 +++++++++++++-----------
gitg/resources/ui/gitg-preferences-commit.ui | 44 +++++++++++++++---------
2 files changed, 52 insertions(+), 37 deletions(-)
---
diff --git a/gitg/preferences/gitg-preferences-commit.vala b/gitg/preferences/gitg-preferences-commit.vala
index 2df8e05..82e8e53 100644
--- a/gitg/preferences/gitg-preferences-commit.vala
+++ b/gitg/preferences/gitg-preferences-commit.vala
@@ -32,18 +32,22 @@ public class PreferencesCommit : Gtk.Grid, GitgExt.Preferences
[GtkChild (name = "grid_show_markup")]
private Gtk.Grid d_grid_show_markup;
- [GtkChild (name = "check_button_show_right_margin")]
- private Gtk.CheckButton d_check_button_show_right_margin;
-
- [GtkChild (name = "spin_button_right_margin")]
- private Gtk.SpinButton d_spin_button_right_margin;
-
[GtkChild (name = "check_button_show_subject_margin")]
private Gtk.CheckButton d_check_button_show_subject_margin;
+ [GtkChild (name = "spin_button_subject_margin_grid")]
+ private Gtk.Grid d_spin_button_subject_margin_grid;
[GtkChild (name = "spin_button_subject_margin")]
private Gtk.SpinButton d_spin_button_subject_margin;
+ [GtkChild (name = "check_button_show_right_margin")]
+ private Gtk.CheckButton d_check_button_show_right_margin;
+
+ [GtkChild (name = "spin_button_right_margin_grid")]
+ private Gtk.Grid d_spin_button_right_margin_grid;
+ [GtkChild (name = "spin_button_right_margin")]
+ private Gtk.SpinButton d_spin_button_right_margin;
+
construct
{
var settings = new Settings("org.gnome.gitg.preferences.commit.message");
@@ -58,36 +62,35 @@ public class PreferencesCommit : Gtk.Grid, GitgExt.Preferences
"sensitive",
SettingsBindFlags.GET);
- settings.bind("show-right-margin",
- d_check_button_show_right_margin,
+ settings.bind("show-subject-margin",
+ d_check_button_show_subject_margin,
"active",
SettingsBindFlags.GET | SettingsBindFlags.SET);
- settings.bind("show-right-margin",
- d_spin_button_right_margin,
+ settings.bind("show-subject-margin",
+ d_spin_button_subject_margin_grid,
"sensitive",
SettingsBindFlags.GET);
- settings.bind("right-margin-position",
- d_spin_button_right_margin,
+ settings.bind("subject-margin-position",
+ d_spin_button_subject_margin,
"value",
- SettingsBindFlags.GET | SettingsBindFlags.SET |
SettingsBindFlags.NO_SENSITIVITY);
+ SettingsBindFlags.GET | SettingsBindFlags.SET);
- settings.bind("show-subject-margin",
- d_check_button_show_subject_margin,
+ settings.bind("show-right-margin",
+ d_check_button_show_right_margin,
"active",
SettingsBindFlags.GET | SettingsBindFlags.SET);
- settings.bind("show-subject-margin",
- d_spin_button_subject_margin,
+ settings.bind("show-right-margin",
+ d_spin_button_right_margin_grid,
"sensitive",
SettingsBindFlags.GET);
- settings.bind("subject-margin-position",
- d_spin_button_subject_margin,
+ settings.bind("right-margin-position",
+ d_spin_button_right_margin,
"value",
- SettingsBindFlags.GET | SettingsBindFlags.SET |
SettingsBindFlags.NO_SENSITIVITY);
-
+ SettingsBindFlags.GET | SettingsBindFlags.SET);
}
public Gtk.Widget widget
diff --git a/gitg/resources/ui/gitg-preferences-commit.ui b/gitg/resources/ui/gitg-preferences-commit.ui
index dd06c7d..0af1b69 100644
--- a/gitg/resources/ui/gitg-preferences-commit.ui
+++ b/gitg/resources/ui/gitg-preferences-commit.ui
@@ -100,15 +100,21 @@
</packing>
</child>
<child>
- <object class="GtkSpinButton" id="spin_button_subject_margin">
+ <object class="GtkGrid" id="spin_button_subject_margin_grid">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="text" translatable="yes">50</property>
- <property name="adjustment">spin_button_subject_margin_adjustment</property>
- <property name="climb_rate">1</property>
- <property name="snap_to_ticks">True</property>
- <property name="numeric">True</property>
- <property name="value">50</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkSpinButton" id="spin_button_subject_margin">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="text" translatable="yes">50</property>
+ <property name="adjustment">spin_button_subject_margin_adjustment</property>
+ <property name="climb_rate">1</property>
+ <property name="snap_to_ticks">True</property>
+ <property name="numeric">True</property>
+ <property name="value">50</property>
+ </object>
+ </child>
</object>
<packing>
<property name="left_attach">1</property>
@@ -137,15 +143,21 @@
</packing>
</child>
<child>
- <object class="GtkSpinButton" id="spin_button_right_margin">
+ <object class="GtkGrid" id="spin_button_right_margin_grid">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="text" translatable="yes">72</property>
- <property name="adjustment">spin_button_right_margin_adjustment</property>
- <property name="climb_rate">1</property>
- <property name="snap_to_ticks">True</property>
- <property name="numeric">True</property>
- <property name="value">72</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkSpinButton" id="spin_button_right_margin">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="text" translatable="yes">72</property>
+ <property name="adjustment">spin_button_right_margin_adjustment</property>
+ <property name="climb_rate">1</property>
+ <property name="snap_to_ticks">True</property>
+ <property name="numeric">True</property>
+ <property name="value">72</property>
+ </object>
+ </child>
</object>
<packing>
<property name="left_attach">1</property>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]