2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Move text options constant to a separate module.

Also start MediaView group thumbs code.
This commit is contained in:
John Preston
2017-12-28 16:06:06 +03:00
parent 54d6673d0b
commit 5b4694a4eb
37 changed files with 721 additions and 257 deletions

View File

@@ -32,6 +32,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "ui/widgets/scroll_area.h"
#include "ui/wrap/fade_wrap.h"
#include "ui/grouped_layout.h"
#include "ui/text_options.h"
#include "media/media_clip_reader.h"
#include "window/window_controller.h"
#include "styles/style_history.h"
@@ -796,7 +797,10 @@ void SingleFilePreview::preparePreview(const Storage::PreparedFile &file) {
const auto filepath = file.path;
if (filepath.isEmpty()) {
auto filename = filedialogDefaultName(qsl("image"), qsl(".png"), QString(), true);
_nameText.setText(st::semiboldTextStyle, filename, _textNameOptions);
_nameText.setText(
st::semiboldTextStyle,
filename,
Ui::NameTextOptions());
_statusText = qsl("%1x%2").arg(preview.width()).arg(preview.height());
_statusWidth = qMax(_nameText.maxWidth(), st::normalFont->width(_statusText));
_fileIsImage = true;
@@ -823,7 +827,7 @@ void SingleFilePreview::preparePreview(const Storage::PreparedFile &file) {
_nameText.setText(
st::semiboldTextStyle,
nameString,
_textNameOptions);
Ui::NameTextOptions());
_statusText = formatSizeText(fileinfo.size());
_statusWidth = qMax(
_nameText.maxWidth(),