Skip to content

Commit e508fcd

Browse files
authored
Merge pull request #98 from labscript-suite/qt-float-fix
Only pass ints to self.ui.move
2 parents 5e3603d + 514e7d2 commit e508fcd

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

blacs/__main__.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -464,8 +464,17 @@ def restore_window(self,tab_data):
464464
# Actually this is a waste of time because if you close when maximized, reoopen and then
465465
# de-maximize, the window moves to a random position (not the position it was at before maximizing)
466466
# so bleh!
467-
self.ui.move(tab_data['BLACS settings']["window_xpos"]-tab_data['BLACS settings']['window_frame_width']/2,tab_data['BLACS settings']["window_ypos"]-tab_data['BLACS settings']['window_frame_height']+tab_data['BLACS settings']['window_frame_width']/2)
468-
self.ui.resize(tab_data['BLACS settings']["window_width"],tab_data['BLACS settings']["window_height"])
467+
self.ui.move(
468+
tab_data['BLACS settings']["window_xpos"]
469+
- tab_data['BLACS settings']['window_frame_width'] // 2,
470+
tab_data['BLACS settings']["window_ypos"]
471+
- tab_data['BLACS settings']['window_frame_height']
472+
+ tab_data['BLACS settings']['window_frame_width'] // 2,
473+
)
474+
self.ui.resize(
475+
tab_data['BLACS settings']["window_width"],
476+
tab_data['BLACS settings']["window_height"],
477+
)
469478

470479
if 'window_maximized' in tab_data['BLACS settings'] and tab_data['BLACS settings']['window_maximized']:
471480
self.ui.showMaximized()
@@ -474,7 +483,7 @@ def restore_window(self,tab_data):
474483
pane.setSizes(tab_data['BLACS settings'][pane_name])
475484

476485
except Exception as e:
477-
logger.warning("Unable to load window and notebook defaults. Exception:"+str(e))
486+
logger.exception("Unable to load window and notebook defaults. Exception:"+str(e))
478487

479488
def order_tabs(self,tab_data):
480489
# Move the tabs to the correct notebook

0 commit comments

Comments
 (0)