Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2014-07-22 13:04:33 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2014-07-22 13:04:33 (GMT)
commitdcc190cf76e3f2f61d3641b67c45dfb59c9a7c57 (patch)
treea138e0b6263d3e263f1c28270838b6fa44c9fd4e
parent3eef74c473176b3f25b1bc5516edebb5b9e41940 (diff)
Reorganize summary panel to allow big numbers without resize the screen
-rw-r--r--activity/activity.info2
-rw-r--r--finance.py27
2 files changed, 20 insertions, 9 deletions
diff --git a/activity/activity.info b/activity/activity.info
index 41fa458..ba8ed37 100644
--- a/activity/activity.info
+++ b/activity/activity.info
@@ -1,6 +1,6 @@
[Activity]
name = Finance
-activity_version = 10
+activity_version = 10.5
host_version = 1
bundle_id = org.laptop.community.Finance
icon = Finance-activity
diff --git a/finance.py b/finance.py
index 3a4c0bf..aff0af3 100644
--- a/finance.py
+++ b/finance.py
@@ -120,7 +120,9 @@ class Finance(activity.Activity):
self._active_panel = None
# Add the summary data.
+
self.startlabel = Gtk.Label()
+ self.startamountlabel = Gtk.Label()
self.creditslabel = Gtk.Label()
self.debitslabel = Gtk.Label()
self.balancelabel = Gtk.Label()
@@ -129,16 +131,21 @@ class Finance(activity.Activity):
font_size = int(style.FONT_SIZE * 1.25)
font = Pango.FontDescription("Sans %d" % font_size)
- for label in (self.startlabel, self.creditslabel, self.debitslabel):
+ for label in (self.startlabel, self.startamountlabel,
+ self.creditslabel, self.debitslabel):
label.modify_font(font)
+ label.set_hexpand(True)
+ label.set_halign(Gtk.Align.START)
+ label.props.margin = style.DEFAULT_PADDING
self.balance_evbox = Gtk.EventBox()
self.balance_evbox.add(self.balancelabel)
- summarybox = Gtk.HBox()
- summarybox.pack_start(self.startlabel, True, False, 0)
- summarybox.pack_start(self.creditslabel, True, False, 0)
- summarybox.pack_start(self.debitslabel, True, False, 0)
- summarybox.pack_end(self.balance_evbox, True, True, 0)
+ summarybox = Gtk.Grid()
+ summarybox.attach(self.startlabel, 0, 0, 1, 1)
+ summarybox.attach(self.startamountlabel, 0, 1, 1, 1)
+ summarybox.attach(self.creditslabel, 1, 0, 1, 1)
+ summarybox.attach(self.debitslabel, 1, 1, 1, 1)
+ summarybox.attach(self.balance_evbox, 2, 0, 1, 2)
self.balance_evbox.set_halign(Gtk.Align.END)
summary_evbox = Gtk.EventBox()
@@ -493,8 +500,12 @@ class Finance(activity.Activity):
Gtk.StateType.NORMAL, style.Color(balancecolor).get_gdk_color())
self.startlabel.set_markup(
- "<span foreground='white'><b>%s %s</b></span>" %
- (_('Starting Balance:'), locale.currency(start)))
+ "<span foreground='white'><b>%s</b></span>" %
+ _('Starting Balance:'))
+ self.startamountlabel.set_markup(
+ "<span foreground='white'><b>%s</b></span>" %
+ locale.currency(start))
+
self.creditslabel.set_markup(
"<span foreground='white'><b>%s</b></span>" %
(_('%s in %d credits') % (locale.currency(credit_total),