Added a callback on selection change

This commit is contained in:
Clement Roblot
2024-12-02 15:40:50 +07:00
committed by ArthurSonzogni
parent 70a6a04e80
commit dc70091203
3 changed files with 43 additions and 2 deletions

View File

@@ -70,6 +70,8 @@ class ScreenInteractive : public Screen {
// Selection API.
// TODO: Implement somethings here.
std::string GetSelectedContent(void);
void onSelectionModified(std::function<void(void)> callback);
private:
void ExitNow();
@@ -141,6 +143,8 @@ class ScreenInteractive : public Screen {
int selection_start_y_ = 0;
int selection_end_x_ = 0;
int selection_end_y_ = 0;
bool selection_changed = false;
std::function<void(void)> selection_changed_callback_ = nullptr;
friend class Loop;