mirror of
https://git.alemi.dev/dashboard.git
synced 2024-11-25 08:54:49 +01:00
fix: proper ui sizing
This commit is contained in:
parent
fc6926816b
commit
2e38a00583
2 changed files with 8 additions and 7 deletions
|
@ -23,17 +23,17 @@ pub fn metric_edit_ui(ui: &mut Ui, metric: &entities::metrics::Model) {
|
|||
ui.horizontal(|ui| {
|
||||
// ui.color_edit_button_srgba(&mut unpack_color(metric.color));
|
||||
color_square(ui, unpack_color(metric.color));
|
||||
let available = ui.available_width() - 79.0;
|
||||
let unit = (ui.available_width() - 65.0) / 5.0;
|
||||
TextEdit::singleline(&mut name)
|
||||
.desired_width(available / 2.0)
|
||||
.desired_width(unit * 2.0)
|
||||
.interactive(false)
|
||||
.hint_text("name")
|
||||
.show(ui);
|
||||
ui.separator();
|
||||
TextEdit::singleline(&mut query)
|
||||
.desired_width(available / 2.0)
|
||||
.desired_width(unit * 3.0)
|
||||
.interactive(false)
|
||||
.hint_text("y")
|
||||
.hint_text("query")
|
||||
.show(ui);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -296,14 +296,15 @@ pub fn header(app: &mut App, ui: &mut Ui, frame: &mut Frame) {
|
|||
if !last_edit { // TODO kinda cheap fix having it down here
|
||||
app.panels = app.view.panels.borrow().clone();
|
||||
}
|
||||
if ui.button("+").clicked() {
|
||||
app.editing.push(entities::panels::Model::default().into());
|
||||
}
|
||||
if ui.button("reset").clicked() {
|
||||
app.panels = app.view.panels.borrow().clone();
|
||||
}
|
||||
if ui.button("save").clicked() {
|
||||
app.save_all_panels();
|
||||
}
|
||||
if ui.button("+").clicked() {
|
||||
app.editing.push(entities::panels::Model::default().into());
|
||||
app.edit = false;
|
||||
}
|
||||
}
|
||||
ui.separator();
|
||||
|
|
Loading…
Reference in a new issue