From 27969813e86d4a60bfa12e6a43cab8e9d9cddd4d Mon Sep 17 00:00:00 2001 From: vhanla Date: Mon, 14 Aug 2023 05:18:42 -0500 Subject: [PATCH] Fix show alternate url option only on browser present --- menu.dfm | 1 + menu.pas | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/menu.dfm b/menu.dfm index 250e7dc..e442733 100644 --- a/menu.dfm +++ b/menu.dfm @@ -192,6 +192,7 @@ object frmMenu: TfrmMenu end object AlternatURL1: TMenuItem Caption = 'Alternat URL' + Visible = False OnClick = AlternatURL1Click end end diff --git a/menu.pas b/menu.pas index db155d8..88a574d 100644 --- a/menu.pas +++ b/menu.pas @@ -268,18 +268,20 @@ procedure TfrmMenu.ShowMenuAnimation; procedure TfrmMenu.SiteContextPopup(Sender: TObject; MousePos: TPoint; var Handled: Boolean); begin + AlternatURL1.Visible := False; if Sender is TSkSvg then begin //TODO needs better way for it to enable close site option if not TSkSvg(Sender).Svg.GrayScale then - FCurrentPopupCardId := Settings.Sites[TSkSvg(Sender).Tag].Id - else - FCurrentPopupCardId := 0; // hard coded way to say, site not started + begin + FCurrentPopupCardId := Settings.Sites[TSkSvg(Sender).Tag].Id; + // show alternate URL once the broser is loaded + if Trim(Settings.Sites[TSkSvg(Sender).Tag].AltUrl) <> '' then + AlternatURL1.Visible := True; - if Trim(Settings.Sites[TSkSvg(Sender).Tag].AltUrl) <> '' then - AlternatURL1.Visible := True + end else - AlternatURL1.Visible := False; + FCurrentPopupCardId := 0; // hard coded way to say, site not started end; end;