working favourite button

This commit is contained in:
Lynne Megido 2020-09-04 21:18:51 +10:00
parent 392cb52c71
commit 0a400cf53b
Signed by: lynnesbian
GPG key ID: F0A184B5213D9F90
2 changed files with 9 additions and 0 deletions

View file

@ -265,6 +265,9 @@ namespace Buypeeb {
l.Text = row.Value;
}
var f = (ToggleButton)this.builder.GetObject("ButtonSelectedFavourite");
f.Active = item.favourite;
}
private void OpenUrl(string url) {
// https://github.com/dotnet/runtime/issues/17938
@ -423,6 +426,11 @@ namespace Buypeeb {
this.UpdateItem(this.selectedItem.id);
}
private void ButtonSelectedFavouriteToggled(object sender, EventArgs args) {
ToggleButton s = (ToggleButton)sender;
this.selectedItem.favourite = s.Active;
}
// timers
private bool UpdateSelectionEndTime() {

View file

@ -705,6 +705,7 @@
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="tooltip_text" translatable="yes">Favourite</property>
<signal name="toggled" handler="ButtonSelectedFavouriteToggled" swapped="no"/>
<child>
<object class="GtkImage" id="image3">
<property name="visible">True</property>