Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mycitadel/mycitadel-desktop
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 79cbda84e2ea14b6adda1539ed00483029efae6f
Choose a base ref
..
head repository: mycitadel/mycitadel-desktop
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4d56545a115059f0ccc7d6e9dc47ba26ba2a50ad
Choose a head ref
Showing with 14 additions and 1 deletion.
  1. +11 −0 src/view/wallet/asset_row/widget.rs
  2. +1 −1 src/view/wallet/wallet.glade
  3. +2 −0 src/view/wallet/widget.rs
11 changes: 11 additions & 0 deletions src/view/wallet/asset_row/widget.rs
Original file line number Diff line number Diff line change
@@ -57,6 +57,17 @@ impl RowWidgets {

asset
.bind_property("amount", &self.amount_lbl, "label")
.transform_to(|binding, value: u64| {
let precision = binding.source().unwrap().property::<u8>("precision");
let pow = 10u64.pow(precision as u32);
let int = value / pow;
let mut fract = (value - int * pow) as f64 / pow as f64;
if fract > 0.0 && fract < 0.01 {
fract = 0.01;
}
let fract = format!("{:.2}", fract);
Some(format!("{int}.{}", fract.trim_start_matches("0.")))
})
.flags(flags)
.build();
}
2 changes: 1 addition & 1 deletion src/view/wallet/wallet.glade
Original file line number Diff line number Diff line change
@@ -641,7 +641,7 @@
</packing>
</child>
<child>
<object class="GtkSeparator">
<object class="GtkSeparator" id="sep0">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
2 changes: 2 additions & 0 deletions src/view/wallet/widget.rs
Original file line number Diff line number Diff line change
@@ -94,6 +94,7 @@ pub struct Widgets {
value_lbl: Label,
fiat_lbl: Label,
price_lbl: Label,
sep0: Separator,
sep1: Separator,
sep2: Separator,

@@ -475,6 +476,7 @@ impl Widgets {
self.fiat_lbl.set_visible(!is_asset);
self.price_box.set_visible(!is_asset);
self.price_lbl.set_visible(!is_asset);
self.sep0.set_visible(!is_asset);
self.sep1.set_visible(!is_asset);
self.sep2.set_visible(!is_asset);