mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-15 23:48:15 +08:00
Make use of Box instead of my custom Region struct
This commit is contained in:

committed by
ArthurSonzogni

parent
b352e13253
commit
011b9a1426
@@ -26,13 +26,6 @@ struct Event;
|
||||
using Component = std::shared_ptr<ComponentBase>;
|
||||
class ScreenInteractivePrivate;
|
||||
|
||||
typedef struct {
|
||||
uint16_t startx = 0;
|
||||
uint16_t endx = 0;
|
||||
uint16_t starty = 0;
|
||||
uint16_t endy = 0;
|
||||
} Region;
|
||||
|
||||
class ScreenInteractive : public Screen {
|
||||
public:
|
||||
// Constructors:
|
||||
@@ -137,11 +130,6 @@ class ScreenInteractive : public Screen {
|
||||
bool force_handle_ctrl_c_ = true;
|
||||
bool force_handle_ctrl_z_ = true;
|
||||
|
||||
bool selection_enabled = false;
|
||||
CapturedMouse selection_pending;
|
||||
Region selection_region;
|
||||
std::string selection_text;
|
||||
|
||||
// The style of the cursor to restore on exit.
|
||||
int cursor_reset_shape_ = 1;
|
||||
|
||||
|
@@ -10,6 +10,7 @@
|
||||
|
||||
#include "ftxui/screen/image.hpp" // for Pixel, Image
|
||||
#include "ftxui/screen/terminal.hpp" // for Dimensions
|
||||
#include "ftxui/component/captured_mouse.hpp" // for CapturedMouse
|
||||
|
||||
namespace ftxui {
|
||||
|
||||
@@ -62,6 +63,11 @@ class Screen : public Image {
|
||||
Cursor cursor() const { return cursor_; }
|
||||
void SetCursor(Cursor cursor) { cursor_ = cursor; }
|
||||
|
||||
bool selection_enabled = false;
|
||||
CapturedMouse selection_pending;
|
||||
Box selection_region;
|
||||
std::string selection_text;
|
||||
|
||||
// Store an hyperlink in the screen. Return the id of the hyperlink. The id is
|
||||
// used to identify the hyperlink when the user click on it.
|
||||
uint8_t RegisterHyperlink(const std::string& link);
|
||||
|
Reference in New Issue
Block a user