2015-12-09 19:21:38 +08:00
|
|
|
#ifndef SECTION_TITLE_WIDGET_H
|
|
|
|
#define SECTION_TITLE_WIDGET_H
|
|
|
|
|
2016-02-26 19:43:14 +08:00
|
|
|
#include <QPointer>
|
2015-12-09 19:21:38 +08:00
|
|
|
#include <QPoint>
|
2016-02-26 19:43:14 +08:00
|
|
|
#include <QFrame>
|
2016-02-02 22:01:48 +08:00
|
|
|
|
|
|
|
#include "ads/API.h"
|
|
|
|
#include "ads/SectionContent.h"
|
2015-12-09 19:21:38 +08:00
|
|
|
|
|
|
|
ADS_NAMESPACE_BEGIN
|
2016-02-15 18:13:58 +08:00
|
|
|
class ContainerWidget;
|
2015-12-09 19:21:38 +08:00
|
|
|
class SectionWidget;
|
|
|
|
class FloatingWidget;
|
|
|
|
|
|
|
|
class SectionTitleWidget : public QFrame
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2016-02-15 19:27:23 +08:00
|
|
|
Q_PROPERTY(bool activeTab READ isActiveTab WRITE setActiveTab NOTIFY activeTabChanged)
|
2015-12-09 19:21:38 +08:00
|
|
|
|
2016-02-15 18:13:58 +08:00
|
|
|
friend class ContainerWidget;
|
2015-12-09 19:21:38 +08:00
|
|
|
friend class SectionWidget;
|
|
|
|
|
|
|
|
SectionContent::RefPtr _content;
|
2016-02-02 15:24:12 +08:00
|
|
|
|
|
|
|
// Drag & Drop (Floating)
|
2015-12-09 19:21:38 +08:00
|
|
|
QPointer<FloatingWidget> _fw;
|
|
|
|
QPoint _dragStartPos;
|
|
|
|
|
2016-02-02 15:24:12 +08:00
|
|
|
// Drag & Drop (Title/Tabs)
|
|
|
|
bool _tabMoving;
|
|
|
|
|
|
|
|
// Property values
|
2015-12-09 19:21:38 +08:00
|
|
|
bool _activeTab;
|
|
|
|
|
|
|
|
public:
|
|
|
|
SectionTitleWidget(SectionContent::RefPtr content, QWidget* parent);
|
2016-02-18 22:06:00 +08:00
|
|
|
virtual ~SectionTitleWidget();
|
2015-12-09 19:21:38 +08:00
|
|
|
|
|
|
|
bool isActiveTab() const;
|
|
|
|
void setActiveTab(bool active);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void mousePressEvent(QMouseEvent* ev);
|
|
|
|
virtual void mouseReleaseEvent(QMouseEvent* ev);
|
|
|
|
virtual void mouseMoveEvent(QMouseEvent* ev);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void activeTabChanged();
|
|
|
|
void clicked();
|
|
|
|
};
|
|
|
|
|
|
|
|
ADS_NAMESPACE_END
|
2016-02-12 14:15:10 +08:00
|
|
|
#endif
|