| 231 | } |
| 232 | |
| 233 | void MainWindow::activateView(Sublime::View* view, bool focus) |
| 234 | { |
| 235 | Q_D(MainWindow); |
| 236 | |
| 237 | const auto containerIt = d->viewContainers.constFind(view); |
| 238 | if (containerIt == d->viewContainers.constEnd()) |
| 239 | return; |
| 240 | |
| 241 | if (d->activeView == view) |
| 242 | { |
| 243 | optionallyFocusViewWidget(view, focus); |
| 244 | return; |
| 245 | } |
| 246 | |
| 247 | auto* const widget = view->widget(); |
| 248 | Q_ASSERT(widget); |
| 249 | (*containerIt)->setCurrentWidget(widget); |
| 250 | |
| 251 | setActiveView(view, focus); |
| 252 | d->area->setActiveView(view); |
| 253 | } |
| 254 | |
| 255 | void MainWindow::setActiveView(View *view, bool focus) |
| 256 | { |