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

files overview redesign done

This commit is contained in:
John Preston
2015-12-21 16:14:29 +03:00
parent cc004d435b
commit 0fd6f04aa9
17 changed files with 596 additions and 382 deletions

View File

@@ -1077,6 +1077,8 @@ class MessageLink : public ITextLink {
public:
MessageLink(PeerId peer, MsgId msgid) : _peer(peer), _msgid(msgid) {
}
MessageLink(HistoryItem *item) : _peer(item->history()->peer->id), _msgid(item->id) {
}
void onClick(Qt::MouseButton button) const;
PeerId peer() const {
return _peer;
@@ -1164,11 +1166,6 @@ public:
virtual void draw(Painter &p, const HistoryItem *parent, const QRect &r, bool selected, uint64 ms) const = 0;
virtual void getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y, const HistoryItem *parent) const = 0;
virtual void drawOverview(Painter &p, int32 width, const HistoryItem *parent, const QRect &r, bool selected, uint64 ms) const {
}
virtual void getStateOverview(TextLinkPtr &lnk, int32 x, int32 y, const HistoryItem *parent, int32 width) const {
}
virtual void linkOver(HistoryItem *parent, const TextLinkPtr &lnk) {
}
virtual void linkOut(HistoryItem *parent, const TextLinkPtr &lnk) {
@@ -1257,8 +1254,6 @@ public:
void draw(Painter &p, const HistoryItem *parent, const QRect &r, bool selected, uint64 ms) const;
void getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y, const HistoryItem *parent) const;
void getStateOverview(TextLinkPtr &lnk, int32 x, int32 y, const HistoryItem *parent, int32 width) const;
const QString inDialogsText() const;
const QString inHistoryText() const;
@@ -1303,17 +1298,6 @@ private:
};
static const int32 FileStatusSizeReady = 0x7FFFFFF0;
static const int32 FileStatusSizeLoaded = 0x7FFFFFF1;
static const int32 FileStatusSizeFailed = 0x7FFFFFF2;
QString formatSizeText(qint64 size);
QString formatDownloadText(qint64 ready, qint64 total);
QString formatDurationText(qint64 duration);
QString formatDurationAndSizeText(qint64 duration, qint64 size);
QString formatGifAndSizeText(qint64 size);
QString formatPlayedText(qint64 played, qint64 duration);
class HistoryFileMedia : public HistoryMedia {
public:
@@ -1393,9 +1377,6 @@ public:
void draw(Painter &p, const HistoryItem *parent, const QRect &r, bool selected, uint64 ms) const;
void getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y, const HistoryItem *parent) const;
void drawOverview(Painter &p, int32 width, const HistoryItem *parent, const QRect &r, bool selected, uint64 ms) const;
void getStateOverview(TextLinkPtr &lnk, int32 x, int32 y, const HistoryItem *parent, int32 width) const;
const QString inDialogsText() const;
const QString inHistoryText() const;
@@ -1467,9 +1448,6 @@ public:
void draw(Painter &p, const HistoryItem *parent, const QRect &r, bool selected, uint64 ms) const;
void getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y, const HistoryItem *parent) const;
void drawOverview(Painter &p, int32 width, const HistoryItem *parent, const QRect &r, bool selected, uint64 ms) const;
void getStateOverview(TextLinkPtr &lnk, int32 x, int32 y, const HistoryItem *parent, int32 width) const;
const QString inDialogsText() const;
const QString inHistoryText() const;
@@ -1533,9 +1511,6 @@ public:
void draw(Painter &p, const HistoryItem *parent, const QRect &r, bool selected, uint64 ms) const;
void getState(TextLinkPtr &lnk, HistoryCursorState &state, int32 x, int32 y, const HistoryItem *parent) const;
void drawOverview(Painter &p, int32 width, const HistoryItem *parent, const QRect &r, bool selected, uint64 ms) const;
void getStateOverview(TextLinkPtr &lnk, int32 x, int32 y, const HistoryItem *parent, int32 width) const;
const QString inDialogsText() const;
const QString inHistoryText() const;
@@ -1591,8 +1566,8 @@ private:
DocumentData *_data;
TextLinkPtr _linksavel, _linkcancell;
int32 _namew;
QString _name;
int32 _namew;
int32 _thumbw;
mutable int32 _linkw;