mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-09-10 12:03:18 +02:00
Donation campaign: add donate tipbox
GitLab: #1334 Change-Id: Ie32b6278fb28381524936baabf09ee3cbba04eb6
This commit is contained in:
parent
4e549d123e
commit
9d3b5cd0c5
5 changed files with 125 additions and 4 deletions
5
resources/icons/favorite_black_24dp.svg
Normal file
5
resources/icons/favorite_black_24dp.svg
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="21.5" height="20.112" viewBox="0 0 21.5 20.112">
|
||||||
|
<g id="favorite_black_24dp" transform="translate(-1.25 -2.25)">
|
||||||
|
<path id="Path_270" data-name="Path 270" d="M12,21.35l-1.45-1.32C5.4,15.36,2,12.28,2,8.5A5.447,5.447,0,0,1,7.5,3,5.988,5.988,0,0,1,12,5.09,5.988,5.988,0,0,1,16.5,3,5.447,5.447,0,0,1,22,8.5c0,3.78-3.4,6.86-8.55,11.54Z" fill="none" stroke="#03b9e9" stroke-width="1.5"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 448 B |
|
@ -839,6 +839,7 @@ Item {
|
||||||
property string zoomLevel: qsTr("Text zoom level")
|
property string zoomLevel: qsTr("Text zoom level")
|
||||||
|
|
||||||
//Donation campaign
|
//Donation campaign
|
||||||
|
property string donationTipBoxText: qsTr("Free and private sharing. <a href=\"https://jami.net/donate/\">Donate</a> to expand it.")
|
||||||
property string donation: qsTr("Donate")
|
property string donation: qsTr("Donate")
|
||||||
property string donationText: qsTr("If you enjoy using Jami and believe in our mission, would you make a donation?")
|
property string donationText: qsTr("If you enjoy using Jami and believe in our mission, would you make a donation?")
|
||||||
property string notNow: qsTr("Not now")
|
property string notNow: qsTr("Not now")
|
||||||
|
|
105
src/app/mainview/components/DonationTipBox.qml
Normal file
105
src/app/mainview/components/DonationTipBox.qml
Normal file
|
@ -0,0 +1,105 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2023 Savoir-faire Linux Inc.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import net.jami.Models 1.1
|
||||||
|
import net.jami.Adapters 1.1
|
||||||
|
import net.jami.Constants 1.1
|
||||||
|
import "../../commoncomponents"
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: root
|
||||||
|
focus: true
|
||||||
|
width: parent.width
|
||||||
|
height: backupLayout.height
|
||||||
|
|
||||||
|
property real iconSize: 26
|
||||||
|
property real margin: 5
|
||||||
|
property real preferredWidth: 170
|
||||||
|
|
||||||
|
property real maxHeight: 250
|
||||||
|
|
||||||
|
property color textColor: JamiTheme.textColor
|
||||||
|
property color iconColor: JamiTheme.tintedBlue
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
id: backupLayout
|
||||||
|
|
||||||
|
anchors.top: parent.top
|
||||||
|
width: parent.width
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
id: rowlayout
|
||||||
|
|
||||||
|
Layout.leftMargin: 15
|
||||||
|
Layout.alignment: Qt.AlignLeft
|
||||||
|
|
||||||
|
ResponsiveImage {
|
||||||
|
id: icon
|
||||||
|
|
||||||
|
visible: !opened
|
||||||
|
|
||||||
|
Layout.alignment: Qt.AlignLeft
|
||||||
|
Layout.topMargin: root.margin
|
||||||
|
Layout.preferredWidth: root.iconSize
|
||||||
|
Layout.preferredHeight: root.iconSize
|
||||||
|
|
||||||
|
containerHeight: Layout.preferredHeight
|
||||||
|
containerWidth: Layout.preferredWidth
|
||||||
|
|
||||||
|
color: JamiTheme.tintedBlue
|
||||||
|
|
||||||
|
source: JamiResources.favorite_black_24dp_svg
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id: title
|
||||||
|
text: JamiStrings.donation
|
||||||
|
color: root.textColor
|
||||||
|
font.weight: Font.Medium
|
||||||
|
Layout.topMargin: root.margin
|
||||||
|
Layout.alignment: Qt.AlignLeft
|
||||||
|
Layout.leftMargin: root.margin
|
||||||
|
Layout.preferredWidth: root.preferredWidth - 2 * root.margin - root.iconSize
|
||||||
|
font.pixelSize: JamiTheme.tipBoxTitleFontSize
|
||||||
|
horizontalAlignment: Text.AlignLeft
|
||||||
|
elide: Qt.ElideRight
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id: content
|
||||||
|
Layout.preferredWidth: root.preferredWidth
|
||||||
|
focus: true
|
||||||
|
Layout.leftMargin: 20
|
||||||
|
Layout.topMargin: 8
|
||||||
|
Layout.bottomMargin: 8
|
||||||
|
font.pixelSize: JamiTheme.tipBoxContentFontSize
|
||||||
|
visible: true
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
font.weight: Font.Normal
|
||||||
|
text: JamiStrings.donationTipBoxText
|
||||||
|
color: root.textColor
|
||||||
|
horizontalAlignment: Text.AlignLeft
|
||||||
|
linkColor: JamiTheme.buttonTintedBlue
|
||||||
|
onLinkActivated: {
|
||||||
|
Qt.openUrlExternally(JamiTheme.donationUrl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -37,7 +37,6 @@ FocusScope {
|
||||||
property color textColor: JamiTheme.textColor
|
property color textColor: JamiTheme.textColor
|
||||||
property color iconColor: JamiTheme.tintedBlue
|
property color iconColor: JamiTheme.tintedBlue
|
||||||
|
|
||||||
|
|
||||||
property string customizeTip: "CustomizeTipBox {}"
|
property string customizeTip: "CustomizeTipBox {}"
|
||||||
|
|
||||||
property string backupTip: "BackupTipBox {" + " onIgnore: {" + " root.ignoreClicked()" + " }" + "}"
|
property string backupTip: "BackupTipBox {" + " onIgnore: {" + " root.ignoreClicked()" + " }" + "}"
|
||||||
|
@ -56,7 +55,6 @@ FocusScope {
|
||||||
focus: true
|
focus: true
|
||||||
activeFocusOnTab: true
|
activeFocusOnTab: true
|
||||||
|
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: rect
|
id: rect
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
@ -73,6 +71,18 @@ FocusScope {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
anchors.topMargin: 10
|
anchors.topMargin: 10
|
||||||
|
|
||||||
|
Loader {
|
||||||
|
id: loader_donationTip
|
||||||
|
active: type === "donation"
|
||||||
|
focus: true
|
||||||
|
sourceComponent: DonationTipBox {
|
||||||
|
maxHeight: root.maximumHeight
|
||||||
|
textColor: root.textColor
|
||||||
|
iconColor: root.iconColor
|
||||||
|
}
|
||||||
|
width: parent.width
|
||||||
|
}
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
id: loader_backupTip
|
id: loader_backupTip
|
||||||
active: type === "backup"
|
active: type === "backup"
|
||||||
|
@ -95,7 +105,6 @@ FocusScope {
|
||||||
}
|
}
|
||||||
width: parent.width
|
width: parent.width
|
||||||
focus: true
|
focus: true
|
||||||
|
|
||||||
}
|
}
|
||||||
Loader {
|
Loader {
|
||||||
id: loader_infoTip
|
id: loader_infoTip
|
||||||
|
@ -106,7 +115,6 @@ FocusScope {
|
||||||
iconColor: root.iconColor
|
iconColor: root.iconColor
|
||||||
}
|
}
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -119,6 +127,7 @@ FocusScope {
|
||||||
|
|
||||||
TapHandler {
|
TapHandler {
|
||||||
target: rect
|
target: rect
|
||||||
|
enabled: type !== "donation"
|
||||||
onTapped: {
|
onTapped: {
|
||||||
return opened ? focus = false : root.forceActiveFocus();
|
return opened ? focus = false : root.forceActiveFocus();
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,6 +75,7 @@ TipsModel::reset()
|
||||||
beginResetModel();
|
beginResetModel();
|
||||||
tips_.clear();
|
tips_.clear();
|
||||||
|
|
||||||
|
tips_.append({{"id", "14"}, {"title", tr("Donate")}, {"desc", ""}, {"type", "donation"}});
|
||||||
tips_.append({{"id", "0"}, {"title", tr("Customize")}, {"desc", ""}, {"type", "customize"}});
|
tips_.append({{"id", "0"}, {"title", tr("Customize")}, {"desc", ""}, {"type", "customize"}});
|
||||||
tips_.append({{"id", "13"}, {"title", tr("Backup account")}, {"desc", ""}, {"type", "backup"}});
|
tips_.append({{"id", "13"}, {"title", tr("Backup account")}, {"desc", ""}, {"type", "backup"}});
|
||||||
tips_.append({{"id", "1"},
|
tips_.append({{"id", "1"},
|
||||||
|
|
Loading…
Add table
Reference in a new issue