change ui window size + ui spacing size & make an enum Copy
This commit is contained in:
@@ -2,7 +2,7 @@ use serde::{Deserialize, Serialize};
|
|||||||
use std::{fmt::Display, path::PathBuf, process::Command};
|
use std::{fmt::Display, path::PathBuf, process::Command};
|
||||||
use winreg::{RegKey, enums::HKEY_LOCAL_MACHINE};
|
use winreg::{RegKey, enums::HKEY_LOCAL_MACHINE};
|
||||||
|
|
||||||
#[derive(Clone, Default, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Clone, Copy, Default, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
pub enum Platform {
|
pub enum Platform {
|
||||||
#[default]
|
#[default]
|
||||||
Steam,
|
Steam,
|
||||||
|
|||||||
+13
-19
@@ -24,7 +24,7 @@ use sysinfo::System;
|
|||||||
use windows::Win32::Foundation::HANDLE;
|
use windows::Win32::Foundation::HANDLE;
|
||||||
|
|
||||||
const THEME: catppuccin_egui::Theme = catppuccin_egui::MOCHA;
|
const THEME: catppuccin_egui::Theme = catppuccin_egui::MOCHA;
|
||||||
const WINDOW_SIZE: [f32; 2] = [267.0, 237.0];
|
const WINDOW_SIZE: [f32; 2] = [240.0, 240.0];
|
||||||
static CONFIG_PATH: LazyLock<PathBuf> = LazyLock::new(|| {
|
static CONFIG_PATH: LazyLock<PathBuf> = LazyLock::new(|| {
|
||||||
let mut config_path = dirs::config_local_dir().unwrap();
|
let mut config_path = dirs::config_local_dir().unwrap();
|
||||||
config_path.push("GTA Tools");
|
config_path.push("GTA Tools");
|
||||||
@@ -90,7 +90,7 @@ impl eframe::App for App {
|
|||||||
self.launch.selected = persistent_state.launcher;
|
self.launch.selected = persistent_state.launcher;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ctx.style_mut(|style| style.spacing.item_spacing = egui::vec2(3.0, 3.0));
|
ctx.style_mut(|style| style.spacing.item_spacing = egui::vec2(4.0, 4.0));
|
||||||
self.initialized = true;
|
self.initialized = true;
|
||||||
}
|
}
|
||||||
self.run_timers();
|
self.run_timers();
|
||||||
@@ -111,22 +111,16 @@ impl eframe::App for App {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
egui::CentralPanel::default().show(ctx, |ui| {
|
egui::CentralPanel::default().show(ctx, |ui| match self.stage {
|
||||||
egui::ScrollArea::both()
|
Stage::Main => {
|
||||||
.auto_shrink([false, false])
|
self.header(ui, "Game");
|
||||||
.show(ui, |ui| match self.stage {
|
self.show_game(ctx, ui);
|
||||||
Stage::Main => {
|
self.header(ui, "Session");
|
||||||
self.header(ui, "Game");
|
self.show_session(ctx, ui);
|
||||||
self.show_game(ctx, ui);
|
self.header(ui, "Network");
|
||||||
self.header(ui, "Session");
|
self.show_network(ctx, ui);
|
||||||
self.show_session(ctx, ui);
|
}
|
||||||
self.header(ui, "Network");
|
Stage::About => self.show_about(ctx, ui),
|
||||||
self.show_network(ctx, ui);
|
|
||||||
}
|
|
||||||
Stage::About => {
|
|
||||||
self.show_about(ctx, ui);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
if self.check_debug_keycombo_pressed(ctx) {
|
if self.check_debug_keycombo_pressed(ctx) {
|
||||||
self.debug = !self.debug;
|
self.debug = !self.debug;
|
||||||
@@ -347,7 +341,7 @@ impl Drop for App {
|
|||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
// save any persistent state to config file
|
// save any persistent state to config file
|
||||||
let persistent_state = PersistentState {
|
let persistent_state = PersistentState {
|
||||||
launcher: self.launch.selected.clone(),
|
launcher: self.launch.selected,
|
||||||
};
|
};
|
||||||
let config_path = CONFIG_PATH.as_path();
|
let config_path = CONFIG_PATH.as_path();
|
||||||
let config_path_parent = config_path.parent().unwrap();
|
let config_path_parent = config_path.parent().unwrap();
|
||||||
|
|||||||
Reference in New Issue
Block a user