Skip to content

Commit

Permalink
Merge pull request #259 from iced-rs/main
Browse files Browse the repository at this point in the history
update to how main is
  • Loading branch information
genusistimelord authored Jul 15, 2024
2 parents a6faf72 + 752c573 commit 27efba3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/widgets/menu/menu_bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ where
}
Event::Mouse(mouse::Event::ButtonReleased(mouse::Button::Left)) => {
if cursor.is_over(bar_bounds) && bar.is_pressed {
bar.open = true;
bar.open = !bar.open;
bar.is_pressed = false;
for (i, l) in layout.children().enumerate() {
if cursor.is_over(l.bounds()) {
Expand Down
11 changes: 7 additions & 4 deletions src/widgets/tabs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,18 @@ where
/// * the function that will be called if a tab is selected by the user.
/// It takes the index of the selected tab.
pub fn new_with_tabs<F>(
tabs: Vec<(TabId, TabLabel, Element<'a, Message, Theme, Renderer>)>,
tabs: impl IntoIterator<Item = (TabId, TabLabel, Element<'a, Message, Theme, Renderer>)>,
on_select: F,
) -> Self
where
F: 'static + Fn(TabId) -> Message,
{
let mut tab_labels = Vec::with_capacity(tabs.len());
let mut elements = Vec::with_capacity(tabs.len());
let mut indices = Vec::with_capacity(tabs.len());
let tabs = tabs.into_iter();
let n_tabs = tabs.size_hint().0;

let mut tab_labels = Vec::with_capacity(n_tabs);
let mut elements = Vec::with_capacity(n_tabs);
let mut indices = Vec::with_capacity(n_tabs);

for (id, tab_label, element) in tabs {
tab_labels.push((id.clone(), tab_label));
Expand Down

0 comments on commit 27efba3

Please sign in to comment.