|
|
@@ -32,9 +32,10 @@ use crate::{
|
|
|
schema::{
|
|
|
chat::ui_consts::{BACKARROW_SCALE, EMOJI_CLOSE_SCALE, EMOJI_SCALE},
|
|
|
menu::ui_consts::{MENU_ICON_SCALE, SETTINGS_ICON_SCALE},
|
|
|
+ wallet::data::{COPY_SCALE, DARKFI_LOGO_SCALE, PASTE_SCALE},
|
|
|
},
|
|
|
},
|
|
|
- error::{Error, Result},
|
|
|
+ error::Result,
|
|
|
expr,
|
|
|
mesh::{rgba, COLOR_BLACK, COLOR_WHITE},
|
|
|
prop::{PropertyAtomicGuard, PropertyValue, Role},
|
|
|
@@ -76,6 +77,17 @@ async fn light_apply(ctx: &ThemeCtx) -> Result<()> {
|
|
|
("chatview.hi_bg_color", [0.75, 0.75, 0.75, 1.]),
|
|
|
("chatview.action_text_color", [0.20, 0.20, 0.20, 1.]),
|
|
|
("chatview.url_text_color", [0.30, 0.20, 0.10, 1.]),
|
|
|
+ ("wallet.text_color", [0.08, 0.08, 0.08, 1.]),
|
|
|
+ ("wallet.title_color", [0.08, 0.08, 0.08, 1.]),
|
|
|
+ ("wallet.label_color", [0.20, 0.20, 0.20, 1.]),
|
|
|
+ ("wallet.accent_color", rgba!(0x3300ffff)),
|
|
|
+ ("wallet.value_color", [0.05, 0.30, 0.55, 1.]),
|
|
|
+ ("wallet.muted_color", [0.45, 0.45, 0.45, 1.]),
|
|
|
+ ("wallet.recipient_color", [0.05, 0.30, 0.55, 1.]),
|
|
|
+ ("wallet.tx_status_recipient_color", [0.05, 0.30, 0.55, 1.]),
|
|
|
+ ("wallet.tx_status_value_color", [0.05, 0.30, 0.55, 1.]),
|
|
|
+ ("wallet.fee_label_color", [0.08, 0.08, 0.08, 1.]),
|
|
|
+ ("wallet.fee_value_color", [0.35, 0.20, 0.55, 1.]),
|
|
|
];
|
|
|
for (name, val) in tokens {
|
|
|
ctx.set_shared_token_color(atom, name, *val)?;
|
|
|
@@ -85,6 +97,9 @@ async fn light_apply(ctx: &ThemeCtx) -> Result<()> {
|
|
|
|
|
|
let sg_root = ctx.sg_root();
|
|
|
|
|
|
+ let accent = rgba!(0x3300ffff);
|
|
|
+
|
|
|
+ // Chat button on the wallet main screen
|
|
|
let node = sg_root.lookup_node("/window/content/wallet/main_layer/chat_btn_shape").unwrap();
|
|
|
let color = rgba!(0xF41740ff);
|
|
|
let mut shape = shape::create_netlogo1(color);
|
|
|
@@ -93,65 +108,208 @@ async fn light_apply(ctx: &ThemeCtx) -> Result<()> {
|
|
|
let prop = node.get_property("shape").unwrap();
|
|
|
ctx.set_touched(atom, &prop, 0, PropertyValue::VectorShape(Arc::new(shape)))?;
|
|
|
|
|
|
- let node =
|
|
|
- sg_root.lookup_node("/window/content/chat/menu_layer/mainbtn_layer/wallet_icon").unwrap();
|
|
|
- let mut shape = shape::create_blockchain_netlogo1(color);
|
|
|
- shape.join(shape::create_blockchain_netlogo2(color));
|
|
|
- shape.join(shape::create_blockchain_netlogo3(color));
|
|
|
- shape.join(shape::create_blockchain_netlogo4(color));
|
|
|
+ // Main balance background
|
|
|
+ let node = sg_root.lookup_node("/window/content/wallet/main_layer/wallet_balance_bg").unwrap();
|
|
|
+ let mut shape = VectorShape::new();
|
|
|
+ shape.add_filled_box(
|
|
|
+ expr::const_f32(0.),
|
|
|
+ expr::const_f32(0.),
|
|
|
+ expr::load_var("w"),
|
|
|
+ expr::load_var("h"),
|
|
|
+ [0.72, 0.82, 0.97, 0.6],
|
|
|
+ );
|
|
|
let prop = node.get_property("shape").unwrap();
|
|
|
ctx.set_touched(atom, &prop, 0, PropertyValue::VectorShape(Arc::new(shape)))?;
|
|
|
|
|
|
- let node =
|
|
|
- sg_root.lookup_node("/window/content/chat/menu_layer/mainbtn_layer/settings_icon").unwrap();
|
|
|
- let shape = shape::create_settings(color).scaled(SETTINGS_ICON_SCALE);
|
|
|
+ // Main-menu darkfi logo
|
|
|
+ let node = sg_root.lookup_node("/window/content/wallet/main_menu_btn_bg").unwrap();
|
|
|
+ let color = rgba!(0x3300ffff);
|
|
|
+ let shape = shape::create_darkfi_logo(color).scaled(DARKFI_LOGO_SCALE);
|
|
|
let prop = node.get_property("shape").unwrap();
|
|
|
ctx.set_touched(atom, &prop, 0, PropertyValue::VectorShape(Arc::new(shape)))?;
|
|
|
|
|
|
- let node =
|
|
|
- sg_root.lookup_node("/window/content/chat/menu_layer/mainbtn_layer/write_icon").unwrap();
|
|
|
- let shape = shape::create_menu_icon(color).scaled(MENU_ICON_SCALE);
|
|
|
+ // Recipient input outline
|
|
|
+ let node = sg_root
|
|
|
+ .lookup_node("/window/content/wallet/send_step2_layer/send_recipient_input_outline")
|
|
|
+ .unwrap();
|
|
|
let prop = node.get_property("shape").unwrap();
|
|
|
- ctx.set_touched(atom, &prop, 0, PropertyValue::VectorShape(Arc::new(shape)))?;
|
|
|
-
|
|
|
- let color = rgba!(0x3300ffff);
|
|
|
- let node = sg_root.lookup_node("/window/content/wallet/main_layer/receive_label").unwrap();
|
|
|
- let prop = node.get_property("text_color").unwrap();
|
|
|
- ctx.set_touched_color(atom, &prop, color)?;
|
|
|
- let node = sg_root.lookup_node("/window/content/wallet/main_layer/receive_btn_bg").unwrap();
|
|
|
let mut shape = VectorShape::new();
|
|
|
- shape.add_outline(
|
|
|
+ shape.add_filled_box(
|
|
|
expr::const_f32(0.),
|
|
|
expr::const_f32(0.),
|
|
|
expr::load_var("w"),
|
|
|
expr::load_var("h"),
|
|
|
- 1.,
|
|
|
- color,
|
|
|
+ [0.90, 0.93, 0.97, 0.60],
|
|
|
);
|
|
|
- let prop = node.get_property("shape").unwrap();
|
|
|
- ctx.set_touched(atom, &prop, 0, PropertyValue::VectorShape(Arc::new(shape)))?;
|
|
|
- let node = sg_root.lookup_node("/window/content/wallet/main_layer/wallet_send_btn_bg").unwrap();
|
|
|
- let mut shape = VectorShape::new();
|
|
|
shape.add_outline(
|
|
|
expr::const_f32(0.),
|
|
|
expr::const_f32(0.),
|
|
|
expr::load_var("w"),
|
|
|
expr::load_var("h"),
|
|
|
1.,
|
|
|
- color,
|
|
|
+ [0.78, 0.82, 0.85, 1.],
|
|
|
);
|
|
|
+ ctx.set_touched(atom, &prop, 0, PropertyValue::VectorShape(Arc::new(shape)))?;
|
|
|
+
|
|
|
+ // Wallet bg
|
|
|
+ let node = sg_root.lookup_node("/window/content/wallet/bg").unwrap();
|
|
|
let prop = node.get_property("shape").unwrap();
|
|
|
+ let shape = VectorShape::new();
|
|
|
ctx.set_touched(atom, &prop, 0, PropertyValue::VectorShape(Arc::new(shape)))?;
|
|
|
- let node = sg_root.lookup_node("/window/content/wallet/main_layer/wallet_send_label").unwrap();
|
|
|
- let prop = node.get_property("text_color").unwrap();
|
|
|
- ctx.set_touched_color(atom, &prop, color)?;
|
|
|
- let node = sg_root.lookup_node("/window/content/wallet/main_layer/tokens_label").unwrap();
|
|
|
- let prop = node.get_property("text_color").unwrap();
|
|
|
- ctx.set_touched_color(atom, &prop, COLOR_BLACK)?;
|
|
|
- let node = sg_root.lookup_node("/window/content/wallet/main_layer/tokens_table").unwrap();
|
|
|
- let prop = node.get_property("text_color").unwrap();
|
|
|
- ctx.set_touched_color(atom, &prop, COLOR_BLACK)?;
|
|
|
|
|
|
+ // Copy/paste button icons follow the wallet accent
|
|
|
+ let node =
|
|
|
+ sg_root.lookup_node("/window/content/wallet/receive_layer/receive_copy_btn_bg").unwrap();
|
|
|
+ let shape = shape::create_copy(accent).scaled(COPY_SCALE);
|
|
|
+ let prop = node.get_property("shape").unwrap();
|
|
|
+ ctx.set_touched(atom, &prop, 0, PropertyValue::VectorShape(Arc::new(shape)))?;
|
|
|
+
|
|
|
+ let node =
|
|
|
+ sg_root.lookup_node("/window/content/wallet/send_step2_layer/send_paste_btn_bg").unwrap();
|
|
|
+ let shape = shape::create_paste(accent).scaled(PASTE_SCALE);
|
|
|
+ let prop = node.get_property("shape").unwrap();
|
|
|
+ ctx.set_touched(atom, &prop, 0, PropertyValue::VectorShape(Arc::new(shape)))?;
|
|
|
+
|
|
|
+ // Wallet menu icon (chat menu bar) keeps its theme-side recolor.
|
|
|
+ let node =
|
|
|
+ sg_root.lookup_node("/window/content/chat/menu_layer/mainbtn_layer/wallet_icon").unwrap();
|
|
|
+ let color = rgba!(0xF41740ff);
|
|
|
+ let mut shape = shape::create_blockchain_netlogo1(color);
|
|
|
+ shape.join(shape::create_blockchain_netlogo2(color));
|
|
|
+ shape.join(shape::create_blockchain_netlogo3(color));
|
|
|
+ shape.join(shape::create_blockchain_netlogo4(color));
|
|
|
+ let prop = node.get_property("shape").unwrap();
|
|
|
+ ctx.set_touched(atom, &prop, 0, PropertyValue::VectorShape(Arc::new(shape)))?;
|
|
|
+
|
|
|
+ let node =
|
|
|
+ sg_root.lookup_node("/window/content/chat/menu_layer/mainbtn_layer/settings_icon").unwrap();
|
|
|
+ let shape = shape::create_settings(color).scaled(SETTINGS_ICON_SCALE);
|
|
|
+ let prop = node.get_property("shape").unwrap();
|
|
|
+ ctx.set_touched(atom, &prop, 0, PropertyValue::VectorShape(Arc::new(shape)))?;
|
|
|
+
|
|
|
+ let node =
|
|
|
+ sg_root.lookup_node("/window/content/chat/menu_layer/mainbtn_layer/write_icon").unwrap();
|
|
|
+ let shape = shape::create_menu_icon(color).scaled(MENU_ICON_SCALE);
|
|
|
+ let prop = node.get_property("shape").unwrap();
|
|
|
+ ctx.set_touched(atom, &prop, 0, PropertyValue::VectorShape(Arc::new(shape)))?;
|
|
|
+
|
|
|
+ // Wallet receive/send button outlines
|
|
|
+ let outline_overrides = [
|
|
|
+ "/window/content/wallet/main_layer/receive_btn_bg",
|
|
|
+ "/window/content/wallet/main_layer/wallet_send_btn_bg",
|
|
|
+ ];
|
|
|
+ for path in outline_overrides {
|
|
|
+ let node = sg_root.lookup_node(path).unwrap();
|
|
|
+ let prop = node.get_property("shape").unwrap();
|
|
|
+ let mut shape = VectorShape::new();
|
|
|
+ shape.add_outline(
|
|
|
+ expr::const_f32(0.),
|
|
|
+ expr::const_f32(0.),
|
|
|
+ expr::load_var("w"),
|
|
|
+ expr::load_var("h"),
|
|
|
+ 1.,
|
|
|
+ accent,
|
|
|
+ );
|
|
|
+ ctx.set_touched(atom, &prop, 0, PropertyValue::VectorShape(Arc::new(shape)))?;
|
|
|
+ }
|
|
|
+
|
|
|
+ // Address boxes
|
|
|
+ let addr_box_paths = [
|
|
|
+ "/window/content/wallet/receive_layer/receive_address_bg",
|
|
|
+ "/window/content/wallet/send_step3_layer/send_recipient_bg",
|
|
|
+ "/window/content/wallet/send_step4_layer/send_recipient_bg",
|
|
|
+ ];
|
|
|
+ for path in addr_box_paths {
|
|
|
+ let node = sg_root.lookup_node(path).unwrap();
|
|
|
+ let prop = node.get_property("shape").unwrap();
|
|
|
+ let mut shape = VectorShape::new();
|
|
|
+ shape.add_filled_box(
|
|
|
+ expr::const_f32(0.),
|
|
|
+ expr::const_f32(0.),
|
|
|
+ expr::load_var("w"),
|
|
|
+ expr::load_var("h"),
|
|
|
+ [0.88, 0.92, 0.99, 0.75],
|
|
|
+ );
|
|
|
+ ctx.set_touched(atom, &prop, 0, PropertyValue::VectorShape(Arc::new(shape)))?;
|
|
|
+ }
|
|
|
+
|
|
|
+ // Wallet bottom button outlines
|
|
|
+ let bottom_btn_outlines = [
|
|
|
+ "/window/content/wallet/receive_layer/receive_copy_tooltip/bg",
|
|
|
+ "/window/content/wallet/send_step2_layer/send_add_recipient_btn_layer/send_add_recipient_btn_bg",
|
|
|
+ "/window/content/wallet/send_step3_layer/send_add_amount_btn_layer/send_add_amount_btn_bg",
|
|
|
+ "/window/content/wallet/send_step4_layer/send_btn_layer/send_btn_bg",
|
|
|
+ "/window/content/wallet/tx_status_layer/close_btn_layer/close_btn_bg",
|
|
|
+ ];
|
|
|
+ for path in bottom_btn_outlines {
|
|
|
+ let node = sg_root.lookup_node(path).unwrap();
|
|
|
+ let prop = node.get_property("shape").unwrap();
|
|
|
+ let mut shape = VectorShape::new();
|
|
|
+ shape.add_outline(
|
|
|
+ expr::const_f32(0.),
|
|
|
+ expr::const_f32(0.),
|
|
|
+ expr::load_var("w"),
|
|
|
+ expr::load_var("h"),
|
|
|
+ 1.,
|
|
|
+ accent,
|
|
|
+ );
|
|
|
+ ctx.set_touched(atom, &prop, 0, PropertyValue::VectorShape(Arc::new(shape)))?;
|
|
|
+ }
|
|
|
+
|
|
|
+ // Wallet separators
|
|
|
+ let separator_color = [0.2, 0.2745, 0.2784, 1.];
|
|
|
+ let separator_paths = [
|
|
|
+ "/window/content/wallet/main_layer/wallet_balance_separator",
|
|
|
+ "/window/content/wallet/main_layer/wallet_buttons_separator",
|
|
|
+ "/window/content/wallet/main_layer/tokens_label_separator",
|
|
|
+ "/window/content/wallet/receive_layer/receive_separator",
|
|
|
+ "/window/content/wallet/receive_layer/address_separator",
|
|
|
+ "/window/content/wallet/send_step1_layer/send_separator",
|
|
|
+ "/window/content/wallet/send_step1_layer/pick_label_separator",
|
|
|
+ "/window/content/wallet/send_step2_layer/send_separator",
|
|
|
+ "/window/content/wallet/send_step2_layer/send_token_separator",
|
|
|
+ "/window/content/wallet/send_step3_layer/send_separator",
|
|
|
+ "/window/content/wallet/send_step3_layer/send_token_separator3",
|
|
|
+ "/window/content/wallet/send_step3_layer/send_amount_label_separator",
|
|
|
+ "/window/content/wallet/send_step3_layer/recipient_separator",
|
|
|
+ "/window/content/wallet/send_step3_layer/available_balance_separator",
|
|
|
+ "/window/content/wallet/send_step4_layer/send_separator",
|
|
|
+ "/window/content/wallet/send_step4_layer/send_token_separator4",
|
|
|
+ "/window/content/wallet/send_step4_layer/send_amount_label_separator4",
|
|
|
+ "/window/content/wallet/send_step4_layer/recipient_separator",
|
|
|
+ "/window/content/wallet/send_step4_layer/tx_fee_separator",
|
|
|
+ "/window/content/wallet/tx_status_layer/hint_separator",
|
|
|
+ ];
|
|
|
+ for path in separator_paths {
|
|
|
+ let node = sg_root.lookup_node(path).unwrap();
|
|
|
+ let prop = node.get_property("shape").unwrap();
|
|
|
+ let mut shape = VectorShape::new();
|
|
|
+ shape.add_filled_box(
|
|
|
+ expr::const_f32(0.),
|
|
|
+ expr::const_f32(0.),
|
|
|
+ expr::load_var("w"),
|
|
|
+ expr::const_f32(1.),
|
|
|
+ separator_color,
|
|
|
+ );
|
|
|
+ ctx.set_touched(atom, &prop, 0, PropertyValue::VectorShape(Arc::new(shape)))?;
|
|
|
+ }
|
|
|
+
|
|
|
+ // Wallet titles
|
|
|
+ let title_bg_paths = [
|
|
|
+ "/window/content/wallet/main_layer/tokens_label_bg",
|
|
|
+ "/window/content/wallet/receive_layer/receive_bg",
|
|
|
+ "/window/content/wallet/send_step1_layer/send_bg",
|
|
|
+ "/window/content/wallet/send_step2_layer/send_bg",
|
|
|
+ "/window/content/wallet/send_step3_layer/send_bg",
|
|
|
+ "/window/content/wallet/send_step4_layer/send_bg",
|
|
|
+ ];
|
|
|
+ for path in title_bg_paths {
|
|
|
+ let node = sg_root.lookup_node(path).unwrap();
|
|
|
+ let prop = node.get_property("shape").unwrap();
|
|
|
+ ctx.set_touched(atom, &prop, 0, PropertyValue::VectorShape(Arc::new(VectorShape::new())))?;
|
|
|
+ }
|
|
|
+
|
|
|
+ // Chat labels
|
|
|
let node = sg_root.lookup_node("/window/content/chat/main_chat_layer/channel_label").unwrap();
|
|
|
let prop = node.get_property("text_color").unwrap();
|
|
|
ctx.set_touched_color(atom, &prop, COLOR_BLACK)?;
|
|
|
@@ -159,6 +317,7 @@ async fn light_apply(ctx: &ThemeCtx) -> Result<()> {
|
|
|
let prop = node.get_property("text_color").unwrap();
|
|
|
ctx.set_touched_color(atom, &prop, COLOR_BLACK)?;
|
|
|
|
|
|
+ // Header
|
|
|
let node = sg_root.lookup_node("/window/content/header_bg").unwrap();
|
|
|
let mut shape = VectorShape::new();
|
|
|
shape.add_filled_box(
|