Compare commits

...

2 commits

Author SHA1 Message Date
hippoz
9f52cad7e9
dont accept events if we did not init yet 2022-07-26 17:26:18 +03:00
hippoz
913240c33b
increase scroll step 2022-07-26 17:26:02 +03:00
2 changed files with 2 additions and 2 deletions

View file

@ -24,7 +24,7 @@ protected:
void on_layout(); void on_layout();
void on_mouse_button(MouseButtonEvent &event); void on_mouse_button(MouseButtonEvent &event);
private: private:
double m_scroll_step { 5.0 }; double m_scroll_step { 25.0 };
Point m_scroll { 0, 0 }; Point m_scroll { 0, 0 };
std::shared_ptr<Widget> m_target { nullptr }; std::shared_ptr<Widget> m_target { nullptr };
}; };

View file

@ -273,7 +273,7 @@ void Widget::handle_mouse_button_event(MouseButtonEvent &event) {
} }
void Widget::dispatch_event(Event &event) { void Widget::dispatch_event(Event &event) {
if (!m_accepts_events) if (!m_accepts_events || !m_did_init)
return; return;
on_event(event); on_event(event);