diff --git a/src/SARibbonBar/SARibbonBar.cpp b/src/SARibbonBar/SARibbonBar.cpp index efd34cc..669f48f 100644 --- a/src/SARibbonBar/SARibbonBar.cpp +++ b/src/SARibbonBar/SARibbonBar.cpp @@ -86,6 +86,7 @@ class SARibbonBar::PrivateData int mTabBarHeight { 28 }; ///< tabbar高度 int mPannelTitleHeight { 15 }; ///< pannel的标题栏默认高度 int mCategoryHeight { 60 }; ///< Category的高度 + int mPannelSpacing { 0 }; ///< pannel的spacing std::unique_ptr< int > mUserDefTitleBarHeight; ///< 用户定义的标题栏高度,正常不使用用户设定的高度,而是使用自动计算的高度 std::unique_ptr< int > mUserDefTabBarHeight; ///< 用户定义的tabbar高度,正常不使用用户设定的高度,而是使用自动计算的高度 std::unique_ptr< int > mUserDefCategoryHeight; ///< 用户定义的Category的高度,正常不使用用户设定的高度,而是使用自动计算的高度 @@ -169,8 +170,8 @@ void SARibbonBar::PrivateData::init() int SARibbonBar::PrivateData::systemTabBarHeight() const { return q_ptr->style()->pixelMetric(QStyle::PM_TabBarBaseHeight) - + q_ptr->style()->pixelMetric(QStyle::PM_TabBarTabHSpace) - + q_ptr->style()->pixelMetric(QStyle::PM_TabBarTabOverlap); + + q_ptr->style()->pixelMetric(QStyle::PM_TabBarTabHSpace) + + q_ptr->style()->pixelMetric(QStyle::PM_TabBarTabOverlap); } /** @@ -519,13 +520,13 @@ QList< QColor > SARibbonBar::defaultContextCategoryColorList() { QList< QColor > res; res // - << QColor(206, 232, 252) // 蓝 - << QColor(253, 238, 179) // 黄 - << QColor(212, 255, 174) // 绿 - << QColor(255, 196, 214) // 红 - << QColor(255, 216, 153) // 橙 - << QColor(255, 224, 243) // 玫红 - ; + << QColor(206, 232, 252) // 蓝 + << QColor(253, 238, 179) // 黄 + << QColor(212, 255, 174) // 绿 + << QColor(255, 196, 214) // 红 + << QColor(255, 216, 153) // 橙 + << QColor(255, 224, 243) // 玫红 + ; return res; } @@ -654,26 +655,32 @@ SARibbonCategory* SARibbonBar::insertCategoryPage(const QString& title, int inde return (category); } +/** + * @brief 插入一个category + * @param category SARibbonCategory指针 + * @param index 插入的位置,如果超出范围,将默认插入到最后 + */ void SARibbonBar::insertCategoryPage(SARibbonCategory* category, int index) { if (nullptr == category) { return; } category->setPannelLayoutMode(d_ptr->mDefaulePannelLayoutMode); - int i = d_ptr->mRibbonTabBar->insertTab(index, category->categoryName()); + category->setPannelSpacing(d_ptr->mPannelSpacing); + int i = d_ptr->mRibbonTabBar->insertTab(index, category->categoryName()); - _SARibbonTabData tabdata; + _SARibbonTabData tabdata; - tabdata.category = category; - tabdata.index = i; - d_ptr->mRibbonTabBar->setTabData(i, QVariant::fromValue(tabdata)); + tabdata.category = category; + tabdata.index = i; + d_ptr->mRibbonTabBar->setTabData(i, QVariant::fromValue(tabdata)); d_ptr->mStackedContainerWidget->insertWidget(index, category); - connect(category, &QWidget::windowTitleChanged, this, &SARibbonBar::onCategoryWindowTitleChanged); - // 更新index信息 - d_ptr->updateTabData(); - QApplication::postEvent(this, new QResizeEvent(size(), size())); + // 更新index信息 + d_ptr->updateTabData(); + QApplication::postEvent(this, new QResizeEvent(size(), size())); - connect(category, &SARibbonCategory::actionTriggered, this, &SARibbonBar::actionTriggered); + connect(category, &QWidget::windowTitleChanged, this, &SARibbonBar::onCategoryWindowTitleChanged); + connect(category, &SARibbonCategory::actionTriggered, this, &SARibbonBar::actionTriggered); } /** @@ -1093,13 +1100,13 @@ void SARibbonBar::showMinimumModeButton(bool isShow) d_ptr->mMinimumCategoryButtonAction = new QAction(this); d_ptr->mMinimumCategoryButtonAction->setIcon( - style()->standardIcon(isMinimumMode() ? QStyle::SP_TitleBarUnshadeButton : QStyle::SP_TitleBarShadeButton, - nullptr)); + style()->standardIcon(isMinimumMode() ? QStyle::SP_TitleBarUnshadeButton : QStyle::SP_TitleBarShadeButton, + nullptr)); connect(d_ptr->mMinimumCategoryButtonAction, &QAction::triggered, this, [ this ]() { this->setMinimumMode(!isMinimumMode()); this->d_ptr->mMinimumCategoryButtonAction->setIcon( - style()->standardIcon(isMinimumMode() ? QStyle::SP_TitleBarUnshadeButton : QStyle::SP_TitleBarShadeButton, - nullptr)); + style()->standardIcon(isMinimumMode() ? QStyle::SP_TitleBarUnshadeButton : QStyle::SP_TitleBarShadeButton, + nullptr)); }); d_ptr->mRightButtonGroup->addAction(d_ptr->mMinimumCategoryButtonAction); @@ -1289,8 +1296,8 @@ void SARibbonBar::onCurrentRibbonTabChanged(int index) if (d_ptr->mStackedContainerWidget->isPopupMode()) { // 在stackedContainerWidget弹出前,先给tabbar一个QHoverEvent,让tabbar知道鼠标已经移开 QHoverEvent ehl(QEvent::HoverLeave, - d_ptr->mRibbonTabBar->mapToGlobal(QCursor::pos()), - d_ptr->mRibbonTabBar->mapToGlobal(QCursor::pos())); + d_ptr->mRibbonTabBar->mapToGlobal(QCursor::pos()), + d_ptr->mRibbonTabBar->mapToGlobal(QCursor::pos())); QApplication::sendEvent(d_ptr->mRibbonTabBar, &ehl); resizeStackedContainerWidget(); d_ptr->mStackedContainerWidget->setFocus(); @@ -1320,8 +1327,8 @@ void SARibbonBar::onCurrentRibbonTabClicked(int index) if (this->d_ptr->mStackedContainerWidget->isPopupMode()) { // 在stackedContainerWidget弹出前,先给tabbar一个QHoverEvent,让tabbar知道鼠标已经移开 QHoverEvent ehl(QEvent::HoverLeave, - d_ptr->mRibbonTabBar->mapToGlobal(QCursor::pos()), - d_ptr->mRibbonTabBar->mapToGlobal(QCursor::pos())); + d_ptr->mRibbonTabBar->mapToGlobal(QCursor::pos()), + d_ptr->mRibbonTabBar->mapToGlobal(QCursor::pos())); QApplication::sendEvent(d_ptr->mRibbonTabBar, &ehl); // 弹出前都调整一下位置,避免移动后位置异常 resizeStackedContainerWidget(); @@ -1486,11 +1493,11 @@ void SARibbonBar::setRibbonStyle(SARibbonBar::RibbonStyles v) d_ptr->mRibbonStyle = v; #if SA_DEBUG_PRINT_SIZE_HINT qDebug() << "setRibbonStyle(" << v << ")" // - << "\n isThreeRowStyle=" << isThreeRowStyle() // - << "\n isTwoRowStyle=" << isTwoRowStyle() // - << "\n isLooseStyle=" << isLooseStyle() // - << "\n isCompactStyle=" << isCompactStyle() // - ; + << "\n isThreeRowStyle=" << isThreeRowStyle() // + << "\n isTwoRowStyle=" << isTwoRowStyle() // + << "\n isLooseStyle=" << isLooseStyle() // + << "\n isCompactStyle=" << isCompactStyle() // + ; #endif // 执行判断 setEnableWordWrap(isThreeRowStyle(v)); @@ -1764,7 +1771,32 @@ void SARibbonBar::setEnableShowPannelTitle(bool on) iterate([ on ](SARibbonCategory* c) -> bool { c->setEnableShowPannelTitle(on); return true; - }); + }); +} + +/** + * @brief 设置pannel的spacing + * @param n + */ +void SARibbonBar::setPannelSpacing(int n) +{ + d_ptr->mPannelSpacing = n; + // 同步当前被SARibbonBar管理的SARibbonCategory的PannelSpacing + iterate([ n ](SARibbonCategory* category) -> bool { + if (category) { + category->setPannelSpacing(n); + } + return true; + }); +} + +/** + * @brief pannel的spacing + * @return + */ +int SARibbonBar::pannelSpacing() const +{ + return d_ptr->mPannelSpacing; } /** @@ -1916,7 +1948,7 @@ bool SARibbonBar::eventFilter(QObject* obj, QEvent* e) // 调整多文档时在窗口模式下的按钮更新 if ((obj == cornerWidget(Qt::TopLeftCorner)) || (obj == cornerWidget(Qt::TopRightCorner))) { if ((QEvent::UpdateLater == e->type()) || (QEvent::MouseButtonRelease == e->type()) - || (QEvent::WindowActivate == e->type())) { + || (QEvent::WindowActivate == e->type())) { QApplication::postEvent(this, new QResizeEvent(size(), size())); } } else if (obj == d_ptr->mStackedContainerWidget) { @@ -2084,13 +2116,13 @@ void SARibbonBar::paintInLooseStyle() QRect titleRegion; if (contextCategoryRegion.y() < 0) { titleRegion.setRect(d_ptr->mQuickAccessBar->geometry().right() + 1, - border.top(), - width() - d_ptr->mIconRightBorderPosition - border.right() - - d_ptr->mWindowButtonSize.width() - d_ptr->mQuickAccessBar->geometry().right() - 1, - titleBarHeight()); + border.top(), + width() - d_ptr->mIconRightBorderPosition - border.right() + - d_ptr->mWindowButtonSize.width() - d_ptr->mQuickAccessBar->geometry().right() - 1, + titleBarHeight()); } else { int leftwidth = contextCategoryRegion.x() - d_ptr->mQuickAccessBar->geometry().right() - - d_ptr->mIconRightBorderPosition; + - d_ptr->mIconRightBorderPosition; int rightwidth = width() - contextCategoryRegion.y() - d_ptr->mWindowButtonSize.width(); // if (width() - contextCategoryRegion.y() > contextCategoryRegion.x()-x) { if (rightwidth > leftwidth) { @@ -2099,9 +2131,9 @@ void SARibbonBar::paintInLooseStyle() } else { // 说明左边的大一点 titleRegion.setRect(d_ptr->mIconRightBorderPosition + d_ptr->mQuickAccessBar->geometry().right(), - border.top(), - leftwidth, - titleBarHeight()); + border.top(), + leftwidth, + titleBarHeight()); } } #ifdef SA_RIBBON_DEBUG_HELP_DRAW @@ -2231,9 +2263,9 @@ void SARibbonBar::paintContextCategoryTab(QPainter& painter, const QString& titl if (isLooseStyle()) { if (!title.isEmpty()) { QRect textRect = QRect(contextRect.x(), - contextRect.y() + contextLineWidth, - contextRect.width(), - contextRect.height() - contextLineWidth - d_ptr->mRibbonTabBar->height()); + contextRect.y() + contextLineWidth, + contextRect.width(), + contextRect.height() - contextLineWidth - d_ptr->mRibbonTabBar->height()); painter.setPen(contextCategoryTitleTextColor()); painter.drawText(textRect, Qt::AlignCenter, title); } @@ -2556,21 +2588,21 @@ QDebug operator<<(QDebug debug, const SARibbonBar& ribbon) QDebugStateSaver saver(debug); QFontMetrics fm = ribbon.fontMetrics(); debug.nospace() << "SARibbonBar(" << ribbon.versionString() << ")" // - << "\nribbon font metrics info:" // - << "\n - lineSpacing:" << fm.lineSpacing() // - << "\n - height:" << fm.height() // - << "\n - em:" << fm.boundingRect("M").width() // - << "\n - ex:" << fm.boundingRect("X").height() // - << "\nribbon info:" // - << "\n -mTitleBarHeight=" << ribbon.d_ptr->mTitleBarHeight // - << "\n -mTabBarHeight=" << ribbon.d_ptr->mTabBarHeight // - << "\n -mPannelTitleHeight=" << ribbon.d_ptr->mPannelTitleHeight // - << "\n -mCategoryHeight=" << ribbon.d_ptr->mCategoryHeight // - << "\n -mIsTabOnTitle=" << ribbon.d_ptr->mIsTabOnTitle // - << "\n -mEnableShowPannelTitle=" << ribbon.d_ptr->mEnableShowPannelTitle // - << "\n -mWindowButtonSize=" << ribbon.d_ptr->mWindowButtonSize // - << "\n -mIconRightBorderPosition=" << ribbon.d_ptr->mIconRightBorderPosition // - ; + << "\nribbon font metrics info:" // + << "\n - lineSpacing:" << fm.lineSpacing() // + << "\n - height:" << fm.height() // + << "\n - em:" << fm.boundingRect("M").width() // + << "\n - ex:" << fm.boundingRect("X").height() // + << "\nribbon info:" // + << "\n -mTitleBarHeight=" << ribbon.d_ptr->mTitleBarHeight // + << "\n -mTabBarHeight=" << ribbon.d_ptr->mTabBarHeight // + << "\n -mPannelTitleHeight=" << ribbon.d_ptr->mPannelTitleHeight // + << "\n -mCategoryHeight=" << ribbon.d_ptr->mCategoryHeight // + << "\n -mIsTabOnTitle=" << ribbon.d_ptr->mIsTabOnTitle // + << "\n -mEnableShowPannelTitle=" << ribbon.d_ptr->mEnableShowPannelTitle // + << "\n -mWindowButtonSize=" << ribbon.d_ptr->mWindowButtonSize // + << "\n -mIconRightBorderPosition=" << ribbon.d_ptr->mIconRightBorderPosition // + ; return debug; } diff --git a/src/SARibbonBar/SARibbonBar.h b/src/SARibbonBar/SARibbonBar.h index dcfd011..1ab1209 100644 --- a/src/SARibbonBar/SARibbonBar.h +++ b/src/SARibbonBar/SARibbonBar.h @@ -333,6 +333,10 @@ class SA_RIBBON_EXPORT SARibbonBar : public QMenuBar bool isEnableShowPannelTitle() const; void setEnableShowPannelTitle(bool on); + // 设置pannel的spacing + void setPannelSpacing(int n); + int pannelSpacing() const; + // 获取SARibbonStackedWidget,谨慎使用此函数 SARibbonStackedWidget* ribbonStackedWidget(); diff --git a/src/SARibbonBar/SARibbonCategory.cpp b/src/SARibbonBar/SARibbonCategory.cpp index 8f7df14..f216ea7 100644 --- a/src/SARibbonBar/SARibbonCategory.cpp +++ b/src/SARibbonBar/SARibbonCategory.cpp @@ -50,6 +50,7 @@ class SARibbonCategory::PrivateData int mPannelTitleHeight { 15 }; ///< pannel的标题栏默认高度 bool mIsContextCategory { false }; ///< 标记是否是上下文标签 bool mIsCanCustomize { true }; ///< 标记是否可以自定义 + int mPannelSpacing { 0 }; ///< pannel的spacing SARibbonPannel::PannelLayoutMode mDefaultPannelLayoutMode { SARibbonPannel::ThreeRowMode }; }; SARibbonCategory::PrivateData::PrivateData(SARibbonCategory* p) : q_ptr(p) @@ -101,17 +102,17 @@ void SARibbonCategory::PrivateData::insertPannel(int index, SARibbonPannel* pann if (pannel->parentWidget() != q_ptr) { pannel->setParent(q_ptr); } - // 同步一些状态 + // 同步状态 pannel->setEnableShowTitle(mEnableShowPannelTitle); pannel->setTitleHeight(mPannelTitleHeight); pannel->setPannelLayoutMode(mDefaultPannelLayoutMode); + pannel->setSpacing(mPannelSpacing); index = qMax(0, index); index = qMin(lay->pannelCount(), index); lay->insertPannel(index, pannel); pannel->setVisible(true); - QObject::connect(pannel, &SARibbonPannel::actionTriggered - , ribbonCategory(), &SARibbonCategory::actionTriggered); + QObject::connect(pannel, &SARibbonPannel::actionTriggered, ribbonCategory(), &SARibbonCategory::actionTriggered); } bool SARibbonCategory::PrivateData::takePannel(SARibbonPannel* pannel) @@ -620,6 +621,30 @@ SARibbonAlignment SARibbonCategory::categoryAlignment() const return SARibbonAlignment::AlignLeft; } +/** + * @brief 设置pannel的spacing + * @param n + */ +void SARibbonCategory::setPannelSpacing(int n) +{ + d_ptr->mPannelSpacing = n; + iterate([ n ](SARibbonPannel* pannel) -> bool { + if (pannel) { + pannel->setSpacing(n); + } + return true; + }); +} + +/** + * @brief pannel的spacing + * @return + */ +int SARibbonCategory::pannelSpacing() const +{ + return d_ptr->mPannelSpacing; +} + /** * @brief 在超出边界情况下,滚轮可滚动pannel * @param event diff --git a/src/SARibbonBar/SARibbonCategory.h b/src/SARibbonBar/SARibbonCategory.h index 6f7ef6a..8d0ef81 100644 --- a/src/SARibbonBar/SARibbonCategory.h +++ b/src/SARibbonBar/SARibbonCategory.h @@ -105,6 +105,9 @@ class SA_RIBBON_EXPORT SARibbonCategory : public QFrame void setCategoryAlignment(SARibbonAlignment al); SARibbonAlignment categoryAlignment() const; + // 设置pannel的spacing + void setPannelSpacing(int n); + int pannelSpacing() const; // 获取对应的ribbonbar,如果没有加入ribbonbar的管理,此值为null SARibbonBar* ribbonBar() const; diff --git a/src/SARibbonBar/SARibbonPannel.cpp b/src/SARibbonBar/SARibbonPannel.cpp index 523afeb..62cc18d 100644 --- a/src/SARibbonBar/SARibbonPannel.cpp +++ b/src/SARibbonBar/SARibbonPannel.cpp @@ -756,6 +756,29 @@ SARibbonBar* SARibbonPannel::ribbonBar() const return nullptr; } +/** + * @brief 设置按钮之间的间隔 + * @param n + */ +void SARibbonPannel::setSpacing(int n) +{ + if (auto lay = layout()) { + lay->setSpacing(n); + } +} + +/** + * @brief 按钮之间的间隔 + * @return + */ +int SARibbonPannel::spacing() const +{ + if (auto lay = layout()) { + return lay->spacing(); + } + return 0; +} + /** * @brief pannel高度推荐 * @param fm diff --git a/src/SARibbonBar/SARibbonPannel.h b/src/SARibbonBar/SARibbonPannel.h index 73c4ec8..246a913 100644 --- a/src/SARibbonBar/SARibbonPannel.h +++ b/src/SARibbonBar/SARibbonPannel.h @@ -180,6 +180,9 @@ class SA_RIBBON_EXPORT SARibbonPannel : public QFrame SARibbonCategory* category() const; // 获取ribbonBar指针,如果没有返回nullptr SARibbonBar* ribbonBar() const; + // 设置按钮之间的间隔 + void setSpacing(int n); + int spacing() const; // virtual QSize sizeHint() const Q_DECL_OVERRIDE; virtual QSize minimumSizeHint() const Q_DECL_OVERRIDE; diff --git a/src/SARibbonBar/SARibbonPannelLayout.cpp b/src/SARibbonBar/SARibbonPannelLayout.cpp index 457cd31..6d63081 100644 --- a/src/SARibbonBar/SARibbonPannelLayout.cpp +++ b/src/SARibbonBar/SARibbonPannelLayout.cpp @@ -412,13 +412,14 @@ void SARibbonPannelLayout::updateGeomArray(const QRect& setrect) return; } - const int height = setrect.height(); - const QMargins& mag = contentsMargins(); - const int spacing = this->spacing(); - int x = mag.left(); - const int yBegin = mag.top(); - int titleH = (m_titleHeight >= 0) ? m_titleHeight : 0; // 防止负数影响 - int titleSpace = (m_titleHeight >= 0) ? m_titleSpace : 0; // 对于没有标题的情况,spacing就不生效 + const int height = setrect.height(); + const QMargins& mag = contentsMargins(); + const int spacing = this->spacing(); + const int spacingRow = 1; // 高度间距,也就是行间距,不同行之间的距离 + int x = mag.left(); + const int yBegin = mag.top(); + int titleH = (m_titleHeight >= 0) ? m_titleHeight : 0; // 防止负数影响 + int titleSpace = (m_titleHeight >= 0) ? m_titleSpace : 0; // 对于没有标题的情况,spacing就不生效 if (!isEnableShowPannelTitle()) { titleH = 0; titleSpace = 0; @@ -431,15 +432,15 @@ void SARibbonPannelLayout::updateGeomArray(const QRect& setrect) const int yTitleBegin = height - mag.bottom() - titleH; m_largeHeight = largeHeight; // 计算smallHeight的高度 - const int smallHeight = (largeHeight - (rowCount - 1) * spacing) / rowCount; + const int smallHeight = (largeHeight - (rowCount - 1) * spacingRow) / rowCount; // Medium行的y位置 const int yMediumRow0 = (2 == rowCount) ? yBegin : (yBegin + ((largeHeight - 2 * smallHeight) / 3)); - const int yMediumRow1 = (2 == rowCount) ? (yBegin + smallHeight + spacing) + const int yMediumRow1 = (2 == rowCount) ? (yBegin + smallHeight + spacingRow) : (yBegin + ((largeHeight - 2 * smallHeight) / 3) * 2 + smallHeight); // Small行的y位置 const int ySmallRow0 = yBegin; - const int ySmallRow1 = yBegin + smallHeight + spacing; - const int ySmallRow2 = yBegin + 2 * (smallHeight + spacing); + const int ySmallRow1 = yBegin + smallHeight + spacingRow; + const int ySmallRow2 = yBegin + 2 * (smallHeight + spacingRow); // row用于记录下个item应该属于第几行,item->rowIndex用于记录当前处于第几行, // item->rowIndex主要用于SARibbonPannelItem::Medium short row = 0; diff --git a/src/SARibbonBar/SARibbonTabBar.cpp b/src/SARibbonBar/SARibbonTabBar.cpp index e1d9b99..e3db428 100644 --- a/src/SARibbonBar/SARibbonTabBar.cpp +++ b/src/SARibbonBar/SARibbonTabBar.cpp @@ -17,8 +17,18 @@ void SARibbonTabBar::setTabMargin(const QMargins& tabMargin) m_tabMargin = tabMargin; } +/** + * @brief tab的尺寸预估 + * + * 有别于系统默认的tabbar,SARibbonTabBar的tab高度和tabbar高度一致,且不考虑纵向分布情况 + * @param index + * @return + */ QSize SARibbonTabBar::tabSizeHint(int index) const { + if (index < 0) { + return QSize(); + } QStyleOptionTab opt; initStyleOption(&opt, index); int hframe = style()->pixelMetric(QStyle::PM_TabBarTabHSpace, &opt, this); @@ -38,10 +48,6 @@ QSize SARibbonTabBar::tabSizeHint(int index) const padding += 4; } const int textWidth = fm.size(Qt::TextShowMnemonic, opt.text).width(); - QSize csz; - - csz = QSize(textWidth + opt.iconSize.width() + hframe + widgetWidth + padding, height()); - - QSize retSize = style()->sizeFromContents(QStyle::CT_TabBarTab, &opt, csz, this); - return retSize; + QSize csz = QSize(textWidth + opt.iconSize.width() + hframe + widgetWidth + padding, height()); + return style()->sizeFromContents(QStyle::CT_TabBarTab, &opt, csz, this); } diff --git a/src/SARibbonBar/debug/moc_predefs.h b/src/SARibbonBar/debug/moc_predefs.h deleted file mode 100644 index 435ef38..0000000 --- a/src/SARibbonBar/debug/moc_predefs.h +++ /dev/null @@ -1,13 +0,0 @@ -#define _MSC_EXTENSIONS -#define _MSC_VER 1929 -#define _MSC_FULL_VER 192930153 -#define _MSC_BUILD 0 -#define _M_AMD64 100 -#define _M_X64 100 -#define _WIN64 -#define _WIN32 -#define _CPPRTTI -#define _DEBUG -#define _MT -#define _DLL -#define _UTF8 diff --git a/src/SARibbonBar/resource/theme-office2021-blue.qss b/src/SARibbonBar/resource/theme-office2021-blue.qss index c9cdb81..69c9c3b 100644 --- a/src/SARibbonBar/resource/theme-office2021-blue.qss +++ b/src/SARibbonBar/resource/theme-office2021-blue.qss @@ -349,11 +349,11 @@ SARibbonControlButton:hover { background-color: #f5f6f6;/*{ControlButton.BKColor:hover}*/ } -SARibbonControlButton#SARibbonGalleryButtonUp, #SARibbonGalleryButtonDown, #SARibbonGalleryButtonMore { +SARibbonGalleryButton { border: 1px solid #f1f1f1;/*{GalleryButton.BorderColor}*/ background-color: #f1f1f1;/*{GalleryButton.BKColor}*/ } -SARibbonControlButton#SARibbonGalleryButtonUp:hover, #SARibbonGalleryButtonDown:hover, #SARibbonGalleryButtonMore:hover { +SARibbonGalleryButton:hover { border: 1px solid #c5c5c5;/*{GalleryButton.BorderColor:hover}*/ background-color: #c5c5c5;/*{GalleryButton.BKColor:hover}*/ } diff --git a/src/example/MainWindowExample/mainwindow.cpp b/src/example/MainWindowExample/mainwindow.cpp index b3bd225..279bff4 100644 --- a/src/example/MainWindowExample/mainwindow.cpp +++ b/src/example/MainWindowExample/mainwindow.cpp @@ -231,36 +231,36 @@ void MainWindow::onStyleClicked(int id) // cn:"LooseThreeRow"样式的文字显示是换行的,同时也会显示标题栏,你也可以通过SARibbonBar::setEnableWordWrap来控制按钮是否换行显示, // 可以通过SARibbonBar::setEnableShowPannelTitle控制标题栏是否显示 mTextedit->append( - tr("\nThe text display of the \"LooseThreeRow\" style is word wrap and also displays the title bar. " - "You can also control whether the button is line breaking through SARibbonBar::setEnableWordWrap," - "and whether the title bar is displayed through SARibbonBar::setEnableShowPannelTitle")); + tr("\nThe text display of the \"LooseThreeRow\" style is word wrap and also displays the title bar. " + "You can also control whether the button is line breaking through SARibbonBar::setEnableWordWrap," + "and whether the title bar is displayed through SARibbonBar::setEnableShowPannelTitle")); mTextedit->append(tr("ribbonBar()->setRibbonStyle(SARibbonBar::RibbonStyleLooseThreeRow);")); break; case SARibbonBar::RibbonStyleLooseTwoRow: // cn:"LooseThreeRow"样式的文字显示是不换行的,同时也会显示标题栏,你也可以通过SARibbonBar::setEnableWordWrap来控制按钮是否换行显示, // 可以通过SARibbonBar::setEnableShowPannelTitle控制标题栏是否显示 mTextedit->append( - tr("\nThe text display of the \"LooseTwoRow\" style is not word wrap and also displays the title bar. " - "You can also control whether the button is line breaking through SARibbonBar::setEnableWordWrap," - "and whether the title bar is displayed through SARibbonBar::setEnableShowPannelTitle")); + tr("\nThe text display of the \"LooseTwoRow\" style is not word wrap and also displays the title bar. " + "You can also control whether the button is line breaking through SARibbonBar::setEnableWordWrap," + "and whether the title bar is displayed through SARibbonBar::setEnableShowPannelTitle")); mTextedit->append(tr("ribbonBar()->setRibbonStyle(SARibbonBar::RibbonStyleLooseTwoRow);")); break; case SARibbonBar::RibbonStyleCompactThreeRow: // cn:"CompactThreeRow"样式的文字显示是换行的,不会显示标题栏,你也可以通过SARibbonBar::setEnableWordWrap来控制按钮是否换行显示, // 可以通过SARibbonBar::setEnableShowPannelTitle控制标题栏是否显示 mTextedit->append( - tr("\nThe text display of the \"LooseThreeRow\" style is word wrap and not displays the title bar. " - "You can also control whether the button is line breaking through SARibbonBar::setEnableWordWrap," - "and whether the title bar is displayed through SARibbonBar::setEnableShowPannelTitle")); + tr("\nThe text display of the \"LooseThreeRow\" style is word wrap and not displays the title bar. " + "You can also control whether the button is line breaking through SARibbonBar::setEnableWordWrap," + "and whether the title bar is displayed through SARibbonBar::setEnableShowPannelTitle")); mTextedit->append(tr("ribbonBar()->setRibbonStyle(SARibbonBar::RibbonStyleCompactThreeRow);")); break; case SARibbonBar::RibbonStyleCompactTwoRow: // cn:"CompactTwoRow"样式的文字显示是不换行的,不会显示标题栏,你也可以通过SARibbonBar::setEnableWordWrap来控制按钮是否换行显示, // 可以通过SARibbonBar::setEnableShowPannelTitle控制标题栏是否显示 mTextedit->append( - tr("\nThe text display of the \"CompactTwoRow\" style is not word wrap and not displays the title bar. " - "You can also control whether the button is line breaking through SARibbonBar::setEnableWordWrap," - "and whether the title bar is displayed through SARibbonBar::setEnableShowPannelTitle")); + tr("\nThe text display of the \"CompactTwoRow\" style is not word wrap and not displays the title bar. " + "You can also control whether the button is line breaking through SARibbonBar::setEnableWordWrap," + "and whether the title bar is displayed through SARibbonBar::setEnableShowPannelTitle")); mTextedit->append(tr("ribbonBar()->setRibbonStyle(SARibbonBar::RibbonStyleCompactTwoRow);")); break; default: @@ -273,9 +273,9 @@ void MainWindow::onActionCustomizeTriggered(bool b) Q_UNUSED(b); if (nullptr == mWidgetForCustomize) { mWidgetForCustomize = new SARibbonCustomizeWidget(this, - this, - Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint - | Qt::Dialog); + this, + Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint + | Qt::Dialog); mWidgetForCustomize->setWindowModality(Qt::ApplicationModal); // 设置阻塞类型 mWidgetForCustomize->setAttribute(Qt::WA_ShowModal, true); // 属性设置 true:模态 false:非模态 mWidgetForCustomize->setupActionsManager(mActionsManager); @@ -292,8 +292,8 @@ void MainWindow::onActionCustomizeAndSaveTriggered(bool b) // 如果启动时未应用上次修改,先应用再读取,保持本地数据和ui一致 if (!mHasApplyCustomizeXmlFile) { auto res = QMessageBox::question(this, - tr("question"), - tr("Apply the last modification?\nIf not, local data will be reset")); + tr("question"), + tr("Apply the last modification?\nIf not, local data will be reset")); if (res == QMessageBox::Yes) { onActionLoadCustomizeXmlFileTriggered(); return; @@ -348,8 +348,8 @@ void MainWindow::onActionCustomizeAndSaveWithApplyTriggered(bool b) // 如果启动时未应用上次修改,先应用再读取,保持本地数据和ui一致 if (!mHasApplyCustomizeXmlFile) { auto res = QMessageBox::question(this, - tr("question"), - tr("Apply the last modification?\nIf not, local data will be reset")); + tr("question"), + tr("Apply the last modification?\nIf not, local data will be reset")); if (res == QMessageBox::Yes) { onActionLoadCustomizeXmlFileTriggered(); return; @@ -368,7 +368,7 @@ void MainWindow::onActionCustomizeAndSaveWithApplyTriggered(bool b) main->addWidget(widgetForCustomize, 1); QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Save | QDialogButtonBox::Cancel - | QDialogButtonBox::Apply); + | QDialogButtonBox::Apply); main->addWidget(buttonBox); @@ -432,13 +432,13 @@ void MainWindow::onActionCustomizeAndSaveWithApplyTriggered(bool b) void MainWindow::onActionHelpTriggered() { QMessageBox::information(this, - tr("infomation"), - tr("\n ===============" - "\n SARibbonBar version:%1" - "\n Author:czy" - "\n Email:czy.t@163.com" - "\n ===============") - .arg(SARibbonBar::versionString())); + tr("infomation"), + tr("\n ===============" + "\n SARibbonBar version:%1" + "\n Author:czy" + "\n Email:czy.t@163.com" + "\n ===============") + .arg(SARibbonBar::versionString())); } void MainWindow::onActionRemoveAppBtnTriggered(bool b) @@ -528,9 +528,9 @@ void MainWindow::onActionWordWrapTriggered(bool b) { ribbonBar()->setEnableWordWrap(b); mTextedit->append(tr("By using the SARibbonBar::setEnableWordWrap function, " - "you can set whether text breaks or not.\n" - "By default, the two line mode will not wrap, the three line mode will wrap.\n" - "You can force the two line mode to wrap, or the three line mode to not wrap")); + "you can set whether text breaks or not.\n" + "By default, the two line mode will not wrap, the three line mode will wrap.\n" + "You can force the two line mode to wrap, or the three line mode to not wrap")); // cn:通过SARibbonBar::setEnableWordWrap函数可以设置文字是否换行。\n // 默认情况下,两行模式都不会换行,三行模式下都会换行。\n // 可以强制设置两行模式也换行,或者三行模式不换行 @@ -641,6 +641,11 @@ void MainWindow::onSpinBoxRibbonPannelTtitleHeightChanged(int h) ribbonBar()->setPannelTitleHeight(h); } +void MainWindow::onSpinBoxRibbonPannelSpacingChanged(int h) +{ + ribbonBar()->setPannelSpacing(h); +} + /** * @brief 创建其它actions,这些actions并不在SARibbonBar管理 */ @@ -759,9 +764,9 @@ void MainWindow::createCategoryMain(SARibbonCategory* page) mComboboxRibbonTheme->addItem("Theme Dark2", static_cast< int >(SARibbonTheme::RibbonThemeDark2)); mComboboxRibbonTheme->setCurrentIndex(mComboboxRibbonTheme->findData(static_cast< int >(ribbonTheme()))); connect(mComboboxRibbonTheme, - QOverload< int >::of(&SARibbonComboBox::currentIndexChanged), - this, - &MainWindow::onRibbonThemeComboBoxCurrentIndexChanged); + QOverload< int >::of(&SARibbonComboBox::currentIndexChanged), + this, + &MainWindow::onRibbonThemeComboBoxCurrentIndexChanged); pannelStyle->addSmallWidget(mComboboxRibbonTheme); SARibbonCheckBox* checkBox = new SARibbonCheckBox(this); @@ -864,7 +869,7 @@ void MainWindow::createCategoryMain(SARibbonCategory* page) connect(act, &QAction::triggered, this, [ this ](bool on) { Q_UNUSED(on); this->mTextedit->append(tr("Text can be manually wrapped(use \\n), and will appear as 1 line in the case of " - "SARibbonBar::setEnableWordWrap (false)")); // cn:文本中手动换行 + "SARibbonBar::setEnableWordWrap (false)")); // cn:文本中手动换行 }); act = createAction(tr("Word \nWrap"), ":/icon/icon/setText.svg"); @@ -873,7 +878,7 @@ void MainWindow::createCategoryMain(SARibbonCategory* page) connect(act, &QAction::triggered, this, [ this ](bool on) { Q_UNUSED(on); this->mTextedit->append(tr("Text can be manually wrapped(use \\n), and will appear as 1 line in the case of " - "SARibbonBar::setEnableWordWrap (false)")); // cn:文本中手动换行 + "SARibbonBar::setEnableWordWrap (false)")); // cn:文本中手动换行 }); //! 3 //! pannel 3 start -> widget test @@ -986,14 +991,14 @@ void MainWindow::createCategoryOther(SARibbonCategory* page) galleryActions.append(lambdaCreateGalleryAction("File Read Only", ":/gallery-icon/icon/gallery/File-Readonly.svg")); galleryActions.append(lambdaCreateGalleryAction("File Settings", ":/gallery-icon/icon/gallery/File-Settings.svg")); galleryActions.append( - lambdaCreateGalleryAction("Presentation File", ":/gallery-icon/icon/gallery/Presentation-File.svg")); + lambdaCreateGalleryAction("Presentation File", ":/gallery-icon/icon/gallery/Presentation-File.svg")); SARibbonGalleryGroup* group1 = gallery->addCategoryActions(tr("Files"), galleryActions); group1->setGalleryGroupStyle(SARibbonGalleryGroup::IconWithWordWrapText); group1->setGridMinimumWidth(80); galleryActions.clear(); galleryActions.append(lambdaCreateGalleryAction("Photoshop", ":/gallery-icon/icon/gallery/Photoshop.svg")); galleryActions.append( - lambdaCreateGalleryAction("Internet-Explorer", ":/gallery-icon/icon/gallery/Internet-Explorer.svg")); + lambdaCreateGalleryAction("Internet-Explorer", ":/gallery-icon/icon/gallery/Internet-Explorer.svg")); galleryActions.append(lambdaCreateGalleryAction("Illustrator", ":/gallery-icon/icon/gallery/Illustrator.svg")); galleryActions.append(lambdaCreateGalleryAction("Google-Maps", ":/gallery-icon/icon/gallery/Google-Maps.svg")); galleryActions.append(lambdaCreateGalleryAction("Adobe", ":/gallery-icon/icon/gallery/Adobe.svg")); @@ -1016,8 +1021,8 @@ void MainWindow::createCategoryOther(SARibbonCategory* page) pannel2->addLargeAction(actionRemoveAppBtn); QAction* actionLongText = createAction(tr("show very long text in a button,balabalabala etc"), - ":/icon/icon/long-text.svg", - "long-text"); + ":/icon/icon/long-text.svg", + "long-text"); pannel2->addLargeAction(actionLongText); SARibbonPannel* pannelStyle = new SARibbonPannel(tr("style")); @@ -1043,8 +1048,8 @@ void MainWindow::createCategoryOther(SARibbonCategory* page) page->addPannel(pannelUtf8); QAction* actionChangeText = createAction(QStringLiteral(u"改变显示为英文"), - ":/icon/icon/chinese-char.svg", - "actionChangeText"); + ":/icon/icon/chinese-char.svg", + "actionChangeText"); actionChangeText->setCheckable(true); actionChangeText->setChecked(false); pannelUtf8->addLargeAction(actionChangeText); @@ -1174,6 +1179,10 @@ void MainWindow::createCategorySize(SARibbonCategory* page) QSpinBox* spinboxRibbonPannelTtitleHeight = new QSpinBox(w); spinboxRibbonPannelTtitleHeight->setRange(5, 99); + QLabel* lab4 = new QLabel("Ribbon Pannel Spacing:"); + QSpinBox* spinboxRibbonPannelSpacing = new QSpinBox(w); + spinboxRibbonPannelSpacing->setRange(0, 25); + g->addWidget(lab0, 0, 0); g->addWidget(spinboxRibbonTitleHeight, 0, 1); g->addWidget(lab1, 1, 0); @@ -1182,32 +1191,40 @@ void MainWindow::createCategorySize(SARibbonCategory* page) g->addWidget(spinboxRibbonCategoryHeight, 0, 3); g->addWidget(lab3, 1, 2); g->addWidget(spinboxRibbonPannelTtitleHeight, 1, 3); + g->addWidget(lab4, 0, 4); + g->addWidget(spinboxRibbonPannelSpacing, 0, 5); spinboxRibbonTitleHeight->setValue(ribbonBar()->titleBarHeight()); spinboxRibbonTabHeight->setValue(ribbonBar()->tabBarHeight()); spinboxRibbonCategoryHeight->setValue(ribbonBar()->categoryHeight()); spinboxRibbonPannelTtitleHeight->setValue(ribbonBar()->pannelTitleHeight()); + spinboxRibbonPannelSpacing->setValue(ribbonBar()->pannelSpacing()); #if QT_VERSION_MAJOR >= 6 connect(spinboxRibbonTitleHeight, &QSpinBox::valueChanged, this, &MainWindow::onSpinBoxRibbonTitleHeightChanged); connect(spinboxRibbonTabHeight, &QSpinBox::valueChanged, this, &MainWindow::onSpinBoxRibbonTabHeightChanged); connect(spinboxRibbonCategoryHeight, &QSpinBox::valueChanged, this, &MainWindow::onSpinBoxRibbonCategoryHeightChanged); connect(spinboxRibbonPannelTtitleHeight, &QSpinBox::valueChanged, this, &MainWindow::onSpinBoxRibbonPannelTtitleHeightChanged); + connect(spinboxRibbonPannelSpacing, &QSpinBox::valueChanged, this, &MainWindow::onSpinBoxRibbonPannelSpacingChanged); #else connect(spinboxRibbonTitleHeight, - QOverload< int >::of(&QSpinBox::valueChanged), - this, - &MainWindow::onSpinBoxRibbonTitleHeightChanged); + QOverload< int >::of(&QSpinBox::valueChanged), + this, + &MainWindow::onSpinBoxRibbonTitleHeightChanged); connect(spinboxRibbonTabHeight, - QOverload< int >::of(&QSpinBox::valueChanged), - this, - &MainWindow::onSpinBoxRibbonTabHeightChanged); + QOverload< int >::of(&QSpinBox::valueChanged), + this, + &MainWindow::onSpinBoxRibbonTabHeightChanged); connect(spinboxRibbonCategoryHeight, - QOverload< int >::of(&QSpinBox::valueChanged), - this, - &MainWindow::onSpinBoxRibbonCategoryHeightChanged); + QOverload< int >::of(&QSpinBox::valueChanged), + this, + &MainWindow::onSpinBoxRibbonCategoryHeightChanged); connect(spinboxRibbonPannelTtitleHeight, - QOverload< int >::of(&QSpinBox::valueChanged), - this, - &MainWindow::onSpinBoxRibbonPannelTtitleHeightChanged); + QOverload< int >::of(&QSpinBox::valueChanged), + this, + &MainWindow::onSpinBoxRibbonPannelTtitleHeightChanged); + connect(spinboxRibbonPannelSpacing, + QOverload< int >::of(&QSpinBox::valueChanged), + this, + &MainWindow::onSpinBoxRibbonPannelSpacingChanged); #endif pannel->addLargeWidget(w); page->addPannel(pannel); @@ -1424,68 +1441,68 @@ void MainWindow::createContextCategoryPage2(SARibbonCategory* page) SARibbonPannel* pannelLayout = page->addPannel(("特殊布局")); pannelLayout->addAction(createAction("Large", ":/icon/icon/layout.svg", "@Large1"), - QToolButton::InstantPopup, - SARibbonPannelItem::Large); + QToolButton::InstantPopup, + SARibbonPannelItem::Large); pannelLayout->addAction(createAction("Small", ":/icon/icon/layout.svg", "@Small1"), - QToolButton::InstantPopup, - SARibbonPannelItem::Small); + QToolButton::InstantPopup, + SARibbonPannelItem::Small); pannelLayout->addAction(createAction("Small", ":/icon/icon/layout.svg", "@Small2"), - QToolButton::InstantPopup, - SARibbonPannelItem::Small); + QToolButton::InstantPopup, + SARibbonPannelItem::Small); pannelLayout->addSeparator(); pannelLayout->addAction(createAction("Small", ":/icon/icon/layout.svg", "@Small3"), - QToolButton::InstantPopup, - SARibbonPannelItem::Small); + QToolButton::InstantPopup, + SARibbonPannelItem::Small); pannelLayout->addAction(createAction("Small", ":/icon/icon/layout.svg", "@Small4"), - QToolButton::InstantPopup, - SARibbonPannelItem::Small); + QToolButton::InstantPopup, + SARibbonPannelItem::Small); pannelLayout->addAction(createAction("Small", ":/icon/icon/layout.svg", "@Small5"), - QToolButton::InstantPopup, - SARibbonPannelItem::Small); + QToolButton::InstantPopup, + SARibbonPannelItem::Small); pannelLayout->addAction(createAction("Small", ":/icon/icon/layout.svg", "@Small6"), - QToolButton::InstantPopup, - SARibbonPannelItem::Small); + QToolButton::InstantPopup, + SARibbonPannelItem::Small); pannelLayout->addSeparator(); pannelLayout->addAction(createAction("Large", ":/icon/icon/layout.svg", "@Large2"), - QToolButton::InstantPopup, - SARibbonPannelItem::Large); + QToolButton::InstantPopup, + SARibbonPannelItem::Large); pannelLayout->addAction(createAction("Medium", ":/icon/icon/layout.svg", "@Medium1"), - QToolButton::InstantPopup, - SARibbonPannelItem::Medium); + QToolButton::InstantPopup, + SARibbonPannelItem::Medium); pannelLayout->addAction(createAction("Medium", ":/icon/icon/layout.svg", "@Medium2"), - QToolButton::InstantPopup, - SARibbonPannelItem::Medium); + QToolButton::InstantPopup, + SARibbonPannelItem::Medium); pannelLayout->addAction(createAction("Small", ":/icon/icon/layout.svg", "@Small7"), - QToolButton::InstantPopup, - SARibbonPannelItem::Small); + QToolButton::InstantPopup, + SARibbonPannelItem::Small); pannelLayout->addAction(createAction("Medium", ":/icon/icon/layout.svg", "@Medium3"), - QToolButton::InstantPopup, - SARibbonPannelItem::Medium); + QToolButton::InstantPopup, + SARibbonPannelItem::Medium); pannelLayout->addAction(createAction("Large", ":/icon/icon/layout.svg", "@Large3"), - QToolButton::InstantPopup, - SARibbonPannelItem::Large); + QToolButton::InstantPopup, + SARibbonPannelItem::Large); pannelLayout->addAction(createAction("Medium", ":/icon/icon/layout.svg", "@Medium4"), - QToolButton::InstantPopup, - SARibbonPannelItem::Medium); + QToolButton::InstantPopup, + SARibbonPannelItem::Medium); pannelLayout->addAction(createAction("Medium", ":/icon/icon/layout.svg", "@Medium5"), - QToolButton::InstantPopup, - SARibbonPannelItem::Medium); + QToolButton::InstantPopup, + SARibbonPannelItem::Medium); pannelLayout->addAction(createAction("Large", ":/icon/icon/layout.svg", "@Large4"), - QToolButton::InstantPopup, - SARibbonPannelItem::Large); + QToolButton::InstantPopup, + SARibbonPannelItem::Large); pannelLayout->addSeparator(); pannelLayout->addAction(createAction("Medium", ":/icon/icon/layout.svg", "@Medium6"), - QToolButton::InstantPopup, - SARibbonPannelItem::Medium); + QToolButton::InstantPopup, + SARibbonPannelItem::Medium); pannelLayout->addAction(createAction("Large", ":/icon/icon/layout.svg", "@Large5"), - QToolButton::InstantPopup, - SARibbonPannelItem::Large); + QToolButton::InstantPopup, + SARibbonPannelItem::Large); pannelLayout->addAction(createAction("Medium", ":/icon/icon/layout.svg", "@Medium7"), - QToolButton::InstantPopup, - SARibbonPannelItem::Medium); + QToolButton::InstantPopup, + SARibbonPannelItem::Medium); pannelLayout->addAction(createAction("Small", ":/icon/icon/layout.svg", "@Small8"), - QToolButton::InstantPopup, - SARibbonPannelItem::Small); + QToolButton::InstantPopup, + SARibbonPannelItem::Small); } void MainWindow::createQuickAccessBar() @@ -1513,14 +1530,14 @@ void MainWindow::createQuickAccessBar() QMenu* m1 = new QMenu("Presentation File 1", this); m1->setIcon(QIcon(":/icon/icon/presentationFile.svg")); for (int i = 0; i < 10; ++i) { - m1->addAction(createAction(QString("file%1").arg(i + 1), ":/icon/icon/file.svg")); + m1->addAction(createAction(QString("file%1 - 1").arg(i + 1), ":/icon/icon/file.svg")); } quickAccessBar->addMenu(m1, Qt::ToolButtonIconOnly, QToolButton::InstantPopup); QMenu* m2 = new QMenu("Presentation File 2", this); m2->setIcon(QIcon(":/icon/icon/presentationFile.svg")); for (int i = 0; i < 10; ++i) { - m2->addAction(createAction(QString("file%1").arg(i + 1), ":/icon/icon/file.svg")); + m2->addAction(createAction(QString("file%1 - 2").arg(i + 1), ":/icon/icon/file.svg")); } QAction* actiontestmenu = new QAction("Presentation File 2"); actiontestmenu->setMenu(m2); @@ -1668,7 +1685,7 @@ void MainWindow::onDelayedPopupCheckabletriggered(bool b) { Q_UNUSED(b); mTextedit->append(tr("The SARibbonToolButton::setPopupMode(QToolButton::DelayedPopup) method " - "can be used to set the menu pop-up method to delayed pop-up. " - "This also demonstrates manually setting text wrapping")); + "can be used to set the menu pop-up method to delayed pop-up. " + "This also demonstrates manually setting text wrapping")); // cn:使用SARibbonToolButton::setPopupMode(QToolButton::DelayedPopup)方法可以设置菜单弹出方式为延迟弹出,这里也演示了手动设置文本的换行 } diff --git a/src/example/MainWindowExample/mainwindow.h b/src/example/MainWindowExample/mainwindow.h index 2a28720..d603f52 100644 --- a/src/example/MainWindowExample/mainwindow.h +++ b/src/example/MainWindowExample/mainwindow.h @@ -74,6 +74,7 @@ private slots: void onSpinBoxRibbonTabHeightChanged(int h); void onSpinBoxRibbonCategoryHeightChanged(int h); void onSpinBoxRibbonPannelTtitleHeightChanged(int h); + void onSpinBoxRibbonPannelSpacingChanged(int h); private: // 创建其它actions,这些actions并不在SARibbonBar管理 diff --git a/src/example/NormalMenuBarExample/debug/moc_predefs.h b/src/example/NormalMenuBarExample/debug/moc_predefs.h deleted file mode 100644 index 435ef38..0000000 --- a/src/example/NormalMenuBarExample/debug/moc_predefs.h +++ /dev/null @@ -1,13 +0,0 @@ -#define _MSC_EXTENSIONS -#define _MSC_VER 1929 -#define _MSC_FULL_VER 192930153 -#define _MSC_BUILD 0 -#define _M_AMD64 100 -#define _M_X64 100 -#define _WIN64 -#define _WIN32 -#define _CPPRTTI -#define _DEBUG -#define _MT -#define _DLL -#define _UTF8