Skip to content

Commit

Permalink
Fix show alternate url option only on browser present
Browse files Browse the repository at this point in the history
  • Loading branch information
vhanla committed Aug 14, 2023
1 parent 5c1c4d5 commit 2796981
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions menu.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ object frmMenu: TfrmMenu
end
object AlternatURL1: TMenuItem
Caption = 'Alternat URL'
Visible = False
OnClick = AlternatURL1Click
end
end
Expand Down
14 changes: 8 additions & 6 deletions menu.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 2796981

Please sign in to comment.