T63: a double press on a session's row renames it, which a user asked for after 0.1.6: Ely's ListItem::editor, added for this, draws a field in the title's place; Enter keeps the name, Escape drops it, a blur keeps it; the name stands over the program's title in the row, the header and the window's title until renamed again, and an empty one gives the title back; Ely pinned to 7f7a715
This commit is contained in:
9 files changed
+136
-17
No files matched your search
+5
-6
@@ -29,6 +29,7 @@ use crate::{
|
||||
};
|
||||
|
||||
mod events;
|
||||
mod rename;
|
||||
mod widths;
|
||||
|
||||
use widths::{Dragged, Side};
|
||||
@@ -156,6 +157,8 @@ impl Workspace {
|
||||
self.sessions.push(Session {
|
||||
terminal,
|
||||
title: String::new(),
|
||||
name: String::new(),
|
||||
editing: None,
|
||||
folder: launch.cwd,
|
||||
reports: launch.reports,
|
||||
bell: false,
|
||||
@@ -268,13 +271,9 @@ impl Workspace {
|
||||
&self.sessions
|
||||
}
|
||||
|
||||
/// The shown session's title, or the app's name while its program names none.
|
||||
/// What the shown session is called.
|
||||
fn title(&self) -> &str {
|
||||
self.sessions
|
||||
.get(self.active)
|
||||
.map(|session| session.title.as_str())
|
||||
.filter(|title| !title.is_empty())
|
||||
.unwrap_or(TITLE)
|
||||
self.sessions.get(self.active).map_or(TITLE, Session::named)
|
||||
}
|
||||
|
||||
fn retitle(&self, window: &mut Window) {
|
||||
|
||||
Reference in new issue
Block a user