@@ -113,20 +113,6 @@ impl Widget for ChatHistoryCard {
113
113
fn handle_event ( & mut self , cx : & mut Cx , event : & Event , scope : & mut Scope ) {
114
114
self . view . handle_event ( cx, event, scope) ;
115
115
self . widget_match_event ( cx, event, scope) ;
116
-
117
- let store = scope. data . get_mut :: < Store > ( ) . unwrap ( ) ;
118
- let widget_uid = self . widget_uid ( ) ;
119
- if let Hit :: FingerDown ( fd) = event. hits_with_capture_overload ( cx, self . view . area ( ) , true ) {
120
- if fd. tap_count == 1 {
121
- cx. widget_action (
122
- widget_uid,
123
- & scope. path ,
124
- ChatHistoryCardAction :: ChatSelected ( self . chat_id ) ,
125
- ) ;
126
- store. select_chat ( self . chat_id ) ;
127
- self . redraw ( cx) ;
128
- }
129
- }
130
116
}
131
117
132
118
fn draw_walk ( & mut self , cx : & mut Cx2d , scope : & mut Scope , walk : Walk ) -> DrawStep {
@@ -188,7 +174,7 @@ impl Widget for ChatHistoryCard {
188
174
189
175
impl WidgetMatchEvent for ChatHistoryCard {
190
176
fn handle_actions ( & mut self , cx : & mut Cx , actions : & Actions , scope : & mut Scope ) {
191
- // let store = scope.data.get_mut::<Store>().unwrap();
177
+ let store = scope. data . get_mut :: < Store > ( ) . unwrap ( ) ;
192
178
let widget_uid = self . widget_uid ( ) ;
193
179
194
180
if self . button ( id ! ( delete_chat) ) . clicked ( actions) {
@@ -204,6 +190,18 @@ impl WidgetMatchEvent for ChatHistoryCard {
204
190
) ;
205
191
return ;
206
192
}
193
+
194
+ if let Some ( fe) = self . view ( id ! ( content) ) . finger_down ( actions) {
195
+ if fe. tap_count == 1 {
196
+ cx. widget_action (
197
+ widget_uid,
198
+ & scope. path ,
199
+ ChatHistoryCardAction :: ChatSelected ( self . chat_id ) ,
200
+ ) ;
201
+ store. select_chat ( self . chat_id ) ;
202
+ self . redraw ( cx) ;
203
+ }
204
+ }
207
205
}
208
206
}
209
207
0 commit comments