mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-13 07:47:14 +03:00
Workaround for http://core.tcl.tk/tk/tktview/c84f660833546b1b84e7 on Mac.
Fixes #11.
This commit is contained in:
parent
c5558144a5
commit
47458a53b5
@ -6,6 +6,7 @@ from sys import platform
|
||||
import json
|
||||
from os import mkdir
|
||||
from os.path import expanduser, isdir, join
|
||||
import re
|
||||
import requests
|
||||
from time import time, localtime, strftime
|
||||
|
||||
@ -111,7 +112,9 @@ class AppWindow:
|
||||
|
||||
# update geometry
|
||||
if config.get('geometry'):
|
||||
self.w.geometry(config.get('geometry'))
|
||||
match = re.match('\+([\-\d]+)\+([\-\d]+)', config.get('geometry'))
|
||||
if match and (platform!='darwin' or int(match.group(2))>0): # http://core.tcl.tk/tk/tktview/c84f660833546b1b84e7
|
||||
self.w.geometry(config.get('geometry'))
|
||||
self.w.update_idletasks()
|
||||
self.w.wait_visibility()
|
||||
(w, h) = (self.w.winfo_width(), self.w.winfo_height())
|
||||
@ -259,7 +262,8 @@ class AppWindow:
|
||||
self.button['state'] = tk.NORMAL
|
||||
|
||||
def onexit(self, event=None):
|
||||
config.set('geometry', '+{1}+{2}'.format(*self.w.geometry().split('+')))
|
||||
if platform!='darwin' or self.w.winfo_rooty()>0: # http://core.tcl.tk/tk/tktview/c84f660833546b1b84e7
|
||||
config.set('geometry', '+{1}+{2}'.format(*self.w.geometry().split('+')))
|
||||
config.close()
|
||||
self.session.close()
|
||||
self.w.destroy()
|
||||
|
6
prefs.py
6
prefs.py
@ -40,7 +40,8 @@ class PreferencesDialog(tk.Toplevel):
|
||||
self.transient(parent)
|
||||
|
||||
# position over parent
|
||||
self.geometry("+%d+%d" % (parent.winfo_rootx(), parent.winfo_rooty()))
|
||||
if platform!='darwin' or parent.winfo_rooty()>0: # http://core.tcl.tk/tk/tktview/c84f660833546b1b84e7
|
||||
self.geometry("+%d+%d" % (parent.winfo_rootx(), parent.winfo_rooty()))
|
||||
|
||||
# remove decoration
|
||||
self.resizable(tk.FALSE, tk.FALSE)
|
||||
@ -182,7 +183,8 @@ class AuthenticationDialog(tk.Toplevel):
|
||||
self.transient(parent)
|
||||
|
||||
# position over parent
|
||||
self.geometry("+%d+%d" % (parent.winfo_rootx(), parent.winfo_rooty()))
|
||||
if platform!='darwin' or parent.winfo_rooty()>0: # http://core.tcl.tk/tk/tktview/c84f660833546b1b84e7
|
||||
self.geometry("+%d+%d" % (parent.winfo_rootx(), parent.winfo_rooty()))
|
||||
|
||||
# remove decoration
|
||||
self.resizable(tk.FALSE, tk.FALSE)
|
||||
|
6
stats.py
6
stats.py
@ -35,7 +35,8 @@ class StatsDialog(tk.Toplevel):
|
||||
self.transient(parent)
|
||||
|
||||
# position over parent
|
||||
self.geometry("+%d+%d" % (parent.winfo_rootx(), parent.winfo_rooty()))
|
||||
if platform!='darwin' or parent.winfo_rooty()>0: # http://core.tcl.tk/tk/tktview/c84f660833546b1b84e7
|
||||
self.geometry("+%d+%d" % (parent.winfo_rootx(), parent.winfo_rooty()))
|
||||
|
||||
# remove decoration
|
||||
self.resizable(tk.FALSE, tk.FALSE)
|
||||
@ -116,7 +117,8 @@ class StatsResults(tk.Toplevel):
|
||||
self.transient(parent)
|
||||
|
||||
# position over parent
|
||||
self.geometry("+%d+%d" % (parent.winfo_rootx(), parent.winfo_rooty()))
|
||||
if platform!='darwin' or parent.winfo_rooty()>0: # http://core.tcl.tk/tk/tktview/c84f660833546b1b84e7
|
||||
self.geometry("+%d+%d" % (parent.winfo_rootx(), parent.winfo_rooty()))
|
||||
|
||||
# remove decoration
|
||||
self.resizable(tk.FALSE, tk.FALSE)
|
||||
|
Loading…
x
Reference in New Issue
Block a user