From aea5ca4d6bc03d6e3c5fb8adda6765dfdcbe3cdb Mon Sep 17 00:00:00 2001 From: Sahil Shadwal <sahilshadwal@gmail.com> Date: Wed, 14 Feb 2024 00:32:44 +0530 Subject: [PATCH 1/5] Added search to the ComboRow in BoxedLists --- demos/Boxed Lists/main.blp | 4 +++- demos/Boxed Lists/main.js | 17 +++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 demos/Boxed Lists/main.js diff --git a/demos/Boxed Lists/main.blp b/demos/Boxed Lists/main.blp index dc202f8f..3247d19f 100644 --- a/demos/Boxed Lists/main.blp +++ b/demos/Boxed Lists/main.blp @@ -80,9 +80,10 @@ Adw.StatusPage { }; } - Adw.ComboRow { + Adw.ComboRow drop_down { title: _("Choose an item"); subtitle: _("List of options from a drop down"); + enable-search: true; model: StringList list { strings [ @@ -122,3 +123,4 @@ Adw.StatusPage { } } } + diff --git a/demos/Boxed Lists/main.js b/demos/Boxed Lists/main.js new file mode 100644 index 00000000..dc27a4f9 --- /dev/null +++ b/demos/Boxed Lists/main.js @@ -0,0 +1,17 @@ +import GObject from "gi://GObject"; +import Gtk from "gi://Gtk"; + +const drop_down = workbench.builder.get_object("drop_down"); + +drop_down.connect("notify::selected-item", () => { + const selected_item = drop_down.selected_item.get_string(); + console.log(selected_item); +}); + +const expression = new Gtk.ClosureExpression( + GObject.TYPE_STRING, + (obj) => obj.string, + null, +); + +drop_down.expression = expression; From 6c8f4e620688431d07b55f72f6018ee5f04410fb Mon Sep 17 00:00:00 2001 From: Sahil Shadwal <sahilshadwal@gmail.com> Date: Wed, 14 Feb 2024 00:43:23 +0530 Subject: [PATCH 2/5] Fix Remov extra line --- demos/Boxed Lists/main.blp | 1 - 1 file changed, 1 deletion(-) diff --git a/demos/Boxed Lists/main.blp b/demos/Boxed Lists/main.blp index 3247d19f..39a6c084 100644 --- a/demos/Boxed Lists/main.blp +++ b/demos/Boxed Lists/main.blp @@ -123,4 +123,3 @@ Adw.StatusPage { } } } - From 2c12207d80458950795ca8c27e37200036734c8f Mon Sep 17 00:00:00 2001 From: Sonny Piers <sonny@fastmail.net> Date: Sat, 13 Apr 2024 15:26:20 +0200 Subject: [PATCH 3/5] f --- src/Boxed Lists/main.blp | 10 +++++----- src/Boxed Lists/main.js | 1 - 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Boxed Lists/main.blp b/src/Boxed Lists/main.blp index ad57d8a8..44d47120 100644 --- a/src/Boxed Lists/main.blp +++ b/src/Boxed Lists/main.blp @@ -87,11 +87,11 @@ Adw.StatusPage { model: StringList list { strings [ - "This", - "Is", - "A", - "String", - "List" + "🐈", + "🦦", + "🦛", + "🦆", + "🦤" ] }; } diff --git a/src/Boxed Lists/main.js b/src/Boxed Lists/main.js index dc27a4f9..973c12c0 100644 --- a/src/Boxed Lists/main.js +++ b/src/Boxed Lists/main.js @@ -13,5 +13,4 @@ const expression = new Gtk.ClosureExpression( (obj) => obj.string, null, ); - drop_down.expression = expression; From 95106a43b4184ef3cb33e54114a65fbb1b0c22e7 Mon Sep 17 00:00:00 2001 From: Sonny Piers <sonny@fastmail.net> Date: Sat, 13 Apr 2024 15:26:55 +0200 Subject: [PATCH 4/5] f --- src/Boxed Lists/main.blp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Boxed Lists/main.blp b/src/Boxed Lists/main.blp index 44d47120..391d5f75 100644 --- a/src/Boxed Lists/main.blp +++ b/src/Boxed Lists/main.blp @@ -81,7 +81,7 @@ Adw.StatusPage { } Adw.ComboRow drop_down { - title: _("Choose an item"); + title: _("Choose an Item"); subtitle: _("List of options from a drop down"); enable-search: true; From 6e34bb5296edf4677044dd0c2b45b9673342eb71 Mon Sep 17 00:00:00 2001 From: Sonny Piers <sonny@fastmail.net> Date: Sat, 13 Apr 2024 15:28:05 +0200 Subject: [PATCH 5/5] f --- src/Boxed Lists/main.blp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Boxed Lists/main.blp b/src/Boxed Lists/main.blp index 391d5f75..32de0a18 100644 --- a/src/Boxed Lists/main.blp +++ b/src/Boxed Lists/main.blp @@ -87,11 +87,11 @@ Adw.StatusPage { model: StringList list { strings [ - "🐈", - "🦦", - "🦛", - "🦆", - "🦤" + "Cat", + "Dog", + "Hippo", + "Duck", + "Dodo" ] }; }