forked from qt-creator/qt-creator
Fix image border for examples browser
It was made smaller for the tutorials to fit the new aspect ratio for
their images, but we may not do that for the examples.
Fixup for 7d83472906
Task-number: QTCREATORBUG-20078
Change-Id: I556536a7e299e8f675332cd7450ece5fca6fab0a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -440,6 +440,7 @@ public:
|
||||
QRect pixmapRect = inner;
|
||||
if (!pm.isNull()) {
|
||||
painter->setPen(foregroundColor2);
|
||||
if (!m_showExamples)
|
||||
pixmapRect = inner.adjusted(6, 20, -6, -15);
|
||||
QPoint pixmapPos = pixmapRect.center();
|
||||
pixmapPos.rx() -= pm.width() / pm.devicePixelRatio() / 2;
|
||||
@@ -560,6 +561,8 @@ public:
|
||||
return QAbstractItemDelegate::editorEvent(ev, model, option, idx);
|
||||
}
|
||||
|
||||
void setShowExamples(bool showExamples) { m_showExamples = showExamples; goon(); }
|
||||
|
||||
signals:
|
||||
void tagClicked(const QString &tag);
|
||||
|
||||
@@ -575,6 +578,7 @@ private:
|
||||
mutable QPointer<QAbstractItemView> m_currentWidget;
|
||||
mutable QVector<QPair<QString, QRect>> m_currentTagRects;
|
||||
mutable QPixmapCache m_pixmapCache;
|
||||
bool m_showExamples = true;
|
||||
};
|
||||
|
||||
class ExamplesPageWidget : public QWidget
|
||||
@@ -583,6 +587,7 @@ public:
|
||||
ExamplesPageWidget(bool isExamples)
|
||||
: m_isExamples(isExamples)
|
||||
{
|
||||
m_exampleDelegate.setShowExamples(isExamples);
|
||||
const int sideMargin = 27;
|
||||
static ExamplesListModel *s_examplesModel = new ExamplesListModel(this);
|
||||
m_examplesModel = s_examplesModel;
|
||||
|
Reference in New Issue
Block a user