2 * SPDX-FileCopyrightText: 2014 Emmanuel Pescosta <emmanuelpescosta099@gmail.com>
4 * SPDX-License-Identifier: GPL-2.0-or-later
7 #ifndef DOLPHIN_TAB_BAR_H
8 #define DOLPHIN_TAB_BAR_H
12 class DolphinTabBar
: public QTabBar
17 explicit DolphinTabBar(QWidget
*parent
);
20 void openNewActivatedTab(int index
);
21 void tabDragMoveEvent(int index
, QDragMoveEvent
*event
);
22 void tabDropEvent(int index
, QDropEvent
*event
);
23 void tabDetachRequested(int index
);
24 void tabRenamed(int index
, const QString
&label
);
27 void dragEnterEvent(QDragEnterEvent
*event
) override
;
28 void dragLeaveEvent(QDragLeaveEvent
*event
) override
;
29 void dragMoveEvent(QDragMoveEvent
*event
) override
;
30 void dropEvent(QDropEvent
*event
) override
;
31 void mousePressEvent(QMouseEvent
*event
) override
;
32 void mouseReleaseEvent(QMouseEvent
*event
) override
;
33 void mouseDoubleClickEvent(QMouseEvent
*event
) override
;
36 * Opens a context menu for the tab on the \a event position.
38 void contextMenuEvent(QContextMenuEvent
*event
) override
;
41 void slotAutoActivationTimeout();
45 * If \a index is a valid index (>= 0), store the index and start the timer
46 * (if the interval >= 0 ms). If the index is not valid (< 0), stop the timer.
48 void updateAutoActivationTimer(const int index
);
51 QTimer
*m_autoActivationTimer
;
52 int m_autoActivationIndex
;
53 int m_tabToBeClosedOnMiddleMouseButtonRelease
;
56 #endif // DOLPHIN_TAB_BAR_H