Draw central panel last, fix theme switch button

This commit is contained in:
Piotr Siuszko 2023-02-16 00:27:26 +01:00
parent 870400dce6
commit 089c657bac
2 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,7 @@
# [0.2.0] # [0.2.0]
- Update egui to 0.21 version - Update egui to 0.21 version
- Initial macOS support - Initial macOS support
- Light theme
# [0.1.0] # [0.1.0]

View File

@ -300,7 +300,7 @@ impl HubClient {
} }
fn draw_editors_header(&mut self, _ctx: &egui::Context, ui: &mut Ui) { fn draw_editors_header(&mut self, _ctx: &egui::Context, ui: &mut Ui) {
let text_height = egui::TextStyle::Body.resolve(ui.style()).size * 2.0; let text_height = egui::TextStyle::Body.resolve(ui.style()).size * 2.4;
let table = build_header_table(ui); let table = build_header_table(ui);
table.body(|body| { table.body(|body| {
body.rows(text_height, 1, |_, mut row| { body.rows(text_height, 1, |_, mut row| {
@ -332,7 +332,7 @@ impl HubClient {
} }
fn draw_project_header(&mut self, _ctx: &egui::Context, ui: &mut Ui) { fn draw_project_header(&mut self, _ctx: &egui::Context, ui: &mut Ui) {
let text_height = egui::TextStyle::Body.resolve(ui.style()).size * 2.0; let text_height = egui::TextStyle::Body.resolve(ui.style()).size * 2.4;
let table = build_header_table(ui); let table = build_header_table(ui);
table.body(|body| { table.body(|body| {
body.rows(text_height, 1, |_, mut row| { body.rows(text_height, 1, |_, mut row| {
@ -451,7 +451,6 @@ impl eframe::App for HubClient {
.show(ctx, |ui| { .show(ctx, |ui| {
self.draw_side_panel(ui); self.draw_side_panel(ui);
}); });
self.draw_central_panel(&ctx);
egui::TopBottomPanel::bottom("bottomPanel").show(ctx, |ui| { egui::TopBottomPanel::bottom("bottomPanel").show(ctx, |ui| {
ui.with_layout(Layout::right_to_left(eframe::emath::Align::Center), |ui| { ui.with_layout(Layout::right_to_left(eframe::emath::Align::Center), |ui| {
egui::widgets::global_dark_light_mode_switch(ui); egui::widgets::global_dark_light_mode_switch(ui);
@ -461,5 +460,6 @@ impl eframe::App for HubClient {
); );
}); });
}); });
self.draw_central_panel(&ctx);
} }
} }