ui: fix dark colors, panels strokes

This commit is contained in:
ardocrat
2024-05-30 12:02:52 +03:00
parent c5bafffa76
commit e099b5da8e
8 changed files with 30 additions and 31 deletions
+3 -3
View File
@@ -43,7 +43,7 @@ pub struct Modal {
impl Modal {
/// Margin from [`Modal`] window at top/left/right.
const DEFAULT_MARGIN: f32 = 6.0;
const DEFAULT_MARGIN: f32 = 8.0;
/// Maximum width of the content.
const DEFAULT_WIDTH: f32 = Root::SIDE_PANEL_WIDTH - (2.0 * Self::DEFAULT_MARGIN);
@@ -288,12 +288,12 @@ impl Modal {
// Draw title content.
let title_resp = ui.allocate_ui_at_rect(rect, |ui| {
ui.vertical_centered_justified(|ui| {
ui.add_space(10.0);
ui.add_space(9.0);
ui.label(RichText::new(self.title.as_ref().unwrap())
.size(19.0)
.color(Colors::title(true))
);
ui.add_space(10.0);
ui.add_space(8.0);
});
}).response;
+6 -4
View File
@@ -55,7 +55,6 @@ impl NetworkContent {
.resizable(false)
.frame(egui::Frame {
fill: Colors::fill(),
stroke: View::item_stroke(),
inner_margin: Margin {
left: View::get_left_inset() + 4.0,
right: View::far_right_inset_margin(ui) + 4.0,
@@ -78,14 +77,13 @@ impl NetworkContent {
.resizable(false)
.exact_width(ui.available_width())
.frame(egui::Frame {
stroke: View::default_stroke(),
..Default::default()
})
.show_animated_inside(ui, !show_connections, |ui| {
egui::CentralPanel::default()
.frame(egui::Frame {
fill: Colors::white_or_black(false),
stroke: View::default_stroke(),
stroke: View::item_stroke(),
inner_margin: Margin {
left: View::get_left_inset() + 4.0,
right: View::far_right_inset_margin(ui) + 4.0,
@@ -104,7 +102,11 @@ impl NetworkContent {
egui::CentralPanel::default()
.frame(egui::Frame {
stroke: if show_connections{
View::default_stroke()
if Root::is_dual_panel_mode(ui) {
View::default_stroke()
} else {
Stroke::NONE
}
} else {
Stroke::NONE
},
+5 -9
View File
@@ -118,7 +118,7 @@ impl WalletsContent {
Colors::fill_deep()
} else {
if create_wallet {
Colors::white_or_black(true)
Colors::white_or_black(false)
} else {
Colors::button()
}
@@ -175,7 +175,6 @@ impl WalletsContent {
// Show wallets bottom panel.
egui::TopBottomPanel::bottom("wallets_bottom_panel")
.frame(egui::Frame {
stroke: View::item_stroke(),
fill: Colors::fill(),
inner_margin: Margin {
left: View::get_left_inset() + 4.0,
@@ -197,9 +196,7 @@ impl WalletsContent {
});
});
// Show non-empty list if wallet is not creating and list not hidden.
if !list_hidden {
// Show wallet list panel.
egui::CentralPanel::default()
.frame(egui::Frame {
stroke: View::default_stroke(),
@@ -353,6 +350,9 @@ impl WalletsContent {
let mut list = self.wallets.list().clone();
// Remove deleted wallet from the list.
list.retain(|w| !w.is_deleted());
if !dual_panel {
ui.add_space(1.0);
}
for wallet in &list {
// Check if wallet reopen is needed.
if !wallet.is_open() && wallet.reopen_needed() {
@@ -384,11 +384,7 @@ impl WalletsContent {
rect.set_height(78.0);
let rounding = View::item_rounding(0, 1, false);
let bg = if current {
if AppConfig::dark_theme().unwrap_or(false) {
egui::Color32::from_gray(32)
} else {
egui::Color32::from_gray(233)
}
Colors::item_current()
} else {
Colors::fill()
};
+1 -2
View File
@@ -99,8 +99,7 @@ impl WalletCreation {
// Show wallet creation step content panel.
egui::CentralPanel::default()
.frame(egui::Frame {
fill: Colors::fill(),
stroke: View::default_stroke(),
stroke: View::item_stroke(),
inner_margin: Margin {
left: View::far_left_inset_margin(ui) + 4.0,
right: View::get_right_inset() + 4.0,
+6 -4
View File
@@ -91,7 +91,7 @@ impl WalletContent {
egui::TopBottomPanel::top(Id::from("wallet_balance").with(wallet.identifier()))
.frame(egui::Frame {
fill: Colors::fill(),
stroke: View::default_stroke(),
stroke: View::item_stroke(),
inner_margin: Margin {
left: View::far_left_inset_margin(ui) + 4.0,
right: View::get_right_inset() + 4.0,
@@ -102,7 +102,11 @@ impl WalletContent {
left: 0.0,
right: 0.0,
top: 0.0,
bottom: -1.0,
bottom: if !Root::is_dual_panel_mode(ui) {
0.0
} else {
-1.0
},
},
..Default::default()
})
@@ -118,7 +122,6 @@ impl WalletContent {
// Show wallet tabs panel.
egui::TopBottomPanel::bottom("wallet_tabs")
.frame(egui::Frame {
stroke: View::item_stroke(),
fill: Colors::fill(),
inner_margin: Margin {
left: View::far_left_inset_margin(ui) + 4.0,
@@ -141,7 +144,6 @@ impl WalletContent {
egui::CentralPanel::default()
.frame(egui::Frame {
fill: Colors::white_or_black(false),
stroke: View::default_stroke(),
..Default::default()
})
.show_inside(ui, |ui| {
+1 -1
View File
@@ -64,7 +64,7 @@ impl WalletTab for WalletSettings {
// Show settings content panel.
egui::CentralPanel::default()
.frame(egui::Frame {
stroke: View::default_stroke(),
stroke: View::item_stroke(),
fill: Colors::white_or_black(false),
inner_margin: Margin {
left: View::far_left_inset_margin(ui) + 4.0,
+1 -1
View File
@@ -216,7 +216,7 @@ impl WalletTransactions {
.scroll_bar_visibility(ScrollBarVisibility::AlwaysHidden)
.auto_shrink([false; 2])
.show_rows(ui, TX_ITEM_HEIGHT, data.txs.len(), |ui, row_range| {
ui.add_space(3.0);
ui.add_space(1.0);
View::max_width_ui(ui, Root::SIDE_PANEL_WIDTH * 1.3, |ui| {
let padding = amount_conf != 0 || amount_fin != 0 || amount_locked != 0;
for index in row_range {