mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 07:33:52 +02:00
Pass correct context to setMarkedText.
This commit is contained in:
parent
e7b8a52278
commit
99bf61ac8c
3 changed files with 24 additions and 4 deletions
|
@ -15,6 +15,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "history/view/history_view_cursor_state.h"
|
#include "history/view/history_view_cursor_state.h"
|
||||||
#include "history/view/media/history_view_media_common.h"
|
#include "history/view/media/history_view_media_common.h"
|
||||||
#include "ui/text_options.h"
|
#include "ui/text_options.h"
|
||||||
|
#include "core/ui_integration.h"
|
||||||
#include "data/data_session.h"
|
#include "data/data_session.h"
|
||||||
#include "data/data_game.h"
|
#include "data/data_game.h"
|
||||||
#include "data/data_media_types.h"
|
#include "data/data_media_types.h"
|
||||||
|
@ -32,10 +33,14 @@ Game::Game(
|
||||||
, _title(st::msgMinWidth - st::webPageLeft)
|
, _title(st::msgMinWidth - st::webPageLeft)
|
||||||
, _description(st::msgMinWidth - st::webPageLeft) {
|
, _description(st::msgMinWidth - st::webPageLeft) {
|
||||||
if (!consumed.text.isEmpty()) {
|
if (!consumed.text.isEmpty()) {
|
||||||
|
const auto context = Core::UiIntegration::Context{
|
||||||
|
.session = &history()->session()
|
||||||
|
};
|
||||||
_description.setMarkedText(
|
_description.setMarkedText(
|
||||||
st::webPageDescriptionStyle,
|
st::webPageDescriptionStyle,
|
||||||
consumed,
|
consumed,
|
||||||
Ui::ItemTextOptions(parent->data()));
|
Ui::ItemTextOptions(parent->data()),
|
||||||
|
context);
|
||||||
}
|
}
|
||||||
history()->owner().registerGameView(_data, _parent);
|
history()->owner().registerGameView(_data, _parent);
|
||||||
}
|
}
|
||||||
|
@ -413,10 +418,14 @@ void Game::parentTextUpdated() {
|
||||||
if (const auto media = _parent->data()->media()) {
|
if (const auto media = _parent->data()->media()) {
|
||||||
const auto consumed = media->consumedMessageText();
|
const auto consumed = media->consumedMessageText();
|
||||||
if (!consumed.text.isEmpty()) {
|
if (!consumed.text.isEmpty()) {
|
||||||
|
const auto context = Core::UiIntegration::Context{
|
||||||
|
.session = &history()->session()
|
||||||
|
};
|
||||||
_description.setMarkedText(
|
_description.setMarkedText(
|
||||||
st::webPageDescriptionStyle,
|
st::webPageDescriptionStyle,
|
||||||
consumed,
|
consumed,
|
||||||
Ui::ItemTextOptions(_parent->data()));
|
Ui::ItemTextOptions(_parent->data()),
|
||||||
|
context);
|
||||||
} else {
|
} else {
|
||||||
_description = Ui::Text::String(st::msgMinWidth - st::webPageLeft);
|
_description = Ui::Text::String(st::msgMinWidth - st::webPageLeft);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
*/
|
*/
|
||||||
#include "history/view/media/history_view_media.h"
|
#include "history/view/media/history_view_media.h"
|
||||||
|
|
||||||
|
#include "history/history.h"
|
||||||
#include "history/history_item.h"
|
#include "history/history_item.h"
|
||||||
#include "history/view/history_view_element.h"
|
#include "history/view/history_view_element.h"
|
||||||
#include "history/view/history_view_cursor_state.h"
|
#include "history/view/history_view_cursor_state.h"
|
||||||
|
@ -14,6 +15,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "storage/storage_shared_media.h"
|
#include "storage/storage_shared_media.h"
|
||||||
#include "data/data_document.h"
|
#include "data/data_document.h"
|
||||||
#include "ui/text_options.h"
|
#include "ui/text_options.h"
|
||||||
|
#include "core/ui_integration.h"
|
||||||
#include "styles/style_history.h"
|
#include "styles/style_history.h"
|
||||||
|
|
||||||
namespace HistoryView {
|
namespace HistoryView {
|
||||||
|
@ -137,6 +139,9 @@ Ui::Text::String Media::createCaption(
|
||||||
- st::msgPadding.left()
|
- st::msgPadding.left()
|
||||||
- st::msgPadding.right();
|
- st::msgPadding.right();
|
||||||
auto result = Ui::Text::String(minResizeWidth);
|
auto result = Ui::Text::String(minResizeWidth);
|
||||||
|
const auto context = Core::UiIntegration::Context{
|
||||||
|
.session = &history()->session()
|
||||||
|
};
|
||||||
result.setMarkedText(
|
result.setMarkedText(
|
||||||
st::messageTextStyle,
|
st::messageTextStyle,
|
||||||
(timestampLinksDuration
|
(timestampLinksDuration
|
||||||
|
@ -145,7 +150,8 @@ Ui::Text::String Media::createCaption(
|
||||||
timestampLinksDuration,
|
timestampLinksDuration,
|
||||||
timestampLinkBase)
|
timestampLinkBase)
|
||||||
: item->originalText()),
|
: item->originalText()),
|
||||||
Ui::ItemTextOptions(item));
|
Ui::ItemTextOptions(item),
|
||||||
|
context);
|
||||||
if (const auto width = _parent->skipBlockWidth()) {
|
if (const auto width = _parent->skipBlockWidth()) {
|
||||||
result.updateSkipBlock(width, _parent->skipBlockHeight());
|
result.updateSkipBlock(width, _parent->skipBlockHeight());
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "core/application.h"
|
#include "core/application.h"
|
||||||
#include "core/file_utilities.h"
|
#include "core/file_utilities.h"
|
||||||
#include "core/mime_type.h"
|
#include "core/mime_type.h"
|
||||||
|
#include "core/ui_integration.h"
|
||||||
#include "ui/widgets/popup_menu.h"
|
#include "ui/widgets/popup_menu.h"
|
||||||
#include "ui/widgets/buttons.h"
|
#include "ui/widgets/buttons.h"
|
||||||
#include "ui/image/image.h"
|
#include "ui/image/image.h"
|
||||||
|
@ -1868,10 +1869,14 @@ void OverlayWidget::refreshCaption(HistoryItem *item) {
|
||||||
const auto base = duration
|
const auto base = duration
|
||||||
? DocumentTimestampLinkBase(_document, item->fullId())
|
? DocumentTimestampLinkBase(_document, item->fullId())
|
||||||
: QString();
|
: QString();
|
||||||
|
const auto context = Core::UiIntegration::Context{
|
||||||
|
.session = &item->history()->session()
|
||||||
|
};
|
||||||
_caption.setMarkedText(
|
_caption.setMarkedText(
|
||||||
st::mediaviewCaptionStyle,
|
st::mediaviewCaptionStyle,
|
||||||
AddTimestampLinks(caption, duration, base),
|
AddTimestampLinks(caption, duration, base),
|
||||||
Ui::ItemTextOptions(item));
|
Ui::ItemTextOptions(item),
|
||||||
|
context);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OverlayWidget::refreshGroupThumbs() {
|
void OverlayWidget::refreshGroupThumbs() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue