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,
101 NODELABELPOSITION = 0x100000,
102 SELECTFONT = 0x200000,
103 SHOWNODES = 0x400000,
104 ALLBUTTONS = 0xFFFFFF
106 Q_DECLARE_FLAGS(QuickAccessButtons, QuickAccessButton)
108 explicit QuickAccessBarImpl(QGraphicsItem *quickAccessBarItem =
nullptr,
109 QuickAccessButtons button = ALLBUTTONS, QWidget *parent =
nullptr);
110 ~QuickAccessBarImpl()
override;
112 QPushButton *showEdgesButton();
113 QPushButton *showNodesButton();
114 ColorButton *backgroundColorButton();
115 QPushButton *showLabelsButton();
116 QPushButton *showLabelScaled();
117 QPushButton *showColorInterpolation();
120 void addButtonAtEnd(QAbstractButton *button);
121 void addButtonsAtEnd(
const QVector<QAbstractButton *> &buttonvect);
123 void updateFontButtonStyle();
124 void showHideCaption(CaptionItem::CaptionType captionType);
125 void setAllValues(
unsigned int eltType, PropertyInterface *prop);
126 void setAllColorValues(
unsigned int eltType, ColorProperty *prop,
const Color &color);
129 void reset()
override;
131 virtual void setBackgroundColor(
const QColor &);
132 virtual void setColorInterpolation(
bool);
133 void setLabelColor(
const QColor &);
134 void setNodeColor(
const QColor &);
135 void setNodeBorderColor(
const QColor &);
136 void setEdgeColor(
const QColor &);
137 void setEdgeBorderColor(
const QColor &);
142 void setSizeInterpolation(
bool);
143 void showHideNodesColorCaption();
144 void showHideNodesSizeCaption();
145 void showHideEdgesColorCaption();
146 void showHideEdgesSizeCaption();
148 virtual void setEdgesVisible(
bool);
149 virtual void setNodesVisible(
bool);
150 virtual void setLabelsVisible(
bool);
151 virtual void setLabelsScaled(
bool);
153 void setNodeLabelPosition();
156 Q_DECLARE_OPERATORS_FOR_FLAGS(tlp::QuickAccessBarImpl::QuickAccessButtons)
157 #endif // QUICKACCESSBAR_H An abstract view that displays a GlMainWidget as its central widget.