pub struct FooterWidgets<U: Ui> { /* private fields */ }Expand description
A footer WidgetAlias consisting of a StatusLine,
PromptLine and Notifications combo
These are the default Widgets placed in the footer position of
Duat. By default, they will be placed around the window, but
they can also be placed around individual Files:
setup_duat!(setup);
use duat::prelude::*;
use duat_utils::widgets::{FooterWidgets, status};
fn setup() {
hook::add::<File>(|pa, (cfg, builder)| {
builder.push(FooterWidgets::new(status!(
"{name_txt}{Spacer}{} {sels_txt} {main_txt}",
mode_txt(pa)
)));
cfg
});
}This specific Widget configuration makes use of hooks in
order to show the PromptLine only when it is in focus, showing
Notifications whenever that is not the case. Like Vim/Neovim,
it also takes up two lines on the screen, one for the
StatusLine and one for the other two Widgets.
If you want a Kakoune-like one line footer, use
the one_line method. You can also use the prompt and
notifs methods in order to specify the PromptLine and
Notifications Widgets, respectively.
Additionally, you can call the above method in order to place
the footer as a header instead.
Implementations§
Sourcepub fn new(status_cfg: StatusLineCfg<U>) -> Self
pub fn new(status_cfg: StatusLineCfg<U>) -> Self
Returns a new FooterWidgets, with a StatusLine and
default PromptLine and Notifications
You can set those other two through the prompt and
notifs methods.
Sourcepub fn one_line(self) -> Self
pub fn one_line(self) -> Self
Turns this footer into a Kakoune-like one liner, as opposed to a Neovim-like two liner
Sourcepub fn prompt(self, prompt_cfg: PromptLineCfg<U>) -> Self
pub fn prompt(self, prompt_cfg: PromptLineCfg<U>) -> Self
Sets the PromptLine to be used
Sourcepub fn notifs(self, notifs_cfg: NotificationsCfg<U>) -> Self
pub fn notifs(self, notifs_cfg: NotificationsCfg<U>) -> Self
Sets the Notifications to be used