| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | #ifndef INCLUDE_ROLLUPWIDGET_H
 | 
					
						
							|  |  |  | #define INCLUDE_ROLLUPWIDGET_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <QWidget>
 | 
					
						
							| 
									
										
										
										
											2018-03-20 13:49:21 +01:00
										 |  |  | #include "export.h"
 | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-03-03 20:23:38 +01:00
										 |  |  | class SDRGUI_API RollupWidget : public QWidget { | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 	Q_OBJECT | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | public: | 
					
						
							|  |  |  | 	RollupWidget(QWidget* parent = NULL); | 
					
						
							|  |  |  | 	void setTitleColor(const QColor& c); | 
					
						
							| 
									
										
										
										
											2017-11-14 22:58:35 +01:00
										 |  |  | 	void setHighlighted(bool highlighted); | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | signals: | 
					
						
							|  |  |  | 	void widgetRolled(QWidget* widget, bool rollDown); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | protected: | 
					
						
							|  |  |  | 	enum { | 
					
						
							|  |  |  | 		VersionMarker = 0xff | 
					
						
							|  |  |  | 	}; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-05-09 20:53:18 +02:00
										 |  |  |     enum ContextMenuType | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         ContextMenuNone, | 
					
						
							|  |  |  |         ContextMenuChannelSettings, | 
					
						
							|  |  |  |         ContextMenuStreamSettings | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 	QColor m_titleColor; | 
					
						
							| 
									
										
										
										
											2017-10-05 22:11:17 +02:00
										 |  |  | 	QColor m_titleTextColor; | 
					
						
							| 
									
										
										
										
											2017-11-14 22:58:35 +01:00
										 |  |  | 	bool m_highlighted; | 
					
						
							| 
									
										
										
										
											2019-05-09 20:53:18 +02:00
										 |  |  |     ContextMenuType m_contextMenuType; | 
					
						
							|  |  |  |     QString m_streamIndicator; | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	int arrangeRollups(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-05 00:37:12 +02:00
										 |  |  | 	QByteArray saveState(int version = 0) const; | 
					
						
							|  |  |  |     bool restoreState(const QByteArray& state, int version = 0); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 	void paintEvent(QPaintEvent*); | 
					
						
							|  |  |  | 	int paintRollup(QWidget* rollup, int pos, QPainter* p, bool last, const QColor& frame); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	void resizeEvent(QResizeEvent* size); | 
					
						
							|  |  |  | 	void mousePressEvent(QMouseEvent* event); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	bool event(QEvent* event); | 
					
						
							|  |  |  | 	bool eventFilter(QObject* object, QEvent* event); | 
					
						
							| 
									
										
										
										
											2019-05-09 20:53:18 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     void resetContextMenuType() { m_contextMenuType = ContextMenuNone; } | 
					
						
							| 
									
										
										
										
											2019-05-20 16:31:15 +02:00
										 |  |  | 	void setStreamIndicator(const QString& indicator); | 
					
						
							| 
									
										
										
										
											2020-08-04 23:25:50 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							|  |  |  |     static bool isRollupChild(QWidget *childWidget); //!< chidl is part of rollups (ex: not a dialog)
 | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif // INCLUDE_ROLLUPWIDGET_H
 |