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