changeset 534:d16ed2a8a33e

Make price and control reference dialogs a little shinier.
author Simon Cross <hodgestar@gmail.com>
date Fri, 27 Nov 2009 22:12:20 +0000
parents 7addf41b6abb
children 7e8dbd513ea2
files gamelib/misc.py gamelib/toolbar.py
diffstat 2 files changed, 14 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/gamelib/misc.py	Fri Nov 27 22:09:54 2009 +0000
+++ b/gamelib/misc.py	Fri Nov 27 22:12:20 2009 +0000
@@ -4,6 +4,7 @@
 
 from pygame.locals import KEYDOWN, K_ESCAPE
 from pgu import gui
+from pgu import html
 from pgu.algo import getline
 
 import serializer
@@ -117,11 +118,18 @@
 
 # Utility layout functions
 
-def make_box(text):
+def make_box(text, markup=False):
     style = {
-            'border' : 1
-            }
-    word = gui.Label(text, style=style)
+        'border' : 1,
+        'padding_left': 2,
+        'padding_right': 2,
+        'padding_top': 2,
+        'padding_bottom': 2,
+    }
+    if markup:
+        word = html.HTML(text, style=style)
+    else:
+        word = gui.Label(text, style=style)
     return word
 
 def fix_widths(doc):
--- a/gamelib/toolbar.py	Fri Nov 27 22:09:54 2009 +0000
+++ b/gamelib/toolbar.py	Fri Nov 27 22:12:20 2009 +0000
@@ -120,7 +120,7 @@
         doc = gui.Document(width=510)
         space = doc.style.font.size(" ")
         for header in ['Item', 'Buy Price', 'Sell Price', 'Repair Price']:
-            doc.add(misc.make_box(header))
+            doc.add(misc.make_box("<b>%s</b>" % header, markup=True))
         doc.br(space[1])
         for building in buildings.BUILDINGS:
             doc.add(misc.make_box(building.NAME))
@@ -175,7 +175,7 @@
         doc = gui.Document(width=610)
         space = doc.style.font.size(" ")
         for header in ['Action', 'Combination']:
-            doc.add(misc.make_box(header))
+            doc.add(misc.make_box("<b>%s</b>" % header, markup=True))
         doc.br(space[1])
         for command, combo in COMBOS:
             doc.add(misc.make_box(command))