Changeset View
Changeset View
Standalone View
Standalone View
krusader/panelmanager.cpp
Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Line(s) | 53 | { | |||
---|---|---|---|---|---|
65 | _newTab->adjustSize(); | 65 | _newTab->adjustSize(); | ||
66 | connect(_newTab, &QToolButton::clicked, this, QOverload<>::of(&PanelManager::slotNewTab)); | 66 | connect(_newTab, &QToolButton::clicked, this, QOverload<>::of(&PanelManager::slotNewTab)); | ||
67 | 67 | | |||
68 | // tab-bar | 68 | // tab-bar | ||
69 | _tabbar = new PanelTabBar(this, _actions); | 69 | _tabbar = new PanelTabBar(this, _actions); | ||
70 | connect(_tabbar, &PanelTabBar::currentChanged, this, &PanelManager::slotCurrentTabChanged); | 70 | connect(_tabbar, &PanelTabBar::currentChanged, this, &PanelManager::slotCurrentTabChanged); | ||
71 | connect(_tabbar, &PanelTabBar::tabCloseRequested, this, QOverload<int>::of(&PanelManager::slotCloseTab)); | 71 | connect(_tabbar, &PanelTabBar::tabCloseRequested, this, QOverload<int>::of(&PanelManager::slotCloseTab)); | ||
72 | connect(_tabbar, &PanelTabBar::closeCurrentTab, this, QOverload<>::of(&PanelManager::slotCloseTab)); | 72 | connect(_tabbar, &PanelTabBar::closeCurrentTab, this, QOverload<>::of(&PanelManager::slotCloseTab)); | ||
73 | connect(_tabbar, SIGNAL(newTab(QUrl)), this, SLOT(slotNewTab(QUrl))); | 73 | connect(_tabbar, &PanelTabBar::newTab, this, [=] (const QUrl &url) { slotNewTab(url); }); | ||
74 | connect(_tabbar, &PanelTabBar::draggingTab, this, &PanelManager::slotDraggingTab); | 74 | connect(_tabbar, &PanelTabBar::draggingTab, this, &PanelManager::slotDraggingTab); | ||
75 | connect(_tabbar, &PanelTabBar::draggingTabFinished, this, &PanelManager::slotDraggingTabFinished); | 75 | connect(_tabbar, &PanelTabBar::draggingTabFinished, this, &PanelManager::slotDraggingTabFinished); | ||
76 | 76 | | |||
77 | QHBoxLayout *tabbarLayout = new QHBoxLayout; | 77 | QHBoxLayout *tabbarLayout = new QHBoxLayout; | ||
78 | tabbarLayout->setSpacing(0); | 78 | tabbarLayout->setSpacing(0); | ||
79 | tabbarLayout->setContentsMargins(0, 0, 0, 0); | 79 | tabbarLayout->setContentsMargins(0, 0, 0, 0); | ||
80 | 80 | | |||
81 | tabbarLayout->addWidget(_tabbar); | 81 | tabbarLayout->addWidget(_tabbar); | ||
▲ Show 20 Lines • Show All 138 Lines • ▼ Show 20 Line(s) | 199 | { | |||
220 | // this is needed so that all tab labels get updated | 220 | // this is needed so that all tab labels get updated | ||
221 | layoutTabs(); | 221 | layoutTabs(); | ||
222 | } | 222 | } | ||
223 | 223 | | |||
224 | void PanelManager::layoutTabs() | 224 | void PanelManager::layoutTabs() | ||
225 | { | 225 | { | ||
226 | // delayed url refreshes may be pending - | 226 | // delayed url refreshes may be pending - | ||
227 | // delay the layout too so it happens after them | 227 | // delay the layout too so it happens after them | ||
228 | QTimer::singleShot(0, _tabbar, SLOT(layoutTabs())); | 228 | QTimer::singleShot(0, _tabbar, &PanelTabBar::layoutTabs); | ||
229 | } | 229 | } | ||
230 | 230 | | |||
231 | KrPanel *PanelManager::currentPanel() const { | 231 | KrPanel *PanelManager::currentPanel() const { | ||
232 | return _currentPanel; | 232 | return _currentPanel; | ||
233 | } | 233 | } | ||
234 | 234 | | |||
235 | void PanelManager::moveTabToOtherSide() | 235 | void PanelManager::moveTabToOtherSide() | ||
236 | { | 236 | { | ||
▲ Show 20 Lines • Show All 226 Lines • Show Last 20 Lines |