2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 22:46:10 +00:00

Added initial context menu to TabbedPanel.

Added ability to schedule and send silently stickers and GIFs.
This commit is contained in:
23rd
2020-07-25 18:07:14 +03:00
committed by John Preston
parent a95a324401
commit 7db9843543
8 changed files with 130 additions and 5 deletions

View File

@@ -14,6 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/widgets/labels.h"
#include "ui/widgets/shadow.h"
#include "ui/widgets/discrete_sliders.h"
#include "ui/widgets/popup_menu.h"
#include "ui/widgets/scroll_area.h"
#include "ui/image/image_prepare.h"
#include "window/window_session_controller.h"
@@ -584,7 +585,13 @@ void TabbedSelector::refreshStickers() {
}
bool TabbedSelector::preventAutoHide() const {
return full() ? stickers()->preventAutoHide() : false;
return full()
? (stickers()->preventAutoHide() || hasMenu())
: false;
}
bool TabbedSelector::hasMenu() const {
return (_menu && !_menu->actions().empty());
}
QImage TabbedSelector::grabForAnimation() {
@@ -867,6 +874,15 @@ void TabbedSelector::scrollToY(int y) {
}
}
void TabbedSelector::contextMenuEvent(QContextMenuEvent *e) {
_menu = base::make_unique_q<Ui::PopupMenu>(this);
currentTab()->widget()->fillContextMenu(_menu);
if (!_menu->actions().empty()) {
_menu->popup(QCursor::pos());
}
}
TabbedSelector::Inner::Inner(
QWidget *parent,
not_null<Window::SessionController*> controller)