[gnome-tweak-tool] Ellipsize long strings
- From: John Stowers <jstowers src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-tweak-tool] Ellipsize long strings
- Date: Fri, 21 Oct 2011 20:22:36 +0000 (UTC)
commit 54a4b16e1b708b9672da28ae8684e75ec7f25082
Author: John Stowers <john stowers gmail com>
Date: Sat Oct 22 08:45:51 2011 +1300
Ellipsize long strings
'Fixes' bug 649520
gtweak/tweaks/tweak_test.py | 3 ++-
gtweak/widgets.py | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gtweak/tweaks/tweak_test.py b/gtweak/tweaks/tweak_test.py
index 77af18d..33b778f 100644
--- a/gtweak/tweaks/tweak_test.py
+++ b/gtweak/tweaks/tweak_test.py
@@ -28,7 +28,7 @@ class _TestInfoTweak(Tweak):
self.widget = build_label_beside_widget(
name,
- Gtk.Button(name),
+ Gtk.Button(options.get("test_button_name",name)),
info=options.get("tweak_info"),
warning=options.get("tweak_warning"))
@@ -68,6 +68,7 @@ group_name = "Test Settings"
TWEAKS = (
_TestTweak("foo bar", "does foo bar", group_name=group_name),
_TestTweak("foo baz", "does foo baz", group_name=group_name),
+ _TestInfoTweak("long string "*10, "long description "*10, test_button_name="short",group_name=group_name),
_TestInfoTweak("foo info", "info widget", tweak_info="Information", group_name=group_name),
_TestInfoTweak("foo warning", "info widget", tweak_warning="Warning", group_name=group_name),
_TestButtonTweak("Need Action", "foo bar", need_action=True, group_name=group_name),
diff --git a/gtweak/widgets.py b/gtweak/widgets.py
index 1137a0d..edac0f2 100644
--- a/gtweak/widgets.py
+++ b/gtweak/widgets.py
@@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with gnome-tweak-tool. If not, see <http://www.gnu.org/licenses/>.
-from gi.repository import Gtk, Gdk, Gio
+from gi.repository import Gtk, Gdk, Gio, Pango
from gtweak.tweakmodel import Tweak
from gtweak.gsettings import GSettingsSetting
@@ -42,6 +42,7 @@ def build_label_beside_widget(txt, *widget, **kwargs):
hbox.props.spacing = 4
lbl = Gtk.Label(txt)
+ lbl.props.ellipsize = Pango.EllipsizeMode.END
lbl.props.xalign = 0.0
hbox.pack_start(lbl, True, True, 0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]