21 #ifndef QUICKACCESSBAR_H
22 #define QUICKACCESSBAR_H
26 #include <tulip/CaptionItem.h>
27 #include <tulip/tulipconf.h>
30 class QAbstractButton;
39 class GlGraphRenderingParameters;
40 class GlGraphInputData;
42 class TulipItemDelegate;
45 class PropertyInterface;
48 class TLP_QT_SCOPE QuickAccessBar :
public QWidget {
52 GlMainView *_mainView;
53 GlScene *scene()
const;
54 GlGraphInputData *inputData()
const;
55 GlGraphRenderingParameters *renderingParameters()
const;
58 QuickAccessBar(QWidget *parent =
nullptr);
61 virtual void reset() = 0;
64 void settingsChanged();
67 class TLP_QT_SCOPE QuickAccessBarImpl :
public QuickAccessBar {
69 Ui::QuickAccessBar *_ui;
70 QGraphicsItem *_quickAccessBarItem;
72 TulipItemDelegate *delegate;
76 bool _captionsInitialized;
77 CaptionItem *_captions[4];
80 enum QuickAccessButton {
81 NODESCOLORCAPTION = 0x1,
82 NODESSIZECAPTION = 0x2,
83 EDGESCOLORCAPTION = 0x4,
84 EDGESIZECAPTION = 0x8,
86 BACKGROUNDCOLOR = 0x20,
89 NODEBORDERCOLOR = 0x100,
90 EDGEBORDERCOLOR = 0x200,
92 COLORINTERPOLATION = 0x800,
93 SIZEINTERPOLATION = 0x1000,
96 LABELSSCALED = 0x8000,
102 NODELABELPOSITION = 0x100000,
103 SELECTFONT = 0x200000,
104 SHOWNODES = 0x400000,
105 ALLBUTTONS = 0xFFFFFF
107 Q_DECLARE_FLAGS(QuickAccessButtons, QuickAccessButton)
109 explicit QuickAccessBarImpl(QGraphicsItem *quickAccessBarItem =
nullptr,
110 QuickAccessButtons button = ALLBUTTONS, QWidget *parent =
nullptr);
111 ~QuickAccessBarImpl()
override;
113 QPushButton *showEdgesButton();
114 QPushButton *showNodesButton();
115 ColorButton *backgroundColorButton();
116 QPushButton *showLabelsButton();
117 QPushButton *showLabelScaled();
118 QPushButton *showColorInterpolation();
121 void addButtonAtEnd(QAbstractButton *button);
122 void addButtonsAtEnd(
const QVector<QAbstractButton *> &buttonvect);
124 void updateFontButtonStyle();
125 void showHideCaption(CaptionItem::CaptionType captionType);
126 void setAllValues(
unsigned int eltType, PropertyInterface *prop, QString str =
"");
129 void reset()
override;
131 virtual void setBackgroundColor(
const QColor &);
132 virtual void setColorInterpolation(
bool);
133 void setLabelColor();
135 void setNodeBorderColor();
137 void setEdgeBorderColor();
143 void setSizeInterpolation(
bool);
144 void showHideNodesColorCaption();
145 void showHideNodesSizeCaption();
146 void showHideEdgesColorCaption();
147 void showHideEdgesSizeCaption();
149 virtual void setEdgesVisible(
bool);
150 virtual void setNodesVisible(
bool);
151 virtual void setLabelsVisible(
bool);
152 virtual void setLabelsScaled(
bool);
154 void setNodeLabelPosition();
157 Q_DECLARE_OPERATORS_FOR_FLAGS(tlp::QuickAccessBarImpl::QuickAccessButtons)
An abstract view that displays a GlMainWidget as its central widget.