Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added search to the ComboRow in BoxedLists #96

Merged
merged 6 commits into from
Apr 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/Boxed Lists/main.blp
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,18 @@ 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 [
"This",
"Is",
"A",
"String",
"List"
"Cat",
"Dog",
"Hippo",
"Duck",
"Dodo"
]
};
}
Expand Down
16 changes: 16 additions & 0 deletions src/Boxed Lists/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
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;
Loading