Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scoreboard.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/scoreboard.py b/scoreboard.py
index f381378..9882ad2 100644
--- a/scoreboard.py
+++ b/scoreboard.py
@@ -25,6 +25,8 @@ class Scoreboard(Gtk.EventBox):
def __init__(self):
Gtk.EventBox.__init__(self)
self.modify_bg(Gtk.StateType.NORMAL, Gdk.color_parse('#666666'))
+ self.connect('size-allocate', self._allocate_cb)
+ self._width = self.get_allocation().width
self.players = {}
self.current_buddy = None
self.hbox = Gtk.HBox(False)
@@ -33,6 +35,12 @@ class Scoreboard(Gtk.EventBox):
self.add(self.hbox)
self.show_all()
+ def _allocate_cb(self, widget, allocation):
+ # check if the width changes (when the screen rotates
+ if allocation.width != self._width:
+ self._width = allocation.width
+ self.reset(widget)
+
def change_game(self, widget, data, grid):
for buddy in self.players.keys():
self.players[buddy].change_game(len(grid))