diff options
author | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2018-09-06 16:37:04 +0300 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2018-09-07 09:49:57 +0000 |
commit | c98602a58d1e44730b725808f797335e4ab7a68a (patch) | |
tree | 88c1865df68b49368076bcb6333b634fc52d8205 /src/Authoring/Studio/Palettes | |
parent | f9bd115539b9db0506013011947f62aa7ae0e11e (diff) |
Make space between datainput icon and controller name equal everywhere
Task-number: QT3DS-2270
Change-Id: Ia32fe39341d62302199f77794a23cb2f9540bae5
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Diffstat (limited to 'src/Authoring/Studio/Palettes')
3 files changed, 6 insertions, 5 deletions
diff --git a/src/Authoring/Studio/Palettes/Slide/SlideView.qml b/src/Authoring/Studio/Palettes/Slide/SlideView.qml index 446494e4..0cb96919 100644 --- a/src/Authoring/Studio/Palettes/Slide/SlideView.qml +++ b/src/Authoring/Studio/Palettes/Slide/SlideView.qml @@ -154,6 +154,7 @@ Rectangle { Row { rotation: 90 anchors.centerIn: parent + spacing: 5 Image { id: dataInputImage2 fillMode: Image.Pad @@ -377,7 +378,6 @@ Rectangle { StyledLabel { id: dataInputName text: _parentView.currController - leftPadding: 10 color: _parentView.controlled ? _dataInputColor : "transparent" } } diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTimeline.cpp b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTimeline.cpp index 34e3b9ce..0865757f 100644 --- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTimeline.cpp +++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTimeline.cpp @@ -135,17 +135,17 @@ void RowTimeline::paint(QPainter *painter, const QStyleOptionGraphicsItem *optio if (m_controllerDataInput.size()) { static const QPixmap pixDataInput = QPixmap(":/images/Objects-DataInput-White.png"); - static const QFont normalFont = CAppFonts::GetInstance()->GetNormalFont(); - static const QFontMetrics fm(normalFont); + static const QFontMetrics fm(painter->font()); // need clip region to limit datainput icon visibility to the same rect as we use // for text painter->setClipRect(x, 0, w, currentHeight); painter->setClipping(true); painter->setPen(QPen(CStudioPreferences::textColor(), 2)); - painter->drawText(QRect(x + pixDataInput.width(), 0, w, currentHeight), + // +5 added to text location to make margin comparable to other datainput controls + painter->drawText(QRect(x + pixDataInput.width() + 5, 0, w, currentHeight), m_controllerDataInput, QTextOption(Qt::AlignCenter)); - // place the icon marginY amount away from the datainput name + // place the icon in front of the text int textwidth = fm.width(m_controllerDataInput); int iconx = x + (w - textwidth) / 2; if (iconx < x) diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/TimelineToolbar.cpp b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/TimelineToolbar.cpp index 7469fdd7..b9bfdbc0 100644 --- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/TimelineToolbar.cpp +++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/TimelineToolbar.cpp @@ -118,6 +118,7 @@ TimelineToolbar::TimelineToolbar() : QToolBar() addAction(m_actionNewLayer); addAction(m_actionDeleteRow); addAction(m_actionDataInput); + addSpacing(2); addWidget(m_diLabel); addSpacing(20); addWidget(m_timeLabel); |