diff options
author | Tobias Markmann <tm@ayena.de> | 2014-11-25 14:07:29 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2014-12-14 14:44:00 (GMT) |
commit | b4a54583c4d575fe152122c21da616c3c942bbfd (patch) | |
tree | 7e558fd9cb75291f4d5eec90da9d8dd5650ceea2 /Swift/QtUI/Trellis/QtDNDTabBar.h | |
parent | 92672e17a52d0c86e693183627c8c6b8fa44fb86 (diff) | |
download | swift-b4a54583c4d575fe152122c21da616c3c942bbfd.zip swift-b4a54583c4d575fe152122c21da616c3c942bbfd.tar.bz2 |
Add support for new trellis layout for chat windows.
This includes dynamic customizable grid layouting of chat tabs including:
- arrengement of tabs via menu, keyboard shortcuts or drag'n'drop
- change of grid size via mouse or keyboard
- save/restore of grid size and positions of chats inside the grid
Test-Information:
Tested on OS X 10.9.8.
Change-Id: I43f94293a1c672971640c3000abfc6530f2ea7a8
Diffstat (limited to 'Swift/QtUI/Trellis/QtDNDTabBar.h')
-rw-r--r-- | Swift/QtUI/Trellis/QtDNDTabBar.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/Swift/QtUI/Trellis/QtDNDTabBar.h b/Swift/QtUI/Trellis/QtDNDTabBar.h new file mode 100644 index 0000000..4f26bc1 --- /dev/null +++ b/Swift/QtUI/Trellis/QtDNDTabBar.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2014 Kevin Smith and Remko Tronçon + * Licensed under the GNU General Public License v3. + * See Documentation/Licenses/GPLv3.txt for more information. + */ + +#pragma once + +#include <QTabBar> + +namespace Swift { + +class QtDNDTabBar : public QTabBar { + Q_OBJECT + public: + explicit QtDNDTabBar(QWidget* parent = 0); + virtual ~QtDNDTabBar(); + + int getDragIndex() const; + QString getDragText() const; + QWidget* getDragWidget() const; + + virtual QSize sizeHint() const; + + signals: + void onDropSucceeded(); + + protected: + void dragEnterEvent(QDragEnterEvent* dragEnterEvent); + void dropEvent(QDropEvent* dropEvent); + bool event(QEvent* event); + + private: + int defaultTabHeight; + int dragIndex; + QString dragText; + QWidget* dragWidget; +}; + +} |