# HG changeset patch # User Simon Cross # Date 1259359940 0 # Node ID d16ed2a8a33e9959cccd847ce7f7262ea4450024 # Parent 7addf41b6abb8321bfb48b12d8e1f93574ecde08 Make price and control reference dialogs a little shinier. diff -r 7addf41b6abb -r d16ed2a8a33e gamelib/misc.py --- 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): diff -r 7addf41b6abb -r d16ed2a8a33e gamelib/toolbar.py --- 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("%s" % 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("%s" % header, markup=True)) doc.br(space[1]) for command, combo in COMBOS: doc.add(misc.make_box(command))