mirror of
https://github.com/Cyrix126/gupaxx.git
synced 2024-12-22 22:59:27 +00:00
fix: disable slider when xvb is not started
This commit is contained in:
parent
786432e2b5
commit
acff995c20
1 changed files with 11 additions and 9 deletions
|
@ -36,7 +36,7 @@ impl crate::disk::state::Xvb {
|
||||||
ui: &mut egui::Ui,
|
ui: &mut egui::Ui,
|
||||||
api: &Arc<Mutex<PubXvbApi>>,
|
api: &Arc<Mutex<PubXvbApi>>,
|
||||||
gui_api_xmrig: &Arc<Mutex<PubXmrigApi>>,
|
gui_api_xmrig: &Arc<Mutex<PubXmrigApi>>,
|
||||||
private_stats: bool,
|
is_alive: bool,
|
||||||
) {
|
) {
|
||||||
egui::ScrollArea::vertical().show(ui, |ui| {
|
egui::ScrollArea::vertical().show(ui, |ui| {
|
||||||
|
|
||||||
|
@ -182,12 +182,14 @@ impl crate::disk::state::Xvb {
|
||||||
XVB_MANUAL_SLIDER_KEEP_HELP
|
XVB_MANUAL_SLIDER_KEEP_HELP
|
||||||
};
|
};
|
||||||
|
|
||||||
ui.horizontal(|ui| {
|
ui.add_enabled_ui(is_alive, |ui| {
|
||||||
ui.spacing_mut().slider_width = width * 0.7;
|
ui.horizontal(|ui| {
|
||||||
ui.add_sized(
|
ui.spacing_mut().slider_width = width * 0.7;
|
||||||
[width, text_edit],
|
ui.add_sized(
|
||||||
egui::Slider::new(&mut self.amount, 0.0..=(hashrate_xmrig as f64)).text("H/s")
|
[width, text_edit],
|
||||||
).on_hover_text(slider_help_text);
|
egui::Slider::new(&mut self.amount, 0.0..=(hashrate_xmrig as f64)).text("H/s")
|
||||||
|
).on_hover_text(slider_help_text);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -227,8 +229,8 @@ impl crate::disk::state::Xvb {
|
||||||
|
|
||||||
// private stats
|
// private stats
|
||||||
ui.add_space(space_h);
|
ui.add_space(space_h);
|
||||||
// ui.add_enabled_ui(private_stats, |ui| {
|
// ui.add_enabled_ui(is_alive, |ui| {
|
||||||
ui.add_enabled_ui(private_stats, |ui| {
|
ui.add_enabled_ui(is_alive, |ui| {
|
||||||
let api = &lock!(api);
|
let api = &lock!(api);
|
||||||
let priv_stats = &api.stats_priv;
|
let priv_stats = &api.stats_priv;
|
||||||
let current_node = &api.current_node;
|
let current_node = &api.current_node;
|
||||||
|
|
Loading…
Reference in a new issue