Fixed some conflicts

This commit is contained in:
Quentin Guidée
2020-02-12 17:42:58 +01:00
687 changed files with 13048 additions and 4057 deletions

View File

@@ -1,4 +1,5 @@
#include "editor_view.h"
#include <apps/global_preferences.h>
#include <poincare/integer.h>
#include <escher/app.h>
#include <poincare/preferences.h>
@@ -10,50 +11,47 @@ namespace Code {
EditorView::EditorView(Responder * parentResponder, App * pythonDelegate) :
Responder(parentResponder),
View(),
m_textArea(parentResponder, pythonDelegate, Poincare::Preferences::sharedPreferences()->KDPythonFont()),
m_gutterView(Poincare::Preferences::sharedPreferences()->KDPythonFont())
m_textArea(parentResponder, pythonDelegate, GlobalPreferences::sharedGlobalPreferences()->font()),
m_gutterView(GlobalPreferences::sharedGlobalPreferences()->font())
{
m_textArea.setScrollViewDelegate(this);
}
void EditorView::resetSelection() {
m_textArea.resetSelection();
}
void EditorView::scrollViewDidChangeOffset(ScrollViewDataSource * scrollViewDataSource) {
m_gutterView.setOffset(scrollViewDataSource->offset().y());
}
int EditorView::numberOfSubviews() const {
return 2;
}
View * EditorView::subviewAtIndex(int index) {
View * subviews[] = {&m_textArea, &m_gutterView};
return subviews[index];
if (index == 0) {
return &m_textArea;
}
assert(index == 1);
return &m_gutterView;
}
void EditorView::didBecomeFirstResponder() {
Container::activeApp()->setFirstResponder(&m_textArea);
}
void EditorView::layoutSubviews() {
void EditorView::layoutSubviews(bool force) {
m_gutterView.setOffset(0);
KDCoordinate gutterWidth = m_gutterView.minimalSizeForOptimalDisplay().width();
m_gutterView.setFrame(KDRect(0, 0, gutterWidth, bounds().height()));
m_gutterView.setFrame(KDRect(0, 0, gutterWidth, bounds().height()), force);
m_textArea.setFrame(KDRect(
gutterWidth,
0,
bounds().width()-gutterWidth,
bounds().height()
));
gutterWidth,
0,
bounds().width()-gutterWidth,
bounds().height()),
force);
}
/* EditorView::GutterView */
EditorView::GutterView::GutterView(const KDFont * font) :
View(),
m_offset(0)
{
}
void EditorView::GutterView::drawRect(KDContext * ctx, KDRect rect) const {
KDColor textColor = KDColor::RGB24(0x919EA4);
KDColor backgroundColor = KDColor::RGB24(0xE4E6E7);