Added focus rpl event to time input.
This commit is contained in:
parent
8ff42a86d9
commit
4fcddb5bfe
2 changed files with 7 additions and 0 deletions
|
|
@ -214,6 +214,7 @@ TimeInput::TimeInput(
|
||||||
+ pointer->x()
|
+ pointer->x()
|
||||||
- _hour->x();
|
- _hour->x();
|
||||||
setFocused(true);
|
setFocused(true);
|
||||||
|
_focuses.fire({});
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
const auto blurred = [=] {
|
const auto blurred = [=] {
|
||||||
|
|
@ -320,6 +321,10 @@ rpl::producer<> TimeInput::submitRequests() const {
|
||||||
return _submitRequests.events();
|
return _submitRequests.events();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rpl::producer<> TimeInput::focuses() const {
|
||||||
|
return _focuses.events();
|
||||||
|
}
|
||||||
|
|
||||||
void TimeInput::paintEvent(QPaintEvent *e) {
|
void TimeInput::paintEvent(QPaintEvent *e) {
|
||||||
Painter p(this);
|
Painter p(this);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ public:
|
||||||
bool setFocusFast();
|
bool setFocusFast();
|
||||||
rpl::producer<QString> value() const;
|
rpl::producer<QString> value() const;
|
||||||
rpl::producer<> submitRequests() const;
|
rpl::producer<> submitRequests() const;
|
||||||
|
rpl::producer<> focuses() const;
|
||||||
QString valueCurrent() const;
|
QString valueCurrent() const;
|
||||||
void showError();
|
void showError();
|
||||||
|
|
||||||
|
|
@ -61,6 +62,7 @@ private:
|
||||||
object_ptr<TimePart> _minute;
|
object_ptr<TimePart> _minute;
|
||||||
rpl::variable<QString> _value;
|
rpl::variable<QString> _value;
|
||||||
rpl::event_stream<> _submitRequests;
|
rpl::event_stream<> _submitRequests;
|
||||||
|
rpl::event_stream<> _focuses;
|
||||||
|
|
||||||
style::cursor _cursor = style::cur_default;
|
style::cursor _cursor = style::cur_default;
|
||||||
Animations::Simple _a_borderShown;
|
Animations::Simple _a_borderShown;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue