init
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Close stale issues and PRs / stale (push) Successful in 13s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Close stale issues and PRs / stale (push) Successful in 13s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
This commit is contained in:
81
Telegram/SourceFiles/chat_helpers/tabbed_section.cpp
Normal file
81
Telegram/SourceFiles/chat_helpers/tabbed_section.cpp
Normal file
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#include "chat_helpers/tabbed_section.h"
|
||||
|
||||
#include "chat_helpers/tabbed_selector.h"
|
||||
#include "ui/ui_utility.h"
|
||||
#include "window/window_session_controller.h"
|
||||
#include "styles/style_chat_helpers.h"
|
||||
|
||||
namespace ChatHelpers {
|
||||
|
||||
object_ptr<Window::SectionWidget> TabbedMemento::createWidget(
|
||||
QWidget *parent,
|
||||
not_null<Window::SessionController*> controller,
|
||||
Window::Column column,
|
||||
const QRect &geometry) {
|
||||
auto result = object_ptr<TabbedSection>(parent, controller);
|
||||
result->setGeometry(geometry);
|
||||
return result;
|
||||
}
|
||||
|
||||
TabbedSection::TabbedSection(
|
||||
QWidget *parent,
|
||||
not_null<Window::SessionController*> controller)
|
||||
: Window::SectionWidget(parent, controller)
|
||||
, _selector(controller->tabbedSelector()) {
|
||||
if (Ui::InFocusChain(_selector)) {
|
||||
parent->window()->setFocus();
|
||||
}
|
||||
_selector->setParent(this);
|
||||
_selector->setRoundRadius(0);
|
||||
_selector->setGeometry(rect());
|
||||
_selector->showStarted();
|
||||
_selector->show();
|
||||
_selector->setAfterShownCallback(nullptr);
|
||||
_selector->setBeforeHidingCallback(nullptr);
|
||||
|
||||
setAttribute(Qt::WA_OpaquePaintEvent, true);
|
||||
}
|
||||
|
||||
void TabbedSection::beforeHiding() {
|
||||
_selector->beforeHiding();
|
||||
}
|
||||
|
||||
void TabbedSection::afterShown() {
|
||||
_selector->afterShown();
|
||||
}
|
||||
|
||||
void TabbedSection::resizeEvent(QResizeEvent *e) {
|
||||
_selector->setGeometry(rect());
|
||||
}
|
||||
|
||||
void TabbedSection::showFinishedHook() {
|
||||
afterShown();
|
||||
}
|
||||
|
||||
bool TabbedSection::showInternal(
|
||||
not_null<Window::SectionMemento*> memento,
|
||||
const Window::SectionShow ¶ms) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool TabbedSection::floatPlayerHandleWheelEvent(QEvent *e) {
|
||||
return _selector->floatPlayerHandleWheelEvent(e);
|
||||
}
|
||||
|
||||
QRect TabbedSection::floatPlayerAvailableRect() {
|
||||
return _selector->floatPlayerAvailableRect();
|
||||
}
|
||||
|
||||
TabbedSection::~TabbedSection() {
|
||||
beforeHiding();
|
||||
controller()->takeTabbedSelectorOwnershipFrom(this);
|
||||
}
|
||||
|
||||
} // namespace ChatHelpers
|
||||
Reference in New Issue
Block a user