2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-05 08:55:59 +00:00

Move some style code to lib_ui.

This commit is contained in:
John Preston
2019-09-13 13:24:06 +03:00
parent 5a1c8e6a0a
commit e2f54eb3e9
69 changed files with 1119 additions and 856 deletions

View File

@@ -892,7 +892,8 @@ Document::Document(
if (withThumb()) {
_data->loadThumbnail(parent->fullId());
int32 tw = ConvertScale(_data->thumbnail()->width()), th = ConvertScale(_data->thumbnail()->height());
auto tw = style::ConvertScale(_data->thumbnail()->width());
auto th = style::ConvertScale(_data->thumbnail()->height());
if (tw > th) {
_thumbw = (tw * _st.fileThumbSize) / th;
} else {
@@ -1407,13 +1408,13 @@ Link::Link(
_page->photo->loadThumbnailSmall(parent->fullId());
}
tw = ConvertScale(_page->photo->width());
th = ConvertScale(_page->photo->height());
tw = style::ConvertScale(_page->photo->width());
th = style::ConvertScale(_page->photo->height());
} else if (_page && _page->document && _page->document->hasThumbnail()) {
_page->document->loadThumbnail(parent->fullId());
tw = ConvertScale(_page->document->thumbnail()->width());
th = ConvertScale(_page->document->thumbnail()->height());
tw = style::ConvertScale(_page->document->thumbnail()->width());
th = style::ConvertScale(_page->document->thumbnail()->height());
}
if (tw > st::linksPhotoSize) {
if (th > tw) {