Skip to content

Commit 4a7d12c

Browse files
committed
change to MessageSearchAction
1 parent fbfb272 commit 4a7d12c

11 files changed

+924
-257
lines changed

src/app.rs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use makepad_widgets::*;
44
use matrix_sdk::ruma::{OwnedRoomId, RoomId};
55

66
use crate::{
7-
home::{new_message_context_menu::NewMessageContextMenuWidgetRefExt, room_screen::MessageAction, rooms_list::RoomsListAction}, login::login_screen::LoginAction, shared::{callout_tooltip::{CalloutTooltipOptions, CalloutTooltipWidgetRefExt, TooltipAction}, popup_list::PopupNotificationAction}, utils::room_name_or_id, verification::VerificationAction, verification_modal::{VerificationModalAction, VerificationModalWidgetRefExt}
7+
home::{new_message_context_menu::NewMessageContextMenuWidgetRefExt, room_screen::MessageAction, rooms_list::RoomsListAction}, login::login_screen::LoginAction, shared::{callout_tooltip::{CalloutTooltipOptions, CalloutTooltipWidgetRefExt, TooltipAction}, message_search_input_bar::MessageSearchAction, popup_list::PopupNotificationAction}, utils::room_name_or_id, verification::VerificationAction, verification_modal::{VerificationModalAction, VerificationModalWidgetRefExt}
88
};
99

1010
live_design! {
@@ -242,6 +242,7 @@ impl MatchEvent for App {
242242
&Scope::default().path,
243243
StackNavigationAction::NavigateTo(live_id!(main_content_view))
244244
);
245+
self.ui.view(id!(message_search_input_view)).set_visible(cx, true);
245246
self.ui.redraw(cx);
246247
}
247248

@@ -251,6 +252,7 @@ impl MatchEvent for App {
251252
}
252253
AppStateAction::FocusNone => {
253254
self.app_state.selected_room = None;
255+
self.ui.view(id!(message_search_input_view)).set_visible(cx, false);
254256
}
255257
AppStateAction::UpgradedInviteToJoinedRoom(room_id) => {
256258
if let Some(selected_room) = self.app_state.selected_room.as_mut() {
@@ -318,6 +320,24 @@ impl MatchEvent for App {
318320
// }
319321
// _ => {}
320322
// }
323+
match action.as_widget_action().cast() {
324+
MessageSearchAction::Click(_) => {
325+
self.ui
326+
.view(id!(main_content_view.header.content.message_search_input_mobile_view))
327+
.apply_over(cx, live!{
328+
width: 220
329+
});
330+
}
331+
MessageSearchAction::Clear => {
332+
self.ui
333+
.view(id!(main_content_view.header.content.message_search_input_mobile_view))
334+
.apply_over(cx, live!{
335+
width: 150
336+
});
337+
}
338+
_ => {}
339+
}
340+
321341
}
322342
}
323343
}

src/home/home_screen.rs

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ live_design! {
1010
use crate::home::spaces_dock::SpacesDock;
1111
use crate::shared::styles::*;
1212
use crate::shared::room_filter_input_bar::RoomFilterInputBar;
13+
use crate::shared::message_search_input_bar::MessageSearchInputBar;
1314
use crate::home::main_desktop_ui::MainDesktopUI;
1415

1516
NavigationWrapper = {{NavigationWrapper}} {
@@ -32,11 +33,30 @@ live_design! {
3233

3334
<View> {
3435
flow: Down
35-
width: Fill, height: Fill
36-
37-
<CachedWidget> {
38-
<RoomFilterInputBar> {}
36+
width: Fill, height: Fill,
37+
spacing: 2,
38+
<View> {
39+
flow: Overlay,
40+
width: Fill,
41+
height: Fit,
42+
<CachedWidget> {
43+
<RoomFilterInputBar> {
44+
width: 300
45+
}
46+
}
47+
message_search_input_view = <View> {
48+
width: Fill, height: Fit,
49+
visible: false,
50+
align: {x: 1.0},
51+
<CachedWidget> {
52+
message_search_input_bar = <MessageSearchInputBar> {
53+
width: 300,
54+
}
55+
}
56+
}
57+
3958
}
59+
4060
<MainDesktopUI> {}
4161
}
4262
}
@@ -75,6 +95,21 @@ live_design! {
7595
}
7696
}
7797
}
98+
<View> {
99+
height: Fit,
100+
width: Fill,
101+
align: {x: 1.0 }
102+
message_search_input_mobile_view = <View> {
103+
height: Fit,
104+
width: 150,
105+
align: {x: 1.0 }
106+
<CachedWidget> {
107+
message_search_input_bar = <MessageSearchInputBar> {
108+
width: 300
109+
}
110+
}
111+
}
112+
}
78113
}
79114
}
80115
body = {

src/home/invite_screen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ live_design! {
108108
text: ""
109109
draw_text: {
110110
text_style: <TITLE_TEXT>{
111-
font_size: 18,
111+
font_size: 40,
112112
},
113113
color: #000
114114
}

src/home/main_desktop_ui.rs

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

5-
use crate::{app::{AppState, AppStateAction, SelectedRoom}, shared::room_filter_input_bar::RoomFilterAction, utils::room_name_or_id};
5+
use crate::{app::{AppState, AppStateAction, SelectedRoom}, shared::message_search_input_bar::MessageSearchAction, utils::room_name_or_id};
66
use super::{invite_screen::InviteScreenWidgetRefExt, room_screen::RoomScreenWidgetRefExt, rooms_list::RoomsListAction};
77
live_design! {
88
use link::theme::*;
@@ -209,7 +209,7 @@ impl MainDesktopUI {
209209
dock.close_tab(cx, tab_id);
210210
self.tab_to_close = None;
211211
self.open_rooms.remove(&tab_id);
212-
cx.widget_action(self.widget_uid(), &Scope::empty().path, RoomFilterAction::Clear);
212+
cx.widget_action(self.widget_uid(), &Scope::empty().path, MessageSearchAction::Clear);
213213
}
214214

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

0 commit comments

Comments
 (0)