2014-08-15 11:19:32 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
2014-12-01 10:47:38 +00:00
|
|
|
the official desktop version of Telegram messaging app, see https://telegram.org
|
2014-08-15 11:19:32 +00:00
|
|
|
|
|
|
|
Telegram Desktop is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
It is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
2015-10-03 13:16:42 +00:00
|
|
|
In addition, as a special exception, the copyright holders give permission
|
|
|
|
to link the code of portions of this program with the OpenSSL library.
|
|
|
|
|
2014-08-15 11:19:32 +00:00
|
|
|
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
2017-01-11 18:31:31 +00:00
|
|
|
Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
2014-08-15 11:19:32 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2016-05-19 12:03:51 +00:00
|
|
|
#include "window/section_widget.h"
|
2016-10-26 16:43:13 +00:00
|
|
|
#include "ui/widgets/tooltip.h"
|
2016-11-16 10:44:06 +00:00
|
|
|
#include "ui/widgets/scroll_area.h"
|
2016-05-19 12:03:51 +00:00
|
|
|
|
2016-04-12 21:31:28 +00:00
|
|
|
namespace Overview {
|
|
|
|
namespace Layout {
|
|
|
|
class AbstractItem;
|
|
|
|
class ItemBase;
|
|
|
|
class Date;
|
|
|
|
} // namespace Layout
|
|
|
|
} // namespace Overview
|
|
|
|
|
2016-10-12 19:34:25 +00:00
|
|
|
namespace Ui {
|
|
|
|
class PlainShadow;
|
2016-10-26 16:43:13 +00:00
|
|
|
class PopupMenu;
|
2016-10-27 21:19:38 +00:00
|
|
|
class IconButton;
|
2016-11-15 11:56:49 +00:00
|
|
|
class FlatInput;
|
2016-11-21 17:46:29 +00:00
|
|
|
class CrossButton;
|
2016-10-12 19:34:25 +00:00
|
|
|
} // namespace Ui
|
|
|
|
|
2017-01-01 16:45:20 +00:00
|
|
|
namespace Notify {
|
|
|
|
struct PeerUpdate;
|
|
|
|
} // namespace Notify
|
|
|
|
|
2014-08-15 11:19:32 +00:00
|
|
|
class OverviewWidget;
|
2016-10-26 16:43:13 +00:00
|
|
|
class OverviewInner : public TWidget, public Ui::AbstractTooltipShower, public RPCSender, private base::Subscriber {
|
2014-08-15 11:19:32 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2016-11-16 10:44:06 +00:00
|
|
|
OverviewInner(OverviewWidget *overview, Ui::ScrollArea *scroll, PeerData *peer, MediaOverviewType type);
|
2014-08-15 11:19:32 +00:00
|
|
|
|
2015-08-28 15:15:56 +00:00
|
|
|
void activate();
|
|
|
|
|
2014-08-15 11:19:32 +00:00
|
|
|
void clear();
|
2015-09-03 10:48:40 +00:00
|
|
|
int32 itemTop(const FullMsgId &msgId) const;
|
2014-08-15 11:19:32 +00:00
|
|
|
|
2015-08-28 15:15:56 +00:00
|
|
|
bool preloadLocal();
|
|
|
|
void preloadMore();
|
|
|
|
|
2014-08-20 05:32:50 +00:00
|
|
|
void showContextMenu(QContextMenuEvent *e, bool showFromTouch = false);
|
|
|
|
|
|
|
|
void dragActionStart(const QPoint &screenPos, Qt::MouseButton button = Qt::LeftButton);
|
|
|
|
void dragActionUpdate(const QPoint &screenPos);
|
|
|
|
void dragActionFinish(const QPoint &screenPos, Qt::MouseButton button = Qt::LeftButton);
|
|
|
|
void dragActionCancel();
|
|
|
|
|
|
|
|
void touchScrollUpdated(const QPoint &screenPos);
|
|
|
|
QPoint mapMouseToItem(QPoint p, MsgId itemId, int32 itemIndex);
|
2014-08-15 11:19:32 +00:00
|
|
|
|
2015-12-23 11:13:08 +00:00
|
|
|
int32 resizeToWidth(int32 nwidth, int32 scrollTop, int32 minHeight, bool force = false); // returns new scroll top
|
2014-08-15 11:19:32 +00:00
|
|
|
void dropResizeIndex();
|
|
|
|
|
|
|
|
PeerData *peer() const;
|
2015-11-18 13:11:56 +00:00
|
|
|
PeerData *migratePeer() const;
|
2014-08-15 11:19:32 +00:00
|
|
|
MediaOverviewType type() const;
|
|
|
|
void switchType(MediaOverviewType type);
|
|
|
|
|
2014-11-14 23:23:35 +00:00
|
|
|
void setSelectMode(bool enabled);
|
|
|
|
|
2015-12-23 11:13:08 +00:00
|
|
|
void mediaOverviewUpdated();
|
2014-08-20 19:13:00 +00:00
|
|
|
void changingMsgId(HistoryItem *row, MsgId newId);
|
2015-12-27 21:37:48 +00:00
|
|
|
void repaintItem(const HistoryItem *msg);
|
2016-02-28 12:36:23 +00:00
|
|
|
|
2014-08-20 05:32:50 +00:00
|
|
|
void getSelectionState(int32 &selectedForForward, int32 &selectedForDelete) const;
|
|
|
|
void clearSelectedItems(bool onlyTextSelection = false);
|
|
|
|
void fillSelectedItems(SelectedItemSet &sel, bool forDelete = true);
|
|
|
|
|
2016-03-29 17:17:00 +00:00
|
|
|
// AbstractTooltipShower interface
|
|
|
|
QString tooltipText() const override;
|
|
|
|
QPoint tooltipPos() const override;
|
2016-02-07 18:58:42 +00:00
|
|
|
|
2014-08-15 11:19:32 +00:00
|
|
|
~OverviewInner();
|
|
|
|
|
2016-10-13 15:04:40 +00:00
|
|
|
protected:
|
|
|
|
bool event(QEvent *e) override;
|
|
|
|
void touchEvent(QTouchEvent *e);
|
|
|
|
void paintEvent(QPaintEvent *e) override;
|
|
|
|
void mouseMoveEvent(QMouseEvent *e) override;
|
|
|
|
void mousePressEvent(QMouseEvent *e) override;
|
|
|
|
void mouseReleaseEvent(QMouseEvent *e) override;
|
|
|
|
void keyPressEvent(QKeyEvent *e) override;
|
2017-02-11 11:24:37 +00:00
|
|
|
void enterEventHook(QEvent *e) override;
|
|
|
|
void leaveEventHook(QEvent *e) override;
|
2016-10-13 15:04:40 +00:00
|
|
|
void resizeEvent(QResizeEvent *e) override;
|
|
|
|
|
2014-08-15 11:19:32 +00:00
|
|
|
public slots:
|
2014-08-20 05:32:50 +00:00
|
|
|
void onUpdateSelected();
|
2014-08-15 11:19:32 +00:00
|
|
|
|
2015-08-28 15:15:56 +00:00
|
|
|
void copyContextUrl();
|
2014-08-15 11:19:32 +00:00
|
|
|
void cancelContextDownload();
|
|
|
|
void showContextInFolder();
|
|
|
|
|
|
|
|
void goToMessage();
|
|
|
|
void forwardMessage();
|
2014-09-30 14:11:09 +00:00
|
|
|
void selectMessage();
|
2014-08-15 11:19:32 +00:00
|
|
|
|
2015-08-28 15:15:56 +00:00
|
|
|
void onSearchUpdate();
|
|
|
|
void onCancel();
|
|
|
|
bool onCancelSearch();
|
|
|
|
|
2014-08-15 11:19:32 +00:00
|
|
|
void onMenuDestroy(QObject *obj);
|
2014-08-20 05:32:50 +00:00
|
|
|
void onTouchSelect();
|
|
|
|
void onTouchScrollTimer();
|
2014-08-15 11:19:32 +00:00
|
|
|
|
2015-06-28 13:16:25 +00:00
|
|
|
void onDragExec();
|
|
|
|
|
2015-08-28 15:15:56 +00:00
|
|
|
bool onSearchMessages(bool searchCache = false);
|
|
|
|
void onNeedSearchMessages();
|
|
|
|
|
2014-08-15 11:19:32 +00:00
|
|
|
private:
|
2016-12-09 18:56:01 +00:00
|
|
|
void saveDocumentToFile(DocumentData *document);
|
2016-12-20 13:03:51 +00:00
|
|
|
void invalidateCache();
|
2016-12-09 18:56:01 +00:00
|
|
|
|
2016-10-14 17:10:15 +00:00
|
|
|
void itemRemoved(HistoryItem *item);
|
2015-12-20 14:05:07 +00:00
|
|
|
MsgId complexMsgId(const HistoryItem *item) const;
|
|
|
|
|
2015-11-18 13:11:56 +00:00
|
|
|
bool itemMigrated(MsgId msgId) const;
|
|
|
|
ChannelId itemChannel(MsgId msgId) const;
|
|
|
|
MsgId itemMsgId(MsgId msgId) const;
|
|
|
|
int32 migratedIndexSkip() const;
|
|
|
|
|
2014-08-20 05:32:50 +00:00
|
|
|
void fixItemIndex(int32 ¤t, MsgId msgId) const;
|
|
|
|
bool itemHasPoint(MsgId msgId, int32 index, int32 x, int32 y) const;
|
|
|
|
int32 itemHeight(MsgId msgId, int32 index) const;
|
|
|
|
void moveToNextItem(MsgId &msgId, int32 &index, MsgId upTo, int32 delta) const;
|
|
|
|
|
|
|
|
void updateDragSelection(MsgId dragSelFrom, int32 dragSelFromIndex, MsgId dragSelTo, int32 dragSelToIndex, bool dragSelecting);
|
|
|
|
|
2015-12-27 21:37:48 +00:00
|
|
|
void repaintItem(MsgId itemId, int32 itemIndex);
|
2014-08-20 05:32:50 +00:00
|
|
|
|
|
|
|
void touchResetSpeed();
|
|
|
|
void touchUpdateSpeed();
|
|
|
|
void touchDeaccelerate(int32 elapsed);
|
|
|
|
|
|
|
|
void applyDragSelection();
|
2015-11-18 13:11:56 +00:00
|
|
|
void addSelectionRange(int32 selFrom, int32 selTo, History *history);
|
2014-08-20 05:32:50 +00:00
|
|
|
|
2015-12-23 11:13:08 +00:00
|
|
|
void recountMargins();
|
|
|
|
int32 countHeight();
|
2014-08-15 11:19:32 +00:00
|
|
|
|
|
|
|
OverviewWidget *_overview;
|
2016-11-16 10:44:06 +00:00
|
|
|
Ui::ScrollArea *_scroll;
|
2016-10-14 17:10:15 +00:00
|
|
|
int _resizeIndex = -1;
|
|
|
|
int _resizeSkip = 0;
|
2014-08-15 11:19:32 +00:00
|
|
|
|
|
|
|
PeerData *_peer;
|
|
|
|
MediaOverviewType _type;
|
2015-12-22 12:49:42 +00:00
|
|
|
bool _reversed;
|
2015-11-13 15:14:33 +00:00
|
|
|
History *_migrated, *_history;
|
2015-09-03 10:48:40 +00:00
|
|
|
ChannelId _channel;
|
2016-02-28 12:36:23 +00:00
|
|
|
|
2016-10-14 17:10:15 +00:00
|
|
|
bool _selMode = false;
|
2016-04-13 18:29:32 +00:00
|
|
|
TextSelection itemSelectedValue(int32 index) const;
|
2015-12-22 12:49:42 +00:00
|
|
|
|
2016-10-14 17:10:15 +00:00
|
|
|
int _rowsLeft = 0;
|
|
|
|
int _rowWidth = 0;
|
2015-12-19 18:09:24 +00:00
|
|
|
|
2016-04-12 21:31:28 +00:00
|
|
|
typedef QVector<Overview::Layout::AbstractItem*> Items;
|
2015-12-23 11:13:08 +00:00
|
|
|
Items _items;
|
2016-04-12 21:31:28 +00:00
|
|
|
typedef QMap<HistoryItem*, Overview::Layout::ItemBase*> LayoutItems;
|
2015-12-23 11:13:08 +00:00
|
|
|
LayoutItems _layoutItems;
|
2016-04-12 21:31:28 +00:00
|
|
|
typedef QMap<int32, Overview::Layout::Date*> LayoutDates;
|
2015-12-23 11:13:08 +00:00
|
|
|
LayoutDates _layoutDates;
|
2016-04-12 21:31:28 +00:00
|
|
|
Overview::Layout::ItemBase *layoutPrepare(HistoryItem *item);
|
|
|
|
Overview::Layout::AbstractItem *layoutPrepare(const QDate &date, bool month);
|
|
|
|
int32 setLayoutItem(int32 index, Overview::Layout::AbstractItem *item, int32 top);
|
2014-08-15 11:19:32 +00:00
|
|
|
|
2016-12-13 17:07:56 +00:00
|
|
|
object_ptr<Ui::FlatInput> _search;
|
|
|
|
object_ptr<Ui::CrossButton> _cancelSearch;
|
2015-08-28 15:15:56 +00:00
|
|
|
QVector<MsgId> _results;
|
2015-12-23 11:13:08 +00:00
|
|
|
int32 _itemsToBeLoaded;
|
|
|
|
|
|
|
|
// photos
|
2016-10-14 17:10:15 +00:00
|
|
|
int32 _photosInRow = 1;
|
2015-08-28 15:15:56 +00:00
|
|
|
|
|
|
|
QTimer _searchTimer;
|
|
|
|
QString _searchQuery;
|
2016-10-14 17:10:15 +00:00
|
|
|
bool _inSearch = false;
|
|
|
|
bool _searchFull = false;
|
|
|
|
bool _searchFullMigrated = false;
|
|
|
|
mtpRequestId _searchRequest = 0;
|
2015-08-28 15:15:56 +00:00
|
|
|
History::MediaOverview _searchResults;
|
2016-10-14 17:10:15 +00:00
|
|
|
MsgId _lastSearchId = 0;
|
|
|
|
MsgId _lastSearchMigratedId = 0;
|
|
|
|
int _searchedCount = 0;
|
2015-11-18 13:11:56 +00:00
|
|
|
enum SearchRequestType {
|
|
|
|
SearchFromStart,
|
|
|
|
SearchFromOffset,
|
|
|
|
SearchMigratedFromStart,
|
|
|
|
SearchMigratedFromOffset
|
|
|
|
};
|
|
|
|
void searchReceived(SearchRequestType type, const MTPmessages_Messages &result, mtpRequestId req);
|
|
|
|
bool searchFailed(SearchRequestType type, const RPCError &error, mtpRequestId req);
|
2015-08-28 15:15:56 +00:00
|
|
|
|
|
|
|
typedef QMap<QString, MTPmessages_Messages> SearchCache;
|
|
|
|
SearchCache _searchCache;
|
|
|
|
|
|
|
|
typedef QMap<mtpRequestId, QString> SearchQueries;
|
|
|
|
SearchQueries _searchQueries;
|
|
|
|
|
2016-10-14 17:10:15 +00:00
|
|
|
int _width = 0;
|
|
|
|
int _height = 0;
|
|
|
|
int _minHeight = 0;
|
|
|
|
int _marginTop = 0;
|
|
|
|
int _marginBottom = 0;
|
2014-08-20 05:32:50 +00:00
|
|
|
|
2015-09-01 13:50:56 +00:00
|
|
|
QTimer _linkTipTimer;
|
|
|
|
|
2014-08-20 05:32:50 +00:00
|
|
|
// selection support, like in HistoryWidget
|
2016-10-14 17:10:15 +00:00
|
|
|
style::cursor _cursor = style::cur_default;
|
|
|
|
HistoryCursorState _cursorState = HistoryDefaultCursorState;
|
2016-04-13 18:29:32 +00:00
|
|
|
using SelectedItems = QMap<MsgId, TextSelection>;
|
2014-08-20 05:32:50 +00:00
|
|
|
SelectedItems _selected;
|
|
|
|
enum DragAction {
|
|
|
|
NoDrag = 0x00,
|
|
|
|
PrepareDrag = 0x01,
|
|
|
|
Dragging = 0x02,
|
|
|
|
PrepareSelect = 0x03,
|
|
|
|
Selecting = 0x04,
|
|
|
|
};
|
2016-10-14 17:10:15 +00:00
|
|
|
DragAction _dragAction = NoDrag;
|
2014-08-20 05:32:50 +00:00
|
|
|
QPoint _dragStartPos, _dragPos;
|
2016-10-14 17:10:15 +00:00
|
|
|
MsgId _dragItem = 0;
|
|
|
|
MsgId _selectedMsgId = 0;
|
|
|
|
int _dragItemIndex = -1;
|
|
|
|
MsgId _mousedItem = 0;
|
|
|
|
int _mousedItemIndex = -1;
|
2014-08-20 05:32:50 +00:00
|
|
|
uint16 _dragSymbol;
|
2016-10-14 17:10:15 +00:00
|
|
|
bool _dragWasInactive = false;
|
2014-08-15 11:19:32 +00:00
|
|
|
|
2016-03-29 17:17:00 +00:00
|
|
|
ClickHandlerPtr _contextMenuLnk;
|
2014-08-20 05:32:50 +00:00
|
|
|
|
2016-10-14 17:10:15 +00:00
|
|
|
MsgId _dragSelFrom = 0;
|
|
|
|
MsgId _dragSelTo = 0;
|
|
|
|
int _dragSelFromIndex = -1;
|
|
|
|
int _dragSelToIndex = -1;
|
|
|
|
bool _dragSelecting = false;
|
2014-08-20 05:32:50 +00:00
|
|
|
|
2016-10-14 17:10:15 +00:00
|
|
|
bool _touchScroll = false;
|
|
|
|
bool _touchSelect = false;
|
|
|
|
bool _touchInProgress = false;
|
2014-08-20 05:32:50 +00:00
|
|
|
QPoint _touchStart, _touchPrevPos, _touchPos;
|
|
|
|
QTimer _touchSelectTimer;
|
|
|
|
|
2016-11-16 10:44:06 +00:00
|
|
|
Ui::TouchScrollState _touchScrollState = Ui::TouchScrollState::Manual;
|
2016-10-14 17:10:15 +00:00
|
|
|
bool _touchPrevPosValid = false;
|
|
|
|
bool _touchWaitingAcceleration = false;
|
2014-08-20 05:32:50 +00:00
|
|
|
QPoint _touchSpeed;
|
2016-12-01 19:20:33 +00:00
|
|
|
TimeMs _touchSpeedTime = 0;
|
|
|
|
TimeMs _touchAccelerationTime = 0;
|
|
|
|
TimeMs _touchTime = 0;
|
2014-08-20 05:32:50 +00:00
|
|
|
QTimer _touchScrollTimer;
|
|
|
|
|
2016-10-26 16:43:13 +00:00
|
|
|
Ui::PopupMenu *_menu = nullptr;
|
2014-08-15 11:19:32 +00:00
|
|
|
};
|
|
|
|
|
2015-10-17 14:52:26 +00:00
|
|
|
class OverviewWidget : public TWidget, public RPCSender {
|
2014-08-15 11:19:32 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2015-11-18 13:11:56 +00:00
|
|
|
OverviewWidget(QWidget *parent, PeerData *peer, MediaOverviewType type);
|
2014-08-15 11:19:32 +00:00
|
|
|
|
|
|
|
void clear();
|
|
|
|
|
|
|
|
void scrollBy(int32 add);
|
2015-08-28 15:15:56 +00:00
|
|
|
void scrollReset();
|
2014-08-15 11:19:32 +00:00
|
|
|
|
2016-11-19 09:22:53 +00:00
|
|
|
bool paintTopBar(Painter &p, int decreaseWidth);
|
2014-08-15 11:19:32 +00:00
|
|
|
void topBarClick();
|
|
|
|
|
|
|
|
PeerData *peer() const;
|
2015-11-18 13:11:56 +00:00
|
|
|
PeerData *migratePeer() const;
|
2014-08-15 11:19:32 +00:00
|
|
|
MediaOverviewType type() const;
|
|
|
|
void switchType(MediaOverviewType type);
|
2014-08-20 05:32:50 +00:00
|
|
|
void updateTopBarSelection();
|
|
|
|
|
2014-08-15 11:19:32 +00:00
|
|
|
int32 lastWidth() const;
|
|
|
|
int32 lastScrollTop() const;
|
2015-07-03 10:48:28 +00:00
|
|
|
int32 countBestScroll() const;
|
2014-08-15 11:19:32 +00:00
|
|
|
|
2015-07-03 10:48:28 +00:00
|
|
|
void fastShow(bool back = false, int32 lastScrollTop = -1);
|
2016-05-19 12:03:51 +00:00
|
|
|
bool hasTopBarShadow() const {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
void setLastScrollTop(int lastScrollTop);
|
|
|
|
void showAnimated(Window::SlideDirection direction, const Window::SectionSlideParams ¶ms);
|
2014-08-15 11:19:32 +00:00
|
|
|
|
2015-07-03 08:47:16 +00:00
|
|
|
void doneShow();
|
|
|
|
|
2017-01-01 16:45:20 +00:00
|
|
|
void mediaOverviewUpdated(const Notify::PeerUpdate &update);
|
2014-08-20 19:13:00 +00:00
|
|
|
void changingMsgId(HistoryItem *row, MsgId newId);
|
2014-10-10 12:46:20 +00:00
|
|
|
void itemRemoved(HistoryItem *item);
|
2016-02-28 12:36:23 +00:00
|
|
|
|
2014-08-20 05:32:50 +00:00
|
|
|
QPoint clampMousePosition(QPoint point);
|
|
|
|
|
|
|
|
void checkSelectingScroll(QPoint point);
|
|
|
|
void noSelectingScroll();
|
|
|
|
|
|
|
|
bool touchScroll(const QPoint &delta);
|
2016-02-28 12:36:23 +00:00
|
|
|
|
2014-08-20 05:32:50 +00:00
|
|
|
void fillSelectedItems(SelectedItemSet &sel, bool forDelete);
|
|
|
|
|
2015-09-12 19:00:56 +00:00
|
|
|
void updateAfterDrag();
|
|
|
|
|
2016-02-28 12:36:23 +00:00
|
|
|
void grabStart() override {
|
2015-10-17 14:52:26 +00:00
|
|
|
_inGrab = true;
|
|
|
|
resizeEvent(0);
|
|
|
|
}
|
2016-10-12 19:34:25 +00:00
|
|
|
void grapWithoutTopBarShadow();
|
|
|
|
void grabFinish() override;
|
2016-02-28 12:36:23 +00:00
|
|
|
void rpcClear() override {
|
2016-11-16 10:44:06 +00:00
|
|
|
_inner->rpcClear();
|
2016-02-28 12:36:23 +00:00
|
|
|
RPCSender::rpcClear();
|
|
|
|
}
|
2015-10-17 14:52:26 +00:00
|
|
|
|
2016-12-31 13:34:41 +00:00
|
|
|
void confirmDeleteContextItem();
|
|
|
|
void confirmDeleteSelectedItems();
|
|
|
|
void deleteContextItem(bool forEveryone);
|
|
|
|
void deleteSelectedItems(bool forEveryone);
|
|
|
|
|
2015-12-27 21:37:48 +00:00
|
|
|
void ui_repaintHistoryItem(const HistoryItem *item);
|
2015-12-22 12:49:42 +00:00
|
|
|
|
|
|
|
void notify_historyItemLayoutChanged(const HistoryItem *item);
|
2015-12-13 11:17:15 +00:00
|
|
|
|
2014-08-15 11:19:32 +00:00
|
|
|
~OverviewWidget();
|
|
|
|
|
2016-10-13 15:04:40 +00:00
|
|
|
protected:
|
|
|
|
void resizeEvent(QResizeEvent *e) override;
|
|
|
|
void paintEvent(QPaintEvent *e) override;
|
|
|
|
void contextMenuEvent(QContextMenuEvent *e) override;
|
|
|
|
|
2014-08-15 11:19:32 +00:00
|
|
|
public slots:
|
|
|
|
void activate();
|
|
|
|
void onScroll();
|
|
|
|
|
2014-08-20 05:32:50 +00:00
|
|
|
void onScrollTimer();
|
|
|
|
|
|
|
|
void onForwardSelected();
|
|
|
|
void onClearSelected();
|
|
|
|
|
2014-08-15 11:19:32 +00:00
|
|
|
private:
|
2016-12-05 11:01:08 +00:00
|
|
|
void animationCallback();
|
|
|
|
|
2016-12-13 17:07:56 +00:00
|
|
|
object_ptr<Ui::ScrollArea> _scroll;
|
|
|
|
QPointer<OverviewInner> _inner;
|
2016-10-12 19:34:25 +00:00
|
|
|
bool _noDropResizeIndex = false;
|
2014-08-15 11:19:32 +00:00
|
|
|
|
|
|
|
QString _header;
|
|
|
|
|
2016-12-07 13:32:25 +00:00
|
|
|
Animation _a_show;
|
2016-12-05 11:01:08 +00:00
|
|
|
Window::SlideDirection _showDirection;
|
2016-05-19 12:03:51 +00:00
|
|
|
QPixmap _cacheUnder, _cacheOver;
|
2014-08-15 11:19:32 +00:00
|
|
|
|
2016-10-12 19:34:25 +00:00
|
|
|
int32 _scrollSetAfterShow = 0;
|
2014-08-15 12:44:01 +00:00
|
|
|
|
2014-08-20 05:32:50 +00:00
|
|
|
QTimer _scrollTimer;
|
2016-10-12 19:34:25 +00:00
|
|
|
int32 _scrollDelta = 0;
|
2014-08-20 05:32:50 +00:00
|
|
|
|
2016-10-12 19:34:25 +00:00
|
|
|
int32 _selCount = 0;
|
2014-08-20 05:32:50 +00:00
|
|
|
|
2016-12-13 17:07:56 +00:00
|
|
|
object_ptr<Ui::PlainShadow> _topShadow;
|
2016-10-12 19:34:25 +00:00
|
|
|
bool _inGrab = false;
|
2015-10-17 08:31:48 +00:00
|
|
|
|
2014-08-15 11:19:32 +00:00
|
|
|
};
|
|
|
|
|