Capture mouse for the slider component.

This commit is contained in:
ArthurSonzogni
2021-05-01 18:13:56 +02:00
parent 0af8201023
commit eb399d20c5
15 changed files with 157 additions and 35 deletions

View File

@@ -1,4 +1,5 @@
#include "ftxui/component/input.hpp"
#include "ftxui/component/screen_interactive.hpp"
#include <algorithm>
@@ -102,6 +103,8 @@ bool Input::OnEvent(Event event) {
}
bool Input::OnMouseEvent(Event event) {
if (!event.screen()->CaptureMouse())
return false;
if (!input_box_.Contain(event.mouse().x, event.mouse().y))
return false;