Skip to content

Commit

Permalink
Use the new constants from the Settings in the dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
Marko19907 committed Dec 30, 2023
1 parent a367af6 commit 7345a5c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/delay_dialog.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::{thread, cell::RefCell};
use nwg::{ControlHandle, NativeUi, NumberSelectData};
use crate::settings::{LOWEST_DELAY, MAX_DELAY};

pub enum DelayDialogData {
Cancel,
Expand Down Expand Up @@ -28,9 +29,9 @@ impl DelayDialog {

let number_select_data = NumberSelectData::Int {
value: (current_value / 1000) as i64,
step: 1, // 1 second
max: 1800, // 30 minutes
min: 1, // 1 second
step: 1, // 1 second steps
max: MAX_DELAY as i64, // 30 minutes
min: LOWEST_DELAY as i64, // 1 second
};
app.number_select.set_data(number_select_data);

Expand Down
5 changes: 3 additions & 2 deletions src/distance_dialog.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::mover;
use std::{thread, cell::RefCell};
use nwg::{ControlHandle, NativeUi, NumberSelectData};
use crate::settings::LOWEST_MAX_DISTANCE;

pub enum DistanceDialogData {
Cancel,
Expand Down Expand Up @@ -35,15 +36,15 @@ impl DistanceDialog {
value: current_value_x as i64,
step: 1,
max: smallest_x as i64 / 4,
min: 1,
min: LOWEST_MAX_DISTANCE as i64,
};
app.number_select_x.set_data(number_select_data_x);

let number_select_data_y = NumberSelectData::Int {
value: current_value_y as i64,
step: 1,
max: smallest_y as i64 / 4,
min: 1,
min: LOWEST_MAX_DISTANCE as i64,
};
app.number_select_y.set_data(number_select_data_y);

Expand Down

0 comments on commit 7345a5c

Please sign in to comment.