Utils: Unify and simplify Details(Button|Widget) and ExpandButton

This replaces lots of custom painting/animating code with a simplified
implementation and cross-platform visual unification.

Task-number: QTCREATORBUG-27801
Change-Id: I18b12e8c7f0bba4ba5d8a05271ab1e757769dc5f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Alessandro Portale
2022-09-02 21:56:00 +02:00
parent 4e88a8a6f7
commit 74f5ad6583
15 changed files with 56 additions and 341 deletions

View File

@@ -399,11 +399,6 @@ ToolBarIconShadow=true
WindowColorAsBase=false WindowColorAsBase=false
DarkUserInterface=true DarkUserInterface=true
[Gradients]
DetailsWidgetHeaderGradient\1\color=00000000
DetailsWidgetHeaderGradient\1\pos=1
DetailsWidgetHeaderGradient\size=1
[ImageFiles] [ImageFiles]
IconOverlayCSource=:/cppeditor/images/dark_qt_c.png IconOverlayCSource=:/cppeditor/images/dark_qt_c.png
IconOverlayCppHeader=:/cppeditor/images/dark_qt_h.png IconOverlayCppHeader=:/cppeditor/images/dark_qt_h.png

View File

@@ -366,8 +366,3 @@ FlatMenuBar=false
ToolBarIconShadow=true ToolBarIconShadow=true
WindowColorAsBase=false WindowColorAsBase=false
DarkUserInterface=false DarkUserInterface=false
[Gradients]
DetailsWidgetHeaderGradient\1\color=ffffffff
DetailsWidgetHeaderGradient\1\pos=1
DetailsWidgetHeaderGradient\size=1

View File

@@ -410,8 +410,3 @@ FlatMenuBar=true
ToolBarIconShadow=false ToolBarIconShadow=false
WindowColorAsBase=false WindowColorAsBase=false
DarkUserInterface=false DarkUserInterface=false
[Gradients]
DetailsWidgetHeaderGradient\1\color=00000000
DetailsWidgetHeaderGradient\1\pos=1
DetailsWidgetHeaderGradient\size=1

View File

@@ -510,8 +510,3 @@ FlatMenuBar=true
ToolBarIconShadow=true ToolBarIconShadow=true
WindowColorAsBase=false WindowColorAsBase=false
DarkUserInterface=true DarkUserInterface=true
[Gradients]
DetailsWidgetHeaderGradient\1\color=00000000
DetailsWidgetHeaderGradient\1\pos=1
DetailsWidgetHeaderGradient\size=1

View File

@@ -402,8 +402,3 @@ FlatMenuBar=true
ToolBarIconShadow=true ToolBarIconShadow=true
WindowColorAsBase=false WindowColorAsBase=false
DarkUserInterface=true DarkUserInterface=true
[Gradients]
DetailsWidgetHeaderGradient\1\color=00000000
DetailsWidgetHeaderGradient\1\pos=1
DetailsWidgetHeaderGradient\size=1

View File

@@ -375,8 +375,3 @@ FlatMenuBar=false
ToolBarIconShadow=false ToolBarIconShadow=false
WindowColorAsBase=false WindowColorAsBase=false
DarkUserInterface=false DarkUserInterface=false
[Gradients]
DetailsWidgetHeaderGradient\1\color=00000000
DetailsWidgetHeaderGradient\1\pos=1
DetailsWidgetHeaderGradient\size=1

View File

@@ -373,8 +373,3 @@ FlatMenuBar=false
ToolBarIconShadow=true ToolBarIconShadow=true
WindowColorAsBase=false WindowColorAsBase=false
DarkUserInterface=false DarkUserInterface=false
[Gradients]
DetailsWidgetHeaderGradient\1\color=00000000
DetailsWidgetHeaderGradient\1\pos=1
DetailsWidgetHeaderGradient\size=1

View File

@@ -3,8 +3,8 @@
#include "detailsbutton.h" #include "detailsbutton.h"
#include "hostosinfo.h" #include <utils/hostosinfo.h>
#include "theme/theme.h" #include <utils/icon.h>
#include <QGraphicsOpacityEffect> #include <QGraphicsOpacityEffect>
#include <QPropertyAnimation> #include <QPropertyAnimation>
@@ -12,6 +12,8 @@
#include <QPainter> #include <QPainter>
#include <QStyleOption> #include <QStyleOption>
#include <qdrawutil.h>
using namespace Utils; using namespace Utils;
FadingWidget::FadingWidget(QWidget *parent) : FadingWidget::FadingWidget(QWidget *parent) :
@@ -47,200 +49,52 @@ qreal FadingWidget::opacity()
return m_opacityEffect->opacity(); return m_opacityEffect->opacity();
} }
DetailsButton::DetailsButton(QWidget *parent) : QAbstractButton(parent), m_fader(0) ExpandButton::ExpandButton(QWidget *parent)
: QToolButton(parent)
{ {
setCheckable(true); setCheckable(true);
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum); auto updateArrow = [this] (bool checked) {
static const QIcon expand =
Icon({{":/utils/images/arrowdown.png", Theme::PanelTextColorDark}}, Icon::Tint).icon();
static const QIcon collapse =
Icon({{":/utils/images/arrowup.png", Theme::PanelTextColorDark}}, Icon::Tint).icon();
setIcon(checked ? collapse : expand);
};
updateArrow(false);
connect(this, &QToolButton::toggled, this, updateArrow);
}
DetailsButton::DetailsButton(QWidget *parent)
: ExpandButton(parent)
{
setText(tr("Details")); setText(tr("Details"));
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum);
} }
QSize DetailsButton::sizeHint() const QSize DetailsButton::sizeHint() const
{ {
// TODO: Adjust this when icons become available! const QSize textSize = fontMetrics().size(Qt::TextSingleLine, text());
const int w = fontMetrics().horizontalAdvance(text()) + 32; return QSize(spacing + textSize.width() + spacing + 16 + spacing,
if (HostOsInfo::isMacHost()) spacing + fontMetrics().height() + spacing);
return QSize(w, 34);
return QSize(w, 22);
}
bool DetailsButton::event(QEvent *e)
{
switch (e->type()) {
case QEvent::Enter:
{
QPropertyAnimation *animation = new QPropertyAnimation(this, "fader");
animation->setDuration(200);
animation->setEndValue(1.0);
animation->start(QAbstractAnimation::DeleteWhenStopped);
}
break;
case QEvent::Leave:
{
QPropertyAnimation *animation = new QPropertyAnimation(this, "fader");
animation->setDuration(200);
animation->setEndValue(0.0);
animation->start(QAbstractAnimation::DeleteWhenStopped);
}
break;
default:
return QAbstractButton::event(e);
}
return false;
}
void DetailsButton::changeEvent(QEvent *e)
{
if (e->type() == QEvent::EnabledChange) {
m_checkedPixmap = QPixmap();
m_uncheckedPixmap = QPixmap();
}
} }
void DetailsButton::paintEvent(QPaintEvent *e) void DetailsButton::paintEvent(QPaintEvent *e)
{ {
QWidget::paintEvent(e); Q_UNUSED(e)
QPainter p(this); QPainter p(this);
if (isChecked() || (!HostOsInfo::isMacHost() && underMouse())) {
// draw hover animation p.save();
if (!HostOsInfo::isMacHost() && !isDown() && m_fader > 0) { p.setOpacity(0.125);
QColor c = creatorTheme()->color(Theme::DetailsButtonBackgroundColorHover); p.fillRect(rect(), palette().color(QPalette::Text));
c.setAlpha (int(m_fader * c.alpha())); p.restore();
QRect r = rect();
if (!creatorTheme()->flag(Theme::FlatProjectsMode))
r.adjust(1, 1, -2, -2);
p.fillRect(r, c);
} }
if (isChecked()) { if (!creatorTheme()->flag(Theme::FlatProjectsMode))
if (m_checkedPixmap.isNull() || m_checkedPixmap.size() / m_checkedPixmap.devicePixelRatio() != contentsRect().size()) qDrawPlainRect(&p, rect(), palette().color(QPalette::Mid));
m_checkedPixmap = cacheRendering(contentsRect().size(), true);
p.drawPixmap(contentsRect(), m_checkedPixmap);
} else {
if (m_uncheckedPixmap.isNull() || m_uncheckedPixmap.size() / m_uncheckedPixmap.devicePixelRatio() != contentsRect().size())
m_uncheckedPixmap = cacheRendering(contentsRect().size(), false);
p.drawPixmap(contentsRect(), m_uncheckedPixmap);
}
if (isDown()) {
p.setPen(Qt::NoPen);
p.setBrush(QColor(0, 0, 0, 20));
p.drawRoundedRect(rect().adjusted(1, 1, -1, -1), 1, 1);
}
if (hasFocus()) {
QStyleOptionFocusRect option;
option.initFrom(this);
style()->drawPrimitive(QStyle::PE_FrameFocusRect, &option, &p, this);
}
}
QPixmap DetailsButton::cacheRendering(const QSize &size, bool checked)
{
const qreal pixelRatio = devicePixelRatio();
QPixmap pixmap(size * pixelRatio);
pixmap.setDevicePixelRatio(pixelRatio);
pixmap.fill(Qt::transparent);
QPainter p(&pixmap);
p.setRenderHint(QPainter::Antialiasing, true);
p.translate(0.5, 0.5);
if (!creatorTheme()->flag(Theme::FlatProjectsMode)) {
QLinearGradient lg;
lg.setCoordinateMode(QGradient::ObjectBoundingMode);
lg.setFinalStop(0, 1);
if (!checked) {
lg.setColorAt(0, QColor(0, 0, 0, 10));
lg.setColorAt(1, QColor(0, 0, 0, 16));
} else {
lg.setColorAt(0, QColor(255, 255, 255, 0));
lg.setColorAt(1, QColor(255, 255, 255, 50));
}
p.setBrush(lg);
p.setPen(QColor(255,255,255,140));
p.drawRoundedRect(1, 1, size.width()-3, size.height()-3, 1, 1);
p.setPen(QPen(QColor(0, 0, 0, 40)));
p.drawLine(0, 1, 0, size.height() - 2);
if (checked)
p.drawLine(1, size.height() - 1, size.width() - 1, size.height() - 1);
} else {
p.setPen(Qt::NoPen);
p.drawRoundedRect(0, 0, size.width(), size.height(), 1, 1);
}
p.setPen(palette().color(QPalette::Text));
QRect textRect = p.fontMetrics().boundingRect(text());
textRect.setWidth(textRect.width() + 15);
textRect.setHeight(textRect.height() + 4);
textRect.moveCenter(rect().center());
const QRect textRect(spacing, 0, width(), height());
p.drawText(textRect, Qt::AlignLeft | Qt::AlignVCenter, text()); p.drawText(textRect, Qt::AlignLeft | Qt::AlignVCenter, text());
const QRect iconRect(width() - spacing - 16, 0, 16, height());
int arrowsize = 15; icon().paint(&p, iconRect);
QStyleOption arrowOpt;
arrowOpt.initFrom(this);
QPalette pal = arrowOpt.palette;
pal.setBrush(QPalette::All, QPalette::Text, QColor(0, 0, 0));
arrowOpt.rect = QRect(size.width() - arrowsize - 6, height()/2-arrowsize/2, arrowsize, arrowsize);
arrowOpt.palette = pal;
style()->drawPrimitive(checked ? QStyle::PE_IndicatorArrowUp : QStyle::PE_IndicatorArrowDown, &arrowOpt, &p, this);
return pixmap;
}
ExpandButton::ExpandButton(QWidget *parent) : QAbstractButton(parent)
{
setCheckable(true);
setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum);
}
QSize ExpandButton::sizeHint() const
{
return {fontMetrics().horizontalAdvance(text()) + 26, HostOsInfo::isMacHost() ? 34 : 22};
}
void ExpandButton::paintEvent(QPaintEvent *e)
{
QWidget::paintEvent(e);
QPainter p(this);
QPixmap &pixmap = isChecked() ? m_checkedPixmap : m_uncheckedPixmap;
if (pixmap.isNull() || pixmap.size() / pixmap.devicePixelRatio() != contentsRect().size())
pixmap = cacheRendering();
p.drawPixmap(contentsRect(), pixmap);
if (isDown()) {
p.setPen(Qt::NoPen);
p.setBrush(QColor(0, 0, 0, 20));
p.drawRoundedRect(rect().adjusted(1, 1, -1, -1), 1, 1);
}
if (hasFocus()) {
QStyleOptionFocusRect option;
option.initFrom(this);
style()->drawPrimitive(QStyle::PE_FrameFocusRect, &option, &p, this);
}
}
QPixmap ExpandButton::cacheRendering()
{
const QSize size = contentsRect().size();
const qreal pixelRatio = devicePixelRatio();
QPixmap pixmap(size * pixelRatio);
pixmap.setDevicePixelRatio(pixelRatio);
pixmap.fill(Qt::transparent);
QPainter p(&pixmap);
p.setRenderHint(QPainter::Antialiasing, true);
p.translate(0.5, 0.5);
p.setPen(Qt::NoPen);
p.drawRoundedRect(0, 0, size.width(), size.height(), 1, 1);
int arrowsize = 15;
QStyleOption arrowOpt;
arrowOpt.initFrom(this);
QPalette pal = arrowOpt.palette;
pal.setBrush(QPalette::All, QPalette::Text, QColor(0, 0, 0));
arrowOpt.rect = QRect(size.width() - arrowsize - 6, height() / 2 - arrowsize / 2,
arrowsize, arrowsize);
arrowOpt.palette = pal;
style()->drawPrimitive(isChecked() ? QStyle::PE_IndicatorArrowUp
: QStyle::PE_IndicatorArrowDown, &arrowOpt, &p, this);
return pixmap;
} }

View File

@@ -5,7 +5,7 @@
#include "utils_global.h" #include "utils_global.h"
#include <QAbstractButton> #include <QToolButton>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QGraphicsOpacityEffect; class QGraphicsOpacityEffect;
@@ -36,45 +36,21 @@ protected:
QGraphicsOpacityEffect *m_opacityEffect; QGraphicsOpacityEffect *m_opacityEffect;
}; };
class QTCREATOR_UTILS_EXPORT DetailsButton : public QAbstractButton class QTCREATOR_UTILS_EXPORT ExpandButton : public QToolButton
{ {
Q_OBJECT
Q_PROPERTY(float fader READ fader WRITE setFader)
public:
DetailsButton(QWidget *parent = nullptr);
QSize sizeHint() const override;
float fader() { return m_fader; }
void setFader(float value) { m_fader = value; update(); }
protected:
void paintEvent(QPaintEvent *e) override;
bool event(QEvent *e) override;
void changeEvent(QEvent *e) override;
private:
QPixmap cacheRendering(const QSize &size, bool checked);
QPixmap m_checkedPixmap;
QPixmap m_uncheckedPixmap;
float m_fader;
};
class QTCREATOR_UTILS_EXPORT ExpandButton : public QAbstractButton
{
Q_OBJECT
public: public:
ExpandButton(QWidget *parent = nullptr); ExpandButton(QWidget *parent = nullptr);
};
class QTCREATOR_UTILS_EXPORT DetailsButton : public ExpandButton
{
public:
DetailsButton(QWidget *parent = nullptr);
QSize sizeHint() const override;
private: private:
void paintEvent(QPaintEvent *e) override; void paintEvent(QPaintEvent *e) override;
QSize sizeHint() const override; const int spacing = 6;
QPixmap cacheRendering();
QPixmap m_checkedPixmap;
QPixmap m_uncheckedPixmap;
}; };
} // namespace Utils } // namespace Utils

View File

@@ -5,6 +5,7 @@
#include "detailsbutton.h" #include "detailsbutton.h"
#include "hostosinfo.h" #include "hostosinfo.h"
#include "stylehelper.h"
#include "theme/theme.h" #include "theme/theme.h"
#include <QGridLayout> #include <QGridLayout>
@@ -15,6 +16,8 @@
#include <QApplication> #include <QApplication>
#include <QStyle> #include <QStyle>
#include <qdrawutil.h>
/*! /*!
\class Utils::DetailsWidget \class Utils::DetailsWidget
@@ -57,9 +60,6 @@ public:
FadingPanel *m_toolWidget; FadingPanel *m_toolWidget;
QWidget *m_widget; QWidget *m_widget;
QPixmap m_collapsedPixmap;
QPixmap m_expandedPixmap;
DetailsWidget::State m_state; DetailsWidget::State m_state;
bool m_hovered; bool m_hovered;
bool m_useCheckBox; bool m_useCheckBox;
@@ -112,37 +112,6 @@ DetailsWidgetPrivate::DetailsWidgetPrivate(QWidget *parent) :
m_grid->addWidget(m_additionalSummaryLabel, 1, 0, 1, 3); m_grid->addWidget(m_additionalSummaryLabel, 1, 0, 1, 3);
} }
QPixmap DetailsWidget::createBackground(const QSize &size, int topHeight, QWidget *widget)
{
QPixmap pixmap(size);
pixmap.fill(Qt::transparent);
QPainter p(&pixmap);
QRect topRect(0, 0, size.width(), topHeight);
QRect fullRect(0, 0, size.width(), size.height());
if (HostOsInfo::isMacHost())
p.fillRect(fullRect, QApplication::palette().window().color());
else
p.fillRect(fullRect, creatorTheme()->color(Theme::DetailsWidgetBackgroundColor));
if (!creatorTheme()->flag(Theme::FlatProjectsMode)) {
QLinearGradient lg(topRect.topLeft(), topRect.bottomLeft());
lg.setStops(creatorTheme()->gradient(Theme::DetailsWidgetHeaderGradient));
p.fillRect(topRect, lg);
p.setRenderHint(QPainter::Antialiasing, true);
p.translate(0.5, 0.5);
p.setPen(QColor(0, 0, 0, 40));
p.setBrush(Qt::NoBrush);
p.drawRoundedRect(fullRect.adjusted(0, 0, -1, -1), 2, 2);
p.setBrush(Qt::NoBrush);
p.setPen(QColor(255,255,255,140));
p.drawRoundedRect(fullRect.adjusted(1, 1, -2, -2), 2, 2);
p.setPen(QPen(widget->palette().color(QPalette::Mid)));
}
return pixmap;
}
void DetailsWidgetPrivate::updateControls() void DetailsWidgetPrivate::updateControls()
{ {
if (m_widget) if (m_widget)
@@ -248,27 +217,14 @@ void DetailsWidget::paintEvent(QPaintEvent *paintEvent)
{ {
QWidget::paintEvent(paintEvent); QWidget::paintEvent(paintEvent);
const QColor bgColor = creatorTheme()->flag(Theme::FlatProjectsMode) ?
creatorTheme()->color(Theme::DetailsWidgetBackgroundColor)
: palette().color(QPalette::Window);
QPainter p(this); QPainter p(this);
p.fillRect(rect(), bgColor);
QWidget *topLeftWidget = d->m_useCheckBox ? static_cast<QWidget *>(d->m_summaryCheckBox) : static_cast<QWidget *>(d->m_summaryLabelIcon); if (!creatorTheme()->flag(Theme::FlatProjectsMode))
QPoint topLeft(topLeftWidget->geometry().left() - MARGIN, contentsRect().top()); qDrawPlainRect(&p, rect(), palette().color(QPalette::Mid));
const QRect paintArea(topLeft, contentsRect().bottomRight());
int topHeight = d->m_useCheckBox ? d->m_summaryCheckBox->height() : d->m_summaryLabel->height();
if (d->m_state == DetailsWidget::Expanded || d->m_state == DetailsWidget::Collapsed) // Details Button is shown
topHeight = qMax(d->m_detailsButton->height(), topHeight);
if (d->m_state == Collapsed) {
if (d->m_collapsedPixmap.isNull() ||
d->m_collapsedPixmap.size() != size())
d->m_collapsedPixmap = createBackground(paintArea.size(), topHeight, this);
p.drawPixmap(paintArea, d->m_collapsedPixmap);
} else {
if (d->m_expandedPixmap.isNull() ||
d->m_expandedPixmap.size() != size())
d->m_expandedPixmap = createBackground(paintArea.size(), topHeight, this);
p.drawPixmap(paintArea, d->m_expandedPixmap);
}
} }
void DetailsWidget::enterEvent(QEnterEvent *event) void DetailsWidget::enterEvent(QEnterEvent *event)

View File

@@ -60,8 +60,6 @@ public:
void setExpandable(bool b); void setExpandable(bool b);
void setIcon(const QIcon &icon); void setIcon(const QIcon &icon);
static QPixmap createBackground(const QSize &size, int topHeight, QWidget *widget);
signals: signals:
void checked(bool); void checked(bool);
void linkActivated(const QString &link); void linkActivated(const QString &link);

View File

@@ -25,7 +25,6 @@ ThemePrivate::ThemePrivate()
const QMetaObject &m = Theme::staticMetaObject; const QMetaObject &m = Theme::staticMetaObject;
colors.resize (m.enumerator(m.indexOfEnumerator("Color")).keyCount()); colors.resize (m.enumerator(m.indexOfEnumerator("Color")).keyCount());
imageFiles.resize (m.enumerator(m.indexOfEnumerator("ImageFile")).keyCount()); imageFiles.resize (m.enumerator(m.indexOfEnumerator("ImageFile")).keyCount());
gradients.resize (m.enumerator(m.indexOfEnumerator("Gradient")).keyCount());
flags.resize (m.enumerator(m.indexOfEnumerator("Flag")).keyCount()); flags.resize (m.enumerator(m.indexOfEnumerator("Flag")).keyCount());
} }
@@ -132,11 +131,6 @@ QString Theme::imageFile(Theme::ImageFile imageFile, const QString &fallBack) co
return file.isEmpty() ? fallBack : file; return file.isEmpty() ? fallBack : file;
} }
QGradientStops Theme::gradient(Theme::Gradient role) const
{
return d->gradients[role];
}
QPair<QColor, QString> Theme::readNamedColor(const QString &color) const QPair<QColor, QString> Theme::readNamedColor(const QString &color) const
{ {
if (d->palette.contains(color)) if (d->palette.contains(color))
@@ -210,26 +204,6 @@ void Theme::readSettings(QSettings &settings)
} }
settings.endGroup(); settings.endGroup();
} }
{
settings.beginGroup(QLatin1String("Gradients"));
QMetaEnum e = m.enumerator(m.indexOfEnumerator("Gradient"));
for (int i = 0, total = e.keyCount(); i < total; ++i) {
const QString key = QLatin1String(e.key(i));
QGradientStops stops;
int size = settings.beginReadArray(key);
for (int j = 0; j < size; ++j) {
settings.setArrayIndex(j);
QTC_ASSERT(settings.contains(QLatin1String("pos")), return);
const double pos = settings.value(QLatin1String("pos")).toDouble();
QTC_ASSERT(settings.contains(QLatin1String("color")), return);
const QColor c('#' + settings.value(QLatin1String("color")).toString());
stops.append(qMakePair(pos, c));
}
settings.endArray();
d->gradients[i] = stops;
}
settings.endGroup();
}
{ {
settings.beginGroup(QLatin1String("Flags")); settings.beginGroup(QLatin1String("Flags"));
QMetaEnum e = m.enumerator(m.indexOfEnumerator("Flag")); QMetaEnum e = m.enumerator(m.indexOfEnumerator("Flag"));

View File

@@ -418,10 +418,6 @@ public:
DSredLight, DSredLight,
}; };
enum Gradient {
DetailsWidgetHeaderGradient,
};
enum ImageFile { enum ImageFile {
IconOverlayCSource, IconOverlayCSource,
IconOverlayCppHeader, IconOverlayCppHeader,
@@ -453,13 +449,11 @@ public:
Q_ENUM(Color) Q_ENUM(Color)
Q_ENUM(ImageFile) Q_ENUM(ImageFile)
Q_ENUM(Gradient)
Q_ENUM(Flag) Q_ENUM(Flag)
Q_INVOKABLE bool flag(Utils::Theme::Flag f) const; Q_INVOKABLE bool flag(Utils::Theme::Flag f) const;
Q_INVOKABLE QColor color(Utils::Theme::Color role) const; Q_INVOKABLE QColor color(Utils::Theme::Color role) const;
QString imageFile(ImageFile imageFile, const QString &fallBack) const; QString imageFile(ImageFile imageFile, const QString &fallBack) const;
QGradientStops gradient(Gradient role) const;
QPalette palette() const; QPalette palette() const;
QStringList preferredStyles() const; QStringList preferredStyles() const;
QString defaultTextEditorColorScheme() const; QString defaultTextEditorColorScheme() const;

View File

@@ -24,7 +24,6 @@ public:
QString defaultTextEditorColorScheme; QString defaultTextEditorColorScheme;
QVector<QPair<QColor, QString> > colors; QVector<QPair<QColor, QString> > colors;
QVector<QString> imageFiles; QVector<QString> imageFiles;
QVector<QGradientStops> gradients;
QVector<bool> flags; QVector<bool> flags;
QMap<QString, QColor> palette; QMap<QString, QColor> palette;
}; };

View File

@@ -158,7 +158,7 @@ BuildStepsWidgetData::BuildStepsWidgetData(BuildStep *s) :
toolWidget->setBuildStepEnabled(step->enabled()); toolWidget->setBuildStepEnabled(step->enabled());
detailsWidget->setToolWidget(toolWidget); detailsWidget->setToolWidget(toolWidget);
detailsWidget->setContentsMargins(0, 0, 0, 1); detailsWidget->setContentsMargins(0, 0, 0, 0);
detailsWidget->setSummaryText(s->summaryText()); detailsWidget->setSummaryText(s->summaryText());
} }
@@ -284,7 +284,6 @@ void BuildStepListWidget::setupUi()
m_vbox = new QVBoxLayout(this); m_vbox = new QVBoxLayout(this);
m_vbox->setContentsMargins(0, 0, 0, 0); m_vbox->setContentsMargins(0, 0, 0, 0);
m_vbox->setSpacing(0);
m_noStepsLabel = new QLabel(tr("No Build Steps"), this); m_noStepsLabel = new QLabel(tr("No Build Steps"), this);
m_noStepsLabel->setContentsMargins(0, 0, 0, 0); m_noStepsLabel->setContentsMargins(0, 0, 0, 0);