summaryrefslogtreecommitdiff
path: root/embroider_params.py
diff options
context:
space:
mode:
authorLex Neva <github.com@lexneva.name>2018-01-06 15:48:36 -0500
committerLex Neva <github.com@lexneva.name>2018-01-06 15:49:44 -0500
commit3cd61b8ff9baa5ee76070ffa19580f6f2729a78a (patch)
treee24f32e13f32cfb327ad832d1d1790faaa69ff2c /embroider_params.py
parentece8f15edaa6efcc617cc91508ac3ba6227a6254 (diff)
automatically scale simulation window
The simulation window is scaled to fill the available space on the screen. In the Params dialog, the simulation window sits to the right of the Params window and fills the remaining space.
Diffstat (limited to 'embroider_params.py')
-rw-r--r--embroider_params.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/embroider_params.py b/embroider_params.py
index 7cba8fb0..0c5c52fc 100644
--- a/embroider_params.py
+++ b/embroider_params.py
@@ -400,8 +400,19 @@ class SettingsFrame(wx.Frame):
simulator_pos = my_rect.GetTopRight()
simulator_pos.x += 5
+ screen_rect = wx.Display(0).ClientArea
+ max_width = screen_rect.GetWidth() - my_rect.GetWidth()
+ max_height = screen_rect.GetHeight()
+
try:
- self.simulate_window = EmbroiderySimulator(None, -1, "Embroidery Simulator", simulator_pos, size=(300, 300), patches=patches, on_close=self.simulate_window_closed, target_duration=5)
+ self.simulate_window = EmbroiderySimulator(None, -1, "Embroidery Simulator",
+ simulator_pos,
+ size=(300, 300),
+ patches=patches,
+ on_close=self.simulate_window_closed,
+ target_duration=5,
+ max_width=max_width,
+ max_height=max_height)
except:
error = traceback.format_exc()