Skip to content

Commit

Permalink
Merge pull request #197 from lilopkins/develop
Browse files Browse the repository at this point in the history
0.21.0-rc.9
  • Loading branch information
lilopkins authored May 1, 2024
2 parents c30690a + e3bd8e6 commit a5a913c
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 13 deletions.
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace.package]
version = "0.21.0-rc.8"
version = "0.21.0-rc.9"
edition = "2021"

[workspace]
Expand Down
8 changes: 7 additions & 1 deletion testangel/src/ui/about.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,14 @@ impl SimpleComponent for AppAbout {

let engine_list = init.0;
let action_map = init.1;
let mut env_var_data = String::new();
for (var, val) in std::env::vars() {
if var.starts_with("TA_") {
env_var_data.push_str(&format!("{var}={val}\n"));
}
}
let log_data = format!(
"Debug data generated at: {}\nSoftware version: {}\nLocale: {} (system wanted: {:?})\n\nEngines:\n{:#?}\n\nActions:\n{:#?}",
"Debug data generated at: {}\nSoftware version: {}\nLocale: {} (system wanted: {:?})\n\nEnvironment:\n{env_var_data}\nEngines:\n{:#?}\n\nActions:\n{:#?}",
chrono::Local::now(),
env!("CARGO_PKG_VERSION"),
lang::current_locale(),
Expand Down
2 changes: 1 addition & 1 deletion testangel/src/ui/flows/action_component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ impl FactoryComponent for ActionComponent {
1
};
sender.output(ActionComponentOutput::MoveStep(*from, to, offset)).unwrap();
sender.input(ActionComponentInput::ProposedDrop { above: false, below: false, });
sender.input(ActionComponentInput::ProposedDrop { above: false, below: false });
return true;
}
false
Expand Down
15 changes: 14 additions & 1 deletion testangel/src/ui/flows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -712,9 +712,19 @@ impl Component for FlowsModel {

self.needs_saving = true;
}
FlowInputs::PasteStep(idx, config) => {
FlowInputs::PasteStep(idx, mut config) => {
let flow = self.open_flow.as_mut().unwrap();
let idx = idx.max(0).min(flow.actions.len());

// Adjust step just about to paste
for (_param_idx, source) in config.parameter_sources.iter_mut() {
if let ActionParameterSource::FromOutput(from_step, _output_idx) = source {
if *from_step <= idx {
*source = ActionParameterSource::Literal;
}
}
}

log::info!("Pasting step to {}", idx + 1);
flow.actions.insert(idx, config);

Expand Down Expand Up @@ -747,10 +757,13 @@ impl Component for FlowsModel {
let current_from = from.current_index();
let step = self.open_flow.as_ref().unwrap().actions[current_from].clone();
sender.input(FlowInputs::CutStep(from));

// Establish new position
let mut to = (to.current_index() as isize + offset).max(0) as usize;
if to > current_from && to > 0 {
to -= 1;
}

sender.input(FlowInputs::PasteStep(to, step));
}
}
Expand Down
2 changes: 1 addition & 1 deletion testangel/src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl Component for AppModel {
set_title: Some(&lang::lookup("app-name")),
set_default_width: 800,
set_default_height: 600,
set_icon_name: Some("testangel"),
set_icon_name: Some(relm4_icons::icon_names::TESTANGEL),

gtk::Box {
set_orientation: gtk::Orientation::Vertical,
Expand Down

0 comments on commit a5a913c

Please sign in to comment.