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 tabDropEvent(int index
, QDropEvent
* event
);
22 void tabDetachRequested(int index
);
25 void dragEnterEvent(QDragEnterEvent
* event
) override
;
26 void dragLeaveEvent(QDragLeaveEvent
* event
) override
;
27 void dragMoveEvent(QDragMoveEvent
* event
) override
;
28 void dropEvent(QDropEvent
* event
) override
;
29 void mousePressEvent(QMouseEvent
* event
) override
;
30 void mouseReleaseEvent(QMouseEvent
* event
) override
;
31 void mouseDoubleClickEvent(QMouseEvent
* event
) override
;
34 * Opens a context menu for the tab on the \a event position.
36 void contextMenuEvent(QContextMenuEvent
* event
) override
;
39 void slotAutoActivationTimeout();
43 * If \a index is a valid index (>= 0), store the index and start the timer
44 * (if the interval >= 0 ms). If the index is not valid (< 0), stop the timer.
46 void updateAutoActivationTimer(const int index
);
49 QTimer
* m_autoActivationTimer
;
50 int m_autoActivationIndex
;
51 int m_tabToBeClosedOnMiddleMouseButtonRelease
;
54 #endif // DOLPHIN_TAB_BAR_H