Skip to content
Snippets Groups Projects
Commit ad97faaf authored by Andreas Traczyk's avatar Andreas Traczyk
Browse files

ui: fix margins on smartlist items

Change-Id: I3a739291339767de3582d6be880165654b105998
parent 4156fdff
No related branches found
No related tags found
No related merge requests found
...@@ -189,7 +189,7 @@ ConversationItemDelegate::paintRingConversationItem(QPainter* painter, ...@@ -189,7 +189,7 @@ ConversationItemDelegate::paintRingConversationItem(QPainter* painter,
QRect rectName1(rect.left() + leftMargin, QRect rectName1(rect.left() + leftMargin,
rect.top() + topMargin, rect.top() + topMargin,
rect.width() - leftMargin - infoTextWidth_ - infoTextWidthModifier - 2, rect.width() - leftMargin - infoTextWidth_ - infoTextWidthModifier - 4,
rect.height() / 2 - 2); rect.height() / 2 - 2);
QRect rectName2(rectName1.left(), QRect rectName2(rectName1.left(),
...@@ -199,7 +199,7 @@ ConversationItemDelegate::paintRingConversationItem(QPainter* painter, ...@@ -199,7 +199,7 @@ ConversationItemDelegate::paintRingConversationItem(QPainter* painter,
QRect rectInfo1(rectName1.left() + rectName1.width(), QRect rectInfo1(rectName1.left() + rectName1.width(),
rect.top() + topMargin, rect.top() + topMargin,
infoTextWidth_ - rightMargin + infoTextWidthModifier, infoTextWidth_ - rightMargin + infoTextWidthModifier + 2,
rect.height() / 2 - 2); rect.height() / 2 - 2);
QRect rectInfo2(rectInfo1.left(), QRect rectInfo2(rectInfo1.left(),
...@@ -303,8 +303,13 @@ ConversationItemDelegate::paintRingInviteConversationItem(QPainter* painter, ...@@ -303,8 +303,13 @@ ConversationItemDelegate::paintRingInviteConversationItem(QPainter* painter,
auto leftMargin = dx_ + sizeImage_ + dx_; auto leftMargin = dx_ + sizeImage_ + dx_;
auto rightMargin = dx_; auto rightMargin = dx_;
if (option.state & QStyle::State_MouseOver) { if (option.state & QStyle::State_MouseOver) {
auto scalingRatio = MainWindow::instance().getCurrentScalingRatio();
if (scalingRatio > 1.0) {
rightMargin = infoTextWidth_ + 12 - dx_ * 2;
} else {
rightMargin = infoTextWidth_ - dx_ * 2; rightMargin = infoTextWidth_ - dx_ * 2;
} }
}
auto topMargin = 4; auto topMargin = 4;
auto bottomMargin = 8; auto bottomMargin = 8;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>323</width> <width>342</width>
<height>120</height> <height>120</height>
</rect> </rect>
</property> </property>
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>12</width> <width>8</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>12</width> <width>8</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment