remove nouse editor options

This commit is contained in:
Roy Qu 2024-03-20 16:44:20 +08:00
parent 9964551ed6
commit 4da95ebf0a
7 changed files with 3 additions and 90 deletions

View File

@ -5231,7 +5231,7 @@ void Editor::applySettings()
incPaintLock();
QSynedit::EditorOptions options = QSynedit::eoAltSetsColumnMode |
QSynedit::eoDragDropEditing | QSynedit::eoDropFiles | QSynedit::eoKeepCaretX | QSynedit::eoTabsToSpaces |
QSynedit::eoRightMouseMovesCursor | QSynedit::eoScrollByOneLess | QSynedit::eoTabIndent | QSynedit::eoHideShowScrollbars | QSynedit::eoGroupUndo
QSynedit::eoRightMouseMovesCursor | QSynedit::eoTabIndent | QSynedit::eoHideShowScrollbars | QSynedit::eoGroupUndo
| QSynedit::eoSelectWordByDblClick;
options.setFlag(QSynedit::eoShowLeadingSpaces, pSettings->editor().showLeadingSpaces());
@ -5250,10 +5250,8 @@ void Editor::applySettings()
options.setFlag(QSynedit::eoHideShowScrollbars,pSettings->editor().autoHideScrollbar());
options.setFlag(QSynedit::eoScrollPastEol,pSettings->editor().scrollPastEol());
options.setFlag(QSynedit::eoScrollPastEof,pSettings->editor().scrollPastEof());
options.setFlag(QSynedit::eoScrollByOneLess,pSettings->editor().scrollByOneLess());
options.setFlag(QSynedit::eoHalfPageScroll,pSettings->editor().halfPageScroll());
options.setFlag(QSynedit::eoHalfPageScroll,pSettings->editor().halfPageScroll());
options.setFlag(QSynedit::eoInvertMouseScroll, pSettings->editor().invertMouseScroll());
options.setFlag(QSynedit::eoInvertMouseScroll, false);
options.setFlag(QSynedit::eoShowRainbowColor,
pSettings->editor().rainbowParenthesis()

View File

@ -825,16 +825,6 @@ void Settings::Editor::setForceFixedFontWidth(bool newForceFixedWidth)
mForceFixedFontWidth = newForceFixedWidth;
}
bool Settings::Editor::invertMouseScroll() const
{
return mInvertMouseScroll;
}
void Settings::Editor::setInvertMouseScroll(bool newInvertMouseScroll)
{
mInvertMouseScroll = newInvertMouseScroll;
}
bool Settings::Editor::showTrailingSpaces() const
{
return mShowTrailingSpaces;
@ -1280,16 +1270,6 @@ QString Settings::Editor::fontName() const
return mFontFamilies.length() > 0 ? mFontFamilies[0] : "";
}
bool Settings::Editor::scrollByOneLess() const
{
return mScrollByOneLess;
}
void Settings::Editor::setScrollByOneLess(bool scrollByOneLess)
{
mScrollByOneLess = scrollByOneLess;
}
bool Settings::Editor::scrollPastEol() const
{
return mScrollPastEol;
@ -1348,11 +1328,9 @@ void Settings::Editor::doSave()
saveValue("auto_hide_scroll_bar", mAutoHideScrollbar);
saveValue("scroll_past_eof", mScrollPastEof);
saveValue("scroll_past_eol", mScrollPastEol);
saveValue("scroll_by_one_less", mScrollByOneLess);
saveValue("half_page_scroll", mHalfPageScroll);
saveValue("mouse_wheel_scroll_speed", mMouseWheelScrollSpeed);
saveValue("mouse_selection_scroll_speed",mMouseSelectionScrollSpeed);
saveValue("invert_mouse_scroll",mInvertMouseScroll);
//right edge
saveValue("show_right_edge_line",mShowRightEdgeLine);
@ -1481,11 +1459,9 @@ void Settings::Editor::doLoad()
mAutoHideScrollbar = boolValue("auto_hide_scroll_bar", false);
mScrollPastEof = boolValue("scroll_past_eof", true);
mScrollPastEol = boolValue("scroll_past_eol", false);
mScrollByOneLess = boolValue("scroll_by_one_less", false);
mHalfPageScroll = boolValue("half_page_scroll",false);
mMouseWheelScrollSpeed = intValue("mouse_wheel_scroll_speed", 3);
mMouseSelectionScrollSpeed = intValue("mouse_selection_scroll_speed",1);
mInvertMouseScroll = boolValue("invert_mouse_scroll", false);
//right edge

View File

@ -165,9 +165,6 @@ public:
bool scrollPastEol() const;
void setScrollPastEol(bool scrollPastEol);
bool scrollByOneLess() const;
void setScrollByOneLess(bool scrollByOneLess);
bool halfPageScroll() const;
void setHalfPageScroll(bool halfPageScroll);
@ -410,9 +407,6 @@ public:
bool forceFixedFontWidth() const;
void setForceFixedFontWidth(bool newForceFixedWidth);
bool invertMouseScroll() const;
void setInvertMouseScroll(bool newInvertMouseScroll);
private:
//General
// indents
@ -440,11 +434,9 @@ public:
bool mAutoHideScrollbar;
bool mScrollPastEof;
bool mScrollPastEol;
bool mScrollByOneLess;
bool mHalfPageScroll;
int mMouseWheelScrollSpeed;
int mMouseSelectionScrollSpeed;
bool mInvertMouseScroll;
//right margin
bool mShowRightEdgeLine;

View File

@ -76,13 +76,8 @@ void EditorGeneralWidget::doLoad()
ui->chkScrollPastEOF->setChecked(pSettings->editor().scrollPastEof());
ui->chkScrollPastEOL->setChecked(pSettings->editor().scrollPastEol());
ui->chkScrollHalfPage->setChecked(pSettings->editor().halfPageScroll());
ui->chkScrollByOneLess->setChecked(pSettings->editor().scrollByOneLess());
ui->spinMouseWheelScrollSpeed->setValue(pSettings->editor().mouseWheelScrollSpeed());
ui->spinMouseSelectionScrollSpeed->setValue(pSettings->editor().mouseSelectionScrollSpeed());
if (pSettings->editor().invertMouseScroll())
ui->rbInvertScroll->setChecked(true);
else
ui->rbNaturalScroll->setChecked(true);
//right margin line;
ui->grpRightEdge->setChecked(pSettings->editor().showRightEdgeLine());
@ -116,11 +111,9 @@ void EditorGeneralWidget::doSave()
pSettings->editor().setAutoHideScrollbar(ui->chkAutoHideScrollBars->isChecked());
pSettings->editor().setScrollPastEof(ui->chkScrollPastEOF->isChecked());
pSettings->editor().setScrollPastEol(ui->chkScrollPastEOL->isChecked());
pSettings->editor().setScrollByOneLess(ui->chkScrollByOneLess->isChecked());
pSettings->editor().setHalfPageScroll(ui->chkScrollHalfPage->isChecked());
pSettings->editor().setMouseWheelScrollSpeed(ui->spinMouseWheelScrollSpeed->value());
pSettings->editor().setMouseSelectionScrollSpeed(ui->spinMouseSelectionScrollSpeed->value());
pSettings->editor().setInvertMouseScroll(ui->rbInvertScroll->isChecked());
//right margin line;
pSettings->editor().setShowRightEdgeLine(ui->grpRightEdge->isChecked());
pSettings->editor().setRightEdgeWidth(ui->spRightEdge->value());

View File

@ -360,49 +360,6 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chkScrollByOneLess">
<property name="text">
<string>Forces page scroll to be one line less</string>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Mouse Scroll Direction</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QRadioButton" name="rbNaturalScroll">
<property name="text">
<string>Natural</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rbInvertScroll">
<property name="text">
<string>Invert</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_6" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_3">

View File

@ -5651,9 +5651,6 @@ void QSynEdit::executeCommand(EditCommand command, QChar ch, void *pData)
int counter = mLinesInWindow;
if (mOptions.testFlag(eoHalfPageScroll))
counter /= 2;
if (mOptions.testFlag(eoScrollByOneLess)) {
counter -=1;
}
if (counter<0)
break;
if (command == EditCommand::PageUp || command == EditCommand::SelPageUp) {

View File

@ -90,7 +90,7 @@ enum EditorOption {
eoHideShowScrollbars = 0x00000200, //if enabled, then the scrollbars will only show when necessary. If you have ScrollPastEOL, then it the horizontal bar will always be there (it uses MaxLength instead)
eoKeepCaretX = 0x00000400 , //When moving through lines w/o Cursor Past EOL, keeps the X position of the cursor
eoRightMouseMovesCursor= 0x00000800, //When clicking with the right mouse for a popup menu, move the cursor to that location
eoScrollByOneLess = 0x00001000, //Forces scrolling to be one less
// eoScrollByOneLess = 0x00001000, //Forces scrolling to be one less
eoScrollPastEof = 0x00002000, //Allows the cursor to go past the end of file marker
eoScrollPastEol = 0x00004000, //Allows the cursor to go past the last character into the white space at the end of a line
eoInvertMouseScroll = 0x00008000, //Shows the special Characters