feat: space drag multiplier
This commit is contained in:
@@ -134,6 +134,9 @@ pub enum ButtonAction {
|
||||
channel: ColorChannel,
|
||||
delta: f32,
|
||||
},
|
||||
DragMultiplier {
|
||||
delta: f32,
|
||||
},
|
||||
System {
|
||||
action: SystemAction,
|
||||
},
|
||||
@@ -330,6 +333,9 @@ fn handle_action(action: &ButtonAction, press: &mut PressData, app: &mut AppStat
|
||||
.enqueue(TaskType::System(SystemTask::ColorGain(channel, delta)));
|
||||
}
|
||||
ButtonAction::System { action } => run_system(action, app),
|
||||
ButtonAction::DragMultiplier { delta } => {
|
||||
app.session.config.space_drag_multiplier += delta;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ pub enum LabelContent {
|
||||
low_color: Arc<str>,
|
||||
charging_color: Arc<str>,
|
||||
},
|
||||
DragMultiplier,
|
||||
Ipd,
|
||||
}
|
||||
|
||||
@@ -66,6 +67,7 @@ pub enum LabelData {
|
||||
Ipd {
|
||||
last_ipd: f32,
|
||||
},
|
||||
DragMultiplier,
|
||||
}
|
||||
|
||||
pub fn modular_label_init(label: &mut ModularControl, content: &LabelContent) {
|
||||
@@ -111,6 +113,7 @@ pub fn modular_label_init(label: &mut ModularControl, content: &LabelContent) {
|
||||
None
|
||||
}
|
||||
LabelContent::Ipd => Some(LabelData::Ipd { last_ipd: 0. }),
|
||||
LabelContent::DragMultiplier => Some(LabelData::DragMultiplier),
|
||||
};
|
||||
|
||||
if let Some(state) = state {
|
||||
@@ -249,5 +252,8 @@ pub(super) fn label_update(control: &mut ModularControl, _: &mut (), app: &mut A
|
||||
control.set_text(&format!("{:.1}", app.input_state.ipd));
|
||||
}
|
||||
}
|
||||
LabelData::DragMultiplier => {
|
||||
control.set_text(&format!("{:.1}", app.session.config.space_drag_multiplier));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user