mirror of https://github.com/vitalif/openscad
editor padding removed
parent
6b8acb0d3a
commit
6ff02a9ada
|
@ -4,6 +4,7 @@
|
||||||
LegacyEditor::LegacyEditor(QWidget *parent) : EditorInterface(parent)
|
LegacyEditor::LegacyEditor(QWidget *parent) : EditorInterface(parent)
|
||||||
{
|
{
|
||||||
legacyeditorLayout = new QVBoxLayout(this);
|
legacyeditorLayout = new QVBoxLayout(this);
|
||||||
|
legacyeditorLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
textedit = new QTextEdit(this);
|
textedit = new QTextEdit(this);
|
||||||
legacyeditorLayout->addWidget(textedit);
|
legacyeditorLayout->addWidget(textedit);
|
||||||
textedit->setAcceptRichText(false);
|
textedit->setAcceptRichText(false);
|
||||||
|
|
|
@ -9,6 +9,7 @@ ScintillaEditor::ScintillaEditor(QWidget *parent) : EditorInterface(parent)
|
||||||
{
|
{
|
||||||
scintillaLayout = new QVBoxLayout(this);
|
scintillaLayout = new QVBoxLayout(this);
|
||||||
qsci = new QsciScintilla(this);
|
qsci = new QsciScintilla(this);
|
||||||
|
scintillaLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
scintillaLayout->addWidget(qsci);
|
scintillaLayout->addWidget(qsci);
|
||||||
qsci->setBraceMatching (QsciScintilla::SloppyBraceMatch);
|
qsci->setBraceMatching (QsciScintilla::SloppyBraceMatch);
|
||||||
qsci->setWrapMode(QsciScintilla::WrapWord);
|
qsci->setWrapMode(QsciScintilla::WrapWord);
|
||||||
|
@ -24,9 +25,6 @@ ScintillaEditor::ScintillaEditor(QWidget *parent) : EditorInterface(parent)
|
||||||
}
|
}
|
||||||
void ScintillaEditor::indentSelection()
|
void ScintillaEditor::indentSelection()
|
||||||
{
|
{
|
||||||
int line, index;
|
|
||||||
qsci->getCursorPosition(&line, &index);
|
|
||||||
qsci->indent(line);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
void ScintillaEditor::unindentSelection()
|
void ScintillaEditor::unindentSelection()
|
||||||
|
@ -45,10 +43,12 @@ void ScintillaEditor::setPlainText(const QString &text)
|
||||||
{
|
{
|
||||||
qsci->setText(text);
|
qsci->setText(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ScintillaEditor::toPlainText()
|
QString ScintillaEditor::toPlainText()
|
||||||
{
|
{
|
||||||
return qsci->text();
|
return qsci->text();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScintillaEditor::highlightError(int error_pos)
|
void ScintillaEditor::highlightError(int error_pos)
|
||||||
{
|
{
|
||||||
int line, index;
|
int line, index;
|
||||||
|
@ -57,6 +57,7 @@ void ScintillaEditor::highlightError(int error_pos)
|
||||||
qsci->setIndicatorForegroundColor(QColor(255,0,0,100));
|
qsci->setIndicatorForegroundColor(QColor(255,0,0,100));
|
||||||
qsci->markerAdd(line, markerNumber);
|
qsci->markerAdd(line, markerNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScintillaEditor::unhighlightLastError()
|
void ScintillaEditor::unhighlightLastError()
|
||||||
{
|
{
|
||||||
int totalLength = qsci->text().length();
|
int totalLength = qsci->text().length();
|
||||||
|
@ -65,11 +66,12 @@ void ScintillaEditor::unhighlightLastError()
|
||||||
qsci->clearIndicatorRange(0, 0, line, index, indicatorNumber);
|
qsci->clearIndicatorRange(0, 0, line, index, indicatorNumber);
|
||||||
qsci->markerDeleteAll(markerNumber);
|
qsci->markerDeleteAll(markerNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScintillaEditor::setHighlightScheme(const QString &name)
|
void ScintillaEditor::setHighlightScheme(const QString &name)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScintillaEditor::insertPlainText(const QString &text)
|
void ScintillaEditor::insertPlainText(const QString &text)
|
||||||
{
|
{
|
||||||
qsci->setText(text);
|
qsci->setText(text);
|
||||||
|
@ -110,13 +112,11 @@ void ScintillaEditor::zoomOut()
|
||||||
qsci->zoomOut();
|
qsci->zoomOut();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ScintillaEditor::initFont()
|
void ScintillaEditor::initFont()
|
||||||
{
|
{
|
||||||
QFont font("Courier", 12);
|
QFont font("Courier", 12);
|
||||||
font.setFixedPitch(true);
|
font.setFixedPitch(true);
|
||||||
qsci->setFont(font);
|
qsci->setFont(font);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScintillaEditor::initMargin()
|
void ScintillaEditor::initMargin()
|
||||||
|
|
Loading…
Reference in New Issue