[hamster-applet] force scrollbar if there are more than ten facts in today
- From: Toms Baugis <tbaugis src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [hamster-applet] force scrollbar if there are more than ten facts in today
- Date: Sat, 21 Nov 2009 01:17:00 +0000 (UTC)
commit a4af7fd5de6ec1e8fcb26a1969638bdfecd31522
Author: Toms Bauģis <toms baugis gmail com>
Date: Sat Nov 21 01:16:50 2009 +0000
force scrollbar if there are more than ten facts in today
hamster/applet.py | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/hamster/applet.py b/hamster/applet.py
index 05f8cdf..6a04309 100755
--- a/hamster/applet.py
+++ b/hamster/applet.py
@@ -395,8 +395,14 @@ class HamsterApplet(object):
fact_store.clear()
facts = runtime.storage.get_facts(today)
+ if len(facts) > 10:
+ self._gui.get_object("todays_scroll").set_size_request(-1, 250)
+ self._gui.get_object("todays_scroll").set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS)
+ else:
+ self._gui.get_object("todays_scroll").set_size_request(-1, -1)
+ self._gui.get_object("todays_scroll").set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_NEVER)
+
by_category = {}
-
for fact in facts:
duration = 24 * 60 * fact["delta"].days + fact["delta"].seconds / 60
by_category[fact['category']] = \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]