gps.ui: Use a stock icon for clear

Clear graph on button clicked.
This commit is contained in:
Stéphane Cerveau 2022-01-10 15:06:35 +01:00
parent e8259f3773
commit a6a5d796ca
2 changed files with 5 additions and 4 deletions

View file

@ -592,10 +592,11 @@ impl GPSApp {
let _ = pipeline.set_state(PipelineState::Stopped);
});
let app_weak = self.downgrade();
add_button.connect_clicked(glib::clone!(@weak window => move |_| {
self.connect_button_action("button-clear", move |_| {
let app = upgrade_weak!(app_weak);
app.load_graph("graphs/compositor.xml").expect("Unable to open file");
}));
app.clear_graph();
//app.load_graph("graphs/compositor.xml").expect("Unable to open file");
});
// When user clicks on port with right button
let app_weak = self.downgrade();

View file

@ -211,7 +211,7 @@
<object class="GtkButton" id="button-clear">
<property name="hexpand">1</property>
<property name="receives-default">1</property>
<property name="label" translatable="yes">_clear</property>
<property name="icon-name">edit-clear</property>
</object>
</child>
</object>