Clean up use of Size
This commit is contained in:
parent
d5c0c94883
commit
147c3eaf92
2 changed files with 1 additions and 6 deletions
|
|
@ -15,7 +15,6 @@
|
||||||
#![warn(clippy::use_self)]
|
#![warn(clippy::use_self)]
|
||||||
|
|
||||||
// TODO Enable warn(unreachable_pub)?
|
// TODO Enable warn(unreachable_pub)?
|
||||||
// TODO Clean up use and manipulation of toss Pos and Size
|
|
||||||
// TODO Remove unnecessary Debug impls and compare compile times
|
// TODO Remove unnecessary Debug impls and compare compile times
|
||||||
|
|
||||||
mod config;
|
mod config;
|
||||||
|
|
|
||||||
|
|
@ -497,11 +497,7 @@ impl Editor {
|
||||||
impl Widget for Editor {
|
impl Widget for Editor {
|
||||||
fn size(&self, frame: &mut Frame, max_width: Option<u16>, max_height: Option<u16>) -> Size {
|
fn size(&self, frame: &mut Frame, max_width: Option<u16>, max_height: Option<u16>) -> Size {
|
||||||
if let Some(placeholder) = &self.hidden {
|
if let Some(placeholder) = &self.hidden {
|
||||||
let mut size = if self.text.text().is_empty() {
|
let mut size = placeholder.size(frame, max_width, max_height);
|
||||||
Size::new(1, 1)
|
|
||||||
} else {
|
|
||||||
placeholder.size(frame, max_width, max_height)
|
|
||||||
};
|
|
||||||
|
|
||||||
// Cursor needs to fit regardless of focus
|
// Cursor needs to fit regardless of focus
|
||||||
size.width = size.width.max(1);
|
size.width = size.width.max(1);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue