Skip to content
Snippets Groups Projects
Commit 303639fe authored by Sébastien Blin's avatar Sébastien Blin
Browse files

misc: graphical adjustments

+ Adapt primary color via the luma of the background
+ Adapt font size
+ Adapt some margins
+ Add highlight on avatars
+ Fix selected UID when creating swarms

GitLab: #670
Change-Id: I219acd5a1726298050a1ca908dbf38929bab171a
parent dcd4cad6
No related branches found
No related tags found
No related merge requests found
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
......
...@@ -61,15 +61,10 @@ SBSMessageBase { ...@@ -61,15 +61,10 @@ SBSMessageBase {
onLinkHovered: root.hoveredLink = hoveredLink onLinkHovered: root.hoveredLink = hoveredLink
onLinkActivated: Qt.openUrlExternally(hoveredLink) onLinkActivated: Qt.openUrlExternally(hoveredLink)
readOnly: true readOnly: true
color: { color: UtilsAdapter.luma(bubble.color) ?
var luma = 0.2126 * bubble.color.r + 0.7152 * bubble.color.g + 0.0722 * bubble.color.b // ITU-R BT.709
return luma < 0.60 ?
JamiTheme.chatviewTextColorLight : JamiTheme.chatviewTextColorLight :
JamiTheme.chatviewTextColorDark JamiTheme.chatviewTextColorDark
}
TapHandler { TapHandler {
acceptedButtons: Qt.RightButton acceptedButtons: Qt.RightButton
onTapped: function onTapped(eventPoint) { onTapped: function onTapped(eventPoint) {
......
...@@ -20,6 +20,7 @@ import QtQuick ...@@ -20,6 +20,7 @@ import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
import Qt5Compat.GraphicalEffects import Qt5Compat.GraphicalEffects
import net.jami.Adapters 1.1
import net.jami.Constants 1.1 import net.jami.Constants 1.1
import net.jami.Models 1.1 import net.jami.Models 1.1
......
...@@ -179,7 +179,7 @@ Rectangle { ...@@ -179,7 +179,7 @@ Rectangle {
ColorDialog { ColorDialog {
id: colorDialog id: colorDialog
title: JamiTheme.chooseAColor title: JamiStrings.chooseAColor
onAccepted: { onAccepted: {
console.warn("TODO SAVE preference") console.warn("TODO SAVE preference")
CurrentConversation.color = colorDialog.color CurrentConversation.color = colorDialog.color
...@@ -220,14 +220,14 @@ Rectangle { ...@@ -220,14 +220,14 @@ Rectangle {
} }
} }
RowLayout { Rectangle {
Layout.leftMargin: JamiTheme.preferredMarginSize Layout.fillWidth: true
Layout.preferredHeight: JamiTheme.settingsFontSize + 2 * JamiTheme.preferredMarginSize + 4
Text { Text {
Layout.fillWidth: true anchors.left: parent.left
Layout.preferredHeight: 30 anchors.top: parent.top
Layout.rightMargin: JamiTheme.preferredMarginSize anchors.margins: JamiTheme.preferredMarginSize
text: JamiStrings.leaveTheSwarm text: JamiStrings.leaveTheSwarm
font.pointSize: JamiTheme.settingsFontSize font.pointSize: JamiTheme.settingsFontSize
font.kerning: true font.kerning: true
...@@ -238,17 +238,20 @@ Rectangle { ...@@ -238,17 +238,20 @@ Rectangle {
color: JamiTheme.textColor color: JamiTheme.textColor
} }
PushButton { color: "transparent"
id: leaveTheSwarmBtn
anchors.verticalCenter: parent.verticalCenter
source: JamiResources.round_close_24dp_svg
normalColor: JamiTheme.backgroundColor HoverHandler {
imageColor: JamiTheme.textColor target: parent
toolTipText: JamiStrings.leave enabled: parent.visible
onHoveredChanged: {
parent.color = hovered ? Qt.darker(JamiTheme.selectedColor, 1.05) : "transparent"
}
}
onClicked: { TapHandler {
target: parent
enabled: parent.visible
onTapped: function onTapped(eventPoint) {
MessagesAdapter.removeConversation(LRCInstance.selectedConvUid) MessagesAdapter.removeConversation(LRCInstance.selectedConvUid)
} }
} }
......
...@@ -571,5 +571,6 @@ UtilsAdapter::getParticipantRole(const QString& accountId, const QString& convId ...@@ -571,5 +571,6 @@ UtilsAdapter::getParticipantRole(const QString& accountId, const QString& convId
bool bool
UtilsAdapter::luma(const QColor& color) const UtilsAdapter::luma(const QColor& color) const
{ {
return (0.2126 * color.red() + 0.7152 * color.green() + 0.0722 * color.blue()) > .6; return (0.2126 * color.red() + 0.7152 * color.green() + 0.0722 * color.blue())
< 153 /* .6 * 256 */;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment