Commit 98aa8c4d authored by Thomas BOUTROUE's avatar Thomas BOUTROUE

Use RGBA color instead of color+opacity when possible

Try to simplify chat list delegate for better scroll perf

Enable caching of avatar shape shader effect
parent 1b3e851b
......@@ -13,6 +13,7 @@ Item {
property alias fileItem : img.fileItem;
OpacityMask {
cached: true;
source: ShaderEffectSource {
hideSource: true;
sourceItem: DelegateDownloadableImage {
......
......@@ -24,8 +24,7 @@ Item {
}
Rectangle {
id: rect;
color: "gray";
opacity: 0.35;
color: Theme.rgba (Theme.secondaryColor, 0.35);
anchors.fill: parent;
}
Image {
......
......@@ -46,8 +46,7 @@ DelegateAbstractMessageContent {
}
Rectangle {
color: Theme.secondaryHighlightColor;
opacity: 0.15;
color: Theme.rgba (Theme.secondaryHighlightColor, 0.15);
border {
width: 1;
color: Theme.highlightColor;
......
......@@ -28,6 +28,7 @@ DelegateAbstractMessageContent {
Text {
id: metrics;
z: -1;
text: formattedText.text;
font: formattedText.font;
color: "transparent";
......@@ -41,6 +42,13 @@ DelegateAbstractMessageContent {
sourceComponent: RowContainer {
spacing: Theme.paddingMedium;
MouseArea {
anchors.fill: parent;
Container.ignored: true;
onClicked: {
Qt.openUrlExternally (self.webPage.url);
}
}
Rectangle {
color: Theme.secondaryColor;
implicitWidth: Theme.paddingSmall;
......
......@@ -27,6 +27,7 @@ QtObject {
property alias avatarShape : configAvatarShape.value;
property alias lastUsedStickersetName : configLastUsedStickersetName.value;
property alias hideChatHeader : configHideChatHeader.value;
property alias showBubblesAroundMessages : configShowBubblesAroundMessages.value;
property list<ConfigurationValue> _configurationItems_ : [
ConfigurationValue {
......@@ -73,6 +74,11 @@ QtObject {
id: configHideChatHeader;
key: "/apps/telegrame/hide_chat_header";
defaultValue: false;
},
ConfigurationValue {
id: configShowBubblesAroundMessages;
key: "/apps/telegrame/show_bubbles_around_messages";
defaultValue: true;
}
]
......
......@@ -15,9 +15,8 @@ MouseArea {
property string icon : "";
Rectangle {
color: (active || pressed ? Theme.highlightColor : Theme.primaryColor);
color: Theme.rgba ((active || pressed ? Theme.highlightColor : Theme.primaryColor), (active ? 0.35 : 0.15));
radius: (rounded ? Theme.paddingSmall : 0);
opacity: (active ? 0.35 : 0.15);
antialiasing: rounded;
anchors.fill: parent;
}
......
......@@ -44,8 +44,7 @@ CoverBackground {
}
LabelFixed {
text: qsTr ("unread messages");
color: Theme.primaryColor;
opacity: (count > 0 ? 1.0 : 0.35);
color: Theme.rgba (Theme.primaryColor, (count > 0 ? 1.0 : 0.35));
wrapMode: Text.WrapAtWordBoundaryOrAnywhere;
horizontalAlignment: Text.AlignHCenter;
font.pixelSize: Theme.fontSizeLarge;
......
......@@ -440,8 +440,7 @@ ApplicationWindow {
autoDownload: true;
}
Rectangle {
color: (delegateSelectorStickerSet.active || pressed ? Theme.highlightColor : Theme.primaryColor);
opacity: (delegateSelectorStickerSet.active ? 0.35 : 0.15);
color: Theme.rgba ((delegateSelectorStickerSet.active || pressed ? Theme.highlightColor : Theme.primaryColor), (delegateSelectorStickerSet.active ? 0.35 : 0.15));
anchors.fill: parent;
}
Image {
......@@ -538,8 +537,7 @@ ApplicationWindow {
}
Rectangle {
color: Theme.highlightColor;
opacity: (currentDocument === model.filePath ? 0.35 : 0.15);
color: Theme.rgba (Theme.highlightColor, (currentDocument === model.filePath ? 0.35 : 0.15));
visible: (currentDocument === model.filePath || parent.pressed);
anchors.fill: parent;
}
......
......@@ -38,7 +38,7 @@ Page {
}
LabelFixed {
text: qsTr ("An unofficial client for Telegram messaging, using TDLIB API. It aims to provide all the main features of the official apps on other platforms, while integrating nicely into Sailfish UI that we all love.");
opacity: 0.65;
color: Theme.rgba (Theme.primaryColor, 0.65);
wrapMode: Text.WrapAtWordBoundaryOrAnywhere;
horizontalAlignment: Text.AlignJustify;
font.family: Theme.fontFamilyHeading;
......@@ -50,8 +50,7 @@ Page {
}
LabelFixed {
text: qsTr ("Designed and developed by Thomas BOUTROUE");
color: Theme.secondaryHighlightColor;
opacity: 0.65;
color: Theme.rgba (Theme.secondaryHighlightColor, 0.65);
wrapMode: Text.WrapAtWordBoundaryOrAnywhere;
horizontalAlignment: Text.AlignHCenter;
font.family: Theme.fontFamilyHeading;
......@@ -60,8 +59,7 @@ Page {
}
LabelFixed {
text: "thebootroo@gmail.com";
color: Theme.highlightColor;
opacity: 0.65;
color: Theme.rgba (Theme.highlightColor, 0.65);
wrapMode: Text.WrapAtWordBoundaryOrAnywhere;
horizontalAlignment: Text.AlignHCenter;
font.family: Theme.fontFamilyHeading;
......@@ -92,8 +90,7 @@ Page {
}
LabelFixed {
text: "http://gitlab.unique-conception.org/sailfish-app/telegra-me";
color: Theme.highlightColor;
opacity: 0.65;
color: Theme.rgba (Theme.highlightColor, 0.65);
wrapMode: Text.WrapAtWordBoundaryOrAnywhere;
horizontalAlignment: Text.AlignHCenter;
font.family: Theme.fontFamilyHeading;
......@@ -116,8 +113,7 @@ Page {
}
LabelFixed {
text: qsTr ("Kudos to BlackSailer for compiling tdlib-json on Sailfish OS !");
color: Theme.highlightColor;
opacity: 0.65;
color: Theme.rgba (Theme.highlightColor, 0.65);
wrapMode: Text.WrapAtWordBoundaryOrAnywhere;
horizontalAlignment: Text.AlignHCenter;
font.bold: true;
......@@ -153,9 +149,8 @@ Page {
}
Rectangle {
color: (parent.pressed ? Theme.highlightColor : Theme.primaryColor);
color: Theme.rgba ((parent.pressed ? Theme.highlightColor : Theme.primaryColor), 0.15);
radius: Theme.paddingSmall;
opacity: 0.15;
antialiasing: true;
anchors.fill: parent;
}
......
......@@ -251,8 +251,7 @@ Page {
RemorseItem { id: remorse; }
Rectangle {
color: Theme.secondaryHighlightColor;
opacity: (delegateMsg.messageItem.containsUnreadMention ? 0.35 : 0.10);
color: Theme.rgba (Theme.secondaryHighlightColor, (delegateMsg.messageItem.containsUnreadMention ? 0.35 : 0.10));
visible: (delegateMsg.messageItem.id === currentMessageId || delegateMsg.messageItem.containsUnreadMention);
anchors.fill: parent;
}
......@@ -272,9 +271,8 @@ Page {
font.pixelSize: Theme.fontSizeSmall;
Rectangle {
opacity: 0.15;
gradient: Gradient {
GradientStop { position: 0; color: Theme.highlightColor; }
GradientStop { position: 0; color: Theme.rgba (Theme.highlightColor, 0.15); }
GradientStop { position: 1; color: "transparent"; }
}
anchors.fill: parent;
......@@ -315,9 +313,9 @@ Page {
: 0);
Rectangle {
color: (delegateMsg.messageItem.isOutgoing ? Theme.primaryColor : Theme.highlightColor);
color: Theme.rgba (delegateMsg.messageItem.isOutgoing ? Theme.primaryColor : Theme.highlightColor, 0.10);
radius: Theme.paddingMedium;
opacity: 0.10;
visible: Helpers.showBubblesAroundMessages;
antialiasing: true;
anchors.fill: parent;
}
......@@ -441,8 +439,8 @@ Page {
LabelFixed {
text: ((delegateMsg.messageItem.editDate.getFullYear () > 2000)
? (qsTr ("edited") + " " + Qt.formatDateTime (delegateMsg.messageItem.editDate))
: Qt.formatDateTime (delegateMsg.messageItem.date));
? (qsTr ("edited") + " " + Qt.formatDateTime (delegateMsg.messageItem.editDate, "ddd d MMM, hh:mm:ss"))
: Qt.formatDateTime (delegateMsg.messageItem.date, "ddd d MMM, hh:mm:ss"));
color: Theme.secondaryColor;
font.pixelSize: Theme.fontSizeExtraSmall;
anchors.verticalCenter: parent.verticalCenter;
......@@ -572,8 +570,7 @@ Page {
Behavior on opacity { NumberAnimation { duration: 650; } }
Rectangle {
color: Theme.highlightColor;
opacity: 0.15;
color: Theme.rgba (Theme.highlightColor, 0.15);
anchors.fill: parent;
}
Rectangle {
......@@ -636,8 +633,7 @@ Page {
anchors.fill: parent;
Rectangle {
color: Theme.secondaryHighlightColor;
opacity: 0.65;
color: Theme.rgba (Theme.secondaryHighlightColor, 0.65);
visible: flickerMessages.atYBeginning;
implicitHeight: Theme.paddingSmall;
ExtraAnchors.topDock: parent;
......@@ -750,8 +746,7 @@ Page {
anchors.fill: parent;
Rectangle {
color: Theme.secondaryHighlightColor;
opacity: 0.15;
color: Theme.rgba (Theme.secondaryHighlightColor, 0.15);
anchors.fill: parent;
}
}
......@@ -785,8 +780,7 @@ Page {
anchors.fill: parent;
Rectangle {
color: Theme.secondaryHighlightColor;
opacity: 0.15;
color: Theme.rgba (Theme.secondaryHighlightColor, 0.15);
anchors.fill: parent;
}
}
......
......@@ -133,8 +133,7 @@ Page {
ExtraAnchors.horizontalFill: parent;
Rectangle {
color: Theme.secondaryColor;
opacity: 0.35;
color: Theme.rgba (Theme.secondaryColor, 0.35);
implicitHeight: 1;
anchors.verticalCenter: parent.verticalCenter;
Container.horizontalStretch: 1;
......@@ -146,8 +145,7 @@ Page {
anchors.verticalCenter: parent.verticalCenter;
}
Rectangle {
color: Theme.secondaryColor;
opacity: 0.35;
color: Theme.rgba (Theme.secondaryColor, 0.35);
implicitHeight: 1;
anchors.verticalCenter: parent.verticalCenter;
Container.horizontalStretch: 1;
......
......@@ -65,8 +65,7 @@ Page {
Rectangle {
z: -1;
color: Theme.secondaryColor;
opacity: 0.15;
color: Theme.rgba (Theme.secondaryColor, 0.15);
anchors {
fill: parent;
margins: -Theme.paddingSmall;
......@@ -134,8 +133,7 @@ Page {
ExtraAnchors.horizontalFill: parent;
Rectangle {
color: Theme.secondaryColor;
opacity: 0.35;
color: Theme.rgba (Theme.secondaryColor, 0.35);
implicitHeight: 1;
anchors.verticalCenter: parent.verticalCenter;
Container.horizontalStretch: 1;
......@@ -147,8 +145,7 @@ Page {
anchors.verticalCenter: parent.verticalCenter;
}
Rectangle {
color: Theme.secondaryColor;
opacity: 0.35;
color: Theme.rgba (Theme.secondaryColor, 0.35);
implicitHeight: 1;
anchors.verticalCenter: parent.verticalCenter;
Container.horizontalStretch: 1;
......
This diff is collapsed.
......@@ -43,6 +43,16 @@ Page {
Binding on checked { value: Helpers.includeMutedChatsInUnreadCount; }
}
TextSwitch {
text: qsTr ("Show bubbles around messages");
description: qsTr ("Colored rounded rectangles that delimit messages, can be hidden");
automaticCheck: true;
onCheckedChanged: {
Helpers.showBubblesAroundMessages = checked;
}
Binding on checked { value: Helpers.showBubblesAroundMessages; }
}
TextSwitch {
text: qsTr ("Hide the header in conversation page");
description: qsTr ("Normally, it displays title and status, but hiding it can save some space");
......@@ -97,9 +107,8 @@ Page {
}
Rectangle {
color: Theme.secondaryHighlightColor;
color: Theme.rgba (Theme.secondaryHighlightColor, 0.15);
radius: Theme.paddingMedium;
opacity: 0.15;
visible: (modelData ["shape"] === Helpers.avatarShape);
antialiasing: true;
anchors.fill: parent;
......
......@@ -116,9 +116,8 @@ Page {
}
Rectangle {
color: (parent.pressed ? Theme.highlightColor : Theme.primaryColor);
color: Theme.rgba ((parent.pressed ? Theme.highlightColor : Theme.primaryColor), 0.15);
radius: Theme.paddingSmall;
opacity: 0.15;
antialiasing: true;
anchors.fill: parent;
}
......@@ -140,9 +139,8 @@ Page {
}
Rectangle {
color: (parent.pressed ? Theme.highlightColor : Theme.primaryColor);
color: Theme.rgba ((parent.pressed ? Theme.highlightColor : Theme.primaryColor), 0.15);
radius: Theme.paddingSmall;
opacity: 0.15;
antialiasing: true;
anchors.fill: parent;
}
......
......@@ -14,7 +14,7 @@ Name: harbour-telegrame
%{?qtc_builddir:%define _builddir %qtc_builddir}
Summary: A native Telegram client for Sailfish OS
Version: 0.9
Release: 12
Release: 13
Group: Qt/Qt
License: WTFPL
URL: http://gitlab.unique-conception.org/sailfish-app/telegra-me
......
Name: harbour-telegrame
Summary: A native Telegram client for Sailfish OS
Version: 0.9
Release: 12
Release: 13
Group: Qt/Qt
URL: http://gitlab.unique-conception.org/sailfish-app/telegra-me
......
Markdown is supported
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