Skip to content

Commit 627bacb

Browse files
committed
Merge branch 'dev' of github.com:aspectron/kaspa-ng
2 parents d6e7ebb + d61e0b1 commit 627bacb

39 files changed

Lines changed: 1123 additions & 964 deletions

Cargo.lock

Lines changed: 843 additions & 772 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ default-members = ["app"]
1010

1111
[workspace.package]
1212
rust-version = "1.81.0"
13-
version = "1.0.1"
13+
version = "1.0.3"
1414
authors = ["ASPECTRON Inc.","Kaspa Developers"]
1515
license = "PROPRIETARY"
1616
edition = "2021"
@@ -28,19 +28,19 @@ kaspa-ng-macros = { version = "1.0.0", path = "macros/", default-features = fals
2828
# |___ |__] |__| |
2929
# ___________________
3030

31-
# egui = "=0.28.1"
32-
# epaint = "=0.28.1"
33-
# egui_plot = "=0.28.1"
34-
# egui_extras = { version = "=0.28.1", features = ["svg","image"] }
35-
# eframe = { version = "=0.28.1", default-features = false, features = [
36-
# "accesskit", # Make egui comptaible with screen readers. NOTE: adds a lot of dependencies.
37-
# "default_fonts", # Embed the default egui fonts.
38-
# "glow", # Use the glow rendering backend. Alternative: "wgpu".
39-
# "persistence", # Enable restoring app state when restarting the app.
40-
# ] }
31+
egui = "=0.31.1"
32+
epaint = "=0.31.1"
33+
egui_plot = "=0.32.1"
34+
egui_extras = { version = "=0.31.1", features = ["svg","image"] }
35+
eframe = { version = "=0.31.1", default-features = false, features = [
36+
"accesskit", # Make egui comptaible with screen readers. NOTE: adds a lot of dependencies.
37+
"default_fonts", # Embed the default egui fonts.
38+
"glow", # Use the glow rendering backend. Alternative: "wgpu".
39+
"persistence", # Enable restoring app state when restarting the app.
40+
] }
4141

42-
# egui-phosphor = { git = "https://github.com/aspectron/egui-phosphor", branch = "gamma", version = "=0.6.0", features = ["thin","light","regular","bold"] }
43-
# egui-notify = { git = "https://github.com/aspectron/egui-notify", branch = "gamma"}
42+
egui-phosphor = { version = "=0.9.0", features = ["thin","light","regular","bold"] }
43+
egui-notify = { version = "=0.19.0"}
4444

4545

4646
# egui = { path="../egui/crates/egui", version="=0.28.1"}
@@ -59,19 +59,19 @@ kaspa-ng-macros = { version = "1.0.0", path = "macros/", default-features = fals
5959
# egui-notify = { path = "../egui-notify" }
6060
# egui-toast = { path = "../egui-toast" }
6161

62-
egui = { git = "https://github.com/aspectron/egui", branch = "gamma"}
63-
epaint = { git = "https://github.com/aspectron/egui", branch = "gamma"}
62+
# egui = { git = "https://github.com/aspectron/egui", branch = "gamma"}
63+
# epaint = { git = "https://github.com/aspectron/egui", branch = "gamma"}
6464

65-
egui_plot = { git = "https://github.com/aspectron/egui_plot", branch = "gamma"}
66-
egui_extras = { git = "https://github.com/aspectron/egui", branch = "gamma", features = ["svg","image", "serde"] }
67-
eframe = { git = "https://github.com/aspectron/egui", branch = "gamma", default-features = false, features = [
68-
"accesskit", # Make egui comptaible with screen readers. NOTE: adds a lot of dependencies.
69-
"default_fonts", # Embed the default egui fonts.
70-
"glow", # Use the glow rendering backend. Alternative: "wgpu".
71-
"persistence", # Enable restoring app state when restarting the app.
72-
] }
73-
egui-phosphor = { git = "https://github.com/aspectron/egui-phosphor", branch = "gamma", version = "=0.6.0", features = ["thin","light","regular","bold"] }
74-
egui-notify = { git = "https://github.com/aspectron/egui-notify", branch = "gamma"}
65+
# egui_plot = { git = "https://github.com/aspectron/egui_plot", branch = "gamma"}
66+
# egui_extras = { git = "https://github.com/aspectron/egui", branch = "gamma", features = ["svg","image", "serde"] }
67+
# eframe = { git = "https://github.com/aspectron/egui", branch = "gamma", default-features = false, features = [
68+
# "accesskit", # Make egui comptaible with screen readers. NOTE: adds a lot of dependencies.
69+
# "default_fonts", # Embed the default egui fonts.
70+
# "glow", # Use the glow rendering backend. Alternative: "wgpu".
71+
# "persistence", # Enable restoring app state when restarting the app.
72+
# ] }
73+
# egui-phosphor = { git = "https://github.com/aspectron/egui-phosphor", branch = "gamma", version = "=0.6.0", features = ["thin","light","regular","bold"] }
74+
# egui-notify = { git = "https://github.com/aspectron/egui-notify", branch = "gamma"}
7575
# egui-toast = { git = "https://github.com/aspectron/egui-toast", branch = "omega" }
7676

7777
# egui = { path = "../egui/crates/egui" }

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,17 @@ Kaspa NG application binary can be started in 3 ways:
7272

7373
If you need access to the wallet in a headless environment, you can start Kaspa NG in daemon mode and then use the CLI wallet to access the wallet.
7474

75+
#### Software Rendering for Windows x64 VMs
76+
77+
Kaspa NG uses OpenGL. Due to that, Kaspa NG may have problems powering up on the legacy hardware or inside of virtualization platforms that do not support hardware acceleration.
78+
79+
To address this, you can use Mesa 3d Software Emulation library.
80+
Mesa 3d library build is available for download from the `resources/windows/mesa3d` folder of this repository.
81+
Simply extract the archive and place the `opengl32.dll` file in the same folder as the `kaspa-ng.exe` executable.
82+
83+
This library build was placed in this repository for direct download on 2025-05-14.
84+
The original build was created by Federico Dossena at [https://fdossena.com/?p=mesa/index.frag](https://fdossena.com/?p=mesa/index.frag).
85+
7586
#### Solo Mining
7687

7788
You can use the following stratum bridge to solo mine with Kaspa NG: https://github.com/rdugan/kaspa-stratum-bridge/releases

core/Cargo.toml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,7 @@ epaint.workspace = true
8585
egui_plot.workspace = true
8686
egui_extras.workspace = true
8787
chrono.workspace = true
88-
eframe = { workspace = true, default-features = false, features = [
89-
"accesskit", # Make egui comptaible with screen readers. NOTE: adds a lot of dependencies.
90-
"default_fonts", # Embed the default egui fonts.
91-
# "wgpu", # Use the glow rendering backend. Alternative: "wgpu".
92-
"glow", # Use the glow rendering backend. Alternative: "wgpu".
93-
"persistence", # Enable restoring app state when restarting the app.
94-
] }
88+
9589
egui-phosphor = { workspace = true, features = ["light"] }
9690
# egui-phosphor = { workspace = true, features = ["thin","light","regular","bold"] }
9791
egui-notify.workspace = true
@@ -128,3 +122,21 @@ tokio.workspace = true
128122
[target.'cfg(target_arch = "wasm32")'.dependencies]
129123
wasm-bindgen-futures.workspace = true
130124

125+
[target.'cfg(not(target_os = "linux"))'.dependencies]
126+
eframe = { workspace = true, default-features = false, features = [
127+
"accesskit", # Make egui comptaible with screen readers. NOTE: adds a lot of dependencies.
128+
"default_fonts", # Embed the default egui fonts.
129+
"glow", # Use the glow rendering backend. Alternative: "wgpu".
130+
"persistence", # Enable restoring app state when restarting the app.
131+
] }
132+
133+
[target.'cfg(target_os = "linux")'.dependencies]
134+
eframe = { workspace = true, default-features = false, features = [
135+
"accesskit", # Make egui comptaible with screen readers. NOTE: adds a lot of dependencies.
136+
"default_fonts", # Embed the default egui fonts.
137+
# "wgpu", # Use the glow rendering backend. Alternative: "wgpu".
138+
"glow", # Use the glow rendering backend. Alternative: "wgpu".
139+
"persistence", # Enable restoring app state when restarting the app.
140+
"wayland"
141+
] }
142+

core/src/app.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ cfg_if! {
272272
let native_options = eframe::NativeOptions {
273273
persist_window : true,
274274
viewport,
275-
follow_system_theme: false,
275+
//follow_system_theme: false,
276276
..Default::default()
277277
};
278278

@@ -303,7 +303,7 @@ cfg_if! {
303303

304304
// use crate::result::Result;
305305
// use crate::adaptor::Adaptor;
306-
// use wasm_bindgen::JsCast;
306+
use wasm_bindgen::JsCast;
307307

308308
// pub async fn kaspa_ng_main(wallet_api : Option<Arc<dyn WalletApi>>, application_events : Option<ApplicationEventsChannel>, adaptor: Option<Arc<Adaptor>>) -> Result<()> {
309309
pub async fn kaspa_ng_main(application_context : ApplicationContext) -> Result<()> {
@@ -327,7 +327,7 @@ cfg_if! {
327327
// Redirect `log` message to `console.log` and friends:
328328
eframe::WebLogger::init(log::LevelFilter::Debug).ok();
329329
let web_options = eframe::WebOptions{
330-
follow_system_theme: false,
330+
//follow_system_theme: false,
331331
..eframe::WebOptions::default()
332332
};
333333

@@ -351,8 +351,7 @@ cfg_if! {
351351

352352
eframe::WebRunner::new()
353353
.start(
354-
// will be used in >0.28.1 -> document().get_element_by_id("kaspa-ng").expect("<canvas id=\"kaspa-ng\"> not found.").dyn_into::<web_sys::HtmlCanvasElement>().unwrap(),
355-
"kaspa-ng",
354+
document().get_element_by_id("kaspa-ng").expect("<canvas id=\"kaspa-ng\"> not found.").dyn_into::<web_sys::HtmlCanvasElement>().unwrap(),
356355
web_options,
357356
Box::new(move |cc| {
358357

core/src/core.rs

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -509,14 +509,23 @@ impl Core {
509509

510510
if self.device.orientation() == Orientation::Portrait {
511511
CentralPanel::default()
512-
.frame(Frame::default().fill(ctx.style().visuals.panel_fill))
512+
.frame(
513+
Frame::default()
514+
.corner_radius(4.)
515+
.inner_margin(0.)
516+
.outer_margin(Margin::symmetric(0, 3)),
517+
)
513518
.show_inside(ui, |ui| {
514-
egui::TopBottomPanel::bottom("portrait_bottom_panel").show_inside(
515-
ui,
516-
|ui| {
519+
egui::TopBottomPanel::bottom("portrait_bottom_panel")
520+
.frame(
521+
Frame::default()
522+
.corner_radius(4.)
523+
.inner_margin(0.)
524+
.outer_margin(Margin::symmetric(0, 3)),
525+
)
526+
.show_inside(ui, |ui| {
517527
Status::new(self).render(ui);
518-
},
519-
);
528+
});
520529

521530
if self.device.mobile() {
522531
egui::TopBottomPanel::bottom("mobile_menu_panel").show_inside(
@@ -587,7 +596,7 @@ impl Core {
587596
} else {
588597
egui::TopBottomPanel::bottom("bottom_panel")
589598
// TODO - review margins
590-
.frame(Frame::default().rounding(4.).inner_margin(3.))
599+
.frame(Frame::default().corner_radius(4.).inner_margin(3.))
591600
.show_inside(ui, |ui| {
592601
Status::new(self).render(ui);
593602
egui::warn_if_debug_build(ui);

core/src/egui/composite_button.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pub struct CompositeButton<'a> {
5151
small: bool,
5252
frame: Option<bool>,
5353
min_size: Vec2,
54-
rounding: Option<Rounding>,
54+
rounding: Option<CornerRadius>,
5555
padding: Option<Vec2>,
5656
selected: bool,
5757
show_loading_spinner: Option<bool>,
@@ -186,7 +186,7 @@ impl<'a> CompositeButton<'a> {
186186
}
187187

188188
/// Set the rounding of the button.
189-
pub fn rounding(mut self, rounding: impl Into<Rounding>) -> Self {
189+
pub fn rounding(mut self, rounding: impl Into<CornerRadius>) -> Self {
190190
self.rounding = Some(rounding.into());
191191
self
192192
}
@@ -368,15 +368,15 @@ impl Widget for CompositeButton<'_> {
368368
let selection = ui.visuals().selection;
369369
(
370370
Vec2::ZERO,
371-
Rounding::ZERO,
371+
CornerRadius::ZERO,
372372
selection.bg_fill,
373373
selection.stroke,
374374
)
375375
} else if frame {
376376
let expansion = Vec2::splat(visuals.expansion);
377377
(
378378
expansion,
379-
visuals.rounding,
379+
visuals.corner_radius,
380380
visuals.weak_bg_fill,
381381
visuals.bg_stroke,
382382
)
@@ -391,6 +391,7 @@ impl Widget for CompositeButton<'_> {
391391
frame_rounding,
392392
frame_fill,
393393
frame_stroke,
394+
StrokeKind::Outside,
394395
);
395396

396397
let mut cursor_x = rect.min.x + button_padding.x;
@@ -528,7 +529,7 @@ impl Widget for CompositeButton<'_> {
528529
}
529530

530531
if let Some(cursor) = ui.visuals().interact_cursor {
531-
if response.hovered {
532+
if response.hovered() {
532533
ui.ctx().set_cursor_icon(cursor);
533534
}
534535
}

core/src/egui/composite_icon.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pub struct CompositeIcon {
6060
sense: Sense,
6161
small: bool,
6262
frame: Option<bool>,
63-
rounding: Option<Rounding>,
63+
rounding: Option<CornerRadius>,
6464
padding: Option<Vec2>,
6565
selected: bool,
6666
with_frame: bool,
@@ -146,7 +146,7 @@ impl CompositeIcon {
146146
}
147147

148148
/// Set the rounding of the button.
149-
pub fn rounding(mut self, rounding: impl Into<Rounding>) -> Self {
149+
pub fn rounding(mut self, rounding: impl Into<CornerRadius>) -> Self {
150150
self.rounding = Some(rounding.into());
151151
self
152152
}
@@ -381,15 +381,15 @@ impl Widget for CompositeIcon {
381381
let selection = ui.visuals().selection;
382382
(
383383
Vec2::ZERO,
384-
Rounding::ZERO,
384+
CornerRadius::ZERO,
385385
selection.bg_fill,
386386
selection.stroke,
387387
)
388388
} else if frame {
389389
let expansion = Vec2::splat(visuals.expansion);
390390
(
391391
expansion,
392-
visuals.rounding,
392+
visuals.corner_radius,
393393
visuals.weak_bg_fill,
394394
visuals.bg_stroke,
395395
)
@@ -406,6 +406,7 @@ impl Widget for CompositeIcon {
406406
frame_rounding,
407407
frame_fill,
408408
frame_stroke,
409+
StrokeKind::Outside,
409410
);
410411
}
411412

@@ -461,7 +462,7 @@ impl Widget for CompositeIcon {
461462
}
462463

463464
if let Some(cursor) = ui.visuals().interact_cursor {
464-
if response.hovered {
465+
if response.hovered() {
465466
ui.ctx().set_cursor_icon(cursor);
466467
}
467468
}

core/src/egui/extensions.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub trait UiExtension {
4444
fn confirm_medium_apply_cancel(&mut self, align: Align) -> Option<Confirm>;
4545
fn confirm_medium_cancel(&mut self, align: Align) -> Option<Confirm>;
4646
fn sized_separator(&mut self, size: Vec2) -> Response;
47-
fn widgets_rounding(&self) -> Rounding;
47+
fn widgets_rounding(&self) -> CornerRadius;
4848
fn small_separator(&mut self) {
4949
self.add_separator(self.create_separator(None, 0.5, None));
5050
}
@@ -108,15 +108,15 @@ impl UiExtension for Ui {
108108
self.add(separator);
109109
}
110110

111-
fn widgets_rounding(&self) -> Rounding {
112-
self.visuals().widgets.hovered.rounding
111+
fn widgets_rounding(&self) -> CornerRadius {
112+
self.visuals().widgets.hovered.corner_radius
113113
}
114114

115115
fn medium_button_enabled(&mut self, enabled: bool, text: impl Into<WidgetText>) -> Response {
116116
self.add_enabled(
117117
enabled,
118118
Button::new(text)
119-
.rounding(self.widgets_rounding())
119+
.corner_radius(self.widgets_rounding())
120120
.min_size(theme_style().medium_button_size()),
121121
)
122122
}
@@ -125,7 +125,7 @@ impl UiExtension for Ui {
125125
self.add_enabled(
126126
enabled,
127127
Button::new(text)
128-
.rounding(self.widgets_rounding())
128+
.corner_radius(self.widgets_rounding())
129129
.min_size(theme_style().large_button_size()),
130130
)
131131
}
@@ -139,7 +139,7 @@ impl UiExtension for Ui {
139139
self.add_enabled(
140140
enabled,
141141
Button::new(text)
142-
.rounding(self.widgets_rounding())
142+
.corner_radius(self.widgets_rounding())
143143
.selected(selected)
144144
.min_size(theme_style().large_button_size()),
145145
)
@@ -414,7 +414,8 @@ impl LayoutJobBuilder {
414414
.add(Label::new(egui_phosphor::light::CLIPBOARD_TEXT).sense(Sense::click()))
415415
.clicked()
416416
{
417-
ui.output_mut(|o| o.copied_text = text);
417+
//ui.output_mut(|o| o.copied_text = text);
418+
ui.ctx().copy_text(text);
418419
runtime().notify_clipboard(i18n("Copied to clipboard"));
419420
}
420421
}

0 commit comments

Comments
 (0)