Skip to content

Commit

Permalink
Added --front and --height to update GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
kfsone committed Nov 22, 2014
1 parent c589c37 commit e279417
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ TradeDangerous, Copyright (C) Oliver "kfsone" Smith, July 2014

v6.0.5 Nov 22 2014 (w/Gamma 1)
. (kfsone) Added "import" sub-command for loading 1+ stations from a file
. (kfsone) Added "--height" (-H) option to update GUI
. (kfsone) Added "--front" (-F) to keep the update gui infront of TD
. (kfsone) Added Pilot's Federation/Jameson Memorial

v6.0.4 Nov 21 2014 (Beta 3.9.1)
Expand Down
15 changes: 15 additions & 0 deletions commands/update_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,21 @@
default=False,
dest='gui',
),
ParseArgument('--height', '-H',
help="[GUI] Specify height of the window",
type=int,
default=800,
),
ParseArgument('--front', '-F',
help=(
"[GUI] Keep the GUI infront of other windows; "
"this allows you to put the window infront of "
"the game UI if you run the game in windowed mode."
),
action='store_true',
default=False,
dest='alwaysOnTop',
),
MutuallyExclusiveGroup(
ParseArgument('--sublime',
help='Like --editor but uses Sublime Text (2 or 3), which is nice.',
Expand Down
11 changes: 10 additions & 1 deletion commands/update_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@ class UpdateGUI(tk.Canvas):
"""

def __init__(self, root, tdb, cmdenv):
super().__init__(root, borderwidth=0, width=500, height=440)
width = cmdenv.width or 512
height = cmdenv.height or 640
sticky = 1 if cmdenv.alwaysOnTop else 0

super().__init__(root, borderwidth=0, width=width, height=height)
root.geometry("{}x{}-0+0".format(
width+32, height
))

self.root = root
self.tdb = tdb
Expand All @@ -32,6 +39,8 @@ def __init__(self, root, tdb, cmdenv):
self.results = None
self.headings = []

root.wm_attributes("-topmost", sticky)

self.bind_all("<MouseWheel>", self.onMouseWheel)
self.vsb = tk.Scrollbar(root, orient="vertical", command=self.yview)
self.configure(yscrollcommand=self.vsb.set)
Expand Down

0 comments on commit e279417

Please sign in to comment.