mirror of https://github.com/buggins/dlangui.git
Original ScrollLineUp + ScrollLineUpSingle
This commit is contained in:
parent
6962190955
commit
0cc427f514
|
@ -183,10 +183,10 @@ enum EditorActions : int {
|
||||||
ScrollLineUpSingle,
|
ScrollLineUpSingle,
|
||||||
/// Scroll one line down (not changing cursor)
|
/// Scroll one line down (not changing cursor)
|
||||||
ScrollLineDownSingle,
|
ScrollLineDownSingle,
|
||||||
/// Scroll one line up (not changing cursor)
|
/// Scroll three lines up (not changing cursor)
|
||||||
ScrollLineUpTriple,
|
ScrollLineUp,
|
||||||
/// Scroll one line down (not changing cursor)
|
/// Scroll three lines down (not changing cursor)
|
||||||
ScrollLineDownTriple,
|
ScrollLineDown,
|
||||||
/// Scroll one page up (not changing cursor)
|
/// Scroll one page up (not changing cursor)
|
||||||
ScrollPageUp,
|
ScrollPageUp,
|
||||||
/// Scroll one page down (not changing cursor)
|
/// Scroll one page down (not changing cursor)
|
||||||
|
@ -2246,13 +2246,13 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction
|
||||||
return handleAction(new Action(EditorActions.ScrollRight));
|
return handleAction(new Action(EditorActions.ScrollRight));
|
||||||
if (keyFlags == MouseFlag.Control)
|
if (keyFlags == MouseFlag.Control)
|
||||||
return handleAction(new Action(EditorActions.ZoomOut));
|
return handleAction(new Action(EditorActions.ZoomOut));
|
||||||
return handleAction(new Action(EditorActions.ScrollLineDownTriple));
|
return handleAction(new Action(EditorActions.ScrollLineDown));
|
||||||
} else if (event.wheelDelta > 0) {
|
} else if (event.wheelDelta > 0) {
|
||||||
if (keyFlags == MouseFlag.Shift)
|
if (keyFlags == MouseFlag.Shift)
|
||||||
return handleAction(new Action(EditorActions.ScrollLeft));
|
return handleAction(new Action(EditorActions.ScrollLeft));
|
||||||
if (keyFlags == MouseFlag.Control)
|
if (keyFlags == MouseFlag.Control)
|
||||||
return handleAction(new Action(EditorActions.ZoomIn));
|
return handleAction(new Action(EditorActions.ZoomIn));
|
||||||
return handleAction(new Action(EditorActions.ScrollLineUpTriple));
|
return handleAction(new Action(EditorActions.ScrollLineUp));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cancelHoverTimer();
|
cancelHoverTimer();
|
||||||
|
@ -3238,10 +3238,10 @@ class EditBox : EditWidgetBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
case ScrollLineUpSingle:
|
case ScrollLineUp:
|
||||||
{
|
{
|
||||||
if (_firstVisibleLine > 0) {
|
if (_firstVisibleLine > 0) {
|
||||||
_firstVisibleLine -= 1;
|
_firstVisibleLine -= 3;
|
||||||
if (_firstVisibleLine < 0)
|
if (_firstVisibleLine < 0)
|
||||||
_firstVisibleLine = 0;
|
_firstVisibleLine = 0;
|
||||||
measureVisibleText();
|
measureVisibleText();
|
||||||
|
@ -3250,10 +3250,10 @@ class EditBox : EditWidgetBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
case ScrollLineUpTriple:
|
case ScrollLineUpSingle:
|
||||||
{
|
{
|
||||||
if (_firstVisibleLine > 0) {
|
if (_firstVisibleLine > 0) {
|
||||||
_firstVisibleLine -= 3;
|
_firstVisibleLine -= 1;
|
||||||
if (_firstVisibleLine < 0)
|
if (_firstVisibleLine < 0)
|
||||||
_firstVisibleLine = 0;
|
_firstVisibleLine = 0;
|
||||||
measureVisibleText();
|
measureVisibleText();
|
||||||
|
@ -3275,11 +3275,11 @@ class EditBox : EditWidgetBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
case ScrollLineDownSingle:
|
case ScrollLineDown:
|
||||||
{
|
{
|
||||||
int fullLines = _clientRect.height / _lineHeight;
|
int fullLines = _clientRect.height / _lineHeight;
|
||||||
if (_firstVisibleLine + fullLines < _content.length) {
|
if (_firstVisibleLine + fullLines < _content.length) {
|
||||||
_firstVisibleLine += 1;
|
_firstVisibleLine += 3;
|
||||||
if (_firstVisibleLine > _content.length - fullLines)
|
if (_firstVisibleLine > _content.length - fullLines)
|
||||||
_firstVisibleLine = _content.length - fullLines;
|
_firstVisibleLine = _content.length - fullLines;
|
||||||
if (_firstVisibleLine < 0)
|
if (_firstVisibleLine < 0)
|
||||||
|
@ -3290,11 +3290,11 @@ class EditBox : EditWidgetBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
case ScrollLineDownTriple:
|
case ScrollLineDownSingle:
|
||||||
{
|
{
|
||||||
int fullLines = _clientRect.height / _lineHeight;
|
int fullLines = _clientRect.height / _lineHeight;
|
||||||
if (_firstVisibleLine + fullLines < _content.length) {
|
if (_firstVisibleLine + fullLines < _content.length) {
|
||||||
_firstVisibleLine += 3;
|
_firstVisibleLine += 1;
|
||||||
if (_firstVisibleLine > _content.length - fullLines)
|
if (_firstVisibleLine > _content.length - fullLines)
|
||||||
_firstVisibleLine = _content.length - fullLines;
|
_firstVisibleLine = _content.length - fullLines;
|
||||||
if (_firstVisibleLine < 0)
|
if (_firstVisibleLine < 0)
|
||||||
|
|
Loading…
Reference in New Issue