mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-18 09:08:08 +08:00
Use IWYU.
This commit is contained in:
@@ -1,11 +1,20 @@
|
||||
#include "ftxui/component/component.hpp"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "ftxui/component/captured_mouse.hpp"
|
||||
#include "ftxui/component/event.hpp"
|
||||
#include "ftxui/component/screen_interactive.hpp"
|
||||
|
||||
namespace ftxui {
|
||||
|
||||
namespace {
|
||||
class CaptureMouseImpl : public CapturedMouseInterface {
|
||||
public:
|
||||
~CaptureMouseImpl() override {}
|
||||
};
|
||||
}
|
||||
|
||||
Component::~Component() {
|
||||
Detach();
|
||||
}
|
||||
@@ -97,6 +106,16 @@ void Component::TakeFocus() {
|
||||
}
|
||||
}
|
||||
|
||||
/// @brief Take the CapturedMouse if available. There is only one component of
|
||||
/// them. It represents a component taking priority over others.
|
||||
/// @argument event
|
||||
/// @ingroup component
|
||||
CapturedMouse Component::CaptureMouse(const Event& event) {
|
||||
if (!event.screen_)
|
||||
return std::make_unique<CaptureMouseImpl>();
|
||||
return event.screen_->CaptureMouse();
|
||||
}
|
||||
|
||||
/// @brief Detach this children from its parent.
|
||||
/// @see Attach
|
||||
/// @see Detach
|
||||
|
Reference in New Issue
Block a user