From 45d83bde46c5e9f7d4dd08aeef937cdc8614ba6c Mon Sep 17 00:00:00 2001 From: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com> Date: Tue, 5 Feb 2019 15:45:34 -0500 Subject: [PATCH] messageview: homogenize fonts for invites Change-Id: I01e72deee52ad061ba011580c3e4daff576a1f81 --- conversationitemdelegate.cpp | 7 +++-- web/chatview.css | 52 +++++++++++++++++++----------------- web/chatview.js | 2 +- 3 files changed, 33 insertions(+), 28 deletions(-) diff --git a/conversationitemdelegate.cpp b/conversationitemdelegate.cpp index 3909b06..e1c4a85 100644 --- a/conversationitemdelegate.cpp +++ b/conversationitemdelegate.cpp @@ -296,20 +296,23 @@ ConversationItemDelegate::paintRingInviteConversationItem(QPainter* painter, const QModelIndex& index) const { QFont font(painter->font()); - font.setPointSize(fontSize_); QPen pen(painter->pen()); painter->setPen(pen); auto leftMargin = dx_ + sizeImage_ + dx_; auto rightMargin = dx_; + + auto scalingRatio = MainWindow::instance().getCurrentScalingRatio(); + font.setPointSize(scalingRatio > 1.0 ? fontSize_ - 2 : fontSize_); + 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; } } + auto topMargin = 4; auto bottomMargin = 8; diff --git a/web/chatview.css b/web/chatview.css index aaf6a53..daedf44 100644 --- a/web/chatview.css +++ b/web/chatview.css @@ -118,7 +118,7 @@ body { display: flex; cursor: pointer; align-self: center; - border-radius: 9px; + border-radius: 16px; } .nav-button.deactivated { @@ -128,7 +128,7 @@ body { padding: 2px; align-self: center; display: flex; - border-radius: 9px; + border-radius: 16px; cursor: auto; } @@ -187,26 +187,25 @@ body { /** Invitation bar */ #invitation { - visibility: hidden; - background: var(--bg-color); - position: absolute; - width: 100%; - padding-bottom: 10px; + visibility: hidden; + background: var(--bg-color); + position: absolute; + width: 100%; + padding-bottom: 10px; - /* hairline */ - border-bottom: var(--hairline-thickness) solid var(--hairline-color); + /* hairline */ + border-bottom: var(--hairline-thickness) solid var(--hairline-color); } -#invitation #invite_header { - margin: 10px; - list-style: none; - display: flex; - align-items: center; - justify-content: center; - - /* enable selection (it is globally disabled in the body) */ - -webkit-user-select: auto; -} + #invitation #invite_header { + margin: 10px; + list-style: none; + display: flex; + align-items: center; + justify-content: center; + /* enable selection (it is globally disabled in the body) */ + -webkit-user-select: auto; + } #invitation .sender_image { width: 50px; @@ -233,16 +232,19 @@ body { margin-left: 5px; } -#invitation #text { - text-align: center; - font-size: 0.8em; + #invitation #text { + text-align: center; + font: 11pt sans-serif; - /* enable selection (it is globally disabled in the body) */ - -webkit-user-select: auto; + /* enable selection (it is globally disabled in the body) */ + -webkit-user-select: auto; + } + +#invite_contact_name { + font-weight: 500; } /** Messaging bar */ - #sendMessage { background-color: var(--bg-color); display: flex; diff --git a/web/chatview.js b/web/chatview.js index f684599..917f461 100644 --- a/web/chatview.js +++ b/web/chatview.js @@ -162,7 +162,7 @@ function showInvitation(contactAlias, contactId) { inviteImage.classList.add(`invite_sender_image_${contactId}`); } 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." invitation.style.visibility = "visible" } -- GitLab