mirror of
https://gitlab.freedesktop.org/dabrain34/GstPipelineStudio.git
synced 2024-12-20 23:16:28 +00:00
favorites: display properties as well
As in element list, display properties when selected
This commit is contained in:
parent
b84483057b
commit
18606b687c
1 changed files with 30 additions and 17 deletions
|
@ -53,6 +53,15 @@ pub fn setup_favorite_list(app: &GPSApp) {
|
||||||
app.add_new_element(&element_name);
|
app.add_new_element(&element_name);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
let app_weak = app.downgrade();
|
||||||
|
favorite_list.connect_cursor_changed(move |tree_view| {
|
||||||
|
let app = upgrade_weak!(app_weak);
|
||||||
|
let selection = tree_view.selection();
|
||||||
|
if let Some((model, iter)) = selection.selected() {
|
||||||
|
let element_name = model.get::<String>(&iter, 0);
|
||||||
|
display_properties(&app, &element_name);
|
||||||
|
}
|
||||||
|
});
|
||||||
let gesture = gtk::GestureClick::new();
|
let gesture = gtk::GestureClick::new();
|
||||||
gesture.set_button(0);
|
gesture.set_button(0);
|
||||||
let app_weak = app.downgrade();
|
let app_weak = app.downgrade();
|
||||||
|
@ -138,7 +147,13 @@ pub fn setup_elements_list(app: &GPSApp) {
|
||||||
let selection = tree_view.selection();
|
let selection = tree_view.selection();
|
||||||
if let Some((model, iter)) = selection.selected() {
|
if let Some((model, iter)) = selection.selected() {
|
||||||
let element_name = model.get::<String>(&iter, 0);
|
let element_name = model.get::<String>(&iter, 0);
|
||||||
let description = GPS::ElementInfo::element_description(&element_name)
|
display_properties(&app, &element_name);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn display_properties(app: &GPSApp, element_name: &str) {
|
||||||
|
let description = GPS::ElementInfo::element_description(element_name)
|
||||||
.expect("Unable to get element description from GStreamer");
|
.expect("Unable to get element description from GStreamer");
|
||||||
let box_property: Box = app
|
let box_property: Box = app
|
||||||
.builder
|
.builder
|
||||||
|
@ -156,5 +171,3 @@ pub fn setup_elements_list(app: &GPSApp) {
|
||||||
label.set_selectable(true);
|
label.set_selectable(true);
|
||||||
box_property.append(&label);
|
box_property.append(&label);
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue