input: Hide scrollbar when not overflow in auto grow mode. (#1407)
This commit is contained in:
parent
1af28c49bd
commit
65b53c86e4
1 changed files with 10 additions and 5 deletions
|
|
@ -974,11 +974,16 @@ impl Element for TextElement {
|
||||||
last_layout.lines = Rc::new(lines);
|
last_layout.lines = Rc::new(lines);
|
||||||
|
|
||||||
let total_wrapped_lines = state.text_wrapper.len();
|
let total_wrapped_lines = state.text_wrapper.len();
|
||||||
let empty_bottom_height = bounds
|
let empty_bottom_height = if state.mode.is_auto_grow() || state.mode.is_single_line() {
|
||||||
.size
|
px(0.)
|
||||||
.height
|
} else {
|
||||||
.half()
|
bounds
|
||||||
.max(BOTTOM_MARGIN_ROWS * line_height);
|
.size
|
||||||
|
.height
|
||||||
|
.half()
|
||||||
|
.max(BOTTOM_MARGIN_ROWS * line_height)
|
||||||
|
};
|
||||||
|
|
||||||
let scroll_size = size(
|
let scroll_size = size(
|
||||||
if longest_line_width + line_number_width + RIGHT_MARGIN > bounds.size.width {
|
if longest_line_width + line_number_width + RIGHT_MARGIN > bounds.size.width {
|
||||||
longest_line_width + line_number_width + RIGHT_MARGIN
|
longest_line_width + line_number_width + RIGHT_MARGIN
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue