Skip to content

Commit

Permalink
ui: remove rebond from menu
Browse files Browse the repository at this point in the history
  • Loading branch information
ybyygu committed Jul 14, 2023
1 parent cb3144f commit 1c08938
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ embed-resource = "1.4"
[workspace]

[patch.crates-io]
sbfiles = { path = "/home/ybyygu/Workspace/Programming/cmdline-tools/sbfiles" }
# sbfiles = { path = "/home/ybyygu/Workspace/Programming/cmdline-tools/sbfiles" }
# gchemol = { path = "/home/ybyygu/Workspace/Programming/gchemol-rs/gchemol" }
# gchemol-readwrite = {path = "/home/ybyygu/Workspace/Programming/gchemol-rs/gchemol-readwrite"}
# e345323a ends here
13 changes: 4 additions & 9 deletions src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ mod mols_from_clipbaord {
use std::io::Read;

/// Read molecules from clipbaord encoded by sbfiles
pub fn read(txt: &str) -> Result<Vec<Molecule>> {
pub fn decode(txt: &str) -> Result<Vec<Molecule>> {
let mut mols = vec![];

let mut sbfiles = Sbfiles::new();
Expand Down Expand Up @@ -352,7 +352,7 @@ mod panel {
mut app_exit_events: ResMut<Events<AppExit>>,
mut selection_query: Query<(&crate::base::AtomIndex, &mut PickSelection)>,
selected_atoms: Res<crate::molecule::SelectedAtoms>,
clipboard: Res<bevy_egui::EguiClipboard>,
mut clipboard: ResMut<bevy_egui::EguiClipboard>,
) {
let ctx = contexts.ctx_mut();

Expand Down Expand Up @@ -428,7 +428,7 @@ mod panel {
use std::io::Read;

if let Some(txt) = clipboard.get_contents() {
if let Ok(mols) = super::mols_from_clipbaord::read(&txt) {
if let Ok(mols) = super::mols_from_clipbaord::decode(&txt) {
let n = mols.len();
let command = crate::net::RemoteCommand::Load(mols);
writer.send(crate::net::StreamEvent(command));
Expand All @@ -439,16 +439,12 @@ mod panel {
error!("no text source from clipbaord");
}
}

if ui.button("✖ Quit").clicked() {
app_exit_events.send(AppExit);
}
});
ui.menu_button("Edit", |ui| {
if ui.button("rebond").clicked() {
if let Some(mol) = traj.get_current_molecule_mut(&current_frame) {
state.message = "no implemented yet".into();
}
}
// Remove all molecules
if ui.button("Clear Molecule").clicked() {
action = Action::Clear;
Expand Down Expand Up @@ -568,7 +564,6 @@ mod panel {
Action::Save => app.save_trajectory(traj, state),
Action::Clear => app.clear_molecules(commands, state, label_events, molecule_query),
Action::LabelAtoms => app.label_atoms(state, label_events, selection_query, atoms_query),
// Action::AtomSelection => state.atom_selection.show(ctx),
_ => {
state.message = format!("handler for action {action:?} is not implemented yet");
}
Expand Down

0 comments on commit 1c08938

Please sign in to comment.