Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/actions_editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ impl Default for ActionsEditor {

impl ActionsEditor {
pub fn ui(&mut self, ctx: &egui::Context, app: &mut LauncherApp) {
egui::Window::new("Command Editor").show(ctx, |ui| {
let mut open = app.show_editor;
egui::Window::new("Command Editor")
.open(&mut open)
.show(ctx, |ui| {
ui.horizontal(|ui| {
ui.label("Search");
ui.text_edit_singleline(&mut self.search);
Expand Down Expand Up @@ -117,5 +120,6 @@ impl ActionsEditor {
});
});
}
app.show_editor = open;
}
}
14 changes: 8 additions & 6 deletions src/gui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,14 @@ impl eframe::App for LauncherApp {
TopBottomPanel::top("menu_bar").show(ctx, |ui| {
menu::bar(ui, |ui| {
ui.menu_button("File", |ui| {
ui.menu_button("Commands", |ui| {
if ui.button("Edit Commands").clicked() {
self.show_editor = !self.show_editor;
}
});
if ui.button("Force Hide").clicked() {
ctx.send_viewport_cmd(egui::ViewportCommand::Visible(false));
}
if ui.button("Close Application").clicked() {
ctx.send_viewport_cmd(egui::ViewportCommand::Close);
self.visible_flag.store(false, Ordering::SeqCst);
Expand Down Expand Up @@ -236,12 +244,6 @@ impl eframe::App for LauncherApp {

CentralPanel::default().show(ctx, |ui| {
ui.heading("🚀 LNCHR");
if ui.button("Edit Commands").clicked() {
self.show_editor = !self.show_editor;
}
if ui.button("Force Hide").clicked() {
ctx.send_viewport_cmd(egui::ViewportCommand::Visible(false));
}
if let Some(err) = &self.error {
ui.colored_label(Color32::RED, err);
}
Expand Down
6 changes: 5 additions & 1 deletion src/settings_editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ impl SettingsEditor {
}

pub fn ui(&mut self, ctx: &egui::Context, app: &mut LauncherApp) {
egui::Window::new("Settings").show(ctx, |ui| {
let mut open = app.show_settings;
egui::Window::new("Settings")
.open(&mut open)
.show(ctx, |ui| {
ui.horizontal(|ui| {
ui.label("Launcher hotkey");
ui.text_edit_singleline(&mut self.hotkey);
Expand Down Expand Up @@ -148,5 +151,6 @@ impl SettingsEditor {
}
}
});
app.show_settings = open;
}
}