Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
983 changes: 363 additions & 620 deletions Cargo.lock

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ rust-version = "1.88"

[dependencies]
tokio-util = { version = "0.7.15" }
bip39 = { version = "2.1.0", features = ["all-languages", "rand"] }
bip39 = { version = "2.2.0", features = ["all-languages", "rand"] }
derive_more = "2.0.1"
egui = "0.31.1"
egui_extras = "0.31.1"
egui_commonmark = "0.20.0"
rfd = "0.15.3"
egui = "0.32.0"
egui_extras = "0.32.0"
egui_commonmark = "0.21.1"
rfd = "0.15.4"
qrcode = "0.14.1"
nix = { version = "0.30.1", features = ["signal"] }
eframe = { version = "0.31.1", features = ["persistence"] }
eframe = { version = "0.32.0", features = ["persistence"] }
base64 = "0.22.1"
dash-sdk = { git = "https://github.com/dashpay/platform", rev = "5f93c70720a1ea09f91c9142668e17f314986f03" }
thiserror = "2.0.12"
serde = "1.0.219"
serde_json = "1.0.140"
serde_yaml = { version = "0.9.34-deprecated" }
tokio = { version = "1.45.1", features = ["full"] }
tokio = { version = "1.46.1", features = ["full"] }
bincode = { version = "=2.0.0-rc.3", features = ["serde"] }
hex = { version = "0.4.3" }
itertools = "0.14.0"
Expand All @@ -36,15 +36,15 @@ envy = "0.4.2"
chrono = "0.4.41"
chrono-humanize = "0.2.3"
sha2 = "0.10.9"
arboard = { version = "3.5.0", default-features = false, features = [
arboard = { version = "3.6.0", default-features = false, features = [
"windows-sys",
] }
directories = "6.0.0"
rusqlite = { version = "0.36.0", features = ["functions"] }
dark-light = "1.1.0"
rusqlite = { version = "0.37.0", features = ["functions"] }
dark-light = "2.0.0"
image = { version = "0.25.6", default-features = false, features = ["png"] }
bitflags = "2.9.1"
libsqlite3-sys = { version = "0.34.0", features = ["bundled"] }
libsqlite3-sys = { version = "0.35.0", features = ["bundled"] }
rust-embed = "8.7.2"
zeroize = "1.8.1"
zxcvbn = "3.1.0"
Expand All @@ -53,7 +53,7 @@ aes-gcm = "0.10.3" # For AES-256-GCM encryption
crossbeam-channel = "0.5.15"
regex = "1.11.1"
humantime = "2.2.0"
which = { version = "7.0.3" }
which = { version = "8.0.0" }
tz-rs = { version = "0.7.0" }

[target.'cfg(not(target_os = "windows"))'.dependencies]
Expand All @@ -69,7 +69,7 @@ raw-cpuid = "11.5.0"
[dev-dependencies]

tempfile = { version = "3.20.0" }
egui_kittest = { version = "0.31.1", features = ["eframe"] }
egui_kittest = { version = "0.32.0", features = ["eframe"] }

[lints.clippy]
uninlined_format_args = "allow"
72 changes: 36 additions & 36 deletions src/ui/components/top_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ fn add_location_view(ui: &mut Ui, location: Vec<(&str, AppAction)>, dark_mode: b
// Apply negative vertical offset to move text up
let offset = egui::vec2(0.0, -7.0);

ui.allocate_new_ui(
ui.scope_builder(
egui::UiBuilder::new().max_rect(egui::Rect::from_min_size(
ui.cursor().min + offset,
ui.available_size(),
)),
|ui| {
egui::menu::bar(ui, |ui| {
egui::MenuBar::new().ui(ui, |ui| {
ui.horizontal(|ui| {
let len = location.len();
for (idx, (text, loc_action)) in location.into_iter().enumerate() {
Expand Down Expand Up @@ -122,7 +122,7 @@ fn add_connection_indicator(ui: &mut Ui, app_context: &Arc<AppContext>) -> AppAc

// Wrap in a container that can be positioned vertically
ui.allocate_ui(ui.available_size(), |ui| {
ui.allocate_new_ui(
ui.scope_builder(
egui::UiBuilder::new().max_rect(egui::Rect::from_min_size(
ui.cursor().min,
ui.available_size(),
Expand Down Expand Up @@ -327,29 +327,28 @@ pub fn add_top_panel(
.stroke(Stroke::NONE)
.min_size(egui::vec2(100.0, 30.0));

// a unique ID for the popup
let popup_id = ui.auto_id_with("documents_popup");
let resp = ui.add(docs_btn);
if resp.clicked() {
ui.memory_mut(|mem| mem.toggle_popup(popup_id));
}
let popup_id = ui.make_persistent_id("docs_popup");

// open the popup directly below the button
egui::popup::popup_below_widget(
ui,
egui::Popup::new(
popup_id,
ui.ctx().clone(),
&resp,
egui::popup::PopupCloseBehavior::CloseOnClickOutside,
|ui| {
ui.set_min_width(150.0);
for (text, da) in doc_actions {
if ui.button(text).clicked() {
action = da.create_action(app_context);
ui.close_menu();
}
resp.layer_id,
)
.open_memory(
resp.clicked().then_some(egui::SetOpenCommand::Toggle),
)
.close_behavior(egui::PopupCloseBehavior::CloseOnClickOutside)
.show(|ui| {
ui.set_min_width(150.0);
for (text, da) in doc_actions {
if ui.button(text).clicked() {
action = da.create_action(app_context);
// ui.close();
}
},
);
}
});
}

// Grouped Contracts menu
Expand All @@ -367,25 +366,26 @@ pub fn add_top_panel(

let popup_id = ui.auto_id_with("contracts_popup");
let resp = ui.add(contracts_btn);
if resp.clicked() {
ui.memory_mut(|mem| mem.toggle_popup(popup_id));
}

egui::popup::popup_below_widget(
ui,
egui::Popup::new(
popup_id,
ui.ctx().clone(),
&resp,
egui::popup::PopupCloseBehavior::CloseOnClickOutside,
|ui| {
ui.set_min_width(150.0);
for (text, ca) in contract_actions {
if ui.button(text).clicked() {
action = ca.create_action(app_context);
ui.close_menu();
}
resp.layer_id,
)
.open_memory(
resp.clicked().then_some(egui::SetOpenCommand::Toggle),
)
.close_behavior(egui::PopupCloseBehavior::CloseOnClickOutside)
.show(|ui| {
ui.set_min_width(150.0);
for (text, ca) in contract_actions {
if ui.button(text).clicked() {
action = ca.create_action(app_context);
ui.close();
}
},
);
}
});
}

// Render other buttons normally
Expand Down
62 changes: 32 additions & 30 deletions src/ui/contracts_documents/document_action_screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ use dash_sdk::drive::query::WhereClause;
use dash_sdk::platform::{DocumentQuery, Identifier, IdentityPublicKey};
use dash_sdk::query_types::IndexMap;
use eframe::epaint::Color32;
use egui::{Context, PopupCloseBehavior, RichText, Ui};
use egui::{Context, RichText, Ui};
use std::collections::{BTreeMap, HashMap};
use std::sync::{Arc, RwLock};
use std::time::{SystemTime, UNIX_EPOCH};
Expand Down Expand Up @@ -336,40 +336,42 @@ impl DocumentActionScreen {
ui.label(&doc_id_str);

let view_button_response = ui.button("View");
if view_button_response.clicked() {
ui.memory_mut(|mem| {
mem.open_popup(egui::Id::new(format!("popup_{}", doc_id_str)))
});
}

if ui.button("Select").clicked() {
self.document_id_input = doc_id_str.clone();
}

egui::popup::popup_above_or_below_widget(
ui,
egui::Id::new(format!("popup_{}", doc_id_str)),
let popup_id = egui::Id::new(format!("popup_{}", doc_id_str));
egui::Popup::new(
popup_id,
ui.ctx().clone(),
&view_button_response,
egui::AboveOrBelow::Below,
PopupCloseBehavior::CloseOnClickOutside,
|ui| {
ui.set_min_width(400.0);
ui.label("Document JSON:");
if let Ok(json) = serde_json::to_string_pretty(doc) {
ui.add(
egui::TextEdit::multiline(&mut json.clone())
.font(egui::TextStyle::Monospace)
.desired_rows(10)
.desired_width(380.0)
.interactive(false),
);
} else {
ui.label("Failed to serialize document.");
}
if ui.button("Close").clicked() {
ui.memory_mut(|mem| mem.close_popup());
}
},
);
view_button_response.layer_id,
)
.open_memory(
view_button_response
.clicked()
.then_some(egui::SetOpenCommand::Bool(true)),
)
.close_behavior(egui::PopupCloseBehavior::CloseOnClickOutside)
.show(|ui| {
ui.set_min_width(400.0);
ui.label("Document JSON:");
if let Ok(json) = serde_json::to_string_pretty(doc) {
ui.add(
egui::TextEdit::multiline(&mut json.clone())
.font(egui::TextStyle::Monospace)
.desired_rows(10)
.desired_width(380.0)
.interactive(false),
);
} else {
ui.label("Failed to serialize document.");
}
if ui.button("Close").clicked() {
ui.close();
}
});
});
} else {
ui.label("Document not found");
Expand Down
8 changes: 3 additions & 5 deletions src/ui/identities/add_new_identity_screen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use dash_sdk::dpp::prelude::AssetLockProof;
use dash_sdk::platform::Identifier;
use eframe::egui::Context;
use egui::ahash::HashSet;
use egui::{Color32, ComboBox, ScrollArea, Ui};
use egui::{Button, Color32, ComboBox, ScrollArea, Ui};
use std::cmp::PartialEq;
use std::fmt;
use std::sync::atomic::Ordering;
Expand Down Expand Up @@ -255,10 +255,8 @@ impl AddNewIdentityScreen {
let enabled = !is_used || is_selected;

// Use `add_enabled` to disable used indices
let response = ui.add_enabled(
enabled,
egui::SelectableLabel::new(is_selected, label),
);
let response =
ui.add_enabled(enabled, Button::selectable(is_selected, label));

// Only allow selection if the index is not used
if response.clicked() && !is_used {
Expand Down
7 changes: 6 additions & 1 deletion src/ui/identities/funding_common.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use arboard::Clipboard;
use eframe::epaint::{Color32, ColorImage};
use egui::Vec2;
use image::Luma;
use qrcode::QrCode;

Expand Down Expand Up @@ -33,7 +34,11 @@ pub fn generate_qr_code_image(pay_uri: &str) -> Result<ColorImage, qrcode::types
})
.collect();

Ok(ColorImage { size, pixels })
Ok(ColorImage {
size,
source_size: Vec2::new(size[0] as f32, size[1] as f32),
pixels,
})
}

pub fn copy_to_clipboard(text: &str) -> Result<(), String> {
Expand Down
Loading
Loading