mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-18 07:07:08 +02:00
Added focus to input field in channel earn info section.
This commit is contained in:
parent
538934a88a
commit
479bb2a1d6
4 changed files with 15 additions and 0 deletions
Telegram/SourceFiles/info/channel_statistics/earn
|
@ -449,6 +449,10 @@ void InnerWidget::fill() {
|
|||
Ui::InputField::Mode::MultiLine,
|
||||
tr::lng_channel_earn_balance_placeholder()),
|
||||
st::boxRowPadding);
|
||||
_focusRequested.events(
|
||||
) | rpl::start_with_next([=] {
|
||||
input->setFocusFast();
|
||||
}, input->lifetime());
|
||||
|
||||
Ui::AddSkip(container);
|
||||
|
||||
|
@ -942,6 +946,10 @@ void InnerWidget::showFinished() {
|
|||
_showFinished.fire({});
|
||||
}
|
||||
|
||||
void InnerWidget::setInnerFocus() {
|
||||
_focusRequested.fire({});
|
||||
}
|
||||
|
||||
not_null<PeerData*> InnerWidget::peer() const {
|
||||
return _peer;
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@ public:
|
|||
[[nodiscard]] rpl::producer<ShowRequest> showRequests() const;
|
||||
|
||||
void showFinished();
|
||||
void setInnerFocus();
|
||||
|
||||
void saveState(not_null<Memento*> memento);
|
||||
void restoreState(not_null<Memento*> memento);
|
||||
|
@ -55,6 +56,7 @@ private:
|
|||
rpl::event_stream<Ui::ScrollToRequest> _scrollToRequests;
|
||||
rpl::event_stream<ShowRequest> _showRequests;
|
||||
rpl::event_stream<> _showFinished;
|
||||
rpl::event_stream<> _focusRequested;
|
||||
rpl::event_stream<bool> _loaded;
|
||||
|
||||
};
|
||||
|
|
|
@ -95,6 +95,10 @@ void Widget::showFinished() {
|
|||
_inner->showFinished();
|
||||
}
|
||||
|
||||
void Widget::setInnerFocus() {
|
||||
_inner->setInnerFocus();
|
||||
}
|
||||
|
||||
std::shared_ptr<ContentMemento> Widget::doCreateMemento() {
|
||||
auto result = std::make_shared<Memento>(controller());
|
||||
saveState(result.get());
|
||||
|
|
|
@ -47,6 +47,7 @@ public:
|
|||
rpl::producer<QString> title() override;
|
||||
rpl::producer<bool> desiredShadowVisibility() const override;
|
||||
void showFinished() override;
|
||||
void setInnerFocus() override;
|
||||
|
||||
[[nodiscard]] not_null<PeerData*> peer() const;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue