ui files cleanup

This commit is contained in:
Bilal Elmoussaoui 2021-01-22 22:16:39 +01:00
parent b79ede5f73
commit c7d66ad91e
7 changed files with 26 additions and 58 deletions

View file

@ -29,7 +29,7 @@
</object>
</child>
<child type="end">
<object class="GtkButton" id="add_btn">
<object class="GtkButton">
<property name="label" translatable="yes">_Add</property>
<property name="use-underline">True</property>
<property name="sensitive">False</property>
@ -60,7 +60,7 @@
<property name="margin-bottom">12</property>
<property name="vexpand">True</property>
<child>
<object class="GtkBox" id="main_container">
<object class="GtkBox">
<property name="orientation">vertical</property>
<property name="spacing">18</property>
<property name="margin-start">12</property>
@ -72,7 +72,7 @@
</object>
</child>
<child>
<object class="GtkListBox" id="basic_list">
<object class="GtkListBox">
<property name="selection-mode">none</property>
<child>
<object class="AdwActionRow">
@ -193,16 +193,16 @@
</object>
</child>
<child>
<object class="UrlRow" id="provider_website_row">
<property name="title" translatable="yes">Website</property>
<property name="icon-name">globe-symbolic</property>
</object>
<object class="UrlRow" id="provider_website_row">
<property name="title" translatable="yes">Website</property>
<property name="icon-name">globe-symbolic</property>
</object>
</child>
<child>
<object class="UrlRow" id="provider_help_row">
<property name="title" translatable="yes">How to setup</property>
<property name="icon-name">help-page-symbolic</property>
</object>
<object class="UrlRow" id="provider_help_row">
<property name="title" translatable="yes">How to setup</property>
<property name="icon-name">help-page-symbolic</property>
</object>
</child>
<style>
<class name="content"/>

View file

@ -62,7 +62,7 @@
<property name="icon-name">globe-symbolic</property>
</object>
</child>
<style>
<style>
<class name="content"/>
</style>
</object>

View file

@ -40,7 +40,7 @@
<object class="GtkProgressBar" id="progress">
<property name="pulse-step">0.0001</property>
<style>
<class name="totp-progress" />
<class name="totp-progress" />
</style>
</object>
</child>

View file

@ -19,7 +19,7 @@
<object class="GtkHeaderBar">
<property name="show-title-buttons">True</property>
<child type="start">
<object class="GtkButton" id="add_btn">
<object class="GtkButton">
<property name="receives-default">True</property>
<property name="action-name">providers.add</property>
<property name="icon-name">list-add-symbolic</property>
@ -40,10 +40,10 @@
<object class="GtkBox">
<property name="orientation">vertical</property>
<child>
<object class="GtkSearchBar" id="search_bar">
<object class="GtkSearchBar">
<property name="search-mode-enabled" bind-source="search_btn" bind-property="active" bind-flags="sync-create" />
<child>
<object class="GtkSearchEntry" id="search_entry">
</object>
<object class="GtkSearchEntry" id="search_entry"/>
</child>
</object>
</child>

View file

@ -2,10 +2,10 @@
<interface>
<menu id="menu">
<section>
<item>
<attribute name="label" translatable="yes">_Lock the application</attribute>
<attribute name="action">app.lock</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Lock the application</attribute>
<attribute name="action">app.lock</attribute>
</item>
</section>
<section>
<item>
@ -45,7 +45,7 @@
<object class="GtkHeaderBar">
<property name="show-title-buttons">True</property>
<child type="start">
<object class="GtkButton" id="add_btn">
<object class="GtkButton">
<property name="receives-default">True</property>
<property name="action-name">win.add_account</property>
<property name="icon-name">list-add-symbolic</property>
@ -74,10 +74,10 @@
<property name="vexpand">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkSearchBar" id="search_bar">
<object class="GtkSearchBar">
<property name="search-mode-enabled" bind-source="search_btn" bind-property="active" bind-flags="sync-create" />
<child>
<object class="GtkSearchEntry" id="search_entry">
</object>
<object class="GtkSearchEntry" id="search_entry" />
</child>
</object>
</child>
@ -91,8 +91,7 @@
<object class="AdwLeafletPage">
<property name="name">account</property>
<property name="child">
<object class="AccountDetailsPage" id="account_details">
</object>
<object class="AccountDetailsPage" id="account_details" />
</property>
</object>
</child>

View file

@ -21,8 +21,6 @@ mod imp {
#[template_child]
pub search_entry: TemplateChild<gtk::SearchEntry>,
#[template_child]
pub search_bar: TemplateChild<gtk::SearchBar>,
#[template_child]
pub search_btn: TemplateChild<gtk::ToggleButton>,
}
@ -41,7 +39,6 @@ mod imp {
deck: TemplateChild::default(),
providers_list: TemplateChild::default(),
search_entry: TemplateChild::default(),
search_bar: TemplateChild::default(),
search_btn: TemplateChild::default(),
page: ProviderPage::new(),
actions: gio::SimpleActionGroup::new(),
@ -87,11 +84,6 @@ impl ProvidersDialog {
let self_ = imp::ProvidersDialog::from_instance(self);
self_.filter_model.set_model(Some(&model));
self_
.search_bar
.bind_property("search-mode-enabled", &*self_.search_btn, "active")
.flags(glib::BindingFlags::BIDIRECTIONAL | glib::BindingFlags::SYNC_CREATE)
.build();
self_
.search_entry
@ -100,12 +92,6 @@ impl ProvidersDialog {
dialog.search(text);
}));
self_
.search_btn
.bind_property("active", &*self_.search_bar, "search-mode-enabled")
.flags(glib::BindingFlags::BIDIRECTIONAL | glib::BindingFlags::SYNC_CREATE)
.build();
let factory = gtk::SignalListItemFactory::new();
factory.connect_setup(|_, list_item| {
let row = ProviderActionRow::new();
@ -149,14 +135,6 @@ impl ProvidersDialog {
let self_ = imp::ProvidersDialog::from_instance(self);
let deck = &*self_.deck;
let search_bar = &*self_.search_bar;
gtk_macros::action!(
self_.actions,
"search",
clone!(@weak search_bar => move |_,_| {
search_bar.set_search_mode(!search_bar.get_search_mode());
})
);
gtk_macros::action!(
self_.actions,
"back",

View file

@ -37,8 +37,6 @@ mod imp {
#[template_child]
pub container: TemplateChild<gtk::Box>,
#[template_child]
pub search_bar: TemplateChild<gtk::SearchBar>,
#[template_child]
pub search_btn: TemplateChild<gtk::ToggleButton>,
#[template_child]
pub password_entry: TemplateChild<gtk::PasswordEntry>,
@ -65,7 +63,6 @@ mod imp {
search_entry: TemplateChild::default(),
deck: TemplateChild::default(),
container: TemplateChild::default(),
search_bar: TemplateChild::default(),
search_btn: TemplateChild::default(),
password_entry: TemplateChild::default(),
locked_img: TemplateChild::default(),
@ -196,12 +193,6 @@ impl Window {
self_.container.append(&self_.providers);
self_
.search_bar
.bind_property("search-mode-enabled", &*self_.search_btn, "active")
.flags(glib::BindingFlags::BIDIRECTIONAL | glib::BindingFlags::SYNC_CREATE)
.build();
let search_btn = &*self_.search_btn;
self_.search_entry.connect_search_changed(
clone!(@weak self_.providers as providers => move |entry| {