mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-29 19:23:40 +02:00
draft: Implement new design for the draft indicator
GitLab: #427 Change-Id: I73818240946ab7c42eb238c50ca0f38061ff13d9
This commit is contained in:
parent
29c758a141
commit
f15233b31f
2 changed files with 11 additions and 9 deletions
|
@ -90,15 +90,8 @@ ConversationListModelBase::dataForItem(item_t item, int role) const
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
case Role::Draft: {
|
case Role::Draft: {
|
||||||
if (!item.uid.isEmpty()) {
|
if (!item.uid.isEmpty())
|
||||||
const auto draft = lrcInstance_->getContentDraft(item.uid, item.accountId);
|
return lrcInstance_->getContentDraft(item.uid, item.accountId);
|
||||||
if (!draft.isEmpty()) {
|
|
||||||
// Pencil Emoji
|
|
||||||
uint cp = 0x270F;
|
|
||||||
auto emojiString = QString::fromUcs4(reinterpret_cast<char32_t*>(&cp), 1);
|
|
||||||
return emojiString + draft;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
case Role::IsRequest:
|
case Role::IsRequest:
|
||||||
|
|
|
@ -36,6 +36,8 @@ ItemDelegate {
|
||||||
property string accountId: ""
|
property string accountId: ""
|
||||||
property string convId: ""
|
property string convId: ""
|
||||||
|
|
||||||
|
highlighted: ListView.isCurrentItem
|
||||||
|
|
||||||
onVisibleChanged: {
|
onVisibleChanged: {
|
||||||
if (visible)
|
if (visible)
|
||||||
return
|
return
|
||||||
|
@ -129,6 +131,13 @@ ItemDelegate {
|
||||||
color: JamiTheme.primaryForegroundColor
|
color: JamiTheme.primaryForegroundColor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Draft indicator
|
||||||
|
ResponsiveImage {
|
||||||
|
visible: Draft && !root.highlighted
|
||||||
|
source: JamiResources.round_edit_24dp_svg
|
||||||
|
color: JamiTheme.primaryForegroundColor
|
||||||
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
spacing: 2
|
spacing: 2
|
||||||
|
|
Loading…
Add table
Reference in a new issue