Commit 45d83bde authored by Andreas Traczyk's avatar Andreas Traczyk
Browse files

messageview: homogenize fonts for invites

Change-Id: I01e72deee52ad061ba011580c3e4daff576a1f81
parent f8052f6c
...@@ -296,20 +296,23 @@ ConversationItemDelegate::paintRingInviteConversationItem(QPainter* painter, ...@@ -296,20 +296,23 @@ ConversationItemDelegate::paintRingInviteConversationItem(QPainter* painter,
const QModelIndex& index) const const QModelIndex& index) const
{ {
QFont font(painter->font()); QFont font(painter->font());
font.setPointSize(fontSize_);
QPen pen(painter->pen()); QPen pen(painter->pen());
painter->setPen(pen); painter->setPen(pen);
auto leftMargin = dx_ + sizeImage_ + dx_; auto leftMargin = dx_ + sizeImage_ + dx_;
auto rightMargin = dx_; auto rightMargin = dx_;
auto scalingRatio = MainWindow::instance().getCurrentScalingRatio();
font.setPointSize(scalingRatio > 1.0 ? fontSize_ - 2 : fontSize_);
if (option.state & QStyle::State_MouseOver) { if (option.state & QStyle::State_MouseOver) {
auto scalingRatio = MainWindow::instance().getCurrentScalingRatio();
if (scalingRatio > 1.0) { if (scalingRatio > 1.0) {
rightMargin = infoTextWidth_ + 12 - dx_ * 2; rightMargin = infoTextWidth_ + 12 - dx_ * 2;
} else { } else {
rightMargin = infoTextWidth_ - dx_ * 2; rightMargin = infoTextWidth_ - dx_ * 2;
} }
} }
auto topMargin = 4; auto topMargin = 4;
auto bottomMargin = 8; auto bottomMargin = 8;
......
...@@ -118,7 +118,7 @@ body { ...@@ -118,7 +118,7 @@ body {
display: flex; display: flex;
cursor: pointer; cursor: pointer;
align-self: center; align-self: center;
border-radius: 9px; border-radius: 16px;
} }
.nav-button.deactivated { .nav-button.deactivated {
...@@ -128,7 +128,7 @@ body { ...@@ -128,7 +128,7 @@ body {
padding: 2px; padding: 2px;
align-self: center; align-self: center;
display: flex; display: flex;
border-radius: 9px; border-radius: 16px;
cursor: auto; cursor: auto;
} }
...@@ -187,26 +187,25 @@ body { ...@@ -187,26 +187,25 @@ body {
/** Invitation bar */ /** Invitation bar */
#invitation { #invitation {
visibility: hidden; visibility: hidden;
background: var(--bg-color); background: var(--bg-color);
position: absolute; position: absolute;
width: 100%; width: 100%;
padding-bottom: 10px; padding-bottom: 10px;
/* hairline */ /* hairline */
border-bottom: var(--hairline-thickness) solid var(--hairline-color); border-bottom: var(--hairline-thickness) solid var(--hairline-color);
} }
#invitation #invite_header { #invitation #invite_header {
margin: 10px; margin: 10px;
list-style: none; list-style: none;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
/* enable selection (it is globally disabled in the body) */
/* enable selection (it is globally disabled in the body) */ -webkit-user-select: auto;
-webkit-user-select: auto; }
}
#invitation .sender_image { #invitation .sender_image {
width: 50px; width: 50px;
...@@ -233,16 +232,19 @@ body { ...@@ -233,16 +232,19 @@ body {
margin-left: 5px; margin-left: 5px;
} }
#invitation #text { #invitation #text {
text-align: center; text-align: center;
font-size: 0.8em; font: 11pt sans-serif;
/* enable selection (it is globally disabled in the body) */ /* enable selection (it is globally disabled in the body) */
-webkit-user-select: auto; -webkit-user-select: auto;
}
#invite_contact_name {
font-weight: 500;
} }
/** Messaging bar */ /** Messaging bar */
#sendMessage { #sendMessage {
background-color: var(--bg-color); background-color: var(--bg-color);
display: flex; display: flex;
......
...@@ -162,7 +162,7 @@ function showInvitation(contactAlias, contactId) { ...@@ -162,7 +162,7 @@ function showInvitation(contactAlias, contactId) {
inviteImage.classList.add(`invite_sender_image_${contactId}`); inviteImage.classList.add(`invite_sender_image_${contactId}`);
} }
hasInvitation = true hasInvitation = true
invitationText.innerHTML = "<b>" + contactAlias + " is not in your contacts</b><br/>" invitationText.innerHTML = "<span id='invite_contact_name'>" + contactAlias + "</span> is not in your contacts<br/>"
+ "Note: you can automatically accept this invitation by sending a message." + "Note: you can automatically accept this invitation by sending a message."
invitation.style.visibility = "visible" invitation.style.visibility = "visible"
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment