5BAPU7K6DRZD2DYLIW3GKD2SIM6ANP7RYWGDJ6JCGHB37MHJUMTAC EJPSD5XO43DWUBBZGNQMY4TMCAXL5EWCGX3OEHUERQ5GRASGWQLQC 7WCB5YQJJZIPUAFHTCQBWNI6ZM5XMIQJAKTLYTR7NOR5NKESRMDQC AZ5D2LQUSYVWVEP7ISFDSZTMZ65UEHZATILMDQ4TYLCKJH4Q3TIAC QUMAQ7IXNGTRVUPBLFURIISVDUOAB52OXFBXKCEAVY32IZQSGMCAC CULHFNIVQ3ATML2W3Z45RARZ2LHGXONYTGGN2ETWAAMV7R3Y67AQC LFEMJYYDO45ASMQSOJ3TNID7B5UZXDHB3NWFZJXWOAWNBS6GMDEAC 2SLTGWP6FTM7C7BMSYEI2EBD4YTVO2XCIVRPHBJH5XHVLLVR76TAC TEDT26JQBWGATVTY6HZTIOGFR6BXW2BHSUKUTXTA7HOXARRQ5D6AC YRGDFHABL6BRX55ZWIBGXX3ZX2R4WUV4BELP7JMW5AZX54P5BBIQC LPSUBGUBMG2QHJJSAWQ35SZIMUR62R6ODPWBS7TSNNXJ5UJCNABQC MORKDJUERANZOBUWRC2F5766BEYYWXANAF3YAQ6YQ55WFQA7X64QC 23SFYK4Q5NKBPJG53PQNPWQH6UOUU2YKJEL7RLXYBRLJOJYV7AWQC 6YZAVBWU6E5FYOI5JGEIPXGZLIKAW6LS2AOFIQWEE5DMOPPCD5PQC dir_picker::view(picker, theme::Container::Bordered).map(Msg::PickingRepoDir),
dir_picker::view(picker,theme::Container::Bordered,theme::Container::NavSelectedSection,theme::Button::Normal,theme::Button::Selected,theme::Scrollable::Normal,theme::Scrollable::Selected,).map(Msg::PickingRepoDir),
impl ModKeys {pub fn iter(&self) -> ModKeysIter<'_> {ModKeysIter { keys: self, ix: 0 }}}pub struct ModKeysIter<'a> {keys: &'a ModKeys,ix: usize,}impl<'a> Iterator for ModKeysIter<'a> {type Item = &'a ModKey;fn next(&mut self) -> Option<Self::Item> {let Self { keys, ix } = self;match keys {ModKeys::One(mod_key) => {if *ix == 0 {*ix += 1;Some(mod_key)} else {None}}ModKeys::Two(mod_key_0, mod_key_1) => {if *ix == 0 {*ix += 1;Some(mod_key_0)} else if *ix == 1 {*ix += 1;Some(mod_key_1)} else {None}}}}}
impl ModKeys {pub fn iter(&self) -> ModKeysIter<'_> {ModKeysIter { keys: self, ix: 0 }
fn get_allowed_in_picking_project(state: &model::PickingProject,) -> Vec<Binding> {let model::PickingProject {is_blocking: _,projects,} = state;if projects.is_some() {vec![down(), up()]} else {vec![]
pub struct ModKeysIter<'a> {keys: &'a ModKeys,ix: usize,}
let down = || Binding {keys_str: "C-(↓| j)",keys: ModKeys::Two(ModKey {key: Key::Named(Named::ArrowDown),mods: Mods::CTRL,},ModKey {key: Key::Character("j".into()),mods: Mods::CTRL,},),label: "down",msg: Some(FilteredMsg::Selection(selection::Msg::AltPressDir(selection::Dir::Down,))),};let up = || Binding {keys_str: "C-(↑| k)",keys: ModKeys::Two(ModKey {key: Key::Named(Named::ArrowUp),mods: Mods::CTRL,},ModKey {key: Key::Character("k".into()),mods: Mods::CTRL,},),label: "up",msg: Some(FilteredMsg::Selection(selection::Msg::AltPressDir(selection::Dir::Up,))),};let left = || Binding {keys_str: "C-(←| h)",keys: ModKeys::Two(ModKey {key: Key::Named(Named::ArrowLeft),mods: Mods::CTRL,},ModKey {key: Key::Character("h".into()),mods: Mods::CTRL,},),label: "left",msg: Some(FilteredMsg::Selection(selection::Msg::AltPressDir(selection::Dir::Left,))),};let right = || Binding {keys_str: "C-(→| l)",keys: ModKeys::Two(ModKey {key: Key::Named(Named::ArrowRight),mods: Mods::CTRL,},ModKey {key: Key::Character("l".into()),mods: Mods::CTRL,},),label: "right",msg: Some(FilteredMsg::Selection(selection::Msg::AltPressDir(selection::Dir::Right,))),};
fn next(&mut self) -> Option<Self::Item> {let Self { keys, ix } = self;match keys {ModKeys::One(mod_key) => {if *ix == 0 {*ix += 1;Some(mod_key)} else {None}}ModKeys::Two(mod_key_0, mod_key_1) => {if *ix == 0 {*ix += 1;Some(mod_key_0)} else if *ix == 1 {*ix += 1;Some(mod_key_1)} else {None}}
let can_down_or_up = match selection {dir_picker::Selection::Input => {!matched_child_dirs.is_empty() || !child_dirs.is_empty()}dir_picker::Selection::SubDir(_) => true,dir_picker::Selection::ProjectPijul(_)| dir_picker::Selection::ProjectGit(_) => {!found_repos_dirs_pijul.is_empty()|| !found_repos_dirs_git.is_empty()
fn get_allowed_in_picking_repo(_state: &model::PickingRepoDir) -> Vec<Binding> {vec![down(), up()]
push_if(can_down_or_up, down, ma);push_if(can_down_or_up, up, ma);push_if(matches!(selection,dir_picker::Selection::ProjectPijul(_)| dir_picker::Selection::ProjectGit(_)),left,ma,);push_if(matches!(selection,dir_picker::Selection::Input | dir_picker::Selection::SubDir(_)),right,ma,);push(focus_next, ma);actions
};let focus_next = || Binding {keys_str: "Tab",keys: ModKeys::One(ModKey {key: Key::Named(Named::Tab),mods: Mods::NONE,}),label: "focus next",msg: Some(FilteredMsg::FocusNext),
let focus_prev = || Binding {keys_str: "S-Tab",keys: ModKeys::One(ModKey {key: Key::Named(Named::Tab),mods: Mods::SHIFT,}),label: "focus previous",msg: Some(FilteredMsg::FocusPrev),};
fn focus_next() -> Binding {Binding {keys_str: "Tab",keys: ModKeys::One(ModKey {key: Key::Named(Named::Tab),mods: Mods::NONE,}),label: "focus next",msg: Some(FilteredMsg::FocusNext),}}fn focus_prev() -> Binding {Binding {keys_str: "S-Tab",keys: ModKeys::One(ModKey {key: Key::Named(Named::Tab),mods: Mods::SHIFT,}),label: "focus previous",msg: Some(FilteredMsg::FocusPrev),}}
left_nav: nav_scrollable::State,right_nav: nav_scrollable::State,input: String,current_dir: BasePathBuf,child_dirs: Vec<PathBuf>,matched_child_dirs: Vec<String>,found_repos_dirs_pijul: Vec<PathBuf>,found_repos_dirs_git: Vec<PathBuf>,find_child_dirs_handle: Option<task::Handle>,find_repos_handle: Option<task::Handle>,
pub left_nav: nav_scrollable::State,pub right_nav: nav_scrollable::State,pub input: String,pub current_dir: BasePathBuf,pub child_dirs: Vec<PathBuf>,pub matched_child_dirs: Vec<String>,pub found_repos_dirs_pijul: Vec<PathBuf>,pub found_repos_dirs_git: Vec<PathBuf>,pub find_child_dirs_handle: Option<task::Handle>,pub find_repos_handle: Option<task::Handle>,
}#[derive(Debug, Clone, Copy)]pub enum SelectionDir {Down,Up,Left,Right,}pub fn move_selection(state: &mut State, dir: SelectionDir) {let selection = &mut state.selection;match dir {SelectionDir::Down => match selection {Selection::Input => {if !state.matched_child_dirs.is_empty()|| !state.child_dirs.is_empty(){*selection = Selection::SubDir(0);}}Selection::SubDir(ix) => {if (!state.matched_child_dirs.is_empty()&& state.matched_child_dirs.len() - 1 > *ix)|| (!state.child_dirs.is_empty()&& state.child_dirs.len() - 1 > *ix){let new_ix = *ix + 1;*selection = Selection::SubDir(new_ix);} else {*selection = Selection::Input;}}Selection::ProjectPijul(ix) => {if !state.found_repos_dirs_pijul.is_empty() {if state.found_repos_dirs_pijul.len() - 1 > *ix {let new_ix = *ix + 1;*selection = Selection::ProjectPijul(new_ix);} else if !state.found_repos_dirs_git.is_empty() {*selection = Selection::ProjectGit(0);} else {*selection = Selection::ProjectPijul(0);}} else if !state.found_repos_dirs_git.is_empty() {if state.found_repos_dirs_git.len() - 1 > *ix {let new_ix = *ix + 1;*selection = Selection::ProjectGit(new_ix);} else {*selection = Selection::ProjectGit(0);}} else {*selection = Selection::Input;}}Selection::ProjectGit(ix) => {if !state.found_repos_dirs_git.is_empty() {if state.found_repos_dirs_git.len() - 1 > *ix {let new_ix = *ix + 1;*selection = Selection::ProjectGit(new_ix);} else if !state.found_repos_dirs_pijul.is_empty() {*selection = Selection::ProjectPijul(0);} else {*selection = Selection::ProjectGit(0);}} else if !state.found_repos_dirs_pijul.is_empty() {if state.found_repos_dirs_pijul.len() - 1 > *ix {let new_ix = *ix + 1;*selection = Selection::ProjectPijul(new_ix);} else {*selection = Selection::ProjectPijul(0);}} else {*selection = Selection::Input;}}},SelectionDir::Up => match selection {Selection::Input => {if !state.matched_child_dirs.is_empty() {let new_ix = state.matched_child_dirs.len() - 1;*selection = Selection::SubDir(new_ix);} else if !state.child_dirs.is_empty() {let new_ix = state.child_dirs.len() - 1;*selection = Selection::SubDir(new_ix);}}Selection::SubDir(ix) => {if *ix > 0&& (!state.matched_child_dirs.is_empty()|| !state.child_dirs.is_empty()){let new_ix = *ix - 1;*selection = Selection::SubDir(new_ix);} else {*selection = Selection::Input;}}Selection::ProjectPijul(ix) => {if !state.found_repos_dirs_pijul.is_empty() {if *ix > 0 {let new_ix = *ix - 1;*selection = Selection::ProjectPijul(new_ix);} else if !state.found_repos_dirs_git.is_empty() {*selection = Selection::ProjectGit(state.found_repos_dirs_git.len() - 1,);} else {*selection = Selection::ProjectPijul(state.found_repos_dirs_pijul.len() - 1,);}} else if !state.found_repos_dirs_git.is_empty() {if *ix > 0 {let new_ix = *ix - 1;*selection = Selection::ProjectGit(new_ix);} else {*selection = Selection::ProjectGit(state.found_repos_dirs_git.len() - 1,);}} else {*selection = Selection::Input;}}Selection::ProjectGit(ix) => {if !state.found_repos_dirs_git.is_empty() {if *ix > 0 {let new_ix = *ix - 1;*selection = Selection::ProjectGit(new_ix);} else if !state.found_repos_dirs_pijul.is_empty() {*selection = Selection::ProjectPijul(state.found_repos_dirs_pijul.len() - 1,);} else {*selection = Selection::ProjectGit(state.found_repos_dirs_git.len() - 1,);}} else if !state.found_repos_dirs_pijul.is_empty() {if *ix > 0 {let new_ix = *ix - 1;*selection = Selection::ProjectPijul(new_ix);} else {*selection = Selection::ProjectPijul(state.found_repos_dirs_pijul.len() - 1,);}} else {*selection = Selection::Input;}}},SelectionDir::Right | SelectionDir::Left => match selection {Selection::Input | Selection::SubDir(_) => {if !state.found_repos_dirs_pijul.is_empty() {*selection = Selection::ProjectPijul(0);} else if !state.found_repos_dirs_git.is_empty() {*selection = Selection::ProjectGit(0);}}Selection::ProjectPijul(_) => {if !state.matched_child_dirs.is_empty()|| !state.child_dirs.is_empty(){*selection = Selection::SubDir(0);} else {*selection = Selection::Input;}}Selection::ProjectGit(_) => {if !state.matched_child_dirs.is_empty()|| !state.child_dirs.is_empty(){*selection = Selection::SubDir(0);} else {*selection = Selection::Input;}}},}
bordered_container_class: <Theme as container::Catalog>::Class<'a>,
container_class_bordered: <Theme as container::Catalog>::Class<'a>,container_class_bordered_selected: <Theme as container::Catalog>::Class<'a>,button_class_normal: <Theme as button::Catalog>::Class<'a>,button_class_selected: <Theme as button::Catalog>::Class<'a>,scrollable_normal: <Theme as nav_scrollable::Catalog>::Class<'a>,scrollable_selected: <Theme as nav_scrollable::Catalog>::Class<'a>,
Element::new(button(text(dir)).on_press_with(move || {Msg::SelectChildDir(current_dir.as_path().join(dir),)},)),
Element::new(button(text(dir)).on_press_with(move || {Msg::SelectChildDir(current_dir.as_path().join(dir),)}).class(if let Selection::SubDir(dir_ix) = selection&& *dir_ix == ix{button_class_selected} else {button_class_normal},),),
view::Msg::Action(msg) => {dbg!(msg);Task::none()}view::Msg::UnfilteredSelection(msg) => {dbg!(msg);Task::none()}
view::Msg::Action(msg) => match msg {action::FilteredMsg::Selection(msg) => match msg {selection::Msg::PressDir(_) => Task::none(),inflorescence_model::selection::Msg::AltPressDir(dir) => {update_dir_picker_selection(picker, dir);Task::none()}},action::FilteredMsg::FocusNext => task::widget_focus_next(),action::FilteredMsg::Confirm| action::FilteredMsg::Cancel| action::FilteredMsg::PostponeRecord| action::FilteredMsg::SaveRecord| action::FilteredMsg::DiscardRecord| action::FilteredMsg::AddUntrackedFile| action::FilteredMsg::RmChange| action::FilteredMsg::StartRecord| action::FilteredMsg::SelectChannel| action::FilteredMsg::ForkChannel| action::FilteredMsg::RefreshRepo| action::FilteredMsg::ShowEntireLog| action::FilteredMsg::FocusPrev| action::FilteredMsg::ClipboardCopy| action::FilteredMsg::ToggleReports| action::FilteredMsg::ClipboardCopyReports| action::FilteredMsg::ToRecord(_)| action::FilteredMsg::ToRecordToggleSelectedFileOrChange| action::FilteredMsg::EnterSubMenu(_) => Task::none(),},view::Msg::UnfilteredSelection(_msg) => Task::none(),
fn update_dir_picker_selection(picker: &mut dir_picker::State,dir: selection::Dir,) {let dir = match dir {selection::Dir::Down => dir_picker::SelectionDir::Down,selection::Dir::Up => dir_picker::SelectionDir::Up,selection::Dir::Right => dir_picker::SelectionDir::Right,selection::Dir::Left => dir_picker::SelectionDir::Left,};dir_picker::move_selection(picker, dir);}