diff --git a/krusader/panelmanager.cpp b/krusader/panelmanager.cpp index 50add38f..ae97497f 100644 --- a/krusader/panelmanager.cpp +++ b/krusader/panelmanager.cpp @@ -1,452 +1,455 @@ /***************************************************************************** * Copyright (C) 2002 Shie Erlich * * Copyright (C) 2002 Rafi Yanai * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This package is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this package; if not, write to the Free Software * * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * *****************************************************************************/ #include "panelmanager.h" #include "defaults.h" #include "tabactions.h" #include "krusaderview.h" #include "krmainwindow.h" #include "Panel/listpanel.h" #include "Panel/panelfunc.h" #include "Panel/krviewfactory.h" #include // QtGui #include // QtWidgets #include #include #include #include #include #include #define HIDE_ON_SINGLE_TAB false PanelManager::PanelManager(QWidget *parent, KrMainWindow* mainWindow, bool left) : QWidget(parent), _otherManager(0), _actions(mainWindow->tabActions()), _layout(0), _left(left), _self(0) { _layout = new QGridLayout(this); _layout->setContentsMargins(0, 0, 0, 0); _layout->setSpacing(0); _stack = new QStackedWidget(this); // new tab button _newTab = new QToolButton(this); _newTab->setAutoRaise(true); _newTab->setText(i18n("Open a new tab in home")); _newTab->setToolTip(i18n("Open a new tab in home")); _newTab->setIcon(SmallIcon("tab-new")); _newTab->adjustSize(); connect(_newTab, SIGNAL(clicked()), this, SLOT(slotNewTab())); // tab-bar _tabbar = new PanelTabBar(this, _actions); connect(_tabbar, SIGNAL(currentChanged(int)), this, SLOT(slotCurrentTabChanged(int))); connect(_tabbar, SIGNAL(tabCloseRequested(int)), this, SLOT(slotCloseTab(int))); connect(_tabbar, SIGNAL(closeCurrentTab()), this, SLOT(slotCloseTab())); connect(_tabbar, SIGNAL(newTab(QUrl)), this, SLOT(slotNewTab(QUrl))); connect(_tabbar, SIGNAL(draggingTab(QMouseEvent*)), this, SLOT(slotDraggingTab(QMouseEvent*))); connect(_tabbar, SIGNAL(draggingTabFinished(QMouseEvent*)), this, SLOT(slotDraggingTabFinished(QMouseEvent*))); QHBoxLayout *tabbarLayout = new QHBoxLayout; tabbarLayout->setSpacing(0); tabbarLayout->setContentsMargins(0, 0, 0, 0); tabbarLayout->addWidget(_tabbar); tabbarLayout->addWidget(_newTab); _layout->addWidget(_stack, 0, 0); _layout->addLayout(tabbarLayout, 1, 0); updateTabbarPos(); setLayout(_layout); addPanel(true); tabsCountChanged(); } void PanelManager::tabsCountChanged() { bool showTabbar = true; if (_tabbar->count() <= 1 && HIDE_ON_SINGLE_TAB) showTabbar = false; KConfigGroup cfg(krConfig, "Look&Feel"); bool showButtons = showTabbar && cfg.readEntry("Show Tab Buttons", true); _newTab->setVisible(showButtons); _tabbar->setVisible(showTabbar); // disable close button if only 1 tab is left _tabbar->setTabsClosable(showButtons && _tabbar->count() > 1); _actions->refreshActions(); } void PanelManager::activate() { assert(sender() == (currentPanel()->gui)); emit setActiveManager(this); _actions->refreshActions(); } void PanelManager::slotCurrentTabChanged(int index) // void PanelManager::slotChangePanel(ListPanel *p, bool makeActive) { ListPanel *p = _tabbar->getPanel(index); if (!p || p == _self) return; ListPanel *prev = _self; _self = p; _stack->setCurrentWidget(_self); if(prev) prev->slotFocusOnMe(false); //FIXME - necessary ? _self->slotFocusOnMe(this == ACTIVE_MNG); emit pathChanged(p); if(otherManager()) otherManager()->currentPanel()->otherPanelChanged(); } ListPanel* PanelManager::createPanel(KConfigGroup cfg) { ListPanel * p = new ListPanel(_stack, this, cfg); connectPanel(p); return p; } void PanelManager::connectPanel(ListPanel *p) { connect(p, &ListPanel::activate, this, &PanelManager::activate); connect(p, &ListPanel::pathChanged, this, [=]() { pathChanged(p); }); connect(p, &ListPanel::pathChanged, this, [=]() { _tabbar->updateTab(p); }); } void PanelManager::disconnectPanel(ListPanel *p) { disconnect(p, &ListPanel::activate, this, nullptr); disconnect(p, &ListPanel::pathChanged, this, nullptr); } ListPanel* PanelManager::addPanel(bool setCurrent, KConfigGroup cfg, KrPanel *nextTo) { // create the panel and add it into the widgetstack ListPanel * p = createPanel(cfg); _stack->addWidget(p); // now, create the corresponding tab int index = _tabbar->addPanel(p, setCurrent, nextTo); tabsCountChanged(); if (setCurrent) slotCurrentTabChanged(index); return p; } void PanelManager::saveSettings(KConfigGroup config, bool saveHistory) { config.writeEntry("ActiveTab", activeTab()); KConfigGroup grpTabs(&config, "Tabs"); foreach(const QString &grpTab, grpTabs.groupList()) grpTabs.deleteGroup(grpTab); for(int i = 0; i < _tabbar->count(); i++) { ListPanel *panel = _tabbar->getPanel(i); KConfigGroup grpTab(&grpTabs, "Tab" + QString::number(i)); panel->saveSettings(grpTab, saveHistory); } } void PanelManager::loadSettings(KConfigGroup config) { KConfigGroup grpTabs(&config, "Tabs"); int numTabsOld = _tabbar->count(); int numTabsNew = grpTabs.groupList().count(); for(int i = 0; i < numTabsNew; i++) { KConfigGroup grpTab(&grpTabs, "Tab" + QString::number(i)); // TODO workaround for bug 371453. Remove this when bug is fixed if (grpTab.keyList().isEmpty()) continue; ListPanel *panel = i < numTabsOld ? _tabbar->getPanel(i) : addPanel(false, grpTab); panel->restoreSettings(grpTab); + _tabbar->updateTab(panel); } for(int i = numTabsOld - 1; i >= numTabsNew && i > 0; i--) slotCloseTab(i); setActiveTab(config.readEntry("ActiveTab", 0)); // this is needed so that all tab labels get updated layoutTabs(); } void PanelManager::layoutTabs() { // delayed url refreshes may be pending - // delay the layout too so it happens after them QTimer::singleShot(0, _tabbar, SLOT(layoutTabs())); } void PanelManager::moveTabToOtherSide() { if(tabCount() < 2) return; ListPanel *p; _tabbar->removeCurrentPanel(p); _stack->removeWidget(p); disconnectPanel(p); p->reparent(_otherManager->_stack, _otherManager); _otherManager->connectPanel(p); _otherManager->_stack->addWidget(p); _otherManager->_tabbar->addPanel(p, true); _otherManager->tabsCountChanged(); tabsCountChanged(); p->slotFocusOnMe(); } void PanelManager::slotNewTab(const QUrl &url, bool setCurrent, KrPanel *nextTo) { ListPanel *p = addPanel(setCurrent, KConfigGroup(), nextTo); if(nextTo && nextTo->gui) { // We duplicate tab settings by writing original settings to a temporary // group and making the new tab read settings from it. Duplicating // settings directly would add too much complexity. QString grpName = "PanelManager_" + QString::number(qApp->applicationPid()); krConfig->deleteGroup(grpName); // make sure the group is empty KConfigGroup cfg(krConfig, grpName); nextTo->gui->saveSettings(cfg, true); p->restoreSettings(cfg); krConfig->deleteGroup(grpName); // reset undesired duplicated settings p->setLocked(false); } else p->start(url); } void PanelManager::slotNewTab() { slotNewTab(QUrl::fromLocalFile(QDir::home().absolutePath())); } void PanelManager::slotCloseTab() { slotCloseTab(_tabbar->currentIndex()); } void PanelManager::slotCloseTab(int index) { if (_tabbar->count() <= 1) /* if this is the last tab don't close it */ return ; ListPanel *oldp; // if (index == _tabbar->currentIndex()) // slotChangePanel(_tabbar->removeCurrentPanel(oldp), false); // else _tabbar->removePanel(index, oldp); //this automatically changes the current panel _stack->removeWidget(oldp); deletePanel(oldp); tabsCountChanged(); } void PanelManager::updateTabbarPos() { KConfigGroup group(krConfig, "Look&Feel"); if(group.readEntry("Tab Bar Position", "bottom") == "top") { _layout->addWidget(_stack, 2, 0); _tabbar->setShape(QTabBar::RoundedNorth); } else { _layout->addWidget(_stack, 0, 0); _tabbar->setShape(QTabBar::RoundedSouth); } } int PanelManager::activeTab() { return _tabbar->currentIndex(); } void PanelManager::setActiveTab(int index) { _tabbar->setCurrentIndex(index); } void PanelManager::slotRecreatePanels() { updateTabbarPos(); for (int i = 0; i != _tabbar->count(); i++) { QString grpName = "PanelManager_" + QString::number(qApp->applicationPid()); krConfig->deleteGroup(grpName); // make sure the group is empty KConfigGroup cfg(krConfig, grpName); ListPanel *oldPanel = _tabbar->getPanel(i); oldPanel->saveSettings(cfg, true); disconnect(oldPanel); ListPanel *newPanel = createPanel(cfg); _stack->insertWidget(i, newPanel); _tabbar->changePanel(i, newPanel); if (_self == oldPanel) { _self = newPanel; _stack->setCurrentWidget(_self); } _stack->removeWidget(oldPanel); deletePanel(oldPanel); newPanel->restoreSettings(cfg); _tabbar->updateTab(newPanel); krConfig->deleteGroup(grpName); } tabsCountChanged(); _self->slotFocusOnMe(this == ACTIVE_MNG); emit pathChanged(_self); } void PanelManager::slotNextTab() { int currTab = _tabbar->currentIndex(); int nextInd = (currTab == _tabbar->count() - 1 ? 0 : currTab + 1); _tabbar->setCurrentIndex(nextInd); } void PanelManager::slotPreviousTab() { int currTab = _tabbar->currentIndex(); int nextInd = (currTab == 0 ? _tabbar->count() - 1 : currTab - 1); _tabbar->setCurrentIndex(nextInd); } void PanelManager::refreshAllTabs() { int i = 0; while (i < _tabbar->count()) { ListPanel *panel = _tabbar->getPanel(i); if (panel) { panel->func->refresh(); } ++i; } } void PanelManager::deletePanel(ListPanel * p) { disconnect(p); delete p; } void PanelManager::slotCloseInactiveTabs() { int i = 0; while (i < _tabbar->count()) { if (i == activeTab()) i++; else slotCloseTab(i); } } void PanelManager::slotCloseDuplicatedTabs() { int i = 0; while (i < _tabbar->count() - 1) { ListPanel * panel1 = _tabbar->getPanel(i); if (panel1 != 0) { for (int j = i + 1; j < _tabbar->count(); j++) { ListPanel * panel2 = _tabbar->getPanel(j); if (panel2 != 0 && panel1->virtualPath().matches(panel2->virtualPath(), QUrl::StripTrailingSlash)) { if (j == activeTab()) { slotCloseTab(i); i--; break; } else { slotCloseTab(j); j--; } } } } i++; } } int PanelManager::findTab(QUrl url) { url.setPath(QDir::cleanPath(url.path())); for(int i = 0; i < _tabbar->count(); i++) { if(_tabbar->getPanel(i)) { QUrl panelUrl = _tabbar->getPanel(i)->virtualPath(); panelUrl.setPath(QDir::cleanPath(panelUrl.path())); if(panelUrl.matches(url, QUrl::StripTrailingSlash)) return i; } } return -1; } void PanelManager::slotLockTab() { - currentPanel()->gui->setLocked(!currentPanel()->gui->isLocked()); + ListPanel *panel = _self; + panel->gui->setLocked(!panel->gui->isLocked()); _actions->refreshActions(); + _tabbar->updateTab(panel); } void PanelManager::newTabs(const QStringList& urls) { for(int i = 0; i < urls.count(); i++) slotNewTab(QUrl::fromUserInput(urls[i], QString(), QUrl::AssumeLocalFile)); } KrPanel *PanelManager::currentPanel() { return _self; } diff --git a/krusader/paneltabbar.cpp b/krusader/paneltabbar.cpp index 79a3d103..fd1a166a 100644 --- a/krusader/paneltabbar.cpp +++ b/krusader/paneltabbar.cpp @@ -1,319 +1,321 @@ /***************************************************************************** * Copyright (C) 2002 Shie Erlich * * Copyright (C) 2002 Rafi Yanai * * based on original code from Sebastian Trueg * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This package is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this package; if not, write to the Free Software * * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * *****************************************************************************/ #include "paneltabbar.h" #include "defaults.h" #include "tabactions.h" #include "../krglobal.h" #include "Panel/listpanel.h" // QtCore #include // QtGui #include #include #include // QtWidgets #include #include #include #include +#include #include #define DISPLAY(X) (X.isLocalFile() ? X.path() : X.toDisplayString()) PanelTabBar::PanelTabBar(QWidget *parent, TabActions *actions): QTabBar(parent), _maxTabLength(0), _tabClicked(false), _draggingTab(false) { _panelActionMenu = new KActionMenu(i18n("Panel"), this); setAcceptDrops(true); insertAction(actions->actNewTab); insertAction(actions->actLockTab); insertAction(actions->actDupTab); insertAction(actions->actMoveTabToOtherSide); insertAction(actions->actCloseTab); insertAction(actions->actCloseInactiveTabs); insertAction(actions->actCloseDuplicatedTabs); setMovable(true); // enable drag'n'drop setShape(QTabBar::TriangularSouth); } void PanelTabBar::insertAction(QAction* action) { _panelActionMenu->addAction(action); } int PanelTabBar::addPanel(ListPanel *panel, bool setCurrent, KrPanel *nextTo) { int insertIndex = -1; - if(nextTo) { - for(int i = 0; i < count(); i++) { - if(getPanel(i) == nextTo) { + if (nextTo) { + for (int i = 0; i < count(); i++) { + if (getPanel(i) == nextTo) { insertIndex = i + 1; break; } } } - int newId; - if(insertIndex != -1) { - newId = insertTab(insertIndex, squeeze(DISPLAY(panel->virtualPath()))); - } else - newId = addTab(squeeze(DISPLAY(panel->virtualPath()))); + const QString text = squeeze(DISPLAY(panel->virtualPath())); + const int index = insertIndex != -1 ? insertTab(insertIndex, text) : addTab(text); QVariant v; v.setValue((long long)panel); - setTabData(newId, v); + setTabData(index, v); + + setIcon(index, panel); // make sure all tabs lengths are correct layoutTabs(); if (setCurrent) - setCurrentIndex(newId); + setCurrentIndex(index); - return newId; + return index; } ListPanel* PanelTabBar::getPanel(int tabIdx) { QVariant v = tabData(tabIdx); if (v.isNull()) return 0; return (ListPanel*)v.toLongLong(); } void PanelTabBar::changePanel(int tabIdx, ListPanel *panel) { QVariant v; v.setValue((long long)panel); setTabData(tabIdx, v); } ListPanel* PanelTabBar::removePanel(int index, ListPanel* &panelToDelete) { panelToDelete = getPanel(index); // old panel to kill later disconnect(panelToDelete, 0, this, 0); removeTab(index); layoutTabs(); return getPanel(currentIndex()); } ListPanel* PanelTabBar::removeCurrentPanel(ListPanel* &panelToDelete) { return removePanel(currentIndex(), panelToDelete); } void PanelTabBar::updateTab(ListPanel *panel) { // find which is the correct tab for (int i = 0; i < count(); i++) { if ((ListPanel*)tabData(i).toLongLong() == panel) { setTabText(i, squeeze(DISPLAY(panel->virtualPath()), i)); + setIcon(i, panel); break; } } } void PanelTabBar::duplicateTab() { int id = currentIndex(); emit newTab(((ListPanel*)tabData(id).toLongLong())->virtualPath()); } -void PanelTabBar::closeTab() +void PanelTabBar::setIcon(int index, ListPanel *panel) { - emit closeCurrentTab(); + setTabIcon(index, + panel->isLocked() ? krLoader->loadIcon("lock", KIconLoader::Toolbar, 16) : QIcon()); } QString PanelTabBar::squeeze(QString text, int index) { QString originalText = text; KConfigGroup group(krConfig, "Look&Feel"); bool longNames = group.readEntry("Fullpath Tab Names", _FullPathTabNames); if (!longNames) { while (text.endsWith('/')) text.truncate(text.length() - 1); if (text.isEmpty() || text.endsWith(':')) text += '/'; else { QString shortName; if (text.contains(":/")) shortName = text.left(text.indexOf(":/")) + ':'; shortName += text.mid(text.lastIndexOf("/") + 1); text = shortName; } if (index >= 0) setTabToolTip(index, originalText); index = -1; } QFontMetrics fm(fontMetrics()); // set the real max length _maxTabLength = (static_cast(parent())->width() - (6 * fm.width("W"))) / fm.width("W"); // each tab gets a fair share of the max tab length int _effectiveTabLength = _maxTabLength / (count() == 0 ? 1 : count()); int labelWidth = fm.width("W") * _effectiveTabLength; int textWidth = fm.width(text); if (textWidth > labelWidth) { // start with the dots only QString squeezedText = "..."; int squeezedWidth = fm.width(squeezedText); // estimate how many letters we can add to the dots on both sides int letters = text.length() * (labelWidth - squeezedWidth) / textWidth / 2; if (labelWidth < squeezedWidth) letters = 1; squeezedText = text.left(letters) + "..." + text.right(letters); squeezedWidth = fm.width(squeezedText); if (squeezedWidth < labelWidth) { // we estimated too short // add letters while text < label do { letters++; squeezedText = text.left(letters) + "..." + text.right(letters); squeezedWidth = fm.width(squeezedText); } while (squeezedWidth < labelWidth); letters--; squeezedText = text.left(letters) + "..." + text.right(letters); } else if (squeezedWidth > labelWidth) { // we estimated too long // remove letters while text > label do { letters--; squeezedText = text.left(letters) + "..." + text.right(letters); squeezedWidth = fm.width(squeezedText); } while (letters && squeezedWidth > labelWidth); } if (index >= 0) setTabToolTip(index, originalText); if (letters < 5) { // too few letters added -> we give up squeezing //return text; return squeezedText; } else { return squeezedText; } } else { //if( index >= 0 ) // removeTabToolTip( index ); return text; }; } void PanelTabBar::resizeEvent(QResizeEvent *e) { QTabBar::resizeEvent(e); layoutTabs(); } void PanelTabBar::mouseMoveEvent(QMouseEvent* e) { QTabBar::mouseMoveEvent(e); if(_tabClicked) { _draggingTab = true; emit draggingTab(e); } } void PanelTabBar::mousePressEvent(QMouseEvent* e) { int clickedTab = tabAt(e->pos()); if (-1 == clickedTab) { // clicked on nothing ... QTabBar::mousePressEvent(e); return; } _tabClicked = true; setCurrentIndex(clickedTab); - ListPanel *p = getPanel(clickedTab); - if(p) + ListPanel *p = getPanel(clickedTab); + if (p) p->slotFocusOnMe(); if (e->button() == Qt::RightButton) { // show the popup menu _panelActionMenu->menu()->popup(e->globalPos()); } else { if (e->button() == Qt::MidButton)// close the current tab emit closeCurrentTab(); } QTabBar::mousePressEvent(e); } void PanelTabBar::mouseReleaseEvent(QMouseEvent* e) { QTabBar::mouseReleaseEvent(e); if(_draggingTab) emit draggingTabFinished(e); _draggingTab = false; _tabClicked = false; } void PanelTabBar::dragEnterEvent(QDragEnterEvent *e) { e->accept(); int t = tabAt(e->pos()); if (t == -1) return; if (currentIndex() != t) setCurrentIndex(t); QTabBar::dragEnterEvent(e); } void PanelTabBar::dragMoveEvent(QDragMoveEvent *e) { e->ignore(); int t = tabAt(e->pos()); if (t == -1) return; if (currentIndex() != t) setCurrentIndex(t); QTabBar::dragMoveEvent(e); } void PanelTabBar::layoutTabs() { for (int i = 0; i < count(); i++) { setTabText(i, squeeze(DISPLAY(((ListPanel*)tabData(i).toLongLong())->virtualPath()), i)); } } diff --git a/krusader/paneltabbar.h b/krusader/paneltabbar.h index 6a15e373..a5628069 100644 --- a/krusader/paneltabbar.h +++ b/krusader/paneltabbar.h @@ -1,107 +1,107 @@ /***************************************************************************** * Copyright (C) 2002 Shie Erlich * * Copyright (C) 2002 Rafi Yanai * * based on original code from Sebastian Trueg * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This package is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this package; if not, write to the Free Software * * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * *****************************************************************************/ #ifndef PANELTABBAR_H #define PANELTABBAR_H // QtCore #include // QtGui #include #include // QtWidgets #include class QMouseEvent; class QAction; class KActionMenu; class KrPanel; class ListPanel; class TabActions; /** * This class extends QTabBar such that right-clicking on a tab pops-up a menu * containing relevant actions for the tab. It also emits signals (caught by PanelManager) * to create a new tab, close the current tab and change a panel when a tab was clicked */ class PanelTabBar : public QTabBar { Q_OBJECT public: PanelTabBar(QWidget *parent, TabActions *actions); public slots: /** * called by PanelManager with an already created panel, and creates the corresponding tab */ int addPanel(ListPanel *panel, bool setCurrent = true, KrPanel *nextTo = 0); ListPanel* getPanel(int tabIdx); void changePanel(int tabIdx, ListPanel *panel); void layoutTabs(); /** * when the user changes the current path in a panel, this method updates the tab accordingly */ void updateTab(ListPanel *panel); /** * actually removes the current tab WITHOUT actually deleting the panel. * returns a pointer to the panel which is going to be displayed next. * panelToDelete returns a reference to the pointer of the soon-to-die panel, to * be used by PanelManager. */ ListPanel* removeCurrentPanel(ListPanel* &panelToDelete); // returns the panel focused after removing the current ListPanel* removePanel(int index, ListPanel* &panelToDelete); signals: /** * emitted when the user right-clicks and selected "close" */ void closeCurrentTab(); /** * emitted when the user right-clicks and selects an action that creates a new tab */ void newTab(const QUrl &path); void draggingTab(QMouseEvent*); void draggingTabFinished(QMouseEvent*); protected: virtual void mouseMoveEvent(QMouseEvent*e) Q_DECL_OVERRIDE; virtual void mousePressEvent(QMouseEvent*) Q_DECL_OVERRIDE; virtual void mouseReleaseEvent(QMouseEvent*) Q_DECL_OVERRIDE; void insertAction(QAction*); QString squeeze(QString text, int index = -1); virtual void dragEnterEvent(QDragEnterEvent *) Q_DECL_OVERRIDE; virtual void dragMoveEvent(QDragMoveEvent *) Q_DECL_OVERRIDE; virtual void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE; protected slots: - void closeTab(); void duplicateTab(); private: + void setIcon(int index, ListPanel *panel); KActionMenu *_panelActionMenu; bool _left; int _maxTabLength; bool _tabClicked, _draggingTab; }; #endif