mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-26 17:53:57 +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 {};
|
||||
}
|
||||
case Role::Draft: {
|
||||
if (!item.uid.isEmpty()) {
|
||||
const auto draft = 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;
|
||||
}
|
||||
}
|
||||
if (!item.uid.isEmpty())
|
||||
return lrcInstance_->getContentDraft(item.uid, item.accountId);
|
||||
return {};
|
||||
}
|
||||
case Role::IsRequest:
|
||||
|
|
|
@ -36,6 +36,8 @@ ItemDelegate {
|
|||
property string accountId: ""
|
||||
property string convId: ""
|
||||
|
||||
highlighted: ListView.isCurrentItem
|
||||
|
||||
onVisibleChanged: {
|
||||
if (visible)
|
||||
return
|
||||
|
@ -129,6 +131,13 @@ ItemDelegate {
|
|||
color: JamiTheme.primaryForegroundColor
|
||||
}
|
||||
|
||||
// Draft indicator
|
||||
ResponsiveImage {
|
||||
visible: Draft && !root.highlighted
|
||||
source: JamiResources.round_edit_24dp_svg
|
||||
color: JamiTheme.primaryForegroundColor
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
Layout.fillHeight: true
|
||||
spacing: 2
|
||||
|
|
Loading…
Add table
Reference in a new issue