File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed
Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ if (NOT TARGET Slint::Slint)
88 find_package (Slint REQUIRED)
99endif ()
1010
11+ set (SLINT_STYLE "cosmic-light" CACHE STRING "Style for demo" FORCE)
12+
1113add_executable (usecases main.cpp)
1214target_link_libraries (usecases PRIVATE Slint::Slint)
1315slint_target_sources(usecases ../ui/app.slint)
Original file line number Diff line number Diff line change @@ -62,5 +62,9 @@ int main()
6262
6363 app->global <MailBoxViewAdapter>().set_mails (mails);
6464
65+ app->global <MailBoxViewAdapter>().on_search_text_changed ([mails](const slint::SharedString &text) {
66+ // mails->clear();
67+ });
68+
6569 app->run ();
6670}
Original file line number Diff line number Diff line change @@ -83,6 +83,8 @@ export component MailSideBarView {
8383}
8484
8585export global MailBoxViewAdapter {
86+ callback search-text-changed (/* search-text */ string );
87+
8688 in property <string > title : MailSideBarViewAdapter.current-title ();
8789 in property <[CardListViewItem]> mails: [
8890 {
@@ -135,6 +137,7 @@ export component MailBoxView {
135137 TitleText {
136138 text: MailBoxViewAdapter.title;
137139 min-height: 32px ;
140+
138141 }
139142
140143 Container {
@@ -150,6 +153,10 @@ export component MailBoxView {
150153 Icon {
151154 source: Icons.search;
152155 }
156+
157+ edited => {
158+ MailBoxViewAdapter.search-text-changed(self .text);
159+ }
153160 }
154161
155162 CardListView {
@@ -225,7 +232,7 @@ export component MailMessageView {
225232 }
226233
227234 VerticalBox {
228- TextEdit {
235+ text-edit := TextEdit {
229236 max-height: 94px ;
230237 wrap: word-wrap;
231238 }
@@ -252,6 +259,7 @@ export component MailMessageView {
252259 Button {
253260 text: "Send" ;
254261 primary: true ;
262+ enabled: text-edit.text != "" ;
255263
256264 clicked => {
257265 MailMessageViewAdapter.send();
You can’t perform that action at this time.
0 commit comments