diff options
author | Eike Ziller <eike.ziller@qt.io> | 2018-03-15 13:53:01 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2018-03-15 13:54:08 +0000 |
commit | 454c7f83ff660fafa77488a4d33a020b9982f1cc (patch) | |
tree | e6ce610e60c050d2debb233cd662a331ede79e51 /src | |
parent | da2c66b1d0f0bf868f4ec88c7e61a57fd1095366 (diff) |
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 7d834729065668
Task-number: QTCREATORBUG-20078
Change-Id: I556536a7e299e8f675332cd7450ece5fca6fab0a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/qtsupport/gettingstartedwelcomepage.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp index 156c956ad5..0413e5c505 100644 --- a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp +++ b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp @@ -440,7 +440,8 @@ public: QRect pixmapRect = inner; if (!pm.isNull()) { painter->setPen(foregroundColor2); - pixmapRect = inner.adjusted(6, 20, -6, -15); + if (!m_showExamples) + pixmapRect = inner.adjusted(6, 20, -6, -15); QPoint pixmapPos = pixmapRect.center(); pixmapPos.rx() -= pm.width() / pm.devicePixelRatio() / 2; pixmapPos.ry() -= pm.height() / 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; |