Skip to content

Commit

Permalink
Fix #453
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenyay committed May 29, 2018
1 parent 34c8b98 commit 7b21ed5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/outwiker/gui/pagelistpopup.py
Expand Up @@ -6,8 +6,9 @@


class PageListPopup(wx.PopupTransientWindow):
def __init__(self, parent):
def __init__(self, parent, mainWindow):
super(PageListPopup, self).__init__(parent)
self._mainWindow = mainWindow

self.SetWindowStyle(wx.BORDER_SUNKEN)
self.__pagelist = PageList(self)
Expand Down Expand Up @@ -38,7 +39,7 @@ def __getBestPosition(self):
mousePosition = wx.GetMousePosition()

width, height = self.GetSize()
parent_window_rect = self.GetParent().GetScreenRect()
parent_window_rect = self._mainWindow.GetScreenRect()

if mousePosition.x < parent_window_rect.x + parent_window_rect.width / 2:
popup_x = mousePosition.x
Expand Down
2 changes: 1 addition & 1 deletion src/outwiker/gui/tagscloudpanel.py
Expand Up @@ -21,7 +21,7 @@ def __init__(self, parent, application):
self.__controller = TagsPanelController(self, application)

def showPopup(self, pages):
pageListPopup = PageListPopup(self.__application.mainWindow)
pageListPopup = PageListPopup(self, self.__application.mainWindow)
pageListPopup.SetSize((self.__popupWidth, self.__popupHeight))
pageListPopup.setPageList(pages)
pageListPopup.Popup()
Expand Down

0 comments on commit 7b21ed5

Please sign in to comment.