Skip to content

Commit

Permalink
fmt and better numbering of words
Browse files Browse the repository at this point in the history
  • Loading branch information
QuantumExplorer committed Nov 13, 2024
1 parent 271c979 commit 9648901
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
6 changes: 4 additions & 2 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ impl AppState {
"tcp://127.0.0.1:23708",
core_message_sender.clone(), // Clone the sender for each listener
Some(mainnet_app_context.sx_zmq_status.clone()),
).expect("Failed to create mainnet InstantSend listener");
)
.expect("Failed to create mainnet InstantSend listener");

let tx_zmq_status_option = match testnet_app_context {
Some(ref context) => Some(context.sx_zmq_status.clone()),
Expand All @@ -206,7 +207,8 @@ impl AppState {
"tcp://127.0.0.1:23709",
core_message_sender, // Use the original sender or create a new one if needed
tx_zmq_status_option,
).expect("Failed to create testnet InstantSend listener");
)
.expect("Failed to create testnet InstantSend listener");

Self {
main_screens: [
Expand Down
4 changes: 2 additions & 2 deletions src/components/core_zmq_listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ use std::sync::{
use std::thread;
use std::time::Duration;

#[cfg(not(target_os = "windows"))]
use zmq::Context;
#[cfg(not(target_os = "windows"))]
use image::EncodableLayout;
#[cfg(not(target_os = "windows"))]
use zmq::Context;

#[cfg(target_os = "windows")]
use futures::StreamExt;
Expand Down
14 changes: 9 additions & 5 deletions src/ui/wallet/add_new_wallet_screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use dash_sdk::dashcore_rpc::dashcore::bip32::{ChildNumber, DerivationPath};
use dash_sdk::dashcore_rpc::dashcore::key::Secp256k1;
use dash_sdk::dpp::dashcore::bip32::{ExtendedPrivKey, ExtendedPubKey};
use dash_sdk::dpp::dashcore::Network;
use eframe::emath::Align;
use egui::{
Color32, ComboBox, Direction, FontId, Frame, Grid, Layout, Margin, RichText, Stroke, TextStyle,
Ui, Vec2,
Expand Down Expand Up @@ -269,16 +270,19 @@ impl AddNewWalletScreen {
.min_row_height(row_height)
.show(ui, |ui| {
for (i, word) in mnemonic.words().enumerate() {
let number_text = RichText::new(format!("{} ", i + 1))
.size(row_height * 0.2)
.color(Color32::GRAY);

let word_text = RichText::new(word)
.size(row_height * 0.5)
.monospace();
.color(Color32::BLACK);

ui.with_layout(
Layout::centered_and_justified(
Direction::LeftToRight,
),
Layout::left_to_right(Align::Min),
|ui| {
ui.label(word_text);
ui.label(number_text); // Add the number with the vertical offset
ui.label(word_text); // Add the word
},
);

Expand Down

0 comments on commit 9648901

Please sign in to comment.