malcontent/libmalcontent-ui/restrict-applications-selector.ui
Philip Withnall 73d8343a3e restrict-applications-dialog: Add support for searching the app list
This is a type-ahead search which filters the app list by app name.

It’s always visible because search is a very obvious interaction the
user might want to do to find an app in the app list. That’s why
`GtkSearchBar` is not being used here.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Fixes: #31
2023-10-13 13:24:37 +01:00

41 lines
1.3 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright © 2020 Endless, Inc. -->
<interface domain="malcontent">
<requires lib="gtk+" version="3.12"/>
<template class="MctRestrictApplicationsSelector" parent="GtkBox">
<child>
<object class="GtkListBox" id="listbox">
<property name="hexpand">True</property>
<property name="selection-mode">none</property>
<child type="placeholder">
<object class="GtkLabel">
<property name="label" translatable="yes">No applications found to restrict.</property>
<property name="margin-top">12</property>
<property name="margin-bottom">12</property>
</object>
</child>
<style>
<class name="content"/>
</style>
</object>
</child>
</template>
<object class="GListStore" id="apps">
<property name="item-type">GAppInfo</property>
</object>
<object class="GtkFilterListModel" id="filtered_apps">
<property name="model">apps</property>
<property name="filter">search_filter</property>
</object>
<object class="GtkStringFilter" id="search_filter">
<property name="expression">
<closure type="gchararray" function="app_info_dup_name" />
</property>
</object>
</interface>