Fix country flags + combobox contents list.

Replace unsupported Fonts (Qt need COLRv0).
Clean unused fonts
This commit is contained in:
Julien Wadel 2024-12-05 20:27:52 +01:00
parent a90a31955f
commit aceaa05ec6
104 changed files with 229 additions and 145 deletions

View file

@ -35,6 +35,13 @@ QSharedPointer<AccountCore> AccountCore::create(const std::shared_ptr<linphone::
return model;
}
QVariantMap createDialPlanVariant(QString flag, QString text) {
QVariantMap m;
m["flag"] = flag;
m["text"] = text;
return m;
}
AccountCore::AccountCore(const std::shared_ptr<linphone::Account> &account) : QObject(nullptr) {
App::getInstance()->mEngine->setObjectOwnership(this, QQmlEngine::CppOwnership);
// Should be call from model Thread
@ -87,12 +94,14 @@ AccountCore::AccountCore(const std::shared_ptr<linphone::Account> &account) : QO
mAccountModel = Utils::makeQObject_ptr<AccountModel>(account); // OK
mAccountModel->setSelf(mAccountModel);
mNotificationsAllowed = mAccountModel->getNotificationsAllowed();
mDialPlan = " ";
mDialPlan = createDialPlanVariant("", " ");
mDialPlans << mDialPlan;
for (auto dialPlan : linphone::Factory::get()->getDialPlans()) {
mDialPlans << mAccountModel->dialPlanAsString(dialPlan);
mDialPlans << createDialPlanVariant(
Utils::coreStringToAppString(dialPlan->getFlag()),
Utils::coreStringToAppString(dialPlan->getCountry() + " | +" + dialPlan->getCountryCallingCode()));
if (dialPlan->getCountryCallingCode() == account->getParams()->getInternationalPrefix()) {
mDialPlan = mAccountModel->dialPlanAsString(dialPlan);
mDialPlan = mDialPlans.last().toMap();
}
}
mVoicemailAddress =
@ -136,7 +145,7 @@ void AccountCore::setSelf(QSharedPointer<AccountCore> me) {
mAccountModelConnection->invokeToCore([this, displayName]() { onDisplayNameChanged(displayName); });
});
mAccountModelConnection->makeConnectToModel(&AccountModel::dialPlanChanged, [this](int index) {
auto dialPlan = mDialPlans[index + 1];
auto dialPlan = mDialPlans[index + 1].toMap();
mAccountModelConnection->invokeToCore([this, dialPlan]() { onDialPlanChanged(dialPlan); });
});
mAccountModelConnection->makeConnectToModel(&AccountModel::registerEnabledChanged, [this](bool enabled) {
@ -215,7 +224,7 @@ void AccountCore::setSelf(QSharedPointer<AccountCore> me) {
mAccountModelConnection->makeConnectToCore(&AccountCore::lSetDisplayName, [this](QString displayName) {
mAccountModelConnection->invokeToModel([this, displayName]() { mAccountModel->setDisplayName(displayName); });
});
mAccountModelConnection->makeConnectToCore(&AccountCore::lSetDialPlan, [this](QString dialPlan) {
mAccountModelConnection->makeConnectToCore(&AccountCore::lSetDialPlan, [this](QVariantMap dialPlan) {
auto dialPlanIndex = getDialPlanIndex(dialPlan);
mAccountModelConnection->invokeToModel(
[this, dialPlanIndex]() { mAccountModel->setDialPlan(dialPlanIndex - 1); });
@ -367,22 +376,22 @@ void AccountCore::onDisplayNameChanged(QString displayName) {
}
}
QStringList AccountCore::getDialPlans() {
QVariantList AccountCore::getDialPlans() {
return mDialPlans;
}
QString AccountCore::getDialPlan() const {
QVariantMap AccountCore::getDialPlan() const {
return mDialPlan;
}
void AccountCore::onDialPlanChanged(QString dialPlan) {
void AccountCore::onDialPlanChanged(QVariantMap dialPlan) {
if (dialPlan != mDialPlan) {
mDialPlan = dialPlan;
emit dialPlanChanged();
}
}
int AccountCore::getDialPlanIndex(QString dialPlanString) {
int AccountCore::getDialPlanIndex(QVariantMap dialPlanString) {
return mDialPlans.indexOf(dialPlanString);
}

View file

@ -42,8 +42,8 @@ class AccountCore : public QObject, public AbstractObject {
Q_PROPERTY(
int unreadMessageNotifications READ getUnreadMessageNotifications NOTIFY unreadMessageNotificationsChanged)
Q_PROPERTY(QString displayName READ getDisplayName WRITE lSetDisplayName NOTIFY displayNameChanged)
Q_PROPERTY(QStringList dialPlans READ getDialPlans CONSTANT)
Q_PROPERTY(QString dialPlan READ getDialPlan WRITE lSetDialPlan NOTIFY dialPlanChanged)
Q_PROPERTY(QVariantList dialPlans READ getDialPlans CONSTANT)
Q_PROPERTY(QVariantMap dialPlan READ getDialPlan WRITE lSetDialPlan NOTIFY dialPlanChanged)
Q_PROPERTY(
QString humaneReadableRegistrationState READ getHumanReadableRegistrationState NOTIFY registrationStateChanged)
Q_PROPERTY(QString humaneReadableRegistrationStateExplained READ getHumanReadableRegistrationStateExplained NOTIFY
@ -104,10 +104,10 @@ public:
Q_INVOKABLE void removeAccount();
QString getDisplayName() const;
void onDisplayNameChanged(QString displayName);
QStringList getDialPlans();
int getDialPlanIndex(QString dialPlanString);
QString getDialPlan() const;
void onDialPlanChanged(QString internationalPrefix);
QVariantList getDialPlans();
int getDialPlanIndex(QVariantMap dialPlanString);
QVariantMap getDialPlan() const;
void onDialPlanChanged(QVariantMap internationalPrefix);
QString getHumanReadableRegistrationState() const;
QString getHumanReadableRegistrationStateExplained() const;
bool getRegisterEnabled() const;
@ -177,7 +177,7 @@ signals:
void lResetMissedCalls();
void lRefreshNotifications();
void lSetDisplayName(QString displayName);
void lSetDialPlan(QString internationalPrefix);
void lSetDialPlan(QVariantMap internationalPrefix);
void lSetRegisterEnabled(bool enabled);
void lSetNotificationsAllowed(bool value);
void lSetMwiServerAddress(QString value);
@ -198,8 +198,8 @@ private:
QString mIdentityAddress;
QString mPictureUri;
QString mDisplayName;
QStringList mDialPlans;
QString mDialPlan;
QVariantList mDialPlans;
QVariantMap mDialPlan;
bool mRegisterEnabled;
bool mIsDefaultAccount = false;
LinphoneEnums::RegistrationState mRegistrationState;

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,93 @@
Copyright 2021 Google Inc. All Rights Reserved.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
https://openfontlicense.org
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

View file

@ -1,77 +1,23 @@
<RCC>
<qresource prefix="/">
<file>font/NotoColorEmoji_WindowsCompatible.ttf</file>
<file>font/Noto_Sans/static/NotoSans_SemiCondensed-LightItalic.ttf</file>
<file>font/Noto_Sans/static/NotoSans_Condensed-ThinItalic.ttf</file>
<file>font/Noto_Sans/static/NotoSans-SemiBoldItalic.ttf</file>
<file>font/Noto_Sans/static/NotoSans-Italic.ttf</file>
<file>font/Noto_Sans/static/NotoSans-MediumItalic.ttf</file>
<file>font/Noto_Sans/static/NotoSans_ExtraCondensed-BoldItalic.ttf</file>
<file>font/Noto_Sans/static/NotoSans_Condensed-ExtraBoldItalic.ttf</file>
<file>font/Noto_Sans/static/NotoSans_SemiCondensed-BlackItalic.ttf</file>
<file>font/Noto_Sans/static/NotoSans_Condensed-MediumItalic.ttf</file>
<file>font/Noto_Sans/static/NotoSans_Condensed-BoldItalic.ttf</file>
<file>font/Noto_Sans/static/NotoSans_Condensed-ExtraLightItalic.ttf</file>
<file>font/Noto_Sans/static/NotoSans_Condensed-Medium.ttf</file>
<file>font/Noto_Sans/static/NotoSans_Condensed-SemiBold.ttf</file>
<file>font/Noto_Sans/static/NotoSans_SemiCondensed-Black.ttf</file>
<file>font/Noto_Sans/static/NotoSans-Medium.ttf</file>
<file>font/Noto_Sans/static/NotoSans_Condensed-Bold.ttf</file>
<file>font/Noto_Sans/static/NotoSans_SemiCondensed-ExtraBold.ttf</file>
<file>font/Noto_Sans/static/NotoSans_SemiCondensed-Regular.ttf</file>
<file>font/Noto_Sans/static/NotoSans-SemiBold.ttf</file>
<file>font/Noto_Sans/static/NotoSans-ExtraBoldItalic.ttf</file>
<file>font/Noto_Sans/static/NotoSans_SemiCondensed-Medium.ttf</file>
<file>font/Noto_Sans/static/NotoSans-BlackItalic.ttf</file>
<file>font/Noto_Sans/static/NotoSans_SemiCondensed-MediumItalic.ttf</file>
<file>font/Noto_Sans/static/NotoSans-BoldItalic.ttf</file>
<file>font/Noto_Sans/static/NotoSans_SemiCondensed-SemiBoldItalic.ttf</file>
<file>font/Noto_Sans/static/NotoSans_SemiCondensed-ExtraBoldItalic.ttf</file>
<file>font/Noto_Sans/static/NotoSans_Condensed-SemiBoldItalic.ttf</file>
<file>font/Noto_Sans/static/NotoSans_ExtraCondensed-LightItalic.ttf</file>
<file>font/Noto_Sans/static/NotoSans_ExtraCondensed-MediumItalic.ttf</file>
<file>font/Noto_Sans/static/NotoSans_ExtraCondensed-ExtraBoldItalic.ttf</file>
<file>font/Noto_Sans/static/NotoSans_SemiCondensed-ExtraLightItalic.ttf</file>
<file>font/Noto_Sans/static/NotoSans_SemiCondensed-Italic.ttf</file>
<file>font/Noto_Sans/static/NotoSans_SemiCondensed-ThinItalic.ttf</file>
<file>font/Noto_Sans/static/NotoSans_ExtraCondensed-Italic.ttf</file>
<file>font/Noto_Sans/static/NotoSans_ExtraCondensed-SemiBoldItalic.ttf</file>
<file>font/Noto_Sans/static/NotoSans_ExtraCondensed-BlackItalic.ttf</file>
<file>font/Noto_Sans/static/NotoSans_Condensed-Italic.ttf</file>
<file>font/Noto_Sans/static/NotoSans-ExtraLight.ttf</file>
<file>font/Noto_Sans/static/NotoSans_SemiCondensed-Thin.ttf</file>
<file>font/Noto_Sans/static/NotoSans-Regular.ttf</file>
<file>font/Noto_Sans/static/NotoSans_SemiCondensed-Light.ttf</file>
<file>font/Noto_Sans/static/NotoSans_Condensed-ExtraBold.ttf</file>
<file>font/Noto_Sans/static/NotoSans_SemiCondensed-ExtraLight.ttf</file>
<file>font/Noto_Sans/static/NotoSans_Condensed-ExtraLight.ttf</file>
<file>font/Noto_Sans/static/NotoSans_SemiCondensed-SemiBold.ttf</file>
<file>font/Noto_Sans/static/NotoSans-Thin.ttf</file>
<file>font/Noto_Sans/static/NotoSans_SemiCondensed-Bold.ttf</file>
<file>font/Noto_Sans/static/NotoSans_ExtraCondensed-ExtraLightItalic.ttf</file>
<file>font/Noto_Sans/static/NotoSans_ExtraCondensed-Black.ttf</file>
<file>font/Noto_Sans/static/NotoSans-ExtraBold.ttf</file>
<file>font/Noto_Sans/static/NotoSans_Condensed-Light.ttf</file>
<file>font/Noto_Sans/static/NotoSans_ExtraCondensed-ThinItalic.ttf</file>
<file>font/Noto_Sans/static/NotoSans-Black.ttf</file>
<file>font/Noto_Sans/static/NotoSans-LightItalic.ttf</file>
<file>font/Noto_Sans/static/NotoSans-ThinItalic.ttf</file>
<file>font/Noto_Sans/static/NotoSans_SemiCondensed-BoldItalic.ttf</file>
<file>font/Noto_Sans/static/NotoSans_ExtraCondensed-SemiBold.ttf</file>
<file>font/Noto_Sans/static/NotoSans_ExtraCondensed-Light.ttf</file>
<file>font/Noto_Sans/static/NotoSans_Condensed-LightItalic.ttf</file>
<file>font/Noto_Sans/static/NotoSans_Condensed-BlackItalic.ttf</file>
<file>font/Noto_Sans/static/NotoSans-Bold.ttf</file>
<file>font/Noto_Sans/static/NotoSans_ExtraCondensed-ExtraBold.ttf</file>
<file>font/Noto_Sans/static/NotoSans_Condensed-Thin.ttf</file>
<file>font/Noto_Sans/static/NotoSans_Condensed-Regular.ttf</file>
<file>font/Noto_Sans/static/NotoSans_Condensed-Black.ttf</file>
<file>font/Noto_Sans/static/NotoSans_ExtraCondensed-Bold.ttf</file>
<file>font/Noto_Sans/static/NotoSans-Light.ttf</file>
<file>font/Noto_Sans/static/NotoSans_ExtraCondensed-Medium.ttf</file>
<file>font/Noto_Sans/static/NotoSans-ExtraLightItalic.ttf</file>
<file>font/Noto_Sans/static/NotoSans_ExtraCondensed-Regular.ttf</file>
<file>font/Noto_Sans/static/NotoSans_ExtraCondensed-ExtraLight.ttf</file>
<file>font/Noto_Sans/static/NotoSans_ExtraCondensed-Thin.ttf</file>
<file>font/EmojiTwoCOLRv0.ttf</file>
<file>font/Noto_Sans/NotoSans-Black.ttf</file>
<file>font/Noto_Sans/NotoSans-BlackItalic.ttf</file>
<file>font/Noto_Sans/NotoSans-Bold.ttf</file>
<file>font/Noto_Sans/NotoSans-BoldItalic.ttf</file>
<file>font/Noto_Sans/NotoSans-ExtraBold.ttf</file>
<file>font/Noto_Sans/NotoSans-ExtraBoldItalic.ttf</file>
<file>font/Noto_Sans/NotoSans-ExtraLight.ttf</file>
<file>font/Noto_Sans/NotoSans-ExtraLightItalic.ttf</file>
<file>font/Noto_Sans/NotoSans-Italic.ttf</file>
<file>font/Noto_Sans/NotoSans-Light.ttf</file>
<file>font/Noto_Sans/NotoSans-LightItalic.ttf</file>
<file>font/Noto_Sans/NotoSans-Medium.ttf</file>
<file>font/Noto_Sans/NotoSans-MediumItalic.ttf</file>
<file>font/Noto_Sans/NotoSans-Regular.ttf</file>
<file>font/Noto_Sans/NotoSans-SemiBold.ttf</file>
<file>font/Noto_Sans/NotoSans-SemiBoldItalic.ttf</file>
<file>font/Noto_Sans/NotoSans-Thin.ttf</file>
<file>font/Noto_Sans/NotoSans-ThinItalic.ttf</file>
</qresource>
</RCC>

View file

@ -16,6 +16,7 @@ Control.ComboBox {
property int leftMargin: 10 * DefaultStyle.dp
property bool oneLine: false
property bool shadowEnabled: mainItem.activeFocus || mainItem.hovered
property string flagRole// Specific case if flag is shown (special font)
onConstantImageSourceChanged: if (constantImageSource) selectedItemImg.source = constantImageSource
onCurrentIndexChanged: {
@ -29,6 +30,7 @@ Control.ComboBox {
: item
? item
: ""
if(mainItem.flagRole) selectedItemFlag.text = item[mainItem.flagRole]
selectedItemImg.source = constantImageSource
? constantImageSource
: item.img
@ -67,37 +69,47 @@ Control.ComboBox {
shadowOpacity: mainItem.shadowEnabled ? 0.1 : 0.0
}
}
contentItem: Item {
contentItem: RowLayout {
anchors.fill: parent
anchors.leftMargin: 10 * DefaultStyle.dp
anchors.rightMargin: indicImage.width + 10 * DefaultStyle.dp
spacing: 5 * DefaultStyle.dp
Image {
id: selectedItemImg
Layout.preferredWidth: visible ? 24 * DefaultStyle.dp : 0
Layout.leftMargin: mainItem.leftMargin
source: mainItem.constantImageSource ? mainItem.constantImageSource : ""
visible: source != ""
sourceSize.width: 24 * DefaultStyle.dp
width: visible ? 24 * DefaultStyle.dp : 0
fillMode: Image.PreserveAspectFit
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: visible ? mainItem.leftMargin : 0
}
Text {
id: selectedItemFlag
Layout.preferredWidth: implicitWidth
Layout.leftMargin: selectedItemImg.visible ? 0 : 5 * DefaultStyle.dp
Layout.alignment: Qt.AlignCenter
color: mainItem.enabled ? DefaultStyle.main2_600 : DefaultStyle.grey_400
font {
family: DefaultStyle.flagFont
pixelSize: mainItem.pixelSize
weight: mainItem.weight
}
}
Text {
id: selectedItemText
Layout.fillWidth: true
Layout.leftMargin: selectedItemImg.visible ? 0 : 5 * DefaultStyle.dp
Layout.rightMargin: 20 * DefaultStyle.dp
Layout.alignment: Qt.AlignCenter
color: mainItem.enabled ? DefaultStyle.main2_600 : DefaultStyle.grey_400
elide: Text.ElideRight
maximumLineCount: oneLine ? 1 : 2
wrapMode: Text.WrapAnywhere
font {
family: DefaultStyle.defaultFont
pixelSize: mainItem.pixelSize
weight: mainItem.weight
}
anchors.left: selectedItemImg.right
anchors.leftMargin: selectedItemImg.visible ? 5 * DefaultStyle.dp : 10 * DefaultStyle.dp
anchors.right: parent.right
anchors.rightMargin: 20 * DefaultStyle.dp
anchors.verticalCenter: parent.verticalCenter
}
}
@ -117,7 +129,7 @@ Control.ComboBox {
id: popup
y: mainItem.height - 1
width: mainItem.width
implicitHeight: contentItem.implicitHeight
implicitHeight: Math.min(contentItem.implicitHeight, mainWindow.height)
padding: 1 * DefaultStyle.dp
//height: Math.min(implicitHeight, 300)
@ -129,7 +141,7 @@ Control.ComboBox {
id: listView
clip: true
implicitHeight: contentHeight
height: contentHeight
height: popup.height
model: visible? mainItem.model : []
currentIndex: mainItem.highlightedIndex >= 0 ? mainItem.highlightedIndex : 0
highlightFollowsCurrentItem: true
@ -155,43 +167,59 @@ Control.ComboBox {
height: mainItem.height
// anchors.left: listView.left
// anchors.right: listView.right
Image {
id: delegateImg
visible: source != ""
width: visible ? 20 * DefaultStyle.dp : 0
sourceSize.width: 20 * DefaultStyle.dp
source: typeof(modelData) != "undefined" && modelData.img ? modelData.img : ""
fillMode: Image.PreserveAspectFit
anchors.left: parent.left
anchors.leftMargin: visible ? 10 * DefaultStyle.dp : 0
anchors.verticalCenter: parent.verticalCenter
}
Text {
text: typeof(modelData) != "undefined"
? mainItem.textRole
? modelData[mainItem.textRole]
: modelData.text
? modelData.text
: modelData
: $modelData
? mainItem.textRole
? $modelData[mainItem.textRole]
: $modelData
: ""
elide: Text.ElideRight
maximumLineCount: 1
wrapMode: Text.WrapAnywhere
font {
pixelSize: 14 * DefaultStyle.dp
weight: 400 * DefaultStyle.dp
RowLayout{
anchors.fill: parent
Image {
id: delegateImg
Layout.preferredWidth: visible ? 20 * DefaultStyle.dp : 0
Layout.leftMargin: 10 * DefaultStyle.dp
visible: source != ""
sourceSize.width: 20 * DefaultStyle.dp
source: typeof(modelData) != "undefined" && modelData.img ? modelData.img : ""
fillMode: Image.PreserveAspectFit
}
Text {
Layout.preferredWidth: implicitWidth
Layout.leftMargin: delegateImg.visible ? 0 : 5 * DefaultStyle.dp
Layout.alignment: Qt.AlignCenter
visible: mainItem.flagRole
font {
family: DefaultStyle.flagFont
pixelSize: mainItem.pixelSize
weight: mainItem.weight
}
text: mainItem.flagRole
? typeof(modelData) != "undefined"
? modelData[mainItem.flagRole]
: $modelData[mainItem.flagRole]
: ""
}
Text {
Layout.fillWidth: true
Layout.leftMargin: delegateImg.visible ? 0 : 5 * DefaultStyle.dp
Layout.rightMargin: 20 * DefaultStyle.dp
Layout.alignment: Qt.AlignCenter
text: typeof(modelData) != "undefined"
? mainItem.textRole
? modelData[mainItem.textRole]
: modelData.text
? modelData.text
: modelData
: $modelData
? mainItem.textRole
? $modelData[mainItem.textRole]
: $modelData
: ""
elide: Text.ElideRight
maximumLineCount: 1
wrapMode: Text.WrapAnywhere
font {
family: DefaultStyle.defaultFont
pixelSize: 14 * DefaultStyle.dp
weight: 400 * DefaultStyle.dp
}
}
anchors.verticalCenter: parent.verticalCenter
anchors.left: delegateImg.right
anchors.leftMargin: delegateImg.visible ? 5 * DefaultStyle.dp : 10 * DefaultStyle.dp
anchors.right: parent.right
anchors.rightMargin: 20 * DefaultStyle.dp
}
MouseArea {

View file

@ -51,7 +51,7 @@ ColumnLayout {
visible: text.length > 0
font.pixelSize: 21 * DefaultStyle.dp
text: parent.currentItem ? parent.currentItem.flag : ""
font.family: DefaultStyle.emojiFont
font.family: DefaultStyle.flagFont
anchors.rightMargin: 5 * DefaultStyle.dp
anchors.verticalCenter: parent.verticalCenter
}
@ -122,17 +122,20 @@ ColumnLayout {
delegate: Item {
width: listView.width
height: combobox.height
height: contentLayout.implicitHeight
RowLayout {
id: contentLayout
anchors.fill: parent
anchors.leftMargin: 20 * DefaultStyle.dp
spacing: 0
Text {
id: delegateImg
visible: text.length > 0
text: $modelData.flag
font {
pixelSize: 28 * DefaultStyle.dp
family: DefaultStyle.emojiFont
family: DefaultStyle.flagFont
}
}

Some files were not shown because too many files have changed in this diff Show more