mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[apps/code] Reset selection when leaving script editor
This commit is contained in:
@@ -63,6 +63,7 @@ void EditorController::viewWillAppear() {
|
||||
}
|
||||
|
||||
void EditorController::viewDidDisappear() {
|
||||
m_editorView.resetSelection();
|
||||
m_menuController->scriptContentEditionDidFinish();
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,10 @@ EditorView::EditorView(Responder * parentResponder, App * pythonDelegate) :
|
||||
m_textArea.setScrollViewDelegate(this);
|
||||
}
|
||||
|
||||
void EditorView::resetSelection() {
|
||||
m_textArea.resetSelection();
|
||||
}
|
||||
|
||||
void EditorView::scrollViewDidChangeOffset(ScrollViewDataSource * scrollViewDataSource) {
|
||||
m_gutterView.setOffset(scrollViewDataSource->offset().y());
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ namespace Code {
|
||||
class EditorView : public Responder, public View, public ScrollViewDelegate {
|
||||
public:
|
||||
EditorView(Responder * parentResponder, App * pythonDelegate);
|
||||
void resetSelection();
|
||||
void setTextAreaDelegates(InputEventHandlerDelegate * inputEventHandlerDelegate, TextAreaDelegate * delegate) {
|
||||
m_textArea.setDelegates(inputEventHandlerDelegate, delegate);
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ public:
|
||||
const char * cursorLocation() const { return nonEditableContentView()->cursorLocation(); }
|
||||
bool setCursorLocation(const char * location);
|
||||
virtual void scrollToCursor();
|
||||
void resetSelection() { contentView()->resetSelection(); }
|
||||
protected:
|
||||
class ContentView : public View {
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user