From 3cd61b8ff9baa5ee76070ffa19580f6f2729a78a Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Sat, 6 Jan 2018 15:48:36 -0500 Subject: 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. --- embroider_params.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'embroider_params.py') 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() -- cgit v1.2.3