Speed up UI using fixed tree view size

This commit is contained in:
Joakim Soderlund 2019-09-14 22:44:33 +02:00
parent e6760885c4
commit 76a4951a1e
2 changed files with 11 additions and 11 deletions

View file

@ -15,7 +15,7 @@ pub struct AppWindow {
fetcher: Fetcher<BufReader<File>>,
window: ApplicationWindow,
search: ToggleButton,
result: Mutex<TreeView>,
result: TreeView,
entry: Entry,
}
@ -28,7 +28,7 @@ impl AppWindow {
fetcher: fetcher,
window: builder.get_object("app")?,
search: builder.get_object("search")?,
result: Mutex::new(builder.get_object("result")?),
result: builder.get_object("result")?,
entry: builder.get_object("entry")?,
});
@ -63,8 +63,7 @@ impl AppWindow {
);
}
let result = self.result.lock().unwrap();
result.set_model(Some(&store));
self.result.set_model(Some(&store));
}
pub fn filter(&self, query: &str) {

View file

@ -100,6 +100,7 @@ Author: Joakim Soderlund
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="enable_search">False</property>
<property name="fixed_height_mode">True</property>
<property name="show_expanders">False</property>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
@ -109,8 +110,8 @@ Author: Joakim Soderlund
<property name="resizable">True</property>
<property name="sizing">fixed</property>
<property name="fixed_width">100</property>
<property name="min_width">75</property>
<property name="max_width">200</property>
<property name="min_width">100</property>
<property name="max_width">100</property>
<property name="title" translatable="yes">ID</property>
<child>
<object class="GtkCellRendererText"/>
@ -124,8 +125,8 @@ Author: Joakim Soderlund
<object class="GtkTreeViewColumn" id="title_column">
<property name="resizable">True</property>
<property name="sizing">fixed</property>
<property name="fixed_width">300</property>
<property name="min_width">100</property>
<property name="fixed_width">400</property>
<property name="min_width">400</property>
<property name="max_width">400</property>
<property name="title" translatable="yes">Title</property>
<child>
@ -139,10 +140,10 @@ Author: Joakim Soderlund
<child>
<object class="GtkTreeViewColumn" id="author_column">
<property name="resizable">True</property>
<property name="sizing">autosize</property>
<property name="sizing">fixed</property>
<property name="fixed_width">300</property>
<property name="min_width">100</property>
<property name="max_width">500</property>
<property name="min_width">300</property>
<property name="max_width">300</property>
<property name="title" translatable="yes">Author</property>
<child>
<object class="GtkCellRendererText"/>