105 friend class SARibbonCategoryPrivate;
106 friend class SARibbonCustomizeWidgetPrivate;
108 Q_PROPERTY(
bool isCanCustomize READ isCanCustomize WRITE setCanCustomize)
109 Q_PROPERTY(
bool isExpanding READ isExpanding WRITE setExpanding)
110 Q_PROPERTY(QString panelName READ panelName WRITE setPanelName)
158 Q_ENUM(PanelLayoutMode)
166 explicit SARibbonPanel(
const QString& name, QWidget* parent =
nullptr);
169 using QWidget::addAction;
174 void addAction(QAction* act,
175 QToolButton::ToolButtonPopupMode popMode,
178 void addLargeAction(QAction* action);
180 void addMediumAction(QAction* action);
182 void addSmallAction(QAction* action);
185 void addSmallAction(QAction* action, QToolButton::ToolButtonPopupMode popMode);
187 void addLargeAction(QAction* action, QToolButton::ToolButtonPopupMode popMode);
189 void addMediumAction(QAction* action, QToolButton::ToolButtonPopupMode popMode);
191 QAction* addAction(const QString& text,
193 QToolButton::ToolButtonPopupMode popMode,
197 void addMenu(QMenu* menu,
199 QToolButton::ToolButtonPopupMode popMode = QToolButton::InstantPopup);
201 void addLargeMenu(QMenu* menu, QToolButton::ToolButtonPopupMode popMode = QToolButton::InstantPopup);
203 void addMediumMenu(QMenu* menu, QToolButton::ToolButtonPopupMode popMode = QToolButton::InstantPopup);
205 void addSmallMenu(QMenu* menu, QToolButton::ToolButtonPopupMode popMode = QToolButton::InstantPopup);
211 QAction* addSmallWidget(QWidget* w);
214 QAction* addMediumWidget(QWidget* w);
217 QAction* addLargeWidget(QWidget* w);
223 QAction* addSeparator();
230 void setOptionAction(QAction* action);
233 bool isHaveOptionAction() const;
239 PanelLayoutMode panelLayoutMode() const;
241 void setPanelLayoutMode(PanelLayoutMode mode);
244 void resetToolButtonSize();
247 bool isTwoRow() const;
250 void setExpanding(
bool isExpanding = true);
252 bool isExpanding() const;
255 int titleHeight() const;
258 bool isEnableShowTitle() const;
261 int actionIndex(QAction* act) const;
264 void moveAction(
int from,
int to);
267 bool isCanCustomize() const;
269 void setCanCustomize(
bool b);
272 QString panelName() const;
274 void setPanelName(const QString& title);
277 int largeButtonHeight() const;
286 void updateItemGeometry();
298 void setToolButtonIconSize(const QSize& smallSize, const QSize& largeSize);
300 QPair< QSize, QSize > toolButtonIconSize() const;
303 void setLargeIconSize(const QSize& largeSize);
305 QSize largeIconSize() const;
308 void setSmallIconSize(const QSize& smallSize);
310 QSize smallIconSize() const;
319 bool isEnableWordWrap() const;
322 void setEnableIconRightText(
bool on);
324 bool isEnableIconRightText() const;
327 qreal buttonMaximumAspectRatio() const;
331 bool iterateButton(FpRibbonToolButtonIterate fp) const;
335 virtual QSize sizeHint() const Q_DECL_OVERRIDE;
337 virtual QSize minimumSizeHint() const Q_DECL_OVERRIDE;
341 static
int panelHeightHint(const QFontMetrics& fm, PanelLayoutMode layMode,
int panelTitleHeight);
343 static
void setActionRowProportionProperty(QAction* action,
SARibbonPanelItem::RowProportion rp);
345 static
SARibbonPanelItem::RowProportion getActionRowProportionProperty(QAction* action);
347 static
void setActionToolButtonPopupModeProperty(QAction* action, QToolButton::ToolButtonPopupMode popMode);
349 static QToolButton::ToolButtonPopupMode getActionToolButtonPopupModeProperty(QAction* action);
351 static
void setActionToolButtonStyleProperty(QAction* action, Qt::ToolButtonStyle buttonStyle);
353 static Qt::ToolButtonStyle getActionToolButtonStyleProperty(QAction* action);
368 void actionTriggered(QAction* action);
381 void panelNameChanged(const QString& n);
385 virtual
void actionEvent(QActionEvent* e) Q_DECL_OVERRIDE;
387 virtual
void changeEvent(QEvent* e) Q_DECL_OVERRIDE;
396 void setTitleHeight(
int h);
399 void setSpacing(
int n);
402 void setEnableShowTitle(
bool on);
406 void setEnableWordWrap(
bool on);
409 void setButtonMaximumAspectRatio(qreal fac = 1.4);