exit properly after last tab closes
This commit is contained in:
parent
e7dae3f939
commit
52e857aa5a
|
@ -35,6 +35,6 @@ Max tabs 8 => 20
|
||||||
Max framerate => 30 fps (less cpu usage)
|
Max framerate => 30 fps (less cpu usage)
|
||||||
|
|
||||||
# 1.1.0 :
|
# 1.1.0 :
|
||||||
Added close tab and refresh confirm prompt
|
Added confirm prompt if unsaved
|
||||||
Async terminal !
|
Async terminal !
|
||||||
Better Ui
|
Better Ui
|
|
@ -142,12 +142,16 @@ impl Calcifer {
|
||||||
ui.style_mut().visuals.override_text_color = None;
|
ui.style_mut().visuals.override_text_color = None;
|
||||||
|
|
||||||
if ui.link("X").clicked() && !self.close_tab_confirm.visible {
|
if ui.link("X").clicked() && !self.close_tab_confirm.visible {
|
||||||
|
if self.tabs.len() > 1 {
|
||||||
if tab.saved {
|
if tab.saved {
|
||||||
self.delete_tab(index);
|
self.delete_tab(index);
|
||||||
} else {
|
} else {
|
||||||
self.close_tab_confirm.ask();
|
self.close_tab_confirm.ask();
|
||||||
self.tab_to_close = index;
|
self.tab_to_close = index;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
egui::Context::send_viewport_cmd(ctx, egui::ViewportCommand::Close);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ui.separator();
|
ui.separator();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue