forked from qt-creator/qt-creator
Utils: Migrate to new spacing tokens
The spacing tokens in the Figma designs were reorganized. This change adopts the new tokens in Qt Creator. Only constants names do change, all values remain the same as they were. Change-Id: Icedf82bfd55a145ccf3d31d955ddda636ca2f564 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -2129,7 +2129,7 @@ void BoolAspect::addToLayoutHelper(Layouting::Layout &parent, QAbstractButton *b
|
|||||||
ttLabel->setFont(StyleHelper::uiFont(StyleHelper::UiElementLabelSmall));
|
ttLabel->setFont(StyleHelper::uiFont(StyleHelper::UiElementLabelSmall));
|
||||||
auto lt = new QVBoxLayout;
|
auto lt = new QVBoxLayout;
|
||||||
lt->setContentsMargins({});
|
lt->setContentsMargins({});
|
||||||
lt->setSpacing(StyleHelper::SpacingTokens::VGapXxs);
|
lt->setSpacing(StyleHelper::SpacingTokens::GapVXs);
|
||||||
lt->addWidget(button);
|
lt->addWidget(button);
|
||||||
lt->addWidget(ttLabel);
|
lt->addWidget(ttLabel);
|
||||||
parent.addItem(lt);
|
parent.addItem(lt);
|
||||||
|
@@ -647,9 +647,9 @@ void MarkdownBrowser::highlightCodeBlock(const QString &language, QTextBlock &bl
|
|||||||
QTextFrameFormat frameFormat;
|
QTextFrameFormat frameFormat;
|
||||||
frameFormat.setBorderStyle(QTextFrameFormat::BorderStyle_Solid);
|
frameFormat.setBorderStyle(QTextFrameFormat::BorderStyle_Solid);
|
||||||
frameFormat.setBackground(creatorColor(Theme::Token_Background_Muted));
|
frameFormat.setBackground(creatorColor(Theme::Token_Background_Muted));
|
||||||
frameFormat.setPadding(SpacingTokens::ExPaddingGapM);
|
frameFormat.setPadding(SpacingTokens::PaddingVS);
|
||||||
frameFormat.setLeftMargin(SpacingTokens::VGapM);
|
frameFormat.setLeftMargin(SpacingTokens::PaddingVXs);
|
||||||
frameFormat.setRightMargin(SpacingTokens::VGapM);
|
frameFormat.setRightMargin(SpacingTokens::PaddingVXs);
|
||||||
|
|
||||||
QTextFrame *frame = cursor.insertFrame(frameFormat);
|
QTextFrame *frame = cursor.insertFrame(frameFormat);
|
||||||
QTextCursor frameCursor(frame);
|
QTextCursor frameCursor(frame);
|
||||||
@@ -837,8 +837,8 @@ void MarkdownBrowser::postProcessDocument(bool firstTime)
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (blockFormat.hasProperty(QTextFormat::HeadingLevel)) {
|
if (blockFormat.hasProperty(QTextFormat::HeadingLevel)) {
|
||||||
blockFormat.setTopMargin(SpacingTokens::ExVPaddingGapXl * fontScale);
|
blockFormat.setTopMargin(SpacingTokens::PaddingVXxl * fontScale);
|
||||||
blockFormat.setBottomMargin(SpacingTokens::VGapL * fontScale);
|
blockFormat.setBottomMargin(SpacingTokens::GapVM * fontScale);
|
||||||
} else {
|
} else {
|
||||||
blockFormat
|
blockFormat
|
||||||
.setLineHeight(lineHeight(contentTF) * fontScale, QTextBlockFormat::FixedHeight);
|
.setLineHeight(lineHeight(contentTF) * fontScale, QTextBlockFormat::FixedHeight);
|
||||||
|
@@ -138,31 +138,31 @@ QSize QtcButton::minimumSizeHint() const
|
|||||||
void QtcButton::paintEvent(QPaintEvent *event)
|
void QtcButton::paintEvent(QPaintEvent *event)
|
||||||
{
|
{
|
||||||
// Without pixmap
|
// Without pixmap
|
||||||
// +----------------+----------------+----------------+
|
// +------------------------+-----------+------------------------+
|
||||||
// | |(VPadding[S|XS])| |
|
// | |(PaddingVM)| |
|
||||||
// | +----------------+----------------+
|
// | +-----------+ |
|
||||||
// |(HPadding[S|XS])| <label> |(HPadding[S|XS])|
|
// |([PaddingHXL|PaddingHM])| <label> |([PaddingHXL|PaddingHM])|
|
||||||
// | +----------------+----------------+
|
// | +-----------+ |
|
||||||
// | |(VPadding[S|XS])| |
|
// | |(PaddingVM)| |
|
||||||
// +----------------+---------------------------------+
|
// +------------------------+-----------+------------------------+
|
||||||
//
|
//
|
||||||
// With pixmap
|
// With pixmap
|
||||||
// +-------+--------+-------------------------+---------------------------------+
|
// +-----------+--------+----------------+-----------+------------------------+
|
||||||
// | | | |(VPadding[S|XS])| |
|
// | | | |(PaddingVM)| |
|
||||||
// | | | +----------------+ |
|
// | | | +-----------+ |
|
||||||
// |(HGapS)|<pixmap>|([ExPaddingGapM|HGapXxs])| <label> |(HPadding[S|XS])|
|
// |(PaddingHM)|<pixmap>|([GapHS|GapHXs])| <label> |([PaddingHXL|PaddingHM])|
|
||||||
// | | | +----------------+ |
|
// | | | +-----------+ |
|
||||||
// | | | |(VPadding[S|XS])| |
|
// | | | |(PaddingVM)| |
|
||||||
// +-------+--------+-------------------------+----------------+----------------+
|
// +-----------+--------+----------------+-----------+------------------------+
|
||||||
//
|
//
|
||||||
// SmallLink with pixmap
|
// SmallLink with pixmap
|
||||||
// +--------+---------------+---------------------------------+
|
// +--------+-------+-----------+------------------------+
|
||||||
// | | |(VPadding[S|XS])| |
|
// | | |(PaddingVM)| |
|
||||||
// | | +----------------+ |
|
// | | +-----------+ |
|
||||||
// |<pixmap>|(ExPaddingGapM)| <label> |(HPadding[S|XS])|
|
// |<pixmap>|(GapHS)| <label> |([PaddingHXl|PaddingHM])|
|
||||||
// | | +----------------+ |
|
// | | +-----------+ |
|
||||||
// | | |(VPadding[S|XS])| |
|
// | | |(PaddingVM)| |
|
||||||
// +--------+---------------+----------------+----------------+
|
// +--------+-------+-----------+------------------------+
|
||||||
|
|
||||||
const bool hovered = underMouse();
|
const bool hovered = underMouse();
|
||||||
const WidgetState state = isChecked() ? WidgetStateChecked : hovered ? WidgetStateHovered
|
const WidgetState state = isChecked() ? WidgetStateChecked : hovered ? WidgetStateHovered
|
||||||
@@ -227,7 +227,7 @@ void QtcButton::paintEvent(QPaintEvent *event)
|
|||||||
|
|
||||||
if (!m_pixmap.isNull()) {
|
if (!m_pixmap.isNull()) {
|
||||||
const QSizeF pixmapS = m_pixmap.deviceIndependentSize();
|
const QSizeF pixmapS = m_pixmap.deviceIndependentSize();
|
||||||
const int pixmapX = m_role == SmallLink ? 0 : HGapS;
|
const int pixmapX = m_role == SmallLink ? 0 : PaddingHM;
|
||||||
const int pixmapY = (bgR.height() - pixmapS.height()) / 2;
|
const int pixmapY = (bgR.height() - pixmapS.height()) / 2;
|
||||||
p.drawPixmap(pixmapX, pixmapY, m_pixmap);
|
p.drawPixmap(pixmapX, pixmapY, m_pixmap);
|
||||||
}
|
}
|
||||||
@@ -258,18 +258,17 @@ void QtcButton::setRole(Role role)
|
|||||||
void QtcButton::updateMargins()
|
void QtcButton::updateMargins()
|
||||||
{
|
{
|
||||||
if (m_role == Tag) {
|
if (m_role == Tag) {
|
||||||
setContentsMargins(HPaddingXs, VPaddingXxs, HPaddingXs, VPaddingXxs);
|
setContentsMargins(PaddingHM, PaddingVXs, PaddingHM, PaddingVXs);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const bool tokenSizeS = m_role == LargePrimary || m_role == LargeSecondary
|
const bool tokenSizeS = m_role == LargePrimary || m_role == LargeSecondary
|
||||||
|| m_role == SmallList || m_role == SmallLink;
|
|| m_role == SmallList || m_role == SmallLink;
|
||||||
const int hPaddingR = tokenSizeS ? HPaddingS : HPaddingXs;
|
const int hPaddingR = tokenSizeS ? PaddingHXl : PaddingHM;
|
||||||
const int hPaddingL = m_pixmap.isNull() ? hPaddingR
|
const int hPaddingL = m_pixmap.isNull() ? hPaddingR
|
||||||
: (m_role == SmallLink ? 0 : HGapS)
|
: (m_role == SmallLink ? 0 : PaddingHM)
|
||||||
+ int(m_pixmap.deviceIndependentSize().width())
|
+ int(m_pixmap.deviceIndependentSize().width())
|
||||||
+ (tokenSizeS ? ExPaddingGapM : HGapXxs);
|
+ (tokenSizeS ? GapHS : GapHXs);
|
||||||
const int vPadding = tokenSizeS ? VPaddingS : VPaddingXs;
|
setContentsMargins(hPaddingL, PaddingVM, hPaddingR, PaddingVM);
|
||||||
setContentsMargins(hPaddingL, vPadding, hPaddingR, vPadding);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QtcLabel::QtcLabel(const QString &text, Role role, QWidget *parent)
|
QtcLabel::QtcLabel(const QString &text, Role role, QWidget *parent)
|
||||||
@@ -285,7 +284,7 @@ void QtcLabel::setRole(Role role)
|
|||||||
secondaryTF{primaryTF.themeColor, StyleHelper::UiElement::UiElementH6Capital};
|
secondaryTF{primaryTF.themeColor, StyleHelper::UiElement::UiElementH6Capital};
|
||||||
|
|
||||||
const TextFormat &tF = role == Primary ? primaryTF : secondaryTF;
|
const TextFormat &tF = role == Primary ? primaryTF : secondaryTF;
|
||||||
const int vPadding = role == Primary ? ExPaddingGapM : VPaddingS;
|
const int vPadding = role == Primary ? PaddingVS : PaddingVM;
|
||||||
|
|
||||||
setFixedHeight(vPadding + tF.lineHeight() + vPadding);
|
setFixedHeight(vPadding + tF.lineHeight() + vPadding);
|
||||||
setFont(tF.font());
|
setFont(tF.font());
|
||||||
@@ -326,8 +325,8 @@ QtcSearchBox::QtcSearchBox(QWidget *parent)
|
|||||||
pal.setColor(QPalette::Text, searchBoxTextTF.color());
|
pal.setColor(QPalette::Text, searchBoxTextTF.color());
|
||||||
setPalette(pal);
|
setPalette(pal);
|
||||||
|
|
||||||
setContentsMargins({HPaddingXs, ExPaddingGapM, 0, ExPaddingGapM});
|
setContentsMargins({PaddingHM, PaddingVS, 0, PaddingVS});
|
||||||
setFixedHeight(ExPaddingGapM + searchBoxTextTF.lineHeight() + ExPaddingGapM);
|
setFixedHeight(PaddingVS + searchBoxTextTF.lineHeight() + PaddingVS);
|
||||||
setFiltering(true);
|
setFiltering(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -366,13 +365,13 @@ static void paintCommonBackground(QPainter *p, const QRectF &rect, const QWidget
|
|||||||
|
|
||||||
void QtcSearchBox::paintEvent(QPaintEvent *event)
|
void QtcSearchBox::paintEvent(QPaintEvent *event)
|
||||||
{
|
{
|
||||||
// +------------+---------------+------------+------+------------+
|
// +-----------+-----------+-------+------+-----------+
|
||||||
// | |(ExPaddingGapM)| | | |
|
// | |(PaddingVS)| | | |
|
||||||
// | +---------------+ | | |
|
// | +-----------+ | | |
|
||||||
// |(HPaddingXs)| <lineEdit> |(HPaddingXs)|<icon>|(HPaddingXs)|
|
// |(PaddingHM)| <lineEdit>|(GapHM)|<icon>|(PaddingHM)|
|
||||||
// | +---------------+ | | |
|
// | +-----------+ | | |
|
||||||
// | |(ExPaddingGapM)| | | |
|
// | |(PaddingVS)| | | |
|
||||||
// +------------+---------------+------------+------+------------+
|
// +-----------+-----------+-------+------+-----------+
|
||||||
|
|
||||||
QPainter p(this);
|
QPainter p(this);
|
||||||
|
|
||||||
@@ -380,7 +379,7 @@ void QtcSearchBox::paintEvent(QPaintEvent *event)
|
|||||||
if (text().isEmpty()) {
|
if (text().isEmpty()) {
|
||||||
const QPixmap icon = searchBoxIcon();
|
const QPixmap icon = searchBoxIcon();
|
||||||
const QSize iconS = icon.deviceIndependentSize().toSize();
|
const QSize iconS = icon.deviceIndependentSize().toSize();
|
||||||
const QPoint iconPos(width() - HPaddingXs - iconS.width(), (height() - iconS.height()) / 2);
|
const QPoint iconPos(width() - PaddingHM - iconS.width(), (height() - iconS.height()) / 2);
|
||||||
if (!isEnabled())
|
if (!isEnabled())
|
||||||
p.setOpacity(disabledIconOpacity);
|
p.setOpacity(disabledIconOpacity);
|
||||||
p.drawPixmap(iconPos, icon);
|
p.drawPixmap(iconPos, icon);
|
||||||
@@ -407,8 +406,8 @@ QtcComboBox::QtcComboBox(QWidget *parent)
|
|||||||
setMouseTracking(true);
|
setMouseTracking(true);
|
||||||
|
|
||||||
const QSize iconSize = comboBoxIcon().deviceIndependentSize().toSize();
|
const QSize iconSize = comboBoxIcon().deviceIndependentSize().toSize();
|
||||||
setContentsMargins({HPaddingXs, VPaddingXs,
|
setContentsMargins({PaddingHM, PaddingVM,
|
||||||
HGapXxs + iconSize.width() + HPaddingXs, VPaddingXs});
|
GapHXs + iconSize.width() + PaddingHM, PaddingVM});
|
||||||
}
|
}
|
||||||
|
|
||||||
QSize QtcComboBox::sizeHint() const
|
QSize QtcComboBox::sizeHint() const
|
||||||
@@ -433,13 +432,13 @@ void QtcComboBox::leaveEvent(QEvent *event)
|
|||||||
|
|
||||||
void QtcComboBox::paintEvent(QPaintEvent *)
|
void QtcComboBox::paintEvent(QPaintEvent *)
|
||||||
{
|
{
|
||||||
// +------------+-------------+---------+-------+------------+
|
// +-----------+-------------+--------+-------+-----------+
|
||||||
// | | (VPaddingXs)| | | |
|
// | | (PaddingVM) | | | |
|
||||||
// | +-------------+ | | |
|
// | +-------------+ | | |
|
||||||
// |(HPaddingXs)|<currentItem>|(HGapXxs)|<arrow>|(HPaddingXs)|
|
// |(PaddingHM)|<currentItem>|(GapHXs)|<arrow>|(PaddingHM)|
|
||||||
// | +-------------+ | | |
|
// | +-------------+ | | |
|
||||||
// | | (VPaddingXs)| | | |
|
// | | (PaddingVM) | | | |
|
||||||
// +------------+-------------+---------+-------+------------+
|
// +-----------+-------------+--------+-------+-----------+
|
||||||
|
|
||||||
QPainter p(this);
|
QPainter p(this);
|
||||||
paintCommonBackground(&p, rect(), this);
|
paintCommonBackground(&p, rect(), this);
|
||||||
@@ -454,7 +453,7 @@ void QtcComboBox::paintEvent(QPaintEvent *)
|
|||||||
|
|
||||||
const QPixmap icon = comboBoxIcon();
|
const QPixmap icon = comboBoxIcon();
|
||||||
const QSize iconS = icon.deviceIndependentSize().toSize();
|
const QSize iconS = icon.deviceIndependentSize().toSize();
|
||||||
const QPoint iconPos(width() - HPaddingXs - iconS.width(), (height() - iconS.height()) / 2);
|
const QPoint iconPos(width() - PaddingHM - iconS.width(), (height() - iconS.height()) / 2);
|
||||||
if (!isEnabled())
|
if (!isEnabled())
|
||||||
p.setOpacity(disabledIconOpacity);
|
p.setOpacity(disabledIconOpacity);
|
||||||
p.drawPixmap(iconPos, icon);
|
p.drawPixmap(iconPos, icon);
|
||||||
@@ -477,8 +476,8 @@ QSize QtcSwitch::sizeHint() const
|
|||||||
{
|
{
|
||||||
const QFontMetrics fm(SwitchLabelTf.font());
|
const QFontMetrics fm(SwitchLabelTf.font());
|
||||||
const int textWidth = fm.size(Qt::TextShowMnemonic, text()).width();
|
const int textWidth = fm.size(Qt::TextShowMnemonic, text()).width();
|
||||||
const int width = switchTrackS.width() + HGapS + textWidth;
|
const int width = switchTrackS.width() + GapHM + textWidth;
|
||||||
return {width, ExPaddingGapM + SwitchLabelTf.lineHeight() + ExPaddingGapM};
|
return {width, PaddingVS + SwitchLabelTf.lineHeight() + PaddingVS};
|
||||||
}
|
}
|
||||||
|
|
||||||
QSize QtcSwitch::minimumSizeHint() const
|
QSize QtcSwitch::minimumSizeHint() const
|
||||||
@@ -537,7 +536,7 @@ void QtcSwitch::paintEvent([[maybe_unused]] QPaintEvent *event)
|
|||||||
StyleHelper::drawCardBg(&p, thumbR, fill, outline, thumbRounding);
|
StyleHelper::drawCardBg(&p, thumbR, fill, outline, thumbRounding);
|
||||||
}
|
}
|
||||||
{ // switch text label
|
{ // switch text label
|
||||||
const int switchAndGapWidth = switchTrackS.width() + HGapS;
|
const int switchAndGapWidth = switchTrackS.width() + GapHM;
|
||||||
const QRect textR(ltr ? switchAndGapWidth : 0, 0, width() - switchAndGapWidth,
|
const QRect textR(ltr ? switchAndGapWidth : 0, 0, width() - switchAndGapWidth,
|
||||||
trackY + switchTrackS.height());
|
trackY + switchTrackS.height());
|
||||||
p.setFont(SwitchLabelTf.font());
|
p.setFont(SwitchLabelTf.font());
|
||||||
|
@@ -44,35 +44,49 @@ constexpr char C_TOOLBAR_ACTIONWIDGET[] = "toolbar_actionWidget";
|
|||||||
constexpr char C_QT_SCALE_FACTOR_ROUNDING_POLICY[] = "QT_SCALE_FACTOR_ROUNDING_POLICY";
|
constexpr char C_QT_SCALE_FACTOR_ROUNDING_POLICY[] = "QT_SCALE_FACTOR_ROUNDING_POLICY";
|
||||||
|
|
||||||
namespace SpacingTokens {
|
namespace SpacingTokens {
|
||||||
constexpr int VPaddingXxs = 4; // Top and bottom padding within the component
|
constexpr int PrimitiveXxs = 2;
|
||||||
constexpr int HPaddingXxs = 4; // Left and right padding within the component
|
constexpr int PrimitiveXs = 4;
|
||||||
constexpr int VGapXxs = 4; // Vertical Space between TEXT LINE within the Component
|
constexpr int PrimitiveS = 6;
|
||||||
constexpr int HGapXxs = 4; // Horizontal Space between elements within the Component
|
constexpr int PrimitiveM = 8;
|
||||||
|
constexpr int PrimitiveL = 12;
|
||||||
|
constexpr int PrimitiveXl = 16;
|
||||||
|
constexpr int PrimitiveXxl = 24;
|
||||||
|
|
||||||
constexpr int VPaddingXs = 8;
|
// Top and bottom padding within the component
|
||||||
constexpr int HPaddingXs = 8;
|
constexpr int PaddingVXxs = PrimitiveXxs;
|
||||||
constexpr int VGapXs = 4;
|
constexpr int PaddingVXs = PrimitiveXs;
|
||||||
constexpr int HGapXs = 8;
|
constexpr int PaddingVS = PrimitiveS;
|
||||||
|
constexpr int PaddingVM = PrimitiveM;
|
||||||
|
constexpr int PaddingVL = PrimitiveL;
|
||||||
|
constexpr int PaddingVXl = PrimitiveXl;
|
||||||
|
constexpr int PaddingVXxl = PrimitiveXxl;
|
||||||
|
|
||||||
constexpr int VPaddingS = 8;
|
// Left and right padding within the component
|
||||||
constexpr int HPaddingS = 16;
|
constexpr int PaddingHXxs = PrimitiveXxs;
|
||||||
constexpr int VGapS = 4;
|
constexpr int PaddingHXs = PrimitiveXs;
|
||||||
constexpr int HGapS = 8;
|
constexpr int PaddingHS = PrimitiveS;
|
||||||
|
constexpr int PaddingHM = PrimitiveM;
|
||||||
|
constexpr int PaddingHL = PrimitiveL;
|
||||||
|
constexpr int PaddingHXl = PrimitiveXl;
|
||||||
|
constexpr int PaddingHXxl = PrimitiveXxl;
|
||||||
|
|
||||||
constexpr int VPaddingM = 16;
|
// Gap between vertically (on top of each other) positioned elements
|
||||||
constexpr int HPaddingM = 24;
|
constexpr int GapVXxs = PrimitiveXxs;
|
||||||
constexpr int VGapM = 4;
|
constexpr int GapVXs = PrimitiveXs;
|
||||||
constexpr int HGapM = 16;
|
constexpr int GapVS = PrimitiveS;
|
||||||
|
constexpr int GapVM = PrimitiveM;
|
||||||
|
constexpr int GapVL = PrimitiveL;
|
||||||
|
constexpr int GapVXl = PrimitiveXl;
|
||||||
|
constexpr int GapVXxl = PrimitiveXxl;
|
||||||
|
|
||||||
constexpr int VPaddingL = 16;
|
// Gap between horizontally (from left to right) positioned elements
|
||||||
constexpr int HPaddingL = 24;
|
constexpr int GapHXxs = PrimitiveXxs;
|
||||||
constexpr int VGapL = 8;
|
constexpr int GapHXs = PrimitiveXs;
|
||||||
constexpr int HGapL = 16;
|
constexpr int GapHS = PrimitiveS;
|
||||||
|
constexpr int GapHM = PrimitiveM;
|
||||||
constexpr int ExPaddingGapS = 2;
|
constexpr int GapHL = PrimitiveL;
|
||||||
constexpr int ExPaddingGapM = 6;
|
constexpr int GapHXl = PrimitiveXl;
|
||||||
constexpr int ExPaddingGapL = 12;
|
constexpr int GapHXxl = PrimitiveXxl;
|
||||||
constexpr int ExVPaddingGapXl = 24;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class ToolbarStyle {
|
enum class ToolbarStyle {
|
||||||
|
@@ -124,7 +124,7 @@ void PopupInfoBarDisplay::paintEvent(QPaintEvent *)
|
|||||||
const QRect r = rect().adjusted(0, layout()->contentsMargins().top(), 0, 0);
|
const QRect r = rect().adjusted(0, layout()->contentsMargins().top(), 0, 0);
|
||||||
StyleHelper::drawCardBg(&p, r, creatorColor(Theme::Token_Background_Muted),
|
StyleHelper::drawCardBg(&p, r, creatorColor(Theme::Token_Background_Muted),
|
||||||
creatorColor(Theme::Token_Stroke_Subtle),
|
creatorColor(Theme::Token_Stroke_Subtle),
|
||||||
StyleHelper::SpacingTokens::HPaddingXs);
|
StyleHelper::SpacingTokens::PaddingHM);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void disconnectRecursively(QObject *obj)
|
static void disconnectRecursively(QObject *obj)
|
||||||
@@ -188,7 +188,7 @@ InfoWidget::InfoWidget(const InfoBarEntry &info, QPointer<InfoBar> infoBar)
|
|||||||
Column {
|
Column {
|
||||||
Layouting::IconDisplay { icon(InfoBarEntry::icon(infoType)) },
|
Layouting::IconDisplay { icon(InfoBarEntry::icon(infoType)) },
|
||||||
st,
|
st,
|
||||||
customMargins(0, 0, StyleHelper::SpacingTokens::ExPaddingGapS, 0),
|
customMargins(0, 0, StyleHelper::SpacingTokens::PaddingHXxs, 0),
|
||||||
},
|
},
|
||||||
Column {
|
Column {
|
||||||
Row {
|
Row {
|
||||||
@@ -201,12 +201,12 @@ InfoWidget::InfoWidget(const InfoBarEntry &info, QPointer<InfoBar> infoBar)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Space(StyleHelper::SpacingTokens::HGapS),
|
Space(StyleHelper::SpacingTokens::GapHM),
|
||||||
Flow{ bindTo(&buttonLayout), alignment(Qt::AlignRight) },
|
Flow{ bindTo(&buttonLayout), alignment(Qt::AlignRight) },
|
||||||
customMargins(StyleHelper::SpacingTokens::HPaddingS,
|
customMargins(StyleHelper::SpacingTokens::PaddingHXl,
|
||||||
StyleHelper::SpacingTokens::ExPaddingGapL,
|
StyleHelper::SpacingTokens::PaddingVL,
|
||||||
StyleHelper::SpacingTokens::HPaddingS,
|
StyleHelper::SpacingTokens::PaddingHXl,
|
||||||
StyleHelper::SpacingTokens::ExPaddingGapL),
|
StyleHelper::SpacingTokens::PaddingVL),
|
||||||
}.attachTo(this);
|
}.attachTo(this);
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
@@ -298,8 +298,8 @@ void InfoWidget::paintEvent(QPaintEvent *)
|
|||||||
{
|
{
|
||||||
QPainter p(this);
|
QPainter p(this);
|
||||||
p.setPen(creatorColor(Theme::Token_Stroke_Subtle));
|
p.setPen(creatorColor(Theme::Token_Stroke_Subtle));
|
||||||
p.drawLine(Utils::StyleHelper::SpacingTokens::HPaddingXs, 0,
|
p.drawLine(Utils::StyleHelper::SpacingTokens::PaddingHM, 0,
|
||||||
width() - Utils::StyleHelper::SpacingTokens::HPaddingXs - 1, 0);
|
width() - Utils::StyleHelper::SpacingTokens::PaddingHM - 1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
class ProgressTimer : public QObject
|
class ProgressTimer : public QObject
|
||||||
|
@@ -47,7 +47,7 @@ VersionDialog::VersionDialog()
|
|||||||
|
|
||||||
auto logoLabel = new QLabel;
|
auto logoLabel = new QLabel;
|
||||||
logoLabel->setPixmap(Icons::QTCREATORLOGO_BIG.pixmap());
|
logoLabel->setPixmap(Icons::QTCREATORLOGO_BIG.pixmap());
|
||||||
const int margin = Utils::StyleHelper::SpacingTokens::ExPaddingGapL;
|
const int margin = Utils::StyleHelper::SpacingTokens::PaddingVL;
|
||||||
logoLabel->setContentsMargins({margin, margin, margin, margin});
|
logoLabel->setContentsMargins({margin, margin, margin, margin});
|
||||||
|
|
||||||
auto copyRightLabel = new QLabel(ICore::aboutInformationHtml());
|
auto copyRightLabel = new QLabel(ICore::aboutInformationHtml());
|
||||||
|
@@ -409,7 +409,7 @@ constexpr QSize thumbnailAreaSize =
|
|||||||
WelcomeThumbnailSize.grownBy({thumbnailAreaBorderWidth, thumbnailAreaBorderWidth,
|
WelcomeThumbnailSize.grownBy({thumbnailAreaBorderWidth, thumbnailAreaBorderWidth,
|
||||||
thumbnailAreaBorderWidth, thumbnailAreaBorderWidth});
|
thumbnailAreaBorderWidth, thumbnailAreaBorderWidth});
|
||||||
constexpr int tagsRowsCount = 1;
|
constexpr int tagsRowsCount = 1;
|
||||||
constexpr int tagsHGap = ExPaddingGapM;
|
constexpr int tagsHGap = GapHS;
|
||||||
|
|
||||||
constexpr QEasingCurve::Type hoverEasing = QEasingCurve::OutCubic;
|
constexpr QEasingCurve::Type hoverEasing = QEasingCurve::OutCubic;
|
||||||
constexpr std::chrono::milliseconds hoverDuration(300);
|
constexpr std::chrono::milliseconds hoverDuration(300);
|
||||||
@@ -420,80 +420,80 @@ QSize ListItemDelegate::itemSize()
|
|||||||
{
|
{
|
||||||
const int tagsTfLineHeight = tagsTF.lineHeight();
|
const int tagsTfLineHeight = tagsTF.lineHeight();
|
||||||
const int width =
|
const int width =
|
||||||
ExPaddingGapL
|
PaddingHL
|
||||||
+ thumbnailAreaSize.width()
|
+ thumbnailAreaSize.width()
|
||||||
+ ExPaddingGapL;
|
+ PaddingHL;
|
||||||
const int height =
|
const int height =
|
||||||
ExPaddingGapL
|
PaddingVL
|
||||||
+ thumbnailAreaSize.height()
|
+ thumbnailAreaSize.height()
|
||||||
+ VGapL
|
+ GapVM
|
||||||
+ titleTF.lineHeight()
|
+ titleTF.lineHeight()
|
||||||
+ VGapL
|
+ GapVM
|
||||||
+ tagsTfLineHeight
|
+ tagsTfLineHeight
|
||||||
+ (tagsTfLineHeight + ExPaddingGapS) * (tagsRowsCount - 1) // If more than one row
|
+ (tagsTfLineHeight + PaddingVXxs) * (tagsRowsCount - 1) // If more than one row
|
||||||
+ ExPaddingGapL;
|
+ PaddingVL;
|
||||||
return {width + ExVPaddingGapXl, height + ExVPaddingGapXl};
|
return {width + GapHXxl, height + GapVXxl};
|
||||||
}
|
}
|
||||||
|
|
||||||
void ListItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
|
void ListItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
|
||||||
const QModelIndex &index) const
|
const QModelIndex &index) const
|
||||||
{
|
{
|
||||||
// Unhovered tile
|
// Unhovered tile
|
||||||
// +---------------+------------------+---------------+-----------------+
|
// +-----------+------------------+-----------+---------+
|
||||||
// | | (ExPaddingGapL) | | |
|
// | | (PaddingVL) | | |
|
||||||
// | +------------------+ | |
|
// | +------------------+ | |
|
||||||
// | | <thumbnail> | | |
|
// | | <thumbnail> | | |
|
||||||
// | +------------------+ | |
|
// | +------------------+ | |
|
||||||
// | | (VGapL) | | |
|
// | | (GapVM) | | |
|
||||||
// | +------------------+ | |
|
// | +------------------+ | |
|
||||||
// |(ExPaddingGapL)| <title> |(ExPaddingGapL)|(ExVPaddingGapXs)|
|
// |(PaddingHL)| <title> |(PaddingHL)|(GapHXxl)|
|
||||||
// | +------------------+ | |
|
// | +------------------+ | |
|
||||||
// | | (VGapL) | | |
|
// | | (GapVM) | | |
|
||||||
// | +-----------+------+ | |
|
// | +-----------+------+ | |
|
||||||
// | |<tagsLabel>|<tags>| | |
|
// | |<tagsLabel>|<tags>| | |
|
||||||
// | +-----------+------+ | |
|
// | +-----------+------+ | |
|
||||||
// | | (ExPaddingGapL) | | |
|
// | | (PaddingVL) | | |
|
||||||
// +---------------+------------------+---------------+-----------------+
|
// +-----------+------------------+-----------+---------+
|
||||||
// | (ExVPaddingGapXs) |
|
// | (GapVXxl) |
|
||||||
// +--------------------------------------------------------------------+
|
// +----------------------------------------------------+
|
||||||
//
|
//
|
||||||
// Hovered, final animation state of the are above tagsLabel
|
// Hovered, final animation state of the are above tagsLabel
|
||||||
// +---------------+------------------+---------------+
|
// +-----------+-------------+-----------+
|
||||||
// | | (ExPaddingGapL) | |
|
// | | (PaddingVL) | |
|
||||||
// | +------------------+ |
|
// | +-------------+ |
|
||||||
// | | <title> | |
|
// | | <title> | |
|
||||||
// | +------------------+ |
|
// | +-------------+ |
|
||||||
// | | (ExPaddingGapS) | |
|
// | | (GapVXxs) | |
|
||||||
// |(ExPaddingGapL)+------------------+(ExPaddingGapL)| ...
|
// |(PaddingHL)+-------------+(PaddingHL)| ...
|
||||||
// | | <hr> | |
|
// | | <hr> | |
|
||||||
// | +------------------+ |
|
// | +-------------+ |
|
||||||
// | | (ExPaddingGapS) | |
|
// | | (GapVXxs) | |
|
||||||
// | +------------------+ |
|
// | +-------------+ |
|
||||||
// | | <description> | |
|
// | |<description>| |
|
||||||
// +---------------+------------------+---------------+
|
// +-----------+-------------+-----------+
|
||||||
// ...
|
// ...
|
||||||
|
|
||||||
const ListItem *item = index.data(ListModel::ItemRole).value<Core::ListItem *>();
|
const ListItem *item = index.data(ListModel::ItemRole).value<Core::ListItem *>();
|
||||||
|
|
||||||
const QFont tagsLabelFont = tagsLabelTF.font();
|
const QFont tagsLabelFont = tagsLabelTF.font();
|
||||||
const QFontMetrics tagsLabelFM(tagsLabelFont);
|
const QFontMetrics tagsLabelFM(tagsLabelFont);
|
||||||
|
|
||||||
const QRect bgRGlobal = option.rect.adjusted(0, 0, -ExVPaddingGapXl, -ExVPaddingGapXl);
|
const QRect bgRGlobal = option.rect.adjusted(0, 0, -PaddingHXxl, -PaddingVXxl);
|
||||||
const QRect bgR = bgRGlobal.translated(-option.rect.topLeft());
|
const QRect bgR = bgRGlobal.translated(-option.rect.topLeft());
|
||||||
const QRect thumbnailAreaR(bgR.left() + ExPaddingGapL, bgR.top() + ExPaddingGapL,
|
const QRect thumbnailAreaR(bgR.left() + PaddingHL, bgR.top() + PaddingVL,
|
||||||
thumbnailAreaSize.width(), thumbnailAreaSize.height());
|
thumbnailAreaSize.width(), thumbnailAreaSize.height());
|
||||||
const QRect titleR(thumbnailAreaR.left(), thumbnailAreaR.bottom() + VGapL + 1,
|
const QRect titleR(thumbnailAreaR.left(), thumbnailAreaR.bottom() + GapVM + 1,
|
||||||
thumbnailAreaR.width(), titleTF.lineHeight());
|
thumbnailAreaR.width(), titleTF.lineHeight());
|
||||||
const QString tagsLabelText = Tr::tr("Tags:");
|
const QString tagsLabelText = Tr::tr("Tags:");
|
||||||
const int tagsLabelTextWidth = tagsLabelFM.horizontalAdvance(tagsLabelText);
|
const int tagsLabelTextWidth = tagsLabelFM.horizontalAdvance(tagsLabelText);
|
||||||
const QRect tagsLabelR(titleR.left(), titleR.bottom() + VGapL + 1,
|
const QRect tagsLabelR(titleR.left(), titleR.bottom() + GapVM + 1,
|
||||||
tagsLabelTextWidth, tagsTF.lineHeight());
|
tagsLabelTextWidth, tagsTF.lineHeight());
|
||||||
const QRect tagsR(tagsLabelR.right() + 1 + tagsHGap, tagsLabelR.top(),
|
const QRect tagsR(tagsLabelR.right() + 1 + tagsHGap, tagsLabelR.top(),
|
||||||
bgR.right() - ExPaddingGapL - tagsLabelR.right() - tagsHGap,
|
bgR.right() - PaddingHL - tagsLabelR.right() - tagsHGap,
|
||||||
tagsLabelR.height()
|
tagsLabelR.height()
|
||||||
+ (tagsLabelR.height() + ExPaddingGapS) * (tagsRowsCount - 1));
|
+ (tagsLabelR.height() + PaddingVXxs) * (tagsRowsCount - 1));
|
||||||
QTC_CHECK(option.rect.height() == tagsR.bottom() + 1 + ExPaddingGapL + ExVPaddingGapXl);
|
QTC_CHECK(option.rect.height() == tagsR.bottom() + 1 + GapVL + PaddingVXxl);
|
||||||
QTC_CHECK(option.rect.width() == tagsR.right() + 1 + ExPaddingGapL + ExVPaddingGapXl);
|
QTC_CHECK(option.rect.width() == tagsR.right() + 1 + GapHL + PaddingHXxl);
|
||||||
|
|
||||||
QTextOption wrapTO;
|
QTextOption wrapTO;
|
||||||
wrapTO.setWrapMode(QTextOption::WordWrap);
|
wrapTO.setWrapMode(QTextOption::WordWrap);
|
||||||
@@ -604,11 +604,11 @@ void ListItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
|
|||||||
painter->setOpacity(animationProgress); // "fade in" separator line and description
|
painter->setOpacity(animationProgress); // "fade in" separator line and description
|
||||||
|
|
||||||
// The separator line below the example title.
|
// The separator line below the example title.
|
||||||
const QRect hrR(titleR.x(), titleR.bottom() + 1 + ExPaddingGapS, thumbnailAreaR.width(), 1);
|
const QRect hrR(titleR.x(), titleR.bottom() + 1 + GapVXxs, thumbnailAreaR.width(), 1);
|
||||||
painter->fillRect(hrR, themeColor(Theme::Token_Stroke_Muted));
|
painter->fillRect(hrR, themeColor(Theme::Token_Stroke_Muted));
|
||||||
|
|
||||||
// The description text.
|
// The description text.
|
||||||
const QRect descriptionR(hrR.x(), hrR.bottom() + 1 + ExPaddingGapS,
|
const QRect descriptionR(hrR.x(), hrR.bottom() + 1 + GapVXxs,
|
||||||
thumbnailAreaR.width(), shiftY);
|
thumbnailAreaR.width(), shiftY);
|
||||||
painter->setPen(descriptionTF.color());
|
painter->setPen(descriptionTF.color());
|
||||||
painter->setFont(descriptionTF.font());
|
painter->setFont(descriptionTF.font());
|
||||||
@@ -846,8 +846,8 @@ ListModel *SectionedGridView::addSection(const Section §ion, const QList<Lis
|
|||||||
createTitleLabel(section.name),
|
createTitleLabel(section.name),
|
||||||
st,
|
st,
|
||||||
seeAllLink,
|
seeAllLink,
|
||||||
Space(ExVPaddingGapXl),
|
Space(GapHXxl),
|
||||||
customMargins(0, ExPaddingGapM, 0, ExPaddingGapM),
|
customMargins(0, PaddingVS, 0, PaddingVS),
|
||||||
}.emerge();
|
}.emerge();
|
||||||
m_sectionLabels.append(sectionLabel);
|
m_sectionLabels.append(sectionLabel);
|
||||||
auto scrollArea = qobject_cast<QScrollArea *>(widget(0));
|
auto scrollArea = qobject_cast<QScrollArea *>(widget(0));
|
||||||
@@ -917,8 +917,8 @@ void SectionedGridView::zoomInSection(const Section §ion)
|
|||||||
createTitleLabel(section.name),
|
createTitleLabel(section.name),
|
||||||
st,
|
st,
|
||||||
backLink,
|
backLink,
|
||||||
Space(ExVPaddingGapXl),
|
Space(GapHXxl),
|
||||||
customMargins(0, ExPaddingGapM, 0, ExPaddingGapM),
|
customMargins(0, PaddingVS, 0, PaddingVS),
|
||||||
}.emerge();
|
}.emerge();
|
||||||
|
|
||||||
auto gridView = new GridView(zoomedInWidget);
|
auto gridView = new GridView(zoomedInWidget);
|
||||||
|
@@ -83,7 +83,7 @@ ExtensionManagerSettings::ExtensionManagerSettings()
|
|||||||
st,
|
st,
|
||||||
},
|
},
|
||||||
st,
|
st,
|
||||||
spacing(Utils::StyleHelper::SpacingTokens::ExVPaddingGapXl),
|
spacing(Utils::StyleHelper::SpacingTokens::GapVXxl),
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
@@ -85,8 +85,8 @@ static QLabel *sectionTitle(const TextFormat &tf, const QString &title)
|
|||||||
|
|
||||||
static QWidget *toScrollableColumn(QWidget *widget)
|
static QWidget *toScrollableColumn(QWidget *widget)
|
||||||
{
|
{
|
||||||
widget->setContentsMargins(SpacingTokens::ExVPaddingGapXl, SpacingTokens::ExVPaddingGapXl,
|
widget->setContentsMargins(SpacingTokens::PaddingHXxl, SpacingTokens::PaddingVXxl,
|
||||||
SpacingTokens::ExVPaddingGapXl, SpacingTokens::ExVPaddingGapXl);
|
SpacingTokens::PaddingHXxl, SpacingTokens::PaddingVXxl);
|
||||||
widget->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Minimum);
|
widget->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Minimum);
|
||||||
|
|
||||||
auto scrollArea = new QScrollArea;
|
auto scrollArea = new QScrollArea;
|
||||||
@@ -285,11 +285,11 @@ public:
|
|||||||
Widget {
|
Widget {
|
||||||
bindTo(&m_dlCountItems),
|
bindTo(&m_dlCountItems),
|
||||||
Row {
|
Row {
|
||||||
Space(SpacingTokens::HGapXs),
|
Space(SpacingTokens::GapHM),
|
||||||
m_divider,
|
m_divider,
|
||||||
Space(SpacingTokens::HGapXs),
|
Space(SpacingTokens::GapHM),
|
||||||
m_dlIcon,
|
m_dlIcon,
|
||||||
Space(SpacingTokens::HGapXxs),
|
Space(SpacingTokens::GapHXs),
|
||||||
m_dlCount,
|
m_dlCount,
|
||||||
noMargin, spacing(0),
|
noMargin, spacing(0),
|
||||||
},
|
},
|
||||||
@@ -306,7 +306,7 @@ public:
|
|||||||
m_versionSelector,
|
m_versionSelector,
|
||||||
st,
|
st,
|
||||||
},
|
},
|
||||||
noMargin, spacing(SpacingTokens::ExPaddingGapL),
|
noMargin, spacing(SpacingTokens::GapHL),
|
||||||
}.attachTo(this);
|
}.attachTo(this);
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
@@ -526,7 +526,7 @@ public:
|
|||||||
// clang-format off
|
// clang-format off
|
||||||
Flow {
|
Flow {
|
||||||
noMargin,
|
noMargin,
|
||||||
spacing(SpacingTokens::HGapXs),
|
spacing(SpacingTokens::GapHM),
|
||||||
Utils::transform(tags, tagToButton)
|
Utils::transform(tags, tagToButton)
|
||||||
}.attachTo(this);
|
}.attachTo(this);
|
||||||
// clang-format on
|
// clang-format on
|
||||||
@@ -594,7 +594,7 @@ static QWidget *descriptionPlaceHolder()
|
|||||||
WelcomePageHelpers::createRule(Qt::Horizontal),
|
WelcomePageHelpers::createRule(Qt::Horizontal),
|
||||||
text,
|
text,
|
||||||
Stretch(3),
|
Stretch(3),
|
||||||
spacing(SpacingTokens::ExPaddingGapL),
|
spacing(SpacingTokens::GapVL),
|
||||||
},
|
},
|
||||||
st,
|
st,
|
||||||
noMargin,
|
noMargin,
|
||||||
@@ -618,7 +618,7 @@ ExtensionManagerWidget::ExtensionManagerWidget()
|
|||||||
QPalette browserPal = m_description->palette();
|
QPalette browserPal = m_description->palette();
|
||||||
browserPal.setColor(QPalette::Base, creatorColor(Theme::Token_Background_Default));
|
browserPal.setColor(QPalette::Base, creatorColor(Theme::Token_Background_Default));
|
||||||
m_description->setPalette(browserPal);
|
m_description->setPalette(browserPal);
|
||||||
const int verticalPadding = SpacingTokens::ExVPaddingGapXl - SpacingTokens::VPaddingM;
|
const int verticalPadding = SpacingTokens::PaddingVXxl - SpacingTokens::PaddingVXl;
|
||||||
m_description->setMargins({verticalPadding, 0, verticalPadding, 0});
|
m_description->setMargins({verticalPadding, 0, verticalPadding, 0});
|
||||||
m_description->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Preferred);
|
m_description->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Preferred);
|
||||||
|
|
||||||
@@ -664,15 +664,14 @@ ExtensionManagerWidget::ExtensionManagerWidget()
|
|||||||
auto detailsSplitter = new MiniSplitter;
|
auto detailsSplitter = new MiniSplitter;
|
||||||
|
|
||||||
using namespace Layouting;
|
using namespace Layouting;
|
||||||
const auto spL = spacing(SpacingTokens::VPaddingL);
|
const auto spXxs = spacing(SpacingTokens::GapVXs);
|
||||||
const auto spXxs = spacing(SpacingTokens::VPaddingXxs);
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
Column {
|
Column {
|
||||||
Row {
|
Row {
|
||||||
m_headingWidget,
|
m_headingWidget,
|
||||||
m_pluginStatus,
|
m_pluginStatus,
|
||||||
customMargins(SpacingTokens::ExVPaddingGapXl, SpacingTokens::ExVPaddingGapXl,
|
customMargins(SpacingTokens::PaddingHXxl, SpacingTokens::PaddingVXxl,
|
||||||
SpacingTokens::ExVPaddingGapXl, SpacingTokens::ExVPaddingGapXl),
|
SpacingTokens::PaddingHXxl, SpacingTokens::PaddingVXxl),
|
||||||
},
|
},
|
||||||
m_description,
|
m_description,
|
||||||
noMargin, spacing(0),
|
noMargin, spacing(0),
|
||||||
@@ -686,16 +685,16 @@ ExtensionManagerWidget::ExtensionManagerWidget()
|
|||||||
Column { m_platformsTitle, m_platforms, spXxs },
|
Column { m_platformsTitle, m_platforms, spXxs },
|
||||||
Column { m_dependenciesTitle, m_dependencies, spXxs },
|
Column { m_dependenciesTitle, m_dependencies, spXxs },
|
||||||
Column { m_packExtensionsTitle, m_packExtensions, spXxs },
|
Column { m_packExtensionsTitle, m_packExtensions, spXxs },
|
||||||
spacing(SpacingTokens::VPaddingL),
|
spacing(SpacingTokens::GapVXl),
|
||||||
},
|
},
|
||||||
st,
|
st,
|
||||||
noMargin, spacing(SpacingTokens::ExVPaddingGapXl),
|
noMargin, spacing(SpacingTokens::GapVXxl),
|
||||||
}.attachTo(secondaryDetails);
|
}.attachTo(secondaryDetails);
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
new StyledBar,
|
new StyledBar,
|
||||||
Row {
|
Row {
|
||||||
Space(SpacingTokens::ExVPaddingGapXl),
|
Space(SpacingTokens::GapHXxl),
|
||||||
m_extensionBrowser,
|
m_extensionBrowser,
|
||||||
WelcomePageHelpers::createRule(Qt::Vertical),
|
WelcomePageHelpers::createRule(Qt::Vertical),
|
||||||
Stack {
|
Stack {
|
||||||
@@ -788,7 +787,7 @@ void ExtensionManagerWidget::updateView(const QModelIndex ¤t)
|
|||||||
|
|
||||||
const QString description = current.data(RoleDescriptionLong).toString();
|
const QString description = current.data(RoleDescriptionLong).toString();
|
||||||
m_description->setMarkdown(description);
|
m_description->setMarkdown(description);
|
||||||
m_description->document()->setDocumentMargin(SpacingTokens::VPaddingM);
|
m_description->document()->setDocumentMargin(SpacingTokens::PaddingVXl);
|
||||||
|
|
||||||
auto idToDisplayName = [this](const QString &id) {
|
auto idToDisplayName = [this](const QString &id) {
|
||||||
const QModelIndex dependencyIndex = m_extensionModel->indexOfId(id);
|
const QModelIndex dependencyIndex = m_extensionModel->indexOfId(id);
|
||||||
|
@@ -64,7 +64,7 @@ namespace ExtensionManager::Internal {
|
|||||||
|
|
||||||
Q_LOGGING_CATEGORY(browserLog, "qtc.extensionmanager.browser", QtWarningMsg)
|
Q_LOGGING_CATEGORY(browserLog, "qtc.extensionmanager.browser", QtWarningMsg)
|
||||||
|
|
||||||
constexpr int gapSize = HGapL;
|
constexpr int gapSize = GapHXl;
|
||||||
constexpr int itemWidth = 330;
|
constexpr int itemWidth = 330;
|
||||||
constexpr int cellWidth = itemWidth + gapSize;
|
constexpr int cellWidth = itemWidth + gapSize;
|
||||||
|
|
||||||
@@ -84,22 +84,22 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
void paintEvent([[maybe_unused]] QPaintEvent *event) override
|
void paintEvent([[maybe_unused]] QPaintEvent *event) override
|
||||||
{
|
{
|
||||||
// +------------+------+---------+---------------+------------+
|
// +-----------+------+--------+---------------+-----------+
|
||||||
// | | | | (VPaddingXs) | |
|
// | | | | (PaddingVM) | |
|
||||||
// | | | +---------------+ |
|
// | | | +---------------+ |
|
||||||
// |(HPaddingXs)|(icon)|(HGapXxs)|<template%item>|(HPaddingXs)|
|
// |(PaddingHM)|(icon)|(GapHXs)|<template%item>|(PaddingHM)|
|
||||||
// | | | +---------------+ |
|
// | | | +---------------+ |
|
||||||
// | | | | (VPaddingXs) | |
|
// | | | | (PaddingVM) | |
|
||||||
// +------------+------+---------+---------------+------------+
|
// +-----------+------+--------+---------------+-----------+
|
||||||
|
|
||||||
const bool active = currentIndex() > 0;
|
const bool active = currentIndex() > 0;
|
||||||
const bool hover = underMouse();
|
const bool hover = underMouse();
|
||||||
const TextFormat &tF = (active || hover) ? m_itemActiveTf : m_itemDefaultTf;
|
const TextFormat &tF = (active || hover) ? m_itemActiveTf : m_itemDefaultTf;
|
||||||
|
|
||||||
const QRect iconRect(HPaddingXs, 0, m_iconSize.width(), height());
|
const QRect iconRect(PaddingHM, 0, m_iconSize.width(), height());
|
||||||
const int textX = iconRect.right() + 1 + HGapXxs;
|
const int textX = iconRect.right() + 1 + GapHXs;
|
||||||
const QRect textRect(textX, VPaddingXs,
|
const QRect textRect(textX, PaddingVM,
|
||||||
width() - HPaddingXs - textX, tF.lineHeight());
|
width() - PaddingHM - textX, tF.lineHeight());
|
||||||
|
|
||||||
QPainter p(this);
|
QPainter p(this);
|
||||||
(active ? m_iconActive : m_iconDefault).paint(&p, iconRect);
|
(active ? m_iconActive : m_iconDefault).paint(&p, iconRect);
|
||||||
@@ -107,7 +107,7 @@ protected:
|
|||||||
p.setFont(tF.font());
|
p.setFont(tF.font());
|
||||||
const QString elidedText = p.fontMetrics().elidedText(currentFormattedText(),
|
const QString elidedText = p.fontMetrics().elidedText(currentFormattedText(),
|
||||||
Qt::ElideRight,
|
Qt::ElideRight,
|
||||||
textRect.width() + HPaddingXs);
|
textRect.width() + PaddingHM);
|
||||||
p.drawText(textRect, tF.drawTextFlags, elidedText);
|
p.drawText(textRect, tF.drawTextFlags, elidedText);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -129,15 +129,15 @@ private:
|
|||||||
const QFontMetrics fm(m_itemDefaultTf.font());
|
const QFontMetrics fm(m_itemDefaultTf.font());
|
||||||
const int textWidth = fm.horizontalAdvance(currentFormattedText());
|
const int textWidth = fm.horizontalAdvance(currentFormattedText());
|
||||||
const int width =
|
const int width =
|
||||||
HPaddingXs
|
PaddingHM
|
||||||
+ m_iconSize.width()
|
+ m_iconSize.width()
|
||||||
+ HGapXxs
|
+ GapHXs
|
||||||
+ textWidth
|
+ textWidth
|
||||||
+ HPaddingXs;
|
+ PaddingHM;
|
||||||
const int height =
|
const int height =
|
||||||
VPaddingXs
|
PaddingVM
|
||||||
+ m_itemDefaultTf.lineHeight()
|
+ m_itemDefaultTf.lineHeight()
|
||||||
+ VPaddingXs;
|
+ PaddingVM;
|
||||||
return {width, height};
|
return {width, height};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -195,23 +195,23 @@ public:
|
|||||||
ExtensionItemWidget(QWidget *parent = nullptr)
|
ExtensionItemWidget(QWidget *parent = nullptr)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
{
|
{
|
||||||
// +---------------+-------+---------------+-----------------------------------------------------------------------------------+---------------+---------+
|
// +-----------+-------+-------+--------------------------------------------------------------------------------+-----------+---------+
|
||||||
// | | | | (ExPaddingGapL) | | |
|
// | | | | (PaddingVL) | | |
|
||||||
// | | | +----------+---------+---------------+---------+--------------+---------+-----------+ | |
|
// | | | +----------+--------+---------------+--------+--------------+--------+-----------+ | |
|
||||||
// | | | |<itemName>|(HGapXxs)|<releaseStatus>|(HGapXxs)|<installState>|(HGapXxs)|<checkmark>| | |
|
// | | | |<itemName>|(GapHXs)|<releaseStatus>|(GapHXs)|<installState>|(GapHXs)|<checkmark>| | |
|
||||||
// | | | +----------+---------+---------------+---------+--------------+---------+-----------+ | |
|
// | | | +----------+--------+---------------+--------+--------------+--------+-----------+ | |
|
||||||
// | | | | (VGapXxs) | | |
|
// | | | | (GapVXs) | | |
|
||||||
// | | | +---------------------+--------+--------------+--------+--------+---------+---------+ | |
|
// | | | +---------------------+-------+--------------+-------+--------+--------+---------+ | |
|
||||||
// |(ExPaddingGapL)|<icon> |(ExPaddingGapL)| <vendor> |(HGapXs)|<divider>(h16)|(HGapXs)|<dlIcon>|(HGapXxs)|<dlCount>|(ExPaddingGapL)|(gapSize)|
|
// |(PaddingHL)|<icon> |(GapHL)| <vendor> |(GapHM)|<divider>(h16)|(GapHM)|<dlIcon>|(GapHXs)|<dlCount>|(PaddingHL)|(gapSize)|
|
||||||
// | |(50x50)| +---------------------+--------+--------------+--------+--------+---------+---------+ | |
|
// | |(50x50)| +---------------------+-------+--------------+-------+--------+--------+---------+ | |
|
||||||
// | | | | (VGapXxs) | | |
|
// | | | | (GapVXs) | | |
|
||||||
// | | | +-----------------------------------------------------------------------------------+ | |
|
// | | | +--------------------------------------------------------------------------------+ | |
|
||||||
// | | | | <shortDescription> | | |
|
// | | | | <shortDescription> | | |
|
||||||
// | | | +-----------------------------------------------------------------------------------+ | |
|
// | | | +--------------------------------------------------------------------------------+ | |
|
||||||
// | | | | (ExPaddingGapL) | | |
|
// | | | | (PaddingVL) | | |
|
||||||
// +---------------+-------+---------------+-----------------------------------------------------------------------------------+---------------+---------+
|
// +-----------+-------+-------+--------------------------------------------------------------------------------+-----------+---------+
|
||||||
// | (gapSize) |
|
// | (gapSize) |
|
||||||
// +-----------------------------------------------------------------------------------------------------------------------------------------------------+
|
// +----------------------------------------------------------------------------------------------------------------------------------+
|
||||||
|
|
||||||
m_iconLabel = new QLabel;
|
m_iconLabel = new QLabel;
|
||||||
m_iconLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
|
m_iconLabel->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
|
||||||
@@ -249,11 +249,11 @@ public:
|
|||||||
Row {
|
Row {
|
||||||
m_installStateLabel,
|
m_installStateLabel,
|
||||||
m_installStateIcon,
|
m_installStateIcon,
|
||||||
spacing(HGapXxs),
|
spacing(GapHXs),
|
||||||
noMargin,
|
noMargin,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
spacing(HGapXxs),
|
spacing(GapHXs),
|
||||||
},
|
},
|
||||||
Row {
|
Row {
|
||||||
m_vendorLabel,
|
m_vendorLabel,
|
||||||
@@ -261,21 +261,21 @@ public:
|
|||||||
bindTo(&m_downloads),
|
bindTo(&m_downloads),
|
||||||
Row {
|
Row {
|
||||||
m_downloadDividerLabel,
|
m_downloadDividerLabel,
|
||||||
Space(HGapXs),
|
Space(GapHM),
|
||||||
m_downloadIconLabel,
|
m_downloadIconLabel,
|
||||||
Space(HGapXxs),
|
Space(GapHXs),
|
||||||
m_downloadCountLabel,
|
m_downloadCountLabel,
|
||||||
tight,
|
tight,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
spacing(HGapXs),
|
spacing(GapHM),
|
||||||
},
|
},
|
||||||
m_shortDescriptionLabel,
|
m_shortDescriptionLabel,
|
||||||
noMargin,
|
noMargin,
|
||||||
spacing(VGapXxs),
|
spacing(GapVXs),
|
||||||
},
|
},
|
||||||
customMargins(ExPaddingGapL, ExPaddingGapL, ExPaddingGapL, ExPaddingGapL),
|
customMargins(PaddingHL, PaddingVL, PaddingHL, PaddingVL),
|
||||||
spacing(ExPaddingGapL),
|
spacing(GapHL),
|
||||||
}.attachTo(this);
|
}.attachTo(this);
|
||||||
|
|
||||||
setFixedWidth(itemWidth);
|
setFixedWidth(itemWidth);
|
||||||
@@ -523,7 +523,7 @@ static QWidget *extensionViewPlaceHolder()
|
|||||||
using namespace Layouting;
|
using namespace Layouting;
|
||||||
// clang-format off
|
// clang-format off
|
||||||
return Column {
|
return Column {
|
||||||
Space(SpacingTokens::ExVPaddingGapXl),
|
Space(SpacingTokens::PaddingVXxl),
|
||||||
text,
|
text,
|
||||||
st,
|
st,
|
||||||
noMargin,
|
noMargin,
|
||||||
@@ -595,14 +595,14 @@ ExtensionsBrowser::ExtensionsBrowser(ExtensionsModel *model, QWidget *parent)
|
|||||||
Row {
|
Row {
|
||||||
titleLabel,
|
titleLabel,
|
||||||
settingsToolButton,
|
settingsToolButton,
|
||||||
customMargins(0, VPaddingM, rightMargin, 0),
|
customMargins(0, PaddingVXl, rightMargin, 0),
|
||||||
},
|
},
|
||||||
Row {
|
Row {
|
||||||
Column {
|
Column {
|
||||||
Row{ st, externalRepoSwitch },
|
Row{ st, externalRepoSwitch },
|
||||||
d->searchBox,
|
d->searchBox,
|
||||||
},
|
},
|
||||||
customMargins(0, VPaddingM, rightMargin, VPaddingM),
|
customMargins(0, PaddingVXl, rightMargin, PaddingVXl),
|
||||||
},
|
},
|
||||||
Row {
|
Row {
|
||||||
d->filterChooser,
|
d->filterChooser,
|
||||||
@@ -702,7 +702,7 @@ QSize ExtensionsBrowser::sizeHint() const
|
|||||||
int ExtensionsBrowser::extraListViewWidth() const
|
int ExtensionsBrowser::extraListViewWidth() const
|
||||||
{
|
{
|
||||||
// TODO: Investigate "transient" scrollbar, just for this list view.
|
// TODO: Investigate "transient" scrollbar, just for this list view.
|
||||||
constexpr int extraPadding = qMax(0, ExVPaddingGapXl - gapSize);
|
constexpr int extraPadding = qMax(0, PaddingHXxl - gapSize);
|
||||||
return d->extensionsView->style()->pixelMetric(QStyle::PM_ScrollBarExtent)
|
return d->extensionsView->style()->pixelMetric(QStyle::PM_ScrollBarExtent)
|
||||||
+ extraPadding
|
+ extraPadding
|
||||||
+ 1; // Needed
|
+ 1; // Needed
|
||||||
@@ -934,8 +934,8 @@ QPixmap itemBadge(const QModelIndex &index, [[maybe_unused]] Size size)
|
|||||||
|
|
||||||
const QFont font = badgeTF.font();
|
const QFont font = badgeTF.font();
|
||||||
const int textWidth = QFontMetrics(font).horizontalAdvance(badgeText);
|
const int textWidth = QFontMetrics(font).horizontalAdvance(badgeText);
|
||||||
const QSize badgeS(ExPaddingGapM + textWidth + ExPaddingGapM,
|
const QSize badgeS(PaddingHS + textWidth + PaddingHS,
|
||||||
ExPaddingGapS + badgeTF.lineHeight() + ExPaddingGapS);
|
PaddingVXxs + badgeTF.lineHeight() + PaddingVXxs);
|
||||||
const QRect badgeR(QPoint(), badgeS);
|
const QRect badgeR(QPoint(), badgeS);
|
||||||
const qreal dpr = qApp->devicePixelRatio();
|
const qreal dpr = qApp->devicePixelRatio();
|
||||||
QPixmap pixmap(badgeS * dpr);
|
QPixmap pixmap(badgeS * dpr);
|
||||||
|
@@ -498,7 +498,7 @@ public:
|
|||||||
Column {
|
Column {
|
||||||
Row {
|
Row {
|
||||||
m_searcher,
|
m_searcher,
|
||||||
customMargins(0, 0, ExVPaddingGapXl, 0),
|
customMargins(0, 0, PaddingVXxl, 0),
|
||||||
},
|
},
|
||||||
Grid {
|
Grid {
|
||||||
GridCell({
|
GridCell({
|
||||||
@@ -507,8 +507,8 @@ public:
|
|||||||
Align(Qt::AlignCenter, detailWdgt),
|
Align(Qt::AlignCenter, detailWdgt),
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
spacing(ExVPaddingGapXl),
|
spacing(GapVXxl),
|
||||||
customMargins(ExVPaddingGapXl, ExVPaddingGapXl, 0, 0),
|
customMargins(PaddingHXxl, PaddingVXxl, 0, 0),
|
||||||
}.attachTo(this);
|
}.attachTo(this);
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
|
@@ -233,7 +233,7 @@ void setupFetchModule()
|
|||||||
QLabel *list = new QLabel();
|
QLabel *list = new QLabel();
|
||||||
list->setTextFormat(Qt::TextFormat::MarkdownText);
|
list->setTextFormat(Qt::TextFormat::MarkdownText);
|
||||||
list->setText(markdown);
|
list->setText(markdown);
|
||||||
list->setMargin(StyleHelper::SpacingTokens::ExPaddingGapS);
|
list->setMargin(StyleHelper::SpacingTokens::PaddingVXxs);
|
||||||
return list;
|
return list;
|
||||||
});
|
});
|
||||||
entry.addCustomButton(
|
entry.addCustomButton(
|
||||||
|
@@ -398,7 +398,7 @@ void setupInstallModule()
|
|||||||
QLabel *list = new QLabel();
|
QLabel *list = new QLabel();
|
||||||
list->setTextFormat(Qt::TextFormat::MarkdownText);
|
list->setTextFormat(Qt::TextFormat::MarkdownText);
|
||||||
list->setText(details);
|
list->setText(details);
|
||||||
list->setMargin(StyleHelper::SpacingTokens::ExPaddingGapS);
|
list->setMargin(StyleHelper::SpacingTokens::PaddingVXxs);
|
||||||
return list;
|
return list;
|
||||||
});
|
});
|
||||||
ICore::infoBar()->addInfo(entry);
|
ICore::infoBar()->addInfo(entry);
|
||||||
|
@@ -63,8 +63,8 @@ constexpr TextFormat shortcutNumberTF {Theme::Token_Text_Default,
|
|||||||
StyleHelper::UiElementCaptionStrong,
|
StyleHelper::UiElementCaptionStrong,
|
||||||
Qt::AlignCenter | Qt::TextDontClip};
|
Qt::AlignCenter | Qt::TextDontClip};
|
||||||
constexpr int shortcutNumberWidth = 6;
|
constexpr int shortcutNumberWidth = 6;
|
||||||
constexpr int sessionScrollBarGap = HPaddingXs;
|
constexpr int sessionScrollBarGap = PaddingHM;
|
||||||
const int itemSpacing = VGapL;
|
const int itemSpacing = GapVM;
|
||||||
|
|
||||||
static FilePaths pathsForSession(const QString &session, QString *title = nullptr)
|
static FilePaths pathsForSession(const QString &session, QString *title = nullptr)
|
||||||
{
|
{
|
||||||
@@ -313,7 +313,7 @@ public:
|
|||||||
{
|
{
|
||||||
m_shortcut = new QLabel;
|
m_shortcut = new QLabel;
|
||||||
applyTf(m_shortcut, shortcutNumberTF, false);
|
applyTf(m_shortcut, shortcutNumberTF, false);
|
||||||
const int shortcutWidth = HPaddingXs + shortcutNumberWidth + HGapXs;
|
const int shortcutWidth = PaddingHM + shortcutNumberWidth + GapHM;
|
||||||
m_shortcut->setMinimumWidth(shortcutWidth);
|
m_shortcut->setMinimumWidth(shortcutWidth);
|
||||||
|
|
||||||
static const QPixmap icon = pixmap("session", Theme::Token_Text_Muted);
|
static const QPixmap icon = pixmap("session", Theme::Token_Text_Muted);
|
||||||
@@ -328,8 +328,8 @@ public:
|
|||||||
m_sessionNameLabel->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred);
|
m_sessionNameLabel->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred);
|
||||||
m_sessionNameLabel->setTextInteractionFlags(Qt::NoTextInteraction);
|
m_sessionNameLabel->setTextInteractionFlags(Qt::NoTextInteraction);
|
||||||
|
|
||||||
const int collapsedHeight = VPaddingXs + std::max(16, sessionNameTF.lineHeight())
|
const int collapsedHeight = PaddingVM + std::max(16, sessionNameTF.lineHeight())
|
||||||
+ VPaddingXs;
|
+ PaddingVM;
|
||||||
m_shortcut->setMinimumHeight(collapsedHeight);
|
m_shortcut->setMinimumHeight(collapsedHeight);
|
||||||
iconLabel->setMinimumHeight(collapsedHeight);
|
iconLabel->setMinimumHeight(collapsedHeight);
|
||||||
|
|
||||||
@@ -338,7 +338,7 @@ public:
|
|||||||
|
|
||||||
m_sessionType = new ElidingLabel;
|
m_sessionType = new ElidingLabel;
|
||||||
applyTf(m_sessionType, sessionTypeTF);
|
applyTf(m_sessionType, sessionTypeTF);
|
||||||
m_sessionType->setFixedHeight(m_sessionType->height() + VGapXs);
|
m_sessionType->setFixedHeight(m_sessionType->height() + GapVXs);
|
||||||
m_sessionType->setSizePolicy(m_sessionNameLabel->sizePolicy());
|
m_sessionType->setSizePolicy(m_sessionNameLabel->sizePolicy());
|
||||||
m_sessionType->setTextInteractionFlags(Qt::NoTextInteraction);
|
m_sessionType->setTextInteractionFlags(Qt::NoTextInteraction);
|
||||||
|
|
||||||
@@ -353,15 +353,15 @@ public:
|
|||||||
|
|
||||||
auto space = [] {
|
auto space = [] {
|
||||||
auto sp = new QWidget;
|
auto sp = new QWidget;
|
||||||
sp->setFixedSize(HGapXs, VGapXs);
|
sp->setFixedSize(GapHM, GapVXs);
|
||||||
return sp;
|
return sp;
|
||||||
};
|
};
|
||||||
|
|
||||||
using namespace Layouting;
|
using namespace Layouting;
|
||||||
Column paths {
|
Column paths {
|
||||||
m_sessionType,
|
m_sessionType,
|
||||||
spacing(ExPaddingGapS),
|
spacing(GapVXxs),
|
||||||
customMargins(0, 0, HPaddingXs, 0),
|
customMargins(0, 0, PaddingHM, 0),
|
||||||
};
|
};
|
||||||
for (int i = 0; i < kMaxPathsDisplay + 1; ++i) {
|
for (int i = 0; i < kMaxPathsDisplay + 1; ++i) {
|
||||||
auto pathLine = new ElidingLabel;
|
auto pathLine = new ElidingLabel;
|
||||||
@@ -387,10 +387,10 @@ public:
|
|||||||
createRule(Qt::Vertical),
|
createRule(Qt::Vertical),
|
||||||
m_delete,
|
m_delete,
|
||||||
st,
|
st,
|
||||||
spacing(ExPaddingGapM),
|
spacing(GapHS),
|
||||||
noMargin,
|
noMargin,
|
||||||
},
|
},
|
||||||
customMargins(0, VPaddingXs, 0, VPaddingXs),
|
customMargins(0, PaddingVM, 0, PaddingVM),
|
||||||
},
|
},
|
||||||
customMargins(0, 0, sessionScrollBarGap, itemSpacing),
|
customMargins(0, 0, sessionScrollBarGap, itemSpacing),
|
||||||
spacing(0),
|
spacing(0),
|
||||||
@@ -542,7 +542,7 @@ public:
|
|||||||
{
|
{
|
||||||
m_shortcut = new QLabel;
|
m_shortcut = new QLabel;
|
||||||
applyTf(m_shortcut, shortcutNumberTF, false);
|
applyTf(m_shortcut, shortcutNumberTF, false);
|
||||||
const int shortcutWidth = HPaddingXs + shortcutNumberWidth + HGapXs;
|
const int shortcutWidth = PaddingHM + shortcutNumberWidth + GapHM;
|
||||||
m_shortcut->setMinimumWidth(shortcutWidth);
|
m_shortcut->setMinimumWidth(shortcutWidth);
|
||||||
|
|
||||||
const QPixmap icon = pixmap("project", Theme::Token_Text_Muted);
|
const QPixmap icon = pixmap("project", Theme::Token_Text_Muted);
|
||||||
@@ -564,14 +564,14 @@ public:
|
|||||||
Row {
|
Row {
|
||||||
m_shortcut,
|
m_shortcut,
|
||||||
iconLabel,
|
iconLabel,
|
||||||
Space(HGapXs),
|
Space(GapHM),
|
||||||
Column {
|
Column {
|
||||||
m_projectName,
|
m_projectName,
|
||||||
m_projectPath,
|
m_projectPath,
|
||||||
customMargins(0, VPaddingXs, 0, VPaddingXs),
|
customMargins(0, PaddingVM, 0, PaddingVM),
|
||||||
spacing(VGapXs),
|
spacing(GapVXs),
|
||||||
},
|
},
|
||||||
customMargins(0, 0, HPaddingXs, 0),
|
customMargins(0, 0, PaddingHM, 0),
|
||||||
spacing(0),
|
spacing(0),
|
||||||
}.attachTo(this);
|
}.attachTo(this);
|
||||||
|
|
||||||
@@ -599,7 +599,7 @@ public:
|
|||||||
const bool hovered = option.widget->isActiveWindow()
|
const bool hovered = option.widget->isActiveWindow()
|
||||||
&& option.state & QStyle::State_MouseOver;
|
&& option.state & QStyle::State_MouseOver;
|
||||||
|
|
||||||
const QRect bgRGlobal = option.rect.adjusted(0, 0, -HPaddingXs, -itemSpacing);
|
const QRect bgRGlobal = option.rect.adjusted(0, 0, -PaddingHM, -itemSpacing);
|
||||||
const QRect bgR = bgRGlobal.translated(-option.rect.topLeft());
|
const QRect bgR = bgRGlobal.translated(-option.rect.topLeft());
|
||||||
|
|
||||||
QFont projectNameFont = m_projectName->font();
|
QFont projectNameFont = m_projectName->font();
|
||||||
@@ -744,11 +744,11 @@ public:
|
|||||||
sessionsLabel,
|
sessionsLabel,
|
||||||
st,
|
st,
|
||||||
manageSessionsButton,
|
manageSessionsButton,
|
||||||
customMargins(HPaddingS, 0, sessionScrollBarGap, 0),
|
customMargins(PaddingHXl, 0, sessionScrollBarGap, 0),
|
||||||
},
|
},
|
||||||
m_sessionList,
|
m_sessionList,
|
||||||
spacing(ExPaddingGapL),
|
spacing(GapVL),
|
||||||
customMargins(ExVPaddingGapXl, ExVPaddingGapXl, 0, 0),
|
customMargins(PaddingHXxl, PaddingVXxl, 0, 0),
|
||||||
}.attachTo(sessions);
|
}.attachTo(sessions);
|
||||||
connect(manageSessionsButton, &QtcButton::clicked,
|
connect(manageSessionsButton, &QtcButton::clicked,
|
||||||
this, &SessionManager::showSessionManager);
|
this, &SessionManager::showSessionManager);
|
||||||
@@ -770,11 +770,11 @@ public:
|
|||||||
Column {
|
Column {
|
||||||
Row {
|
Row {
|
||||||
projectsLabel,
|
projectsLabel,
|
||||||
customMargins(HPaddingS, 0, 0, 0),
|
customMargins(PaddingHXl, 0, 0, 0),
|
||||||
},
|
},
|
||||||
projectsList,
|
projectsList,
|
||||||
spacing(ExPaddingGapL),
|
spacing(GapVL),
|
||||||
customMargins(ExVPaddingGapXl - sessionScrollBarGap, ExVPaddingGapXl, 0, 0),
|
customMargins(PaddingHXxl - sessionScrollBarGap, PaddingVXxl, 0, 0),
|
||||||
}.attachTo(projects);
|
}.attachTo(projects);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -252,7 +252,7 @@ protected:
|
|||||||
painter->setCompositionMode(QPainter::CompositionMode_Difference);
|
painter->setCompositionMode(QPainter::CompositionMode_Difference);
|
||||||
painter->setPen(Qt::white);
|
painter->setPen(Qt::white);
|
||||||
painter->drawText(
|
painter->drawText(
|
||||||
currentPixmapRect.translated(0, -StyleHelper::SpacingTokens::VPaddingXxs),
|
currentPixmapRect.translated(0, -StyleHelper::SpacingTokens::PaddingVXs),
|
||||||
exampleItem->videoLength, Qt::AlignBottom | Qt::AlignHCenter);
|
exampleItem->videoLength, Qt::AlignBottom | Qt::AlignHCenter);
|
||||||
painter->restore();
|
painter->restore();
|
||||||
static const QPixmap playOverlay =
|
static const QPixmap playOverlay =
|
||||||
@@ -280,8 +280,8 @@ public:
|
|||||||
using namespace StyleHelper::SpacingTokens;
|
using namespace StyleHelper::SpacingTokens;
|
||||||
using namespace Layouting;
|
using namespace Layouting;
|
||||||
Row titleRow {
|
Row titleRow {
|
||||||
customMargins(0, 0, ExVPaddingGapXl, 0),
|
customMargins(0, 0, PaddingHXxl, 0),
|
||||||
spacing(ExVPaddingGapXl),
|
spacing(GapHXxl),
|
||||||
};
|
};
|
||||||
|
|
||||||
m_searcher = new QtcSearchBox;
|
m_searcher = new QtcSearchBox;
|
||||||
@@ -291,7 +291,7 @@ public:
|
|||||||
auto exampleSetSelector = new QtcComboBox;
|
auto exampleSetSelector = new QtcComboBox;
|
||||||
exampleSetSelector->setSizeAdjustPolicy(QComboBox::AdjustToContents);
|
exampleSetSelector->setSizeAdjustPolicy(QComboBox::AdjustToContents);
|
||||||
exampleSetSelector->setMinimumWidth(ListItemDelegate::itemSize().width()
|
exampleSetSelector->setMinimumWidth(ListItemDelegate::itemSize().width()
|
||||||
- ExVPaddingGapXl);
|
- PaddingVXxl);
|
||||||
exampleSetSelector->setModel(s_exampleSetModel);
|
exampleSetSelector->setModel(s_exampleSetModel);
|
||||||
exampleSetSelector->setCurrentIndex(s_exampleSetModel->selectedExampleSet());
|
exampleSetSelector->setCurrentIndex(s_exampleSetModel->selectedExampleSet());
|
||||||
titleRow.addItem(exampleSetSelector);
|
titleRow.addItem(exampleSetSelector);
|
||||||
@@ -317,8 +317,8 @@ public:
|
|||||||
Column {
|
Column {
|
||||||
titleRow,
|
titleRow,
|
||||||
gridView,
|
gridView,
|
||||||
spacing(ExVPaddingGapXl),
|
spacing(GapVXxl),
|
||||||
customMargins(ExVPaddingGapXl, ExVPaddingGapXl, 0, 0),
|
customMargins(PaddingHXxl, PaddingVXxl, 0, 0),
|
||||||
}.attachTo(this);
|
}.attachTo(this);
|
||||||
|
|
||||||
connect(&m_exampleDelegate, &ExampleDelegate::tagClicked,
|
connect(&m_exampleDelegate, &ExampleDelegate::tagClicked,
|
||||||
|
@@ -63,7 +63,7 @@ public:
|
|||||||
setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
|
setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
|
||||||
|
|
||||||
m_pluginButtons = new QHBoxLayout;
|
m_pluginButtons = new QHBoxLayout;
|
||||||
m_pluginButtons->setSpacing(VGapL);
|
m_pluginButtons->setSpacing(GapVM);
|
||||||
m_pluginButtons->setContentsMargins({});
|
m_pluginButtons->setContentsMargins({});
|
||||||
|
|
||||||
auto newButton = new QtcButton(Tr::tr("Create Project..."), QtcButton::LargePrimary);
|
auto newButton = new QtcButton(Tr::tr("Create Project..."), QtcButton::LargePrimary);
|
||||||
@@ -76,8 +76,8 @@ public:
|
|||||||
st,
|
st,
|
||||||
newButton,
|
newButton,
|
||||||
openButton,
|
openButton,
|
||||||
spacing(HGapM),
|
spacing(GapHXl),
|
||||||
customMargins(HPaddingM, VPaddingM, HPaddingM, VPaddingM),
|
customMargins(PaddingHXxl, PaddingVXl, PaddingHXxl, PaddingVXl),
|
||||||
},
|
},
|
||||||
createRule(Qt::Horizontal),
|
createRule(Qt::Horizontal),
|
||||||
noMargin, spacing(0),
|
noMargin, spacing(0),
|
||||||
|
Reference in New Issue
Block a user