forked from github_mirror/framelesshelper
misc: minor tweaks
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
parent
cd05b6ecdf
commit
859912ae25
|
@ -161,6 +161,7 @@ Q_NAMESPACE_EXPORT(FRAMELESSHELPER_CORE_API)
|
|||
[[maybe_unused]] static constexpr const int kDefaultTitleBarHeight = 30;
|
||||
[[maybe_unused]] static constexpr const int kDefaultWindowFrameBorderThickness = 1;
|
||||
[[maybe_unused]] static constexpr const int kDefaultTitleBarFontPointSize = 11;
|
||||
[[maybe_unused]] static constexpr const int kDefaultTitleBarTitleLabelMargin = 10;
|
||||
|
||||
[[maybe_unused]] static constexpr const QColor kDefaultBlackColor = {0, 0, 0}; // #000000
|
||||
[[maybe_unused]] static constexpr const QColor kDefaultWhiteColor = {255, 255, 255}; // #FFFFFF
|
||||
|
|
|
@ -22,8 +22,8 @@
|
|||
SOFTWARE.
|
||||
]]
|
||||
|
||||
find_package(QT NAMES Qt6 Qt5 COMPONENTS QuickTemplates2)
|
||||
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS QuickTemplates2)
|
||||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS QuickTemplates2)
|
||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS QuickTemplates2)
|
||||
|
||||
set(SUB_PROJ_NAME FramelessHelperQuick)
|
||||
|
||||
|
|
|
@ -83,19 +83,19 @@ void QuickStandardTitleBar::setTitleLabelAlignment(const Qt::Alignment value)
|
|||
const QQuickItemPrivate * const titleBarPriv = QQuickItemPrivate::get(this);
|
||||
if (m_labelAlignment & Qt::AlignTop) {
|
||||
labelAnchors->setTop(titleBarPriv->top());
|
||||
labelAnchors->setTopMargin(10);
|
||||
labelAnchors->setTopMargin(kDefaultTitleBarTitleLabelMargin);
|
||||
}
|
||||
if (m_labelAlignment & Qt::AlignBottom) {
|
||||
labelAnchors->setBottom(titleBarPriv->bottom());
|
||||
labelAnchors->setBottomMargin(10);
|
||||
labelAnchors->setBottomMargin(kDefaultTitleBarTitleLabelMargin);
|
||||
}
|
||||
if (m_labelAlignment & Qt::AlignLeft) {
|
||||
labelAnchors->setLeft(titleBarPriv->left());
|
||||
labelAnchors->setLeftMargin(10);
|
||||
labelAnchors->setLeftMargin(kDefaultTitleBarTitleLabelMargin);
|
||||
}
|
||||
if (m_labelAlignment & Qt::AlignRight) {
|
||||
labelAnchors->setRight(QQuickItemPrivate::get(m_row.data())->left());
|
||||
labelAnchors->setRightMargin(10);
|
||||
labelAnchors->setRightMargin(kDefaultTitleBarTitleLabelMargin);
|
||||
}
|
||||
if (m_labelAlignment & Qt::AlignVCenter) {
|
||||
labelAnchors->setTopMargin(0);
|
||||
|
|
Loading…
Reference in New Issue