| 3517 | } |
| 3518 | |
| 3519 | void MapEditorController::addFloatingDockWidget(QDockWidget* dock_widget) |
| 3520 | { |
| 3521 | if (!window->restoreDockWidget(dock_widget)) |
| 3522 | { |
| 3523 | dock_widget->setFloating(true); |
| 3524 | // We must set the size from the sizeHint() ourselves, |
| 3525 | // otherwise QDockWidget may use the minimum size. |
| 3526 | QRect geometry(window->pos(), dock_widget->sizeHint()); |
| 3527 | geometry.translate(window->width() - geometry.width(), window->centralWidget()->y()); |
| 3528 | const int max_height = window->centralWidget()->height(); |
| 3529 | if (geometry.height() > max_height) |
| 3530 | geometry.setHeight(max_height); |
| 3531 | dock_widget->setGeometry(geometry); |
| 3532 | connect(dock_widget, &QDockWidget::dockLocationChanged, this, &MapEditorController::setWindowStateChanged); |
| 3533 | } |
| 3534 | } |
| 3535 | |
| 3536 | |
| 3537 | void MapEditorController::enableGPSDisplay(bool enable) |