Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c69619c
Make platform-specific menus more portable
raphlinus Oct 21, 2020
40604ae
[linux] Textbox should select all text when tabbed to
cmyr Oct 26, 2020
9e5f19a
Reduce flashing on window creation (#1272)
rhzk Oct 28, 2020
140ca91
Try reverting usvg.
jneem Oct 29, 2020
e585488
Merge pull request #1356 from jneem/harfbuzz2
justinmoon Oct 29, 2020
bc96077
The gallery example now requires a new feature. (#1358)
richard-uk1 Oct 29, 2020
6a4062d
Merge pull request #1339 from linebender/menu_work4
raphlinus Oct 29, 2020
ff099e9
Fixed broken doc links due to typo in container.rs (#1357)
xkns Oct 29, 2020
28e5e06
Add WidgetPod::with_event_context for Crochet.
luleyleo Oct 28, 2020
aac8103
Fix LabelText::Static resolve method.
luleyleo Oct 28, 2020
fa86fdf
Add `should_propagate_to_hidden` methods to `Event` and `LifeCycle`
andrewhickman Oct 27, 2020
1b086f4
Add `Either::current_widget` to clean up code slightly
andrewhickman Oct 27, 2020
e46578a
Propagate events to hidden widgets in `Either`
andrewhickman Oct 27, 2020
5a127c3
Make dialogs on windows non-sychronous. (#1328)
jneem Oct 29, 2020
6407860
Make `missed call to set_layout_rect` warning conditional on `should_…
andrewhickman Oct 29, 2020
bca89c7
Update changelog
andrewhickman Oct 30, 2020
9acc014
Merge branch 'master' into master
andrewhickman Oct 30, 2020
a30b1ef
Merge pull request #1351 from andrewhickman/master
luleyleo Oct 31, 2020
7a8464f
Slightly optimize implementation of EditableText for Arc<String>
andrewhickman Oct 29, 2020
0b6aacb
Compare string equality instead of Data::same in Editor::data_is_stale
andrewhickman Oct 30, 2020
9cb4029
Update README.md
richard-uk1 Nov 3, 2020
9f1c9af
Update README.md
richard-uk1 Nov 3, 2020
64374c5
Merge pull request #1366 from linebender/derekdreery-patch-1
richard-uk1 Nov 3, 2020
b9c4304
Rework custom widget (#1363)
JAicewizard Nov 3, 2020
729754c
Allow setting the cursor in the update method. (#1361)
jneem Nov 3, 2020
f7b3904
Ensure that WindowHandle and IdleHandle have the right Send/Sync mark…
jneem Nov 3, 2020
c6aa274
[mac] Fix typo preventing select-all on tab focus
cmyr Nov 3, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Propagate events to hidden widgets in Either
  • Loading branch information
andrewhickman committed Oct 29, 2020
commit e46578afbfacf628cb50f6511a26c444e5051be3
16 changes: 13 additions & 3 deletions druid/src/widget/either.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,25 @@ impl<T> Either<T> {

impl<T: Data> Widget<T> for Either<T> {
fn event(&mut self, ctx: &mut EventCtx, event: &Event, data: &mut T, env: &Env) {
self.current_widget().event(ctx, event, data, env)
if event.should_propagate_to_hidden() {
self.true_branch.event(ctx, event, data, env);
self.false_branch.event(ctx, event, data, env);
} else {
self.current_widget().event(ctx, event, data, env)
}
}

fn lifecycle(&mut self, ctx: &mut LifeCycleCtx, event: &LifeCycle, data: &T, env: &Env) {
if let LifeCycle::WidgetAdded = event {
self.current = (self.closure)(data, env);
}
self.true_branch.lifecycle(ctx, event, data, env);
self.false_branch.lifecycle(ctx, event, data, env);

if event.should_propagate_to_hidden() {
self.true_branch.lifecycle(ctx, event, data, env);
self.false_branch.lifecycle(ctx, event, data, env);
} else {
self.current_widget().lifecycle(ctx, event, data, env)
}
}

fn update(&mut self, ctx: &mut UpdateCtx, _old_data: &T, data: &T, env: &Env) {
Expand Down