Struct Window

Source
pub struct Window<'m> {
    pub prompt: String,
    pub message: Option<&'m str>,
    pub additional_args: Vec<String>,
    pub location: Location,
    pub padding: Padding,
    pub dimensions: Dimensions,
    pub fullscreen: bool,
    pub format: ReturnFormat,
}
Expand description

represents the raw ‘window’ that rofi shows the Window can be customized to change the appearance of the shown window note that some fields will be overwritten by types in components.rs and lib.rs

Fields§

§prompt: String

message to display next to the entry field

§message: Option<&'m str>

short message displayed beneath this field and above all options

§additional_args: Vec<String>

Additional args to pass to rofi

§location: Location

location on screen to place the window

§padding: Padding

X and Y offsets from the Location

§dimensions: Dimensions

width, height, rows and columns of the window

§fullscreen: bool

whether to show in fullscreen. Overrides location and padding

§format: ReturnFormat

return user selection as an index or string

Implementations§

Source§

impl<'a, 's, 'm> Window<'m>

Source

pub fn new(prompt: &'a str) -> Self

create a window with given prompt

Source

pub fn message(self, msg: &'static str) -> Self

set the window’s message

Source

pub fn location(self, l: Location) -> Self

set the window’s location

Source

pub fn padding(self, x: i32, y: i32) -> Self

set the window’s padding

Source

pub fn dimensions(self, d: Dimensions) -> Self

set the window’s dimensions

Source

pub fn prompt(self, s: String) -> Self

set the window’s prompt

Source

pub fn lines(self, l: i32) -> Self

set number of lines for the window

Source

pub fn fullscreen(self, f: bool) -> Self

set if the window should be fullscreen

Source

pub fn format(self, f: char) -> Self

set the windows format

Source

pub fn add_args(self, args: Vec<String>) -> Self

add any additional args rofi accepts as an array of strings. These must include any dashes.

https://gist.github.com/eyalev/a644bb75fdc6f476c2b25d9284a94682

Source

pub fn show(self, options: Vec<String>) -> Result<String, WindowError>

run the rofi command this window represents

Trait Implementations§

Source§

impl<'m> Clone for Window<'m>

Source§

fn clone(&self) -> Window<'m>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'m> Debug for Window<'m>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'m> Freeze for Window<'m>

§

impl<'m> RefUnwindSafe for Window<'m>

§

impl<'m> Send for Window<'m>

§

impl<'m> Sync for Window<'m>

§

impl<'m> Unpin for Window<'m>

§

impl<'m> UnwindSafe for Window<'m>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.