Changeset View
Changeset View
Standalone View
Standalone View
src/ViewManager.cpp
Show First 20 Lines • Show All 223 Lines • ▼ Show 20 Line(s) | 106 | { | |||
---|---|---|---|---|---|
224 | action = new QAction(i18nc("@action Shortcut entry", "Last Used Tabs (Reverse)"), this); | 224 | action = new QAction(i18nc("@action Shortcut entry", "Last Used Tabs (Reverse)"), this); | ||
225 | collection->addAction(QStringLiteral("last-used-tab-reverse"), action); | 225 | collection->addAction(QStringLiteral("last-used-tab-reverse"), action); | ||
226 | collection->setDefaultShortcut(action, Qt::CTRL + Qt::SHIFT + Qt::Key_Tab); | 226 | collection->setDefaultShortcut(action, Qt::CTRL + Qt::SHIFT + Qt::Key_Tab); | ||
227 | connect(action, &QAction::triggered, this, &ViewManager::lastUsedViewReverse); | 227 | connect(action, &QAction::triggered, this, &ViewManager::lastUsedViewReverse); | ||
228 | 228 | | |||
229 | action = new QAction(i18nc("@action Shortcut entry", "Maximize current Terminal"), this); | 229 | action = new QAction(i18nc("@action Shortcut entry", "Maximize current Terminal"), this); | ||
230 | collection->addAction(QStringLiteral("maximize-current-terminal"), action); | 230 | collection->addAction(QStringLiteral("maximize-current-terminal"), action); | ||
231 | collection->setDefaultShortcut(action, Qt::CTRL + Qt::SHIFT + Qt::Key_E); | 231 | collection->setDefaultShortcut(action, Qt::CTRL + Qt::SHIFT + Qt::Key_E); | ||
232 | connect(action, &QAction::triggered, _viewContainer, &TabbedViewContainer::maximizeCurrentTerminal); | 232 | connect(action, &QAction::triggered, _viewContainer, &TabbedViewContainer::toggleMaximizeCurrentTerminal); | ||
233 | _multiSplitterOnlyActions << action; | | |||
234 | _viewContainer->addAction(action); | | |||
235 | | ||||
236 | action = new QAction(i18nc("@action Shortcut entry", "Restore other terminals"), this); | | |||
237 | collection->addAction(QStringLiteral("restore-other-terminals"), action); | | |||
238 | collection->setDefaultShortcut(action, Qt::CTRL + Qt::SHIFT + Qt::Key_Minus); | | |||
239 | connect(action, &QAction::triggered, _viewContainer, &TabbedViewContainer::restoreOtherTerminals); | | |||
240 | _multiSplitterOnlyActions << action; | 233 | _multiSplitterOnlyActions << action; | ||
241 | _viewContainer->addAction(action); | 234 | _viewContainer->addAction(action); | ||
242 | 235 | | |||
243 | action = new QAction(i18nc("@action Shortcut entry", "Move tab to the right"), this); | 236 | action = new QAction(i18nc("@action Shortcut entry", "Move tab to the right"), this); | ||
244 | collection->addAction(QStringLiteral("move-tab-to-right"), action); | 237 | collection->addAction(QStringLiteral("move-tab-to-right"), action); | ||
245 | collection->setDefaultShortcut(action, Qt::CTRL + Qt::ALT + Qt::Key_Right); | 238 | collection->setDefaultShortcut(action, Qt::CTRL + Qt::ALT + Qt::Key_Right); | ||
246 | connect(action, &QAction::triggered, _viewContainer, &TabbedViewContainer::moveTabRight); | 239 | connect(action, &QAction::triggered, _viewContainer, &TabbedViewContainer::moveTabRight); | ||
247 | _multiTabOnlyActions << action; | 240 | _multiTabOnlyActions << action; | ||
▲ Show 20 Lines • Show All 225 Lines • ▼ Show 20 Line(s) | 449 | { | |||
473 | // Before deleting the view, let's unmaximize if it's maximized. | 466 | // Before deleting the view, let's unmaximize if it's maximized. | ||
474 | auto *splitter = qobject_cast<ViewSplitter*>(view->parentWidget()); | 467 | auto *splitter = qobject_cast<ViewSplitter*>(view->parentWidget()); | ||
475 | if (!splitter) { | 468 | if (!splitter) { | ||
476 | return; | 469 | return; | ||
477 | } | 470 | } | ||
478 | 471 | | |||
479 | auto *toplevelSplitter = splitter->getToplevelSplitter(); | 472 | auto *toplevelSplitter = splitter->getToplevelSplitter(); | ||
480 | 473 | | |||
481 | toplevelSplitter->restoreOtherTerminals(); | 474 | toplevelSplitter->handleMinimizeMaximize(false); | ||
482 | view->deleteLater(); | 475 | view->deleteLater(); | ||
483 | 476 | | |||
484 | 477 | | |||
485 | // Only remove the controller from factory() if it's actually controlling | 478 | // Only remove the controller from factory() if it's actually controlling | ||
486 | // the session from the sender. | 479 | // the session from the sender. | ||
487 | // This fixes BUG: 348478 - messed up menus after a detached tab is closed | 480 | // This fixes BUG: 348478 - messed up menus after a detached tab is closed | ||
488 | if ((!_pluggedController.isNull()) && (_pluggedController->session() == session)) { | 481 | if ((!_pluggedController.isNull()) && (_pluggedController->session() == session)) { | ||
489 | // This is needed to remove this controller from factory() in | 482 | // This is needed to remove this controller from factory() in | ||
▲ Show 20 Lines • Show All 281 Lines • ▼ Show 20 Line(s) | |||||
771 | // if (_pluggedController) | 764 | // if (_pluggedController) | ||
772 | // emit unplugController(_pluggedController); | 765 | // emit unplugController(_pluggedController); | ||
773 | } | 766 | } | ||
774 | 767 | | |||
775 | TerminalDisplay *ViewManager::createTerminalDisplay(Session *session) | 768 | TerminalDisplay *ViewManager::createTerminalDisplay(Session *session) | ||
776 | { | 769 | { | ||
777 | auto display = new TerminalDisplay(nullptr); | 770 | auto display = new TerminalDisplay(nullptr); | ||
778 | display->setRandomSeed(session->sessionId() * 31); | 771 | display->setRandomSeed(session->sessionId() * 31); | ||
779 | 772 | connect(display->headerBar(), &TerminalHeaderBar::requestToggleExpansion, | |||
773 | _viewContainer, &TabbedViewContainer::maximizeCurrentTerminal); | ||||
780 | return display; | 774 | return display; | ||
781 | } | 775 | } | ||
782 | 776 | | |||
783 | const ColorScheme *ViewManager::colorSchemeForProfile(const Profile::Ptr &profile) | 777 | const ColorScheme *ViewManager::colorSchemeForProfile(const Profile::Ptr &profile) | ||
784 | { | 778 | { | ||
785 | const ColorScheme *colorScheme = ColorSchemeManager::instance()-> | 779 | const ColorScheme *colorScheme = ColorSchemeManager::instance()-> | ||
786 | findColorScheme(profile->colorScheme()); | 780 | findColorScheme(profile->colorScheme()); | ||
787 | if (colorScheme == nullptr) { | 781 | if (colorScheme == nullptr) { | ||
▲ Show 20 Lines • Show All 333 Lines • Show Last 20 Lines |