More visual fixes

This commit is contained in:
Simon Gellis 2025-02-23 22:30:23 -05:00
parent f7408ac9b7
commit 0ae2a2f54f
3 changed files with 12 additions and 20 deletions

View File

@ -64,9 +64,7 @@ impl TextureSink {
sample_count: 1,
dimension: wgpu::TextureDimension::D2,
format: TextureFormat::Rg8Unorm,
usage: TextureUsages::COPY_SRC
| TextureUsages::COPY_DST
| TextureUsages::TEXTURE_BINDING,
usage: TextureUsages::COPY_DST | TextureUsages::TEXTURE_BINDING,
view_formats: &[TextureFormat::Rg8Unorm],
};
device.create_texture(&desc)

View File

@ -49,11 +49,10 @@ impl UiExt for Ui {
let old_rect = res.response.rect;
let mut text_rect = old_rect;
text_rect.min.x += 6.0;
let new_rect = self
.allocate_new_ui(UiBuilder::new().max_rect(text_rect), |ui| ui.label(text))
.response
.rect;
self.allocate_space((old_rect.max - new_rect.max) - (old_rect.min - new_rect.min));
self.allocate_new_ui(UiBuilder::new().max_rect(text_rect), |ui| ui.label(text));
if old_rect.width() > 0.0 {
self.advance_cursor_after_rect(old_rect);
}
}
fn selectable_button(&mut self, selected: bool, text: impl Into<WidgetText>) -> Response {

View File

@ -130,7 +130,6 @@ impl RegisterWindow {
let row_height = self.row_height(ui);
let mut raw_dpstts = self.read_address(0x0005f820);
let mut dpstts = DisplayReg::parse(raw_dpstts);
ui.add_space(-ui.spacing().item_spacing.x);
ui.section("Display", |ui| {
let width = ui.available_width();
TableBuilder::new(ui)
@ -213,7 +212,6 @@ impl RegisterWindow {
let row_height = self.row_height(ui);
let [mut raw_xpstts, raw_xpctrl] = self.read_address(0x0005f840);
let mut xpstts = DrawingReg::parse(raw_xpstts);
ui.add_space(-ui.spacing().item_spacing.x);
ui.section("Drawing", |ui| {
let width = ui.available_width();
TableBuilder::new(ui)
@ -311,7 +309,6 @@ impl RegisterWindow {
fn show_colors(&mut self, ui: &mut Ui) {
let row_height = self.row_height(ui);
let registers = self.registers.borrow();
ui.add_space(-ui.spacing().item_spacing.x);
ui.section("Colors", |ui| {
let width = ui.available_width();
let xspace = ui.spacing().item_spacing.x;
@ -501,14 +498,13 @@ impl RegisterWindow {
fn show_objects(&mut self, ui: &mut Ui) {
let row_height = self.row_height(ui);
ui.add_space(-ui.spacing().item_spacing.x);
ui.section("Objects", |ui| {
let width = ui.available_width();
let xspace = ui.spacing().item_spacing.x;
TableBuilder::new(ui)
.column(Column::exact(width * 0.25 - xspace))
.column(Column::exact(width * 0.25 - xspace))
.column(Column::exact(width * 0.5 - xspace))
.column(Column::exact(width * 0.3 - xspace))
.column(Column::exact(width * 0.3 - xspace))
.column(Column::exact(width * 0.4 - xspace))
.cell_layout(Layout::left_to_right(Align::Center).with_main_align(Align::RIGHT))
.body(|mut body| {
body.row(row_height, |mut row| {
@ -551,7 +547,6 @@ impl RegisterWindow {
fn show_misc(&mut self, ui: &mut Ui) {
let row_height = self.row_height(ui);
let registers = self.registers.borrow();
ui.add_space(-ui.spacing().item_spacing.x);
ui.section("Misc.", |ui| {
let width = ui.available_width();
let xspace = ui.spacing().item_spacing.x;
@ -653,12 +648,12 @@ impl AppWindow for RegisterWindow {
CentralPanel::default().show(ctx, |ui| {
ScrollArea::vertical().show(ui, |ui| {
ui.horizontal_top(|ui| {
let width = ui.available_width();
let xspace = ui.spacing().item_spacing.x;
let width = ui.available_width() - (xspace * 5.0);
StripBuilder::new(ui)
.size(Size::exact(width * 0.2 - xspace))
.size(Size::exact(width * 0.2 - xspace))
.size(Size::exact(width * 0.4 - xspace))
.size(Size::exact(width * 0.25 - xspace))
.size(Size::exact(width * 0.225 - xspace))
.size(Size::exact(width * 0.325 - xspace))
.size(Size::exact(width * 0.2 - xspace))
.horizontal(|mut strip| {
strip.cell(|ui| {