mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Implement Page(Up|Down) functionality for TextInput.
This commit is contained in:
parent
2ec16a0e88
commit
f99c0e2c15
1 changed files with 10 additions and 2 deletions
|
@ -163,9 +163,9 @@ impl TextInput {
|
|||
self.edit_point.index = 0;
|
||||
self.edit_point.line = 0;
|
||||
return;
|
||||
} else if adjust > 0 && self.edit_point.line >= self.lines.len() - adjust as uint {
|
||||
self.edit_point.index = self.current_line_length();
|
||||
} else if adjust > 0 && self.edit_point.line + adjust as uint >= self.lines.len() {
|
||||
self.edit_point.line = self.lines.len() - 1;
|
||||
self.edit_point.index = self.current_line_length();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -268,6 +268,14 @@ impl TextInput {
|
|||
self.edit_point.index = self.current_line_length();
|
||||
Nothing
|
||||
}
|
||||
"PageUp" => {
|
||||
self.adjust_vertical(-28);
|
||||
Nothing
|
||||
}
|
||||
"PageDown" => {
|
||||
self.adjust_vertical(28);
|
||||
Nothing
|
||||
}
|
||||
"Tab" => TriggerDefaultAction,
|
||||
_ => Nothing,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue