Changeset View
Changeset View
Standalone View
Standalone View
sublime/idealcontroller.cpp
Show First 20 Lines • Show All 117 Lines • ▼ Show 20 Line(s) | 105 | } else { | |||
---|---|---|---|---|---|
118 | dock->setWidget(toolView); | 118 | dock->setWidget(toolView); | ||
119 | } | 119 | } | ||
120 | 120 | | |||
121 | dock->setWindowTitle(view->widget()->windowTitle()); | 121 | dock->setWindowTitle(view->widget()->windowTitle()); | ||
122 | dock->setWindowIcon(view->widget()->windowIcon()); | 122 | dock->setWindowIcon(view->widget()->windowIcon()); | ||
123 | dock->setFocusProxy(dock->widget()); | 123 | dock->setFocusProxy(dock->widget()); | ||
124 | 124 | | |||
125 | if (IdealButtonBarWidget* bar = barForDockArea(area)) { | 125 | if (IdealButtonBarWidget* bar = barForDockArea(area)) { | ||
126 | QAction* action = bar->addWidget( | 126 | QAction* action = bar->addWidget(dock, static_cast<MainWindow*>(parent())->area(), view); | ||
127 | view->document()->title(), dock, | | |||
128 | static_cast<MainWindow*>(parent())->area(), view); | | |||
129 | m_dockwidget_to_action[dock] = m_view_to_action[view] = action; | 127 | m_dockwidget_to_action[dock] = m_view_to_action[view] = action; | ||
130 | 128 | | |||
131 | m_docks->addAction(action); | 129 | m_docks->addAction(action); | ||
132 | connect(dock, &IdealDockWidget::closeRequested, action, &QAction::toggle); | 130 | connect(dock, &IdealDockWidget::closeRequested, action, &QAction::toggle); | ||
133 | } | 131 | } | ||
134 | 132 | | |||
135 | connect(dock, &IdealDockWidget::dockLocationChanged, this, &IdealController::dockLocationChanged); | 133 | connect(dock, &IdealDockWidget::dockLocationChanged, this, &IdealController::dockLocationChanged); | ||
136 | 134 | | |||
Show All 25 Lines | 141 | { | |||
162 | } | 160 | } | ||
163 | 161 | | |||
164 | if (IdealButtonBarWidget* bar = barForDockArea(dock->dockWidgetArea())) | 162 | if (IdealButtonBarWidget* bar = barForDockArea(dock->dockWidgetArea())) | ||
165 | bar->removeAction(action); | 163 | bar->removeAction(action); | ||
166 | 164 | | |||
167 | docks.insert(dock); | 165 | docks.insert(dock); | ||
168 | 166 | | |||
169 | if (IdealButtonBarWidget* bar = barForDockArea(area)) { | 167 | if (IdealButtonBarWidget* bar = barForDockArea(area)) { | ||
170 | QAction* action = bar->addWidget( | 168 | QAction* action = bar->addWidget(dock, static_cast<MainWindow*>(parent())->area(), view); | ||
171 | view->document()->title(), dock, | | |||
172 | static_cast<MainWindow*>(parent())->area(), view); | | |||
173 | m_dockwidget_to_action[dock] = m_view_to_action[view] = action; | 169 | m_dockwidget_to_action[dock] = m_view_to_action[view] = action; | ||
174 | 170 | | |||
175 | // at this point the dockwidget is visible (user dragged it) | 171 | // at this point the dockwidget is visible (user dragged it) | ||
176 | // properly set up UI state | 172 | // properly set up UI state | ||
177 | bar->showWidget(action, true); | 173 | bar->showWidget(action, true); | ||
178 | 174 | | |||
179 | // the dock should now be the "last" opened in a new area, not in the old area | 175 | // the dock should now be the "last" opened in a new area, not in the old area | ||
180 | for (auto it = lastDockWidget.begin(); it != lastDockWidget.end(); ++it) { | 176 | for (auto it = lastDockWidget.begin(); it != lastDockWidget.end(); ++it) { | ||
▲ Show 20 Lines • Show All 325 Lines • Show Last 20 Lines |