From fdc5a0a635f5ba31a257b830d6b06e023c6e5989 Mon Sep 17 00:00:00 2001 From: Gerko de Roo Date: Fri, 22 Jan 2010 15:38:33 +0100 Subject: [PATCH] Added close on double click for a stat window Just in case you don't have a mouse with middle button --- pyfpdb/Hud.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pyfpdb/Hud.py b/pyfpdb/Hud.py index ada7b316..ec2e4ac3 100644 --- a/pyfpdb/Hud.py +++ b/pyfpdb/Hud.py @@ -575,15 +575,14 @@ class Hud: loc = self.config.get_locations(self.table.site, 9) # create the stat windows -# get the width and height of the client window -# The x and Y positions are now made relative. + # get the width and height of the client window + # The x and Y positions are now made relative. for i in xrange(1, self.max + 1): (x, y) = loc[adj[i]] px = int(x * self.table.width / 1000) py = int(y * self.table.height / 1000) if i in self.stat_windows: - self.stat_windows[i].relocate(x, y) self.stat_windows[i].relocate(px, py) else: self.stat_windows[i] = Stat_Window(game = config.supported_games[self.poker_game], @@ -686,6 +685,9 @@ class Stat_Window: return True if event.button == 1: # left button event + if event.type == gtk.gdk._2BUTTON_PRESS: + self.window.hide() + return True # TODO: make position saving save sizes as well? if event.state & gtk.gdk.SHIFT_MASK: self.window.begin_resize_drag(gtk.gdk.WINDOW_EDGE_SOUTH_EAST, event.button, int(event.x_root), int(event.y_root), event.time)