Skip to content

Commit

Permalink
maximised by default, increased input width, changed way of setting z…
Browse files Browse the repository at this point in the history
…oom factor
  • Loading branch information
Inspirateur committed Sep 1, 2024
1 parent 2e7dd83 commit 6b75ca3
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/bin/gui/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// #![windows_subsystem = "windows"]
use eframe::egui;
use anyhow::Result;
use egui::Color32;
use egui::{Color32, TextEdit};
use itertools::Itertools;
use nfd2::Response;
use pathdiff::diff_paths;
Expand All @@ -23,7 +23,7 @@ struct AppState {
impl AppState {
fn new(cc: &eframe::CreationContext<'_>, file: String, cwd: PathBuf) -> Self {
// Customize egui here with cc.egui_ctx.set_fonts and cc.egui_ctx.set_visuals.
cc.egui_ctx.set_pixels_per_point(1.5);
cc.egui_ctx.set_zoom_factor(1.5);
// Restore app state using cc.storage (requires the "persistence" feature).
// Use the cc.gl (a glow::Context) to create graphics shaders and buffers that you can use
// for e.g. egui::PaintCallback.
Expand Down Expand Up @@ -51,6 +51,9 @@ impl AppState {

impl eframe::App for AppState {
fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
let mut style = (*ctx.style()).clone();
style.spacing.text_edit_width = 650.;
ctx.set_style(style);
egui::CentralPanel::default().show(ctx, |ui| {
ui.horizontal(|ui| {
ui.vertical(|ui| {
Expand Down Expand Up @@ -152,7 +155,13 @@ fn main() -> Result<()> {
}
file_path.file_name().unwrap().to_string_lossy().to_string()
};
let native_options = eframe::NativeOptions::default();
let native_options = eframe::NativeOptions {
viewport: egui::ViewportBuilder {
maximized: Some(true),
..Default::default()
},
..Default::default()
};
eframe::run_native(
"Simple Renamer", native_options,
Box::new(|cc| Ok(Box::new(AppState::new(cc, file, cwd))))
Expand Down

0 comments on commit 6b75ca3

Please sign in to comment.