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