INNER CODE UNIT · Rust

set_window_title

David-OConnor/plascad · src/gui/mod.rs:267

pub fn set_window_title(tab: &Tab, ui: &mut Ui) {
    let title = match &tab.path {
        Some(path) => get_window_title(&path),
        None => WINDOW_TITLE.to_owned(),
    };

    ui.ctx().send_viewport_cmd(ViewportCommand::Title(title));
}

pub fn draw(state: &mut State, ui: &mut Ui) {
    let ctx = ui.ctx().clone();
    ctx.options_mut(|o| o.theme_preference = ThemePreference::Dark);

    egui::CentralPanel::default().show(ui, |ui| {
        handle_input(state, ui);

        // todo: This section DRY with seq viewx.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…