Allow clearing system buttons state on Windows.
This commit is contained in:
parent
4f2a33ea70
commit
6b5524b63c
6 changed files with 30 additions and 0 deletions
|
|
@ -150,6 +150,14 @@ rpl::producer<HitTestResult> BasicWindowHelper::systemButtonDown() const {
|
|||
return rpl::never<HitTestResult>();
|
||||
}
|
||||
|
||||
void BasicWindowHelper::overrideSystemButtonOver(HitTestResult button) {
|
||||
Expects(button == HitTestResult::None);
|
||||
}
|
||||
|
||||
void BasicWindowHelper::overrideSystemButtonDown(HitTestResult button) {
|
||||
Expects(button == HitTestResult::None);
|
||||
}
|
||||
|
||||
void BasicWindowHelper::setTitle(const QString &title) {
|
||||
_window->setWindowTitle(title);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,6 +49,8 @@ public:
|
|||
-> rpl::producer<HitTestResult>;
|
||||
[[nodiscard]] virtual auto systemButtonDown() const
|
||||
-> rpl::producer<HitTestResult>;
|
||||
virtual void overrideSystemButtonOver(HitTestResult button);
|
||||
virtual void overrideSystemButtonDown(HitTestResult button);
|
||||
virtual void setTitle(const QString &title);
|
||||
virtual void setTitleStyle(const style::WindowTitle &st);
|
||||
virtual void setNativeFrame(bool enabled);
|
||||
|
|
|
|||
|
|
@ -389,6 +389,14 @@ rpl::producer<HitTestResult> WindowHelper::systemButtonDown() const {
|
|||
return _systemButtonDown.events();
|
||||
}
|
||||
|
||||
void WindowHelper::overrideSystemButtonOver(HitTestResult button) {
|
||||
_systemButtonOver.fire_copy(button);
|
||||
}
|
||||
|
||||
void WindowHelper::overrideSystemButtonDown(HitTestResult button) {
|
||||
_systemButtonDown.fire_copy(button);
|
||||
}
|
||||
|
||||
void WindowHelper::init() {
|
||||
_title->show();
|
||||
GetNativeFilter()->registerWindow(_handle, this);
|
||||
|
|
|
|||
|
|
@ -43,6 +43,8 @@ public:
|
|||
-> rpl::producer<HitTestResult> override;
|
||||
[[nodiscard]] auto systemButtonDown() const
|
||||
-> rpl::producer<HitTestResult> override;
|
||||
void overrideSystemButtonOver(HitTestResult button) override;
|
||||
void overrideSystemButtonDown(HitTestResult button) override;
|
||||
|
||||
private:
|
||||
class NativeFilter;
|
||||
|
|
|
|||
|
|
@ -54,6 +54,14 @@ rpl::producer<Platform::HitTestResult> RpWindow::systemButtonDown() const {
|
|||
return _helper->systemButtonDown();
|
||||
}
|
||||
|
||||
void RpWindow::overrideSystemButtonOver(Platform::HitTestResult button) {
|
||||
_helper->overrideSystemButtonOver(button);
|
||||
}
|
||||
|
||||
void RpWindow::overrideSystemButtonDown(Platform::HitTestResult button) {
|
||||
_helper->overrideSystemButtonDown(button);
|
||||
}
|
||||
|
||||
void RpWindow::setTitle(const QString &title) {
|
||||
_helper->setTitle(title);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,6 +55,8 @@ public:
|
|||
-> rpl::producer<Platform::HitTestResult>;
|
||||
[[nodiscard]] auto systemButtonDown() const
|
||||
-> rpl::producer<Platform::HitTestResult>;
|
||||
void overrideSystemButtonOver(Platform::HitTestResult button);
|
||||
void overrideSystemButtonDown(Platform::HitTestResult button);
|
||||
|
||||
void setTitle(const QString &title);
|
||||
void setTitleStyle(const style::WindowTitle &st);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue