feat: select file name until the extension in rename and save dialog
This commit is contained in:
parent
175f8ba724
commit
fc25260a5f
3 changed files with 75 additions and 49 deletions
|
|
@ -600,6 +600,7 @@ impl App {
|
|||
col = col.push(
|
||||
widget::text_input("", filename)
|
||||
.id(self.filename_id.clone())
|
||||
.double_click_select_delimiter('.')
|
||||
.on_input(Message::Filename)
|
||||
.on_submit(|_| Message::Save(false)),
|
||||
);
|
||||
|
|
@ -1962,6 +1963,16 @@ impl Application for App {
|
|||
if self.search_get().is_some() {
|
||||
return widget::text_input::focus(self.search_id.clone());
|
||||
}
|
||||
if let DialogKind::SaveFile { filename } = &self.flags.kind {
|
||||
return Task::batch([
|
||||
widget::text_input::focus(self.filename_id.clone()),
|
||||
widget::text_input::select_until_last(
|
||||
self.filename_id.clone(),
|
||||
filename,
|
||||
'.',
|
||||
),
|
||||
]);
|
||||
}
|
||||
return widget::text_input::focus(self.filename_id.clone());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue