2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Merge branch 'game_media' into player

Conflicts:
	Telegram/Resources/basic.style
	Telegram/SourceFiles/media/player/media_player_list.cpp
	Telegram/SourceFiles/title.cpp
This commit is contained in:
John Preston
2016-09-30 20:07:56 +03:00
110 changed files with 712 additions and 541 deletions

View File

@@ -22,6 +22,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
#include "overview/overview_layout.h"
#include "styles/style_overview.h"
#include "styles/style_history.h"
#include "ui/filedialog.h"
#include "boxes/addcontactbox.h"
#include "boxes/confirmbox.h"
@@ -334,15 +335,15 @@ void Video::paint(Painter &p, const QRect &clip, TextSelection selection, const
p.setRenderHint(QPainter::HighQualityAntialiasing, false);
p.setOpacity((radial && loaded) ? _radial->opacity() : 1);
style::sprite icon;
if (radial) {
icon = (selected ? st::msgFileInCancelSelected : st::msgFileInCancel);
} else if (loaded) {
icon = (selected ? st::msgFileInPlaySelected : st::msgFileInPlay);
} else {
icon = (selected ? st::msgFileInDownloadSelected : st::msgFileInDownload);
}
p.drawSpriteCenter(inner, icon);
auto icon = ([radial, loaded, selected] {
if (radial) {
return &(selected ? st::historyFileInCancelSelected : st::historyFileInCancel);
} else if (loaded) {
return &(selected ? st::historyFileInPlaySelected : st::historyFileInPlay);
}
return &(selected ? st::historyFileInDownloadSelected : st::historyFileInDownload);
})();
icon->paintInCenter(p, inner);
if (radial) {
p.setOpacity(1);
QRect rinner(inner.marginsRemoved(QMargins(st::msgFileRadialLine, st::msgFileRadialLine, st::msgFileRadialLine, st::msgFileRadialLine)));
@@ -462,17 +463,17 @@ void Voice::paint(Painter &p, const QRect &clip, TextSelection selection, const
_radial->draw(p, rinner, st::msgFileRadialLine, bg);
}
style::sprite icon;
if (showPause) {
icon = selected ? st::msgFileInPauseSelected : st::msgFileInPause;
} else if (_statusSize < 0 || _statusSize == FileStatusSizeLoaded) {
icon = selected ? st::msgFileInPlaySelected : st::msgFileInPlay;
} else if (_data->loading()) {
icon = selected ? st::msgFileInCancelSelected : st::msgFileInCancel;
} else {
icon = selected ? st::msgFileInDownloadSelected : st::msgFileInDownload;
}
p.drawSpriteCenter(inner, icon);
auto icon = ([showPause, this, selected] {
if (showPause) {
return &(selected ? st::historyFileInPauseSelected : st::historyFileInPause);
} else if (_statusSize < 0 || _statusSize == FileStatusSizeLoaded) {
return &(selected ? st::historyFileInPlaySelected : st::historyFileInPlay);
} else if (_data->loading()) {
return &(selected ? st::historyFileInCancelSelected : st::historyFileInCancel);
}
return &(selected ? st::historyFileInDownloadSelected : st::historyFileInDownload);
})();
icon->paintInCenter(p, inner);
}
int32 namewidth = _width - nameleft - nameright;
@@ -673,17 +674,17 @@ void Document::paint(Painter &p, const QRect &clip, TextSelection selection, con
_radial->draw(p, rinner, st::msgFileRadialLine, bg);
}
style::sprite icon;
if (showPause) {
icon = selected ? st::msgFileInPauseSelected : st::msgFileInPause;
} else if (loaded) {
icon = selected ? st::msgFileInPlaySelected : st::msgFileInPlay;
} else if (_data->loading()) {
icon = selected ? st::msgFileInCancelSelected : st::msgFileInCancel;
} else {
icon = selected ? st::msgFileInDownloadSelected : st::msgFileInDownload;
}
p.drawSpriteCenter(inner, icon);
auto icon = ([showPause, loaded, this, selected] {
if (showPause) {
return &(selected ? st::historyFileInPauseSelected : st::historyFileInPause);
} else if (loaded) {
return &(selected ? st::historyFileInPlaySelected : st::historyFileInPlay);
} else if (_data->loading()) {
return &(selected ? st::historyFileInCancelSelected : st::historyFileInCancel);
}
return &(selected ? st::historyFileInDownloadSelected : st::historyFileInDownload);
})();
icon->paintInCenter(p, inner);
}
} else {
nameleft = st::overviewFileSize + st::overviewFilePadding.right();
@@ -749,13 +750,13 @@ void Document::paint(Painter &p, const QRect &clip, TextSelection selection, con
p.setRenderHint(QPainter::HighQualityAntialiasing, false);
p.setOpacity(radialOpacity);
style::sprite icon;
if (loaded || _data->loading()) {
icon = (selected ? st::msgFileInCancelSelected : st::msgFileInCancel);
} else {
icon = (selected ? st::msgFileInDownloadSelected : st::msgFileInDownload);
}
p.drawSpriteCenter(inner, icon);
auto icon = ([loaded, this, selected] {
if (loaded || _data->loading()) {
return &(selected ? st::historyFileInCancelSelected : st::historyFileInCancel);
}
return &(selected ? st::historyFileInDownloadSelected : st::historyFileInDownload);
})();
icon->paintInCenter(p, inner);
if (radial) {
p.setOpacity(1);