mirror of
https://github.com/Qz3rK/tdesktop.git
synced 2026-07-03 14:15:08 +02:00
Added ability to open menu from history view top bar with right click.
This commit is contained in:
@@ -75,6 +75,16 @@ namespace {
|
|||||||
|
|
||||||
constexpr auto kEmojiInteractionSeenDuration = 3 * crl::time(1000);
|
constexpr auto kEmojiInteractionSeenDuration = 3 * crl::time(1000);
|
||||||
|
|
||||||
|
class MenuToggleButton final : public Ui::IconButton {
|
||||||
|
public:
|
||||||
|
using IconButton::IconButton;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void contextMenuEvent(QContextMenuEvent *e) override {
|
||||||
|
Ui::AbstractButton::clicked(Qt::KeyboardModifiers(), Qt::LeftButton);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
[[nodiscard]] inline bool HasGroupCallMenu(not_null<PeerData*> peer) {
|
[[nodiscard]] inline bool HasGroupCallMenu(not_null<PeerData*> peer) {
|
||||||
return !peer->isUser()
|
return !peer->isUser()
|
||||||
&& !peer->groupCall()
|
&& !peer->groupCall()
|
||||||
@@ -125,7 +135,9 @@ TopBarWidget::TopBarWidget(
|
|||||||
, _groupCall(this, st::topBarGroupCall)
|
, _groupCall(this, st::topBarGroupCall)
|
||||||
, _search(this, st::topBarSearch)
|
, _search(this, st::topBarSearch)
|
||||||
, _infoToggle(this, st::topBarInfo)
|
, _infoToggle(this, st::topBarInfo)
|
||||||
, _menuToggle(this, st::topBarMenuToggle)
|
, _menuToggle(
|
||||||
|
object_ptr<Ui::IconButton>::fromRaw(
|
||||||
|
Ui::CreateChild<MenuToggleButton>(this, st::topBarMenuToggle)))
|
||||||
, _titlePeerText(st::windowMinWidth / 3)
|
, _titlePeerText(st::windowMinWidth / 3)
|
||||||
, _onlineUpdater([=] { updateOnlineDisplay(); }) {
|
, _onlineUpdater([=] { updateOnlineDisplay(); }) {
|
||||||
setAttribute(Qt::WA_OpaquePaintEvent);
|
setAttribute(Qt::WA_OpaquePaintEvent);
|
||||||
|
|||||||
Reference in New Issue
Block a user