From 454c7f83ff660fafa77488a4d33a020b9982f1cc Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 15 Mar 2018 13:53:01 +0100 Subject: [PATCH] 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 --- src/plugins/qtsupport/gettingstartedwelcomepage.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/qtsupport/gettingstartedwelcomepage.cpp b/src/plugins/qtsupport/gettingstartedwelcomepage.cpp index 156c956ad54..0413e5c5059 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 m_currentWidget; mutable QVector> 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;