mirror of
https://github.com/MeowLynxSea/ceditor.git
synced 2025-07-09 10:54:37 +00:00
修复了编辑器失去焦点时依然显示指针的问题
This commit is contained in:
parent
43540603c5
commit
09c45e5af8
@ -90,7 +90,10 @@ public:
|
||||
|
||||
void onKeyPress(int key) override { return; }
|
||||
|
||||
void setVisibility(bool visibility) { visibility_ = visibility; }
|
||||
void setVisibility(bool visibility) {
|
||||
if(visibility == visibility_) return;
|
||||
visibility_ = visibility;
|
||||
}
|
||||
|
||||
bool isVisible() { return visibility_; }
|
||||
};
|
||||
|
@ -12,7 +12,7 @@
|
||||
class Editor : public BaseComponent {
|
||||
private:
|
||||
TextArea textArea_ = TextArea(0, 0, 0, 0);
|
||||
Cursor cursor_;
|
||||
Cursor cursor_ = Cursor(0, 0, false);
|
||||
std::string content_;
|
||||
RichText coloredContent_;
|
||||
std::string ruleName_;
|
||||
@ -120,6 +120,8 @@ public:
|
||||
void setFocus(bool focusStatus) {
|
||||
BaseComponent::setFocus(focusStatus);
|
||||
cursor_.setVisibility(focusStatus);
|
||||
|
||||
draw();
|
||||
}
|
||||
|
||||
void onKeyPress(int key) override {
|
||||
|
Loading…
Reference in New Issue
Block a user