From 0a400cf53b59b19d721b2306e82d54590820cd85 Mon Sep 17 00:00:00 2001 From: Lynnesbian Date: Fri, 4 Sep 2020 21:18:51 +1000 Subject: [PATCH] working favourite button --- MainWindow.cs | 8 ++++++++ ui/main.glade | 1 + 2 files changed, 9 insertions(+) diff --git a/MainWindow.cs b/MainWindow.cs index 911a79b..11b6a24 100755 --- a/MainWindow.cs +++ b/MainWindow.cs @@ -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() { diff --git a/ui/main.glade b/ui/main.glade index 22f4934..a0893d3 100644 --- a/ui/main.glade +++ b/ui/main.glade @@ -705,6 +705,7 @@ True True Favourite + True