Fix small bugs in the grid logic
This commit is contained in:
parent
ae9adff40b
commit
40ac396055
@ -58,7 +58,7 @@ class FriendIcon(IconItem):
|
|||||||
|
|
||||||
grid_x = grid_x2 + distance
|
grid_x = grid_x2 + distance
|
||||||
if grid_x + self._popup.get_width() > Grid.ROWS:
|
if grid_x + self._popup.get_width() > Grid.ROWS:
|
||||||
grid_x = grid_x1 - self._popup.get_width() - distance
|
grid_x = grid_x1 - self._popup.get_width() + 1 - distance
|
||||||
|
|
||||||
grid_y = grid_y1
|
grid_y = grid_y1
|
||||||
|
|
||||||
|
@ -10,7 +10,11 @@ class Grid:
|
|||||||
|
|
||||||
def convert_from_screen(self, x, y):
|
def convert_from_screen(self, x, y):
|
||||||
factor = Grid.COLS / gtk.gdk.screen_width()
|
factor = Grid.COLS / gtk.gdk.screen_width()
|
||||||
return [int(x * factor), int(y * factor)]
|
|
||||||
|
grid_x = round(x * factor) - 1
|
||||||
|
grid_y = round(y * factor) - 1
|
||||||
|
|
||||||
|
return [grid_x, grid_y]
|
||||||
|
|
||||||
def set_constraints(self, component, x, y, width=-1, height=-1):
|
def set_constraints(self, component, x, y, width=-1, height=-1):
|
||||||
if isinstance(component, gtk.Window):
|
if isinstance(component, gtk.Window):
|
||||||
|
Loading…
Reference in New Issue
Block a user