Commit bbc2861a authored by Thomas BOUTROUE's avatar Thomas BOUTROUE

Add setting for keep kbd open and avatar shape

parent 80da4bf8
......@@ -2,5 +2,9 @@
<qresource prefix="/">
<file>images/cd-box.svg</file>
<file>images/Telegram_logo.svg</file>
<file>images/mask_circle.svg</file>
<file>images/mask_rounded.svg</file>
<file>images/mask_square.svg</file>
<file>images/mask_squircle.svg</file>
</qresource>
</RCC>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="300"
height="300"
viewBox="0 0 79.374998 79.375002"
version="1.1"
id="svg8"
inkscape:version="0.92.3 (2405546, 2018-03-11)"
sodipodi:docname="mask_circle.svg">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.4"
inkscape:cx="179.67031"
inkscape:cy="131.77333"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1920"
inkscape:window-height="1017"
inkscape:window-x="1912"
inkscape:window-y="-8"
inkscape:window-maximized="1" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Calque 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-53.688445,-53.820549)">
<circle
style="opacity:1;fill:#808080;fill-opacity:1;stroke:none;stroke-width:0.26458332;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path4557"
cx="93.375946"
cy="93.508049"
r="39.158333" />
</g>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
id="svg8"
version="1.1"
viewBox="0 0 79.374998 79.375002"
height="300"
width="300">
<defs
id="defs2" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<rect
ry="11.90625"
rx="11.90625"
y="0.52916771"
x="0.52916664"
height="78.316666"
width="78.316666"
id="rect4559"
style="opacity:1;fill:#808080;fill-opacity:1;stroke:none;stroke-width:0.26458332;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="300"
height="300"
viewBox="0 0 79.374998 79.375002"
version="1.1"
id="svg8"
inkscape:version="0.92.3 (2405546, 2018-03-11)"
sodipodi:docname="mask_rounded.svg">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.4"
inkscape:cx="179.67031"
inkscape:cy="131.77333"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1920"
inkscape:window-height="1017"
inkscape:window-x="1912"
inkscape:window-y="-8"
inkscape:window-maximized="1"
showguides="false" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Calque 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-53.688445,-53.820549)">
<rect
style="opacity:1;fill:#808080;fill-opacity:1;stroke:none;stroke-width:0.26458332;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4559"
width="78.316666"
height="78.316666"
x="54.217613"
y="54.349716" />
</g>
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="300"
height="300"
viewBox="0 0 79.374998 79.375002"
version="1.1"
id="svg8"
inkscape:version="0.92.3 (2405546, 2018-03-11)"
sodipodi:docname="mask_squircle.svg">
<defs
id="defs2" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.4"
inkscape:cx="179.67031"
inkscape:cy="103.2019"
inkscape:document-units="mm"
inkscape:current-layer="layer1"
showgrid="false"
units="px"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1920"
inkscape:window-height="1017"
inkscape:window-x="1912"
inkscape:window-y="-8"
inkscape:window-maximized="1" />
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Calque 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-53.688445,-53.820549)">
<path
style="opacity:1;fill:#808080;fill-opacity:1;stroke:none;stroke-width:0.26458332;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 93.523455,54.350457 c -0.04508,1.35e-4 -0.09015,8.63e-4 -0.135223,0.001 -0.0053,1.9e-5 -0.0111,-1.9e-5 -0.01639,0 -0.0087,4.8e-5 -0.01741,4.62e-4 -0.02612,5.13e-4 -0.01298,7.3e-5 -0.02596,4.33e-4 -0.03893,5.11e-4 -2.480842,0.0098 -4.961169,0.06354 -7.43681,0.197715 -0.0027,1.09e-4 -0.0055,4.03e-4 -0.0082,5.1e-4 -0.0016,1.52e-4 -0.0034,3.63e-4 -0.0051,5.12e-4 -0.486891,0.02645 -0.973847,0.05352 -1.460315,0.08656 -8.133596,0.818904 -16.790741,3.064583 -22.385243,9.45288 -0.02041,0.02369 -0.03911,0.04846 -0.05942,0.07222 -5.736313,6.398669 -7.140619,15.418062 -7.697013,23.717481 -0.06512,4.867604 -0.07907,9.749065 0.250983,14.607261 0.793312,7.8794 2.925474,16.24979 8.865884,21.85149 h 5.23e-4 c 0.191539,0.18061 0.386945,0.35898 0.586484,0.53373 h 5.25e-4 c 0.02361,0.0204 0.04803,0.0392 0.07171,0.0594 0.208404,0.18683 0.419757,0.36876 0.633606,0.54652 0.423465,0.35201 0.857554,0.68661 1.301019,1.00445 0.443466,0.31784 0.896201,0.61901 1.357874,0.90456 1.154185,0.71389 2.362717,1.32989 3.611098,1.86241 0.499352,0.21301 1.004861,0.41254 1.516148,0.5998 0.511287,0.18726 1.028013,0.36216 1.549442,0.52553 0.260715,0.0817 0.52282,0.16057 0.785734,0.23665 0.788743,0.22821 1.587014,0.43177 2.391519,0.61363 0.268169,0.0606 0.536751,0.11873 0.806223,0.17466 1.077887,0.22372 2.16533,0.41094 3.255109,0.56907 0.54489,0.0791 1.090321,0.15069 1.635495,0.21615 1.090347,0.13092 2.179498,0.23649 3.260231,0.32423 0.540367,0.0438 1.078706,0.0835 1.613981,0.11934 2.433803,0.0326 4.871153,0.0522 7.307221,0.0226 1.218032,-0.0149 2.435716,-0.0419 3.652585,-0.0861 0.608434,-0.0221 1.216576,-0.0483 1.824495,-0.0794 0.11922,-0.006 0.23833,-0.0145 0.35753,-0.021 0.002,-1.5e-4 0.003,-2.6e-4 0.005,-5.2e-4 0.48689,-0.0265 0.97384,-0.0535 1.46031,-0.0866 0.45731,-0.0461 0.91635,-0.0986 1.37632,-0.15418 0.56266,-0.0679 1.12678,-0.1416 1.69133,-0.22537 1.28256,-0.19033 2.56699,-0.42352 3.83954,-0.71044 0.76352,-0.17215 1.52269,-0.36386 2.27473,-0.57676 0.50137,-0.14193 0.99954,-0.29315 1.49362,-0.45484 0.24703,-0.0809 0.4932,-0.16444 0.73809,-0.25047 0.48977,-0.17208 0.97483,-0.35475 1.45469,-0.54858 0.9597,-0.38767 1.8979,-0.81992 2.80743,-1.30256 0.68214,-0.36198 1.34804,-0.75234 1.99507,-1.17297 0.8627,-0.56083 1.69161,-1.17572 2.47961,-1.8501 0.39411,-0.33728 0.77765,-0.68955 1.15044,-1.05721 0.18627,-0.1837 0.37001,-0.37088 0.55063,-0.56241 0,0 0,-5.3e-4 0,-5.3e-4 0.16417,-0.1741 0.32572,-0.35249 0.48505,-0.53321 0.0159,-0.0181 0.0323,-0.0352 0.0482,-0.0533 0,0 5.2e-4,-5.2e-4 5.2e-4,-5.2e-4 0.24919,-0.28924 0.48968,-0.5837 0.72324,-0.88254 10e-4,-0.002 0.003,-0.004 0.004,-0.006 0.001,-0.002 0.003,-0.003 0.004,-0.005 2.87383,-3.51506 4.56869,-7.74463 5.51191,-12.11432 0.19673,-0.83657 0.37011,-1.67639 0.52297,-2.51958 0.0765,-0.42159 0.14777,-0.84418 0.21411,-1.26721 0.26533,-1.69213 0.45217,-3.39529 0.5793,-5.1047 0.0318,-0.42737 0.0599,-0.85503 0.0845,-1.283095 0.0146,-0.202876 0.0316,-0.406941 0.0451,-0.609019 0.002,-0.122727 0.002,-0.246046 0.004,-0.368793 0.0796,-1.750621 0.10851,-3.505404 0.0988,-5.260419 h -5.2e-4 v -5.25e-4 c -0.003,-0.627133 -0.0115,-1.253998 -0.0231,-1.880845 -0.0345,-1.88054 -0.10122,-3.758506 -0.1762,-5.628701 v -5.25e-4 c -0.004,-0.04624 -0.009,-0.09304 -0.0133,-0.139321 -0.0824,-0.914284 -0.17771,-1.836795 -0.29197,-2.762363 -0.008,-0.06513 -0.018,-0.130508 -0.0261,-0.195664 -0.11454,-0.907701 -0.24508,-1.818209 -0.39952,-2.726506 -0.0129,-0.07559 -0.0283,-0.150833 -0.0414,-0.226398 -0.36826,-2.114132 -0.85616,-4.215748 -1.52179,-6.243357 -0.0506,-0.15398 -0.10363,-0.306855 -0.15623,-0.459966 -0.0271,-0.07876 -0.0528,-0.158638 -0.0804,-0.237155 -0.0217,-0.06162 -0.0451,-0.122415 -0.0671,-0.183883 -0.39112,-1.092187 -0.83523,-2.161252 -1.34404,-3.195182 -0.10665,-0.216733 -0.21655,-0.431727 -0.32884,-0.645387 -7.8e-4,-0.0015 -10e-4,-0.0031 -0.002,-0.0046 l -5.2e-4,-5.25e-4 c -0.005,-0.0089 -0.01,-0.01772 -0.0144,-0.02663 -1.20518,-2.32173 -2.7441,-4.459548 -4.71996,-6.300128 -6.42676,-6.208536 -15.75751,-7.685779 -24.321885,-8.259936 -1.437286,-0.01922 -2.876138,-0.0326 -4.314875,-0.03534 0,0 -5.24e-4,0 -5.24e-4,0 -0.388287,-7.41e-4 -0.776471,-0.0022 -1.164773,-10e-4 z"
id="rect4518"
inkscape:connector-curvature="0" />
</g>
</svg>
......@@ -14,5 +14,6 @@
<file>qml/pages/PageSettings.qml</file>
<file>qml/pages/PageAbout.qml</file>
<file>qml/pages/PageContacts.qml</file>
<file>qml/components/DelegateAvatar.qml</file>
</qresource>
</RCC>
import QtQuick 2.6;
import QtQmlTricks 3.0;
import Sailfish.Silica 1.0;
import harbour.Telegrame 1.0;
import QtGraphicalEffects 1.0;
Item {
implicitWidth: size;
implicitHeight: size;
property alias size : img.size;
property alias fileItem : img.fileItem;
OpacityMask {
source: ShaderEffectSource {
hideSource: true;
sourceItem: DelegateDownloadableImage {
id: img;
anchors.fill: parent;
autoDownload: true;
}
}
maskSource: maskAvatar;
anchors.fill: parent;
}
}
......@@ -4,6 +4,7 @@ import QtQmlTricks 3.0;
import Sailfish.Silica 1.0;
import Qt.labs.folderlistmodel 2.1;
import QtDocGallery 5.0;
import QtFeedback 5.0;
import Nemo.Thumbnailer 1.0;
import Nemo.Notifications 1.0;
import Nemo.Configuration 1.0;
......@@ -39,11 +40,22 @@ ApplicationWindow {
property alias groupVideosInAlbums : configGroupVideosInAlbum.value;
property alias sendTextMsgOnEnterKey : configSendTextMsgOnEnterKey.value;
property alias includeMutedChatsInUnreadCount : configIncludeMutedChatsInUnreadCount.value;
property alias keepKeyboardOpenAfterMsgSend : configKeepKeyboardOpenAfterMsgSend.value;
readonly property bool active : (Qt.application.state === Qt.ApplicationActive);
readonly property bool isPortrait : (window.orientation === Orientation.Portrait || window.orientation === Orientation.PortraitInverted);
readonly property bool isLandscape : (window.orientation === Orientation.Landscape || window.orientation === Orientation.LandscapeInverted);
readonly property ShaderEffectSource maskAvatar : {
switch (configAvatarShape.value) {
case "square": return null; // NOTE : optimization
case "rounded": return maskAvatarRounded;
case "squircle": return maskAvatarSquircle;
case "circle": return maskAvatarCircle;
}
return "";
}
Connections {
target: TD_Global;
onShowChatRequested: {
......@@ -80,6 +92,37 @@ ApplicationWindow {
key: "/apps/telegrame/include_muted_chats_in_unread_count";
defaultValue: false;
}
ConfigurationValue {
id: configKeepKeyboardOpenAfterMsgSend;
key: "/apps/telegrame/keep_kdb_open_after_msg_send";
defaultValue: true;
}
ConfigurationValue {
id: configAvatarShape;
key: "/apps/telegrame/avatar_shape";
defaultValue: "square";
}
ShaderEffectSource {
id: maskAvatarCircle;
hideSource: true;
sourceItem: Image {
source: "qrc:///images/mask_circle.svg";
}
}
ShaderEffectSource {
id: maskAvatarRounded;
hideSource: true;
sourceItem: Image {
source: "qrc:///images/mask_rounded.svg";
}
}
ShaderEffectSource {
id: maskAvatarSquircle;
hideSource: true;
sourceItem: Image {
source: "qrc:///images/mask_squircle.svg";
}
}
Item {
rotation: {
switch (window.orientation) {
......@@ -125,6 +168,19 @@ ApplicationWindow {
}
}
Timer {
id: restoreFocusTimer;
repeat: false;
running: false;
interval: 50;
onTriggered: {
btnSendMsgText.textBox.forceActiveFocus ();
}
}
ThemeEffect {
id: buzz;
effect: ThemeEffect.Press;
}
Item {
implicitHeight: Math.min (btnSendMsgText.textBox.implicitHeight, Theme.itemSizeLarge * 2);
anchors.bottom: parent.bottom;
......@@ -166,6 +222,7 @@ ApplicationWindow {
readonly property Item textBox : (sendTextMsgOnEnterKey ? inputMsgSingle : inputMsg);
function execute () {
var restore = (textBox.activeFocus && keepKeyboardOpenAfterMsgSend);
textBox.focus = false;
var tmp = textBox.text.trim ();
if (tmp !== "") {
......@@ -173,6 +230,10 @@ ApplicationWindow {
//TD_Global.autoScrollDownRequested (true);
}
textBox.text = "";
buzz.play ();
if (restore) {
restoreFocusTimer.start ();
}
}
}
}
......@@ -1921,10 +1982,9 @@ ApplicationWindow {
Item {
Container.forcedHeight: headerUserInfo.height;
}
DelegateDownloadableImage {
DelegateAvatar {
size: Theme.iconSizeExtraLarge;
fileItem: (pageUserInfo.userItem && pageUserInfo.userItem.profilePhoto ? pageUserInfo.userItem.profilePhoto.big : null);
autoDownload: true;
anchors.horizontalCenter: parent.horizontalCenter;
}
LabelFixed {
......@@ -2134,10 +2194,9 @@ ApplicationWindow {
anchors.margins: Theme.paddingLarge;
ExtraAnchors.horizontalFill: parent;
DelegateDownloadableImage {
DelegateAvatar {
size: Theme.iconSizeExtraLarge;
fileItem: (pageChatInfoPrivate.chatItem && pageChatInfoPrivate.chatItem.photo ? pageChatInfoPrivate.chatItem.photo.big : null);
autoDownload: true;
anchors.verticalCenter: parent.verticalCenter;
}
LabelFixed {
......@@ -2243,10 +2302,9 @@ ApplicationWindow {
anchors.margins: Theme.paddingLarge;
ExtraAnchors.horizontalFill: parent;
DelegateDownloadableImage {
DelegateAvatar {
size: Theme.iconSizeExtraLarge;
fileItem: (pageChatInfoBasicGroup.chatItem && pageChatInfoBasicGroup.chatItem.photo ? pageChatInfoBasicGroup.chatItem.photo.big : null);
autoDownload: true;
anchors.verticalCenter: parent.verticalCenter;
}
LabelFixed {
......@@ -2479,10 +2537,9 @@ ApplicationWindow {
anchors.margins: Theme.paddingLarge;
ExtraAnchors.horizontalFill: parent;
DelegateDownloadableImage {
DelegateAvatar {
size: Theme.iconSizeExtraLarge;
fileItem: (pageChatInfoSupergroup.chatItem && pageChatInfoSupergroup.chatItem.photo ? pageChatInfoSupergroup.chatItem.photo.big : null);
autoDownload: true;
anchors.verticalCenter: parent.verticalCenter;
}
LabelFixed {
......
......@@ -385,12 +385,11 @@ Page {
anchors.margins: Theme.paddingLarge;
ExtraAnchors.topDock: parent;
DelegateDownloadableImage {
DelegateAvatar {
size: Theme.iconSizeMedium;
fileItem: (!delegateMsg.messageItem.isChannelPost
? (delegateMsg.userItem && delegateMsg.userItem.profilePhoto ? delegateMsg.userItem.profilePhoto.big : null)
: (currentChat && currentChat.photo ? currentChat.photo.big : null));
autoDownload: true;
MouseArea {
anchors.fill: parent;
......@@ -827,10 +826,9 @@ Page {
}
}
}
DelegateDownloadableImage {
size: Theme.iconSizeLarge;
DelegateAvatar {
size: Theme.iconSizeMedium;
fileItem: (currentChat && currentChat.photo ? currentChat.photo.big : null);
autoDownload: true;
anchors.verticalCenter: parent.verticalCenter;
}
}
......
......@@ -42,13 +42,12 @@ Page {
}
ExtraAnchors.horizontalFill: parent;
DelegateDownloadableImage {
DelegateAvatar {
id: ico;
size: Theme.iconSizeMedium;
fileItem: (delegateContact.userItem && delegateContact.userItem.profilePhoto
? delegateContact.userItem.profilePhoto.big
: null);
autoDownload: true;
anchors.verticalCenter: parent.verticalCenter;
}
LabelFixed {
......
......@@ -3,6 +3,7 @@ import QtQmlTricks 3.0;
import Sailfish.Silica 1.0;
import Nemo.Notifications 1.0;
import harbour.Telegrame 1.0;
import QtGraphicalEffects 1.0;
import "../InternationalPhoneCodes.js" as InternationalPhoneCodes;
import "../components";
......@@ -473,11 +474,10 @@ Page {
anchors.verticalCenter: parent.verticalCenter;
ExtraAnchors.horizontalFill: parent;
DelegateDownloadableImage {
DelegateAvatar {
id: avatarChat;
size: Theme.iconSizeMedium;
fileItem: (delegateChat.chatPhotoItem ? delegateChat.chatPhotoItem.big : null);
autoDownload: true;
anchors.verticalCenter: parent.verticalCenter;
}
ColumnContainer {
......
import QtQuick 2.1;
import Sailfish.Silica 1.0;
import Nemo.Configuration 1.0;
import QtQmlTricks 3.0;
import "../components";
Page {
id: page;
......@@ -16,6 +18,16 @@ Page {
key: "/apps/telegrame/include_muted_chats_in_unread_count";
defaultValue: false;
}
ConfigurationValue {
id: configKeepKeyboardOpenAfterMsgSend;
key: "/apps/telegrame/keep_kdb_open_after_msg_send";
defaultValue: true;
}
ConfigurationValue {
id: configAvatarShape;
key: "/apps/telegrame/avatar_shape";
defaultValue: "square";
}
Column {
spacing: Theme.paddingLarge;
anchors {
......@@ -47,5 +59,68 @@ Page {
Binding on checked { value: configIncludeMutedChatsInUnreadCount.value; }
}
TextSwitch {
text: qsTr ("Keep keyboard open after sending message");
description: qsTr ("By default Jolla keyboard auto-closes, but we can bypass this")
automaticCheck: true;
onCheckedChanged: {
configKeepKeyboardOpenAfterMsgSend.value = checked;
}
Binding on checked { value: configKeepKeyboardOpenAfterMsgSend.value; }
}
LabelFixed {
text: qsTr ("Avatar shape");
anchors.horizontalCenter: parent.horizontalCenter;
}
RowContainer {
spacing: Theme.paddingLarge;
anchors.margins: Theme.paddingLarge;
ExtraAnchors.horizontalFill: parent;
Repeater {
model: [
{ "shape" : "square", "mask" : "qrc:///images/mask_square.svg", "label" : qsTr ("Square (default)") },
{ "shape" : "rounded", "mask" : "qrc:///images/mask_rounded.svg", "label" : qsTr ("Rounded square") },
{ "shape" : "squircle", "mask" : "qrc:///images/mask_squircle.svg", "label" : qsTr ("Meego 'squircle'") },
{ "shape" : "circle", "mask" : "qrc:///images/mask_circle.svg", "label" : qsTr ("Full circle") },
];
delegate: MouseArea {
id: delegateShape;
implicitHeight: (width * 1.65);
Container.horizontalStretch: 1;
onClicked: {
configAvatarShape.value = modelData ["shape"];
}
Rectangle {
color: Theme.secondaryHighlightColor;
radius: Theme.paddingMedium;
opacity: 0.15;
visible: (modelData ["shape"] === configAvatarShape.value);
antialiasing: true;
anchors.fill: parent;
}
ColumnContainer {
spacing: Theme.paddingMedium;
anchors.centerIn: parent;
Image {
source: modelData ["mask"];
opacity: 0.65;
sourceSize: Qt.size (delegateShape.width * 0.65, delegateShape.width * 0.65);
anchors.horizontalCenter: parent.horizontalCenter;
}
LabelFixed {
text: modelData ["label"].replace (/\s/g, "\n");
color: (modelData ["shape"] === configAvatarShape.value ? Theme.highlightColor : Theme.secondaryColor);
horizontalAlignment: Text.AlignHCenter;
font.pixelSize: Theme.fontSizeSmall;
anchors.horizontalCenter: parent.horizontalCenter;
}
}
}
}
}
}
}
......@@ -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: 8
Release: 9
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: 8
Release: 10
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