Graphical fixes

This commit is contained in:
2024-11-28 12:39:08 -05:00
parent 83377ff5fa
commit 9ff62af310
4 changed files with 56 additions and 15 deletions
+7 -6
View File
@@ -3,8 +3,8 @@ use crate::{
emulator::{EmulatorClient, EmulatorCommand, SimId},
};
use egui::{
menu, Button, CentralPanel, Color32, Context, Response, TopBottomPanel, Ui, ViewportBuilder,
ViewportCommand, ViewportId, WidgetText,
menu, Button, CentralPanel, Color32, Context, Frame, Response, TopBottomPanel, Ui,
ViewportBuilder, ViewportCommand, ViewportId, WidgetText,
};
use winit::event_loop::EventLoopProxy;
@@ -67,7 +67,7 @@ impl GameWindow {
for scale in 1..=4 {
let label = format!("x{scale}");
let scale = scale as f32;
let dims = (384.0 * scale, 224.0 * scale + 20.0).into();
let dims = (384.0 * scale, 224.0 * scale + 22.0).into();
if ui
.selectable_button((current_dims - dims).length() < 1.0, label)
.clicked()
@@ -133,18 +133,19 @@ impl AppWindow for GameWindow {
fn initial_viewport(&self) -> ViewportBuilder {
ViewportBuilder::default()
.with_title("Shrooms VB")
.with_inner_size((384.0, 244.0))
.with_inner_size((384.0, 246.0))
}
fn show(&mut self, ctx: &Context) {
TopBottomPanel::top("menubar")
.exact_height(20.0)
.exact_height(22.0)
.show(ctx, |ui| {
menu::bar(ui, |ui| {
self.show_menu(ctx, ui);
});
});
CentralPanel::default().show(ctx, |ui| {
let frame = Frame::central_panel(&ctx.style()).fill(Color32::BLACK);
CentralPanel::default().frame(frame).show(ctx, |ui| {
if let Some(screen) = self.screen.as_ref() {
ui.add(screen);
}