mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-14 21:27:07 +02:00
Improve shortcut messages geometry.
This commit is contained in:
parent
6e08b00dba
commit
fb539b0f70
4 changed files with 9 additions and 8 deletions
|
@ -735,7 +735,7 @@ TimeId HistoryItem::NewMessageDate(TimeId scheduled) {
|
|||
|
||||
TimeId HistoryItem::NewMessageDate(
|
||||
const Api::SendOptions &options) {
|
||||
return options.shortcutId ? TimeId() : NewMessageDate(options.scheduled);
|
||||
return options.shortcutId ? 1 : NewMessageDate(options.scheduled);
|
||||
}
|
||||
|
||||
HistoryServiceDependentData *HistoryItem::GetServiceDependentData() {
|
||||
|
|
|
@ -32,6 +32,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "mainwindow.h"
|
||||
#include "media/audio/media_audio.h"
|
||||
#include "media/player/media_player_instance.h"
|
||||
#include "data/business/data_shortcut_messages.h"
|
||||
#include "data/stickers/data_custom_emoji.h"
|
||||
#include "data/data_channel.h"
|
||||
#include "data/data_media_types.h"
|
||||
|
@ -301,10 +302,11 @@ ReplyFields ReplyFieldsFromMTP(
|
|||
if (const auto id = data.vreply_to_msg_id().value_or_empty()) {
|
||||
result.messageId = data.is_reply_to_scheduled()
|
||||
? owner->scheduledMessages().localMessageId(id)
|
||||
AssertIsDebug()
|
||||
: item->shortcutId()
|
||||
? owner->shortcutMessages().localMessageId(id)
|
||||
: id;
|
||||
result.topMessageId
|
||||
= data.vreply_to_top_id().value_or(id);
|
||||
= data.vreply_to_top_id().value_or(result.messageId.bare);
|
||||
result.topicPost = data.is_forum_topic() ? 1 : 0;
|
||||
}
|
||||
if (const auto header = data.vreply_from()) {
|
||||
|
|
|
@ -462,7 +462,7 @@ Element::Element(
|
|||
Flag serviceFlag)
|
||||
: _delegate(delegate)
|
||||
, _data(data)
|
||||
, _dateTime(IsItemScheduledUntilOnline(data)
|
||||
, _dateTime((IsItemScheduledUntilOnline(data) || data->shortcutId())
|
||||
? QDateTime()
|
||||
: ItemDateTime(data))
|
||||
, _text(st::msgMinWidth)
|
||||
|
|
|
@ -337,8 +337,8 @@ ShortcutMessages::ShortcutMessages(
|
|||
_inner->setEmptyInfoWidget(std::move(emptyInfo));
|
||||
}
|
||||
|
||||
widthValue() | rpl::start_with_next([=](int width) {
|
||||
resize(width, width);
|
||||
_inner->heightValue() | rpl::start_with_next([=](int height) {
|
||||
resize(width(), height);
|
||||
}, lifetime());
|
||||
}
|
||||
|
||||
|
@ -401,7 +401,6 @@ void ShortcutMessages::outerResized(QSize outer) {
|
|||
: 0;
|
||||
_skipScrollEvent = true;
|
||||
_inner->resizeToWidth(contentWidth, _scroll->height());
|
||||
resize(width(), _inner->height());
|
||||
_skipScrollEvent = false;
|
||||
|
||||
if (!_scroll->isHidden()) {
|
||||
|
@ -743,7 +742,7 @@ void ShortcutMessages::listAddTranslatedItems(
|
|||
|
||||
void ShortcutMessages::cornerButtonsShowAtPosition(
|
||||
Data::MessagePosition position) {
|
||||
//showAtPosition(position);
|
||||
showAtPosition(position);
|
||||
}
|
||||
|
||||
Data::Thread *ShortcutMessages::cornerButtonsThread() {
|
||||
|
|
Loading…
Add table
Reference in a new issue