Skip to content
This repository
Browse code

Fix background colors in StatusScreen to use a consistent gray.

  • Loading branch information...
commit d8b0cd5230bdaa3d7f74144fde32c5b285c415d0 1 parent ab78595
David Ripton authored

Showing 1 changed file with 18 additions and 15 deletions. Show diff stats Hide diff stats

  1. +18 15 slugathon/gui/StatusScreen.py
33 slugathon/gui/StatusScreen.py
@@ -12,11 +12,12 @@
12 12 from slugathon.util import colors
13 13
14 14
15   -def add_label(table, col, row, text=""):
  15 +def add_label(table, col, row, gtkcolor, text=""):
16 16 """Add a label inside an eventbox to the table."""
17 17 label = gtk.Label(text)
18 18 eventbox = gtk.EventBox()
19 19 eventbox.add(label)
  20 + eventbox.modify_bg(gtk.STATE_NORMAL, gtkcolor)
20 21 label.eventbox = eventbox
21 22 table.attach(eventbox, col, col + 1, row, row + 1)
22 23 return label
@@ -46,17 +47,19 @@ def __init__(self, game, playername):
46 47 turn_table.set_homogeneous(True)
47 48 self.vbox.pack_start(turn_table)
48 49
49   - add_label(turn_table, 2, 1, "Game")
50   - add_label(turn_table, 3, 1, "Battle")
51   - add_label(turn_table, 1, 2, "Turn")
52   - add_label(turn_table, 1, 3, "Player")
53   - add_label(turn_table, 1, 4, "Phase")
54   - self.game_turn_label = add_label(turn_table, 2, 2)
55   - self.battle_turn_label = add_label(turn_table, 3, 2)
56   - self.game_player_label = add_label(turn_table, 2, 3)
57   - self.battle_player_label = add_label(turn_table, 3, 3)
58   - self.game_phase_label = add_label(turn_table, 2, 4)
59   - self.battle_phase_label = add_label(turn_table, 3, 4)
  50 + self.default_bg = gtk.gdk.color_parse("lightgray")
  51 +
  52 + add_label(turn_table, 2, 1, self.default_bg, "Game")
  53 + add_label(turn_table, 3, 1, self.default_bg, "Battle")
  54 + add_label(turn_table, 1, 2, self.default_bg, "Turn")
  55 + add_label(turn_table, 1, 3, self.default_bg, "Player")
  56 + add_label(turn_table, 1, 4, self.default_bg, "Phase")
  57 + self.game_turn_label = add_label(turn_table, 2, 2, self.default_bg)
  58 + self.battle_turn_label = add_label(turn_table, 3, 2, self.default_bg)
  59 + self.game_player_label = add_label(turn_table, 2, 3, self.default_bg)
  60 + self.battle_player_label = add_label(turn_table, 3, 3, self.default_bg)
  61 + self.game_phase_label = add_label(turn_table, 2, 4, self.default_bg)
  62 + self.battle_phase_label = add_label(turn_table, 3, 4, self.default_bg)
60 63
61 64 hseparator1 = gtk.HSeparator()
62 65 self.vbox.pack_start(hseparator1)
@@ -66,7 +69,7 @@ def __init__(self, game, playername):
66 69
67 70 for row, text in enumerate(["Name", "Tower", "Color", "Legions",
68 71 "Markers", "Creatures", "Titan Power", "Eliminated", "Score"]):
69   - add_label(self.player_table, 1, row, text)
  72 + add_label(self.player_table, 1, row, self.default_bg, text)
70 73
71 74 for col in xrange(len(self.game.players)):
72 75 for row, st in enumerate(["name%d_label", "tower%d_label",
@@ -74,10 +77,10 @@ def __init__(self, game, playername):
74 77 "creatures%d_label", "titan_power%d_label", "eliminated%d_label",
75 78 "score%d_label"]):
76 79 name = st % col
77   - label = add_label(self.player_table, col + 2, row)
  80 + label = add_label(self.player_table, col + 2, row,
  81 + self.default_bg)
78 82 setattr(self, name, label)
79 83
80   - self.default_bg = gtk.gdk.color_parse("lightgray")
81 84 self.modify_bg(gtk.STATE_NORMAL, self.default_bg)
82 85 self._init_players()
83 86 self._init_turn()

0 comments on commit d8b0cd5

Please sign in to comment.
Something went wrong with that request. Please try again.