Layout tweaks to make the window resizable again
This commit is contained in:
parent
d12ad8fc13
commit
961ca7c910
|
@ -14,7 +14,7 @@ mod widgets;
|
||||||
|
|
||||||
fn main() -> Result<(), eframe::Error> {
|
fn main() -> Result<(), eframe::Error> {
|
||||||
let options = eframe::NativeOptions {
|
let options = eframe::NativeOptions {
|
||||||
viewport: egui::ViewportBuilder::default(),
|
viewport: egui::ViewportBuilder::default().with_min_inner_size((1200.0, 700.0)),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
eframe::run_native(
|
eframe::run_native(
|
||||||
|
@ -156,7 +156,9 @@ impl eframe::App for CheapsdoControl {
|
||||||
|
|
||||||
ui.separator();
|
ui.separator();
|
||||||
|
|
||||||
ui.horizontal(|ui| {
|
ui.with_layout(egui::Layout::right_to_left(egui::Align::TOP), |ui| {
|
||||||
|
self.output_control(ui, ctx);
|
||||||
|
ui.separator();
|
||||||
ui.vertical(|ui| {
|
ui.vertical(|ui| {
|
||||||
ui.vertical(|ui| ui.label(egui::RichText::new("TCXO Status").size(20.0)));
|
ui.vertical(|ui| ui.label(egui::RichText::new("TCXO Status").size(20.0)));
|
||||||
ui.add_space(20.0);
|
ui.add_space(20.0);
|
||||||
|
@ -164,10 +166,6 @@ impl eframe::App for CheapsdoControl {
|
||||||
ui.add_space(20.0);
|
ui.add_space(20.0);
|
||||||
self.show_plots(ui);
|
self.show_plots(ui);
|
||||||
});
|
});
|
||||||
|
|
||||||
ui.separator();
|
|
||||||
|
|
||||||
self.output_control(ui, ctx);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use eframe::egui::Color32;
|
|
||||||
use eframe::egui::{self};
|
use eframe::egui::{self};
|
||||||
|
use eframe::egui::{Color32, Vec2};
|
||||||
|
|
||||||
use crate::serial;
|
use crate::serial;
|
||||||
use crate::widgets;
|
use crate::widgets;
|
||||||
|
@ -12,9 +12,14 @@ const PLL_MAX_FREQ: u32 = 900_000_000;
|
||||||
const OUT_MIN_FREQ: u32 = 500_000;
|
const OUT_MIN_FREQ: u32 = 500_000;
|
||||||
const OUT_MAX_FREQ: u32 = 225_000_000;
|
const OUT_MAX_FREQ: u32 = 225_000_000;
|
||||||
|
|
||||||
|
//Layout::top_down(Align::Center)
|
||||||
|
|
||||||
impl CheapsdoControl {
|
impl CheapsdoControl {
|
||||||
pub fn output_control(&mut self, ui: &mut egui::Ui, ctx: &egui::Context) {
|
pub fn output_control(&mut self, ui: &mut egui::Ui, ctx: &egui::Context) {
|
||||||
ui.vertical(|ui| {
|
ui.allocate_ui_with_layout(
|
||||||
|
(250.0, 500.0).into(),
|
||||||
|
egui::Layout::top_down(egui::Align::Center),
|
||||||
|
|ui| {
|
||||||
ui.label(egui::RichText::new("Output Settings").size(20.0));
|
ui.label(egui::RichText::new("Output Settings").size(20.0));
|
||||||
ui.add_space(20.0);
|
ui.add_space(20.0);
|
||||||
egui::Grid::new("output_pll_settings")
|
egui::Grid::new("output_pll_settings")
|
||||||
|
@ -98,6 +103,7 @@ impl CheapsdoControl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,8 +37,7 @@ impl CheapsdoControl {
|
||||||
pub fn show_plots(&self, ui: &mut egui::Ui) {
|
pub fn show_plots(&self, ui: &mut egui::Ui) {
|
||||||
let average_line = Line::new(PlotPoints::new(self.average_points.clone()));
|
let average_line = Line::new(PlotPoints::new(self.average_points.clone()));
|
||||||
Plot::new("frequency_plot")
|
Plot::new("frequency_plot")
|
||||||
.width(900.0)
|
.view_aspect(3.5)
|
||||||
.view_aspect(3.0)
|
|
||||||
.allow_zoom(false)
|
.allow_zoom(false)
|
||||||
.allow_scroll(false)
|
.allow_scroll(false)
|
||||||
.allow_drag(false)
|
.allow_drag(false)
|
||||||
|
@ -67,8 +66,7 @@ impl CheapsdoControl {
|
||||||
|
|
||||||
let pwm_line = Line::new(PlotPoints::new(self.pwm_points.clone()));
|
let pwm_line = Line::new(PlotPoints::new(self.pwm_points.clone()));
|
||||||
Plot::new("pwm_plot")
|
Plot::new("pwm_plot")
|
||||||
.width(900.0)
|
.view_aspect(3.5)
|
||||||
.view_aspect(3.0)
|
|
||||||
.allow_zoom(false)
|
.allow_zoom(false)
|
||||||
.allow_scroll(false)
|
.allow_scroll(false)
|
||||||
.allow_drag(false)
|
.allow_drag(false)
|
||||||
|
|
Loading…
Reference in New Issue