ui: content draw on sync at connections, wallet list colors, translations

This commit is contained in:
ardocrat
2024-04-19 04:09:23 +03:00
parent 825dbbd3fd
commit c668511bb6
5 changed files with 22 additions and 19 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ impl Colors {
pub const GREEN: Color32 = Color32::from_rgb(0, 0x64, 0);
pub const RED: Color32 = Color32::from_rgb(0x8B, 0, 0);
pub const FILL: Color32 = Color32::from_gray(244);
pub const FILL_DARK: Color32 = Color32::from_gray(234);
pub const FILL_DARK: Color32 = Color32::from_gray(238);
pub const CHECKBOX: Color32 = Color32::from_gray(100);
pub const TEXT: Color32 = Color32::from_gray(80);
pub const TEXT_BUTTON: Color32 = Color32::from_gray(70);
+2 -2
View File
@@ -140,8 +140,8 @@ impl NetworkContent {
});
});
// Redraw after delay if node is not syncing to update stats.
if Node::not_syncing() {
// Redraw after delay if node is syncing to update stats.
if Node::is_running() {
ui.ctx().request_repaint_after(Node::STATS_UPDATE_DELAY);
}
}
+7 -4
View File
@@ -377,14 +377,17 @@ impl WalletsContent {
let config = wallet.get_config();
let id = config.id;
let is_selected = self.wallets.selected_id == Some(id);
let is_current = wallet.is_open() && is_selected;
let current = is_selected && wallet.is_open();
// Draw round background.
let mut rect = ui.available_rect_before_wrap();
rect.set_height(78.0);
let rounding = View::item_rounding(0, 1, false);
let bg_color = if is_current { Colors::ITEM_CURRENT } else { Colors::FILL };
ui.painter().rect(rect, rounding, bg_color, View::HOVER_STROKE);
let bg = if current {
egui::Color32::from_gray(234)
} else {
Colors::FILL
};
ui.painter().rect(rect, rounding, bg, View::HOVER_STROKE);
ui.allocate_ui_with_layout(rect.size(), Layout::right_to_left(Align::Center), |ui| {
// Setup padding for item buttons.