nicen up settings
This commit is contained in:
+23
-19
@@ -198,27 +198,31 @@ impl App {
|
||||
}
|
||||
|
||||
fn show_settings_stage(&mut self, ctx: &egui::Context, ui: &mut egui::Ui) {
|
||||
ui.horizontal(|ui| {
|
||||
ui.label("Launch version");
|
||||
egui::ComboBox::from_id_salt("Launch version")
|
||||
.selected_text(self.settings.launch_version.to_string())
|
||||
.show_ui(ui, |ui| {
|
||||
ui.build_menu(&mut self.settings.launch_version);
|
||||
});
|
||||
ui.collapsing("General", |ui| {
|
||||
ui.checkbox(&mut self.settings.start_elevated, "Always start elevated");
|
||||
ui.horizontal(|ui| {
|
||||
let selection = self.settings.theme;
|
||||
egui::ComboBox::from_id_salt("Theme")
|
||||
.selected_text(self.settings.theme.to_string())
|
||||
.show_ui(ui, |ui| {
|
||||
ui.build_menu(&mut self.settings.theme);
|
||||
});
|
||||
if selection != self.settings.theme {
|
||||
catppuccin_egui::set_theme(ctx, self.settings.theme.into());
|
||||
}
|
||||
ui.label("Theme");
|
||||
});
|
||||
});
|
||||
ui.horizontal(|ui| {
|
||||
let selection = self.settings.theme;
|
||||
ui.label("Theme");
|
||||
egui::ComboBox::from_id_salt("Theme")
|
||||
.selected_text(self.settings.theme.to_string())
|
||||
.show_ui(ui, |ui| {
|
||||
ui.build_menu(&mut self.settings.theme);
|
||||
});
|
||||
if selection != self.settings.theme {
|
||||
catppuccin_egui::set_theme(ctx, self.settings.theme.into());
|
||||
}
|
||||
ui.collapsing("Game", |ui| {
|
||||
ui.horizontal(|ui| {
|
||||
egui::ComboBox::from_id_salt("Launch version")
|
||||
.selected_text(self.settings.launch_version.to_string())
|
||||
.show_ui(ui, |ui| {
|
||||
ui.build_menu(&mut self.settings.launch_version);
|
||||
});
|
||||
ui.label("Launch version");
|
||||
});
|
||||
});
|
||||
ui.checkbox(&mut self.settings.start_elevated, "Always start elevated");
|
||||
}
|
||||
|
||||
fn show_about_stage(&self, _ctx: &egui::Context, ui: &mut egui::Ui) {
|
||||
|
||||
+14
-14
@@ -14,14 +14,14 @@ pub enum Theme {
|
||||
#[default]
|
||||
#[strum(to_string = "Auto")]
|
||||
Auto,
|
||||
#[strum(to_string = "Catppuccin Latte")]
|
||||
CatppuccinLatte,
|
||||
#[strum(to_string = "Catppuccin Frappe")]
|
||||
CatppuccinFrappe,
|
||||
#[strum(to_string = "Catppuccin Macchiato")]
|
||||
CatppuccinMacchiato,
|
||||
#[strum(to_string = "Catppuccin Mocha")]
|
||||
CatppuccinMocha,
|
||||
#[strum(to_string = "Latte")]
|
||||
Latte,
|
||||
#[strum(to_string = "Frappe")]
|
||||
Frappe,
|
||||
#[strum(to_string = "Macchiato")]
|
||||
Macchiato,
|
||||
#[strum(to_string = "Mocha")]
|
||||
Mocha,
|
||||
}
|
||||
|
||||
impl From<Theme> for catppuccin_egui::Theme {
|
||||
@@ -34,17 +34,17 @@ impl From<Theme> for catppuccin_egui::Theme {
|
||||
catppuccin_egui::MOCHA
|
||||
}
|
||||
}
|
||||
Theme::CatppuccinLatte => catppuccin_egui::LATTE,
|
||||
Theme::CatppuccinFrappe => catppuccin_egui::FRAPPE,
|
||||
Theme::CatppuccinMacchiato => catppuccin_egui::MACCHIATO,
|
||||
Theme::CatppuccinMocha => catppuccin_egui::MOCHA,
|
||||
Theme::Latte => catppuccin_egui::LATTE,
|
||||
Theme::Frappe => catppuccin_egui::FRAPPE,
|
||||
Theme::Macchiato => catppuccin_egui::MACCHIATO,
|
||||
Theme::Mocha => catppuccin_egui::MOCHA,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
|
||||
pub struct Settings {
|
||||
pub launch_version: LaunchVersion,
|
||||
pub theme: Theme,
|
||||
pub start_elevated: bool,
|
||||
pub theme: Theme,
|
||||
pub launch_version: LaunchVersion,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user