Skip to content

Commit af68741

Browse files
committed
rebase
1 parent 497973a commit af68741

10 files changed

Lines changed: 635 additions & 516 deletions

src/app.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ impl MatchEvent for App {
192192
self.update_login_visibility(cx);
193193

194194
log!("App::handle_startup(): starting matrix sdk loop");
195-
self.app_state.search_widget = Some(self.ui.search_bar(id!(home_screen_search_bar)).widget_uid());
196195
crate::sliding_sync::start_matrix_tokio().unwrap();
197196
}
198197

@@ -310,9 +309,6 @@ impl MatchEvent for App {
310309
self.ui.modal(id!(verification_modal)).close(cx);
311310
}
312311

313-
if let Some(SearchResultAction::Close) = action.downcast_ref() {
314-
self.ui.search_bar(id!(home_screen_search_bar)).text_input(id!(input)).set_text(cx, "");
315-
}
316312
// // message source modal handling.
317313
// match action.as_widget_action().cast() {
318314
// MessageAction::MessageSourceModalOpen { room_id: _, event_id: _, original_json: _ } => {
@@ -401,10 +397,6 @@ pub struct AppState {
401397
pub logged_in: bool,
402398
/// The current window geometry.
403399
pub window_geom: Option<event::WindowGeom>,
404-
/// Main Desktop Ui's search widget uid.
405-
/// Room screens will get this widget uid to differentiate search action
406-
/// from search bar widget.
407-
pub search_widget: Option<WidgetUid>,
408400
}
409401

410402
/// A saved instance of the state of the main desktop UI's dock.

src/home/home_screen.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ live_design! {
3131
<View> {
3232
flow: Down
3333
width: Fill, height: Fill
34-
home_screen_search_bar = <SearchBar> {}
3534

3635
<CachedWidget> {
3736
<RoomFilterInputBar> { }

src/home/main_desktop_ui.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@ use makepad_widgets::*;
22
use matrix_sdk::ruma::OwnedRoomId;
33
use std::collections::HashMap;
44

5-
use crate::{app::{AppState, AppStateAction, SelectedRoom}, utils::room_name_or_id};
5+
use crate::{app::{AppState, AppStateAction, SelectedRoom}, shared::room_filter_input_bar::RoomFilterAction, utils::room_name_or_id};
66
use super::{invite_screen::InviteScreenWidgetRefExt, room_screen::RoomScreenWidgetRefExt, rooms_list::RoomsListAction};
7-
8-
use super::{room_screen::RoomScreenWidgetRefExt, room_search_result::SearchResultAction};
97
live_design! {
108
use link::theme::*;
119
use link::shaders::*;
@@ -211,7 +209,7 @@ impl MainDesktopUI {
211209
dock.close_tab(cx, tab_id);
212210
self.tab_to_close = None;
213211
self.open_rooms.remove(&tab_id);
214-
cx.action(SearchResultAction::Close);
212+
cx.widget_action(self.widget_uid(), &Scope::empty().path, RoomFilterAction::Clear);
215213
}
216214

217215
/// Replaces an invite with a joined room in the dock.

src/home/new_message_context_menu.rs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -282,28 +282,6 @@ bitflags! {
282282
}
283283
}
284284
impl MessageAbilities {
285-
// pub fn from_user_power_and_event(
286-
// user_power_levels: &UserPowerLevels,
287-
// event_tl_item: &EventTimelineItem,
288-
// _message: &MessageOrSticker,
289-
// has_html: bool,
290-
// ) -> Self {
291-
// let mut abilities = Self::empty();
292-
// abilities.set(Self::CanEdit, event_tl_item.is_editable());
293-
// // Currently we only support deleting one's own messages.
294-
// if event_tl_item.is_own() {
295-
// abilities.set(Self::CanDelete, user_power_levels.can_redact_own());
296-
// }
297-
// abilities.set(Self::CanReplyTo, event_tl_item.can_be_replied_to());
298-
// abilities.set(Self::CanPin, user_power_levels.can_pin());
299-
// // TODO: currently we don't differentiate between pin and unpin,
300-
// // but we should first check whether the given message is already pinned
301-
// // before deciding which ability to set.
302-
// // abilities.set(Self::CanUnPin, user_power_levels.can_pin_unpin());
303-
// abilities.set(Self::CanReact, user_power_levels.can_send_reaction());
304-
// abilities.set(Self::HasHtml, has_html);
305-
// abilities
306-
// }
307285
pub fn from_user_power_and_event_generic<T: Eventable, M: MsgTypeAble>(
308286
user_power_levels: &UserPowerLevels,
309287
event_tl_item: &T,

src/home/room_screen.rs

Lines changed: 170 additions & 280 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)