Fix update checker not working on macOS (#1642)

* Prevent update dialog from going off screen

Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
Daniel
2020-05-10 07:13:47 -04:00
committed by GitHub
parent c5a7205d12
commit 680b500993
3 changed files with 19 additions and 7 deletions
+11 -2
View File
@@ -14,8 +14,17 @@ void initUpdateButton(Button &button,
QObject::connect(&button, &Button::leftClicked, [&button] {
auto dialog = new UpdateDialog();
dialog->setActionOnFocusLoss(BaseWindow::Delete);
dialog->move(button.mapToGlobal(
QPoint(int(-100 * button.scale()), button.height())));
auto globalPoint = button.mapToGlobal(
QPoint(int(-100 * button.scale()), button.height()));
// Make sure that update dialog will not go off left edge of screen
if (globalPoint.x() < 0)
{
globalPoint.setX(0);
}
dialog->move(globalPoint);
dialog->show();
dialog->raise();