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

voice messages moved to documents with waveforms

This commit is contained in:
John Preston
2016-02-12 19:35:06 +03:00
parent ffa588bf5d
commit 189d0e8de3
36 changed files with 1615 additions and 2495 deletions

View File

@@ -363,7 +363,7 @@ void MediaView::updateControls() {
_dateNav = myrtlrect(st::mvTextLeft, height() - st::mvTextTop, st::mvFont->width(_dateText), st::mvFont->height);
}
updateHeader();
if (_photo || (_history && (_overview == OverviewPhotos || _overview == OverviewDocuments))) {
if (_photo || (_history && (_overview == OverviewPhotos || _overview == OverviewFiles))) {
_leftNavVisible = (_index > 0) || (_index == 0 && (
(!_msgmigrated && _history && _history->overview[_overview].size() < _history->overviewCount(_overview)) ||
(_msgmigrated && _migrated && _migrated->overview[_overview].size() < _migrated->overviewCount(_overview)) ||
@@ -865,7 +865,7 @@ void MediaView::showDocument(DocumentData *doc, HistoryItem *context) {
_canForward = _msgid > 0;
_canDelete = context ? context->canDelete() : false;
if (_history) {
_overview = OverviewDocuments;
_overview = OverviewFiles;
findCurrent();
}
displayDocument(doc, context);
@@ -1486,7 +1486,7 @@ void MediaView::keyPressEvent(QKeyEvent *e) {
}
void MediaView::moveToNext(int32 delta) {
if (_index < 0 || (_history && _overview != OverviewPhotos && _overview != OverviewDocuments) || (_overview == OverviewCount && !_user)) {
if (_index < 0 || (_history && _overview != OverviewPhotos && _overview != OverviewFiles) || (_overview == OverviewCount && !_user)) {
return;
}
if (_msgmigrated && !_history->overviewLoaded(_overview)) {
@@ -1515,7 +1515,7 @@ void MediaView::moveToNext(int32 delta) {
if (HistoryMedia *media = item->getMedia()) {
switch (media->type()) {
case MediaTypePhoto: displayPhoto(static_cast<HistoryPhoto*>(item->getMedia())->photo(), item); preloadData(delta); break;
case MediaTypeDocument:
case MediaTypeFile:
case MediaTypeGif:
case MediaTypeSticker: displayDocument(media->getDocument(), item); preloadData(delta); break;
}
@@ -1562,7 +1562,7 @@ void MediaView::preloadData(int32 delta) {
if (HistoryMedia *media = item->getMedia()) {
switch (media->type()) {
case MediaTypePhoto: static_cast<HistoryPhoto*>(media)->photo()->forget(); break;
case MediaTypeDocument:
case MediaTypeFile:
case MediaTypeGif:
case MediaTypeSticker: media->getDocument()->forget(); break;
}
@@ -1587,7 +1587,7 @@ void MediaView::preloadData(int32 delta) {
if (HistoryMedia *media = item->getMedia()) {
switch (media->type()) {
case MediaTypePhoto: static_cast<HistoryPhoto*>(media)->photo()->download(); break;
case MediaTypeDocument:
case MediaTypeFile:
case MediaTypeGif: {
DocumentData *doc = media->getDocument();
doc->thumb->load();