mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 21:57:10 +02:00
Don't treat window controls as continuous
This commit is contained in:
parent
ec407d57a5
commit
3e6ea8109c
3 changed files with 9 additions and 6 deletions
|
@ -198,7 +198,9 @@ void Panel::initWindow() {
|
|||
return Flag::None | Flag(0);
|
||||
}
|
||||
#ifndef Q_OS_MAC
|
||||
if (_controls->controls.geometry().contains(widgetPoint)) {
|
||||
using Result = Ui::Platform::HitTestResult;
|
||||
const auto windowPoint = widget()->mapTo(window(), widgetPoint);
|
||||
if (_controls->controls.hitTest(windowPoint) != Result::None) {
|
||||
return Flag::None | Flag(0);
|
||||
}
|
||||
#endif // !Q_OS_MAC
|
||||
|
|
|
@ -659,11 +659,11 @@ OverlayWidget::OverlayWidget()
|
|||
});
|
||||
_helper->mouseEvents(
|
||||
) | rpl::start_with_next([=](not_null<QMouseEvent*> e) {
|
||||
const auto type = e->type();
|
||||
const auto position = e->pos();
|
||||
if (_helper->skipTitleHitTest(position)) {
|
||||
if (_helper->skipTitleHitTest(e->windowPos().toPoint())) {
|
||||
return;
|
||||
}
|
||||
const auto type = e->type();
|
||||
const auto position = e->pos();
|
||||
if (type == QEvent::MouseButtonPress) {
|
||||
handleMousePress(position, e->button());
|
||||
} else if (type == QEvent::MouseButtonRelease) {
|
||||
|
@ -804,7 +804,7 @@ void OverlayWidget::setupWindow() {
|
|||
using Flag = Ui::WindowTitleHitTestFlag;
|
||||
Ui::WindowTitleHitTestFlags result;
|
||||
if (!_widget->rect().contains(widgetPoint)
|
||||
|| _helper->skipTitleHitTest(widgetPoint)) {
|
||||
|| _helper->skipTitleHitTest(_widget->mapTo(_window, widgetPoint))) {
|
||||
return result;
|
||||
}
|
||||
if (widgetPoint.y() <= st::mediaviewTitleButton.height) {
|
||||
|
|
|
@ -215,7 +215,8 @@ void DefaultOverlayWidgetHelper::orderWidgets() {
|
|||
}
|
||||
|
||||
bool DefaultOverlayWidgetHelper::skipTitleHitTest(QPoint position) {
|
||||
return _controls->controls.geometry().contains(position);
|
||||
using namespace Ui::Platform;
|
||||
return _controls->controls.hitTest(position) != HitTestResult::None;
|
||||
}
|
||||
|
||||
rpl::producer<> DefaultOverlayWidgetHelper::controlsActivations() {
|
||||
|
|
Loading…
Add table
Reference in a new issue