add ObserveMouseInput override
This commit is contained in:
@@ -288,9 +288,6 @@ namespace JUI {
|
||||
int LayoutOrder() const { return layout_order; }
|
||||
void LayoutOrder(int value) { layout_order = value;}
|
||||
|
||||
|
||||
|
||||
|
||||
#pragma endregion
|
||||
|
||||
/// Returns the complete bounding box around this instance that will be rendered onto.
|
||||
|
@@ -138,14 +138,23 @@ namespace JUI {
|
||||
}
|
||||
|
||||
/// @see class Hoverable.
|
||||
void OnExit(const J3ML::LinearAlgebra::Vector2 &MousePos) override
|
||||
{
|
||||
void OnExit(const J3ML::LinearAlgebra::Vector2 &MousePos) override {
|
||||
Hoverable::OnExit(MousePos);
|
||||
zindex--;
|
||||
focused = false;
|
||||
this->BorderColor(Style::Window::UnfocusedOutlineColor);
|
||||
this->BGColor(Style::Window::UnfocusedOutlineColor);
|
||||
}
|
||||
|
||||
bool ObserveMouseInput(JUI::MouseButton btn, bool pressed) override
|
||||
{
|
||||
// TODO: Consider how this plays with Clickable::OnClick and Clickable::OnRelease
|
||||
|
||||
if (this->visible && this->focused)
|
||||
return Widget::ObserveMouseInput(btn, pressed);
|
||||
|
||||
return false;
|
||||
}
|
||||
protected:
|
||||
void UpdateInternalWidgetsTitlebarHeight();
|
||||
protected:
|
||||
|
@@ -91,7 +91,6 @@ namespace JUI {
|
||||
exit_btn->OnReleaseEvent += [&] (auto... _) {
|
||||
this->Visible(false);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Window::Window(Widget* parent) : Window() {
|
||||
@@ -161,8 +160,6 @@ namespace JUI {
|
||||
}
|
||||
|
||||
void Window::Update(float delta) {
|
||||
|
||||
|
||||
if (dragging) {
|
||||
// Move the window with the mouse, accounting for initial offset of window-mouse when we first clicked.
|
||||
Vector2 goal = last_known_mouse_pos - initial_drag_offset;
|
||||
|
Reference in New Issue
Block a user