diff --git a/app/formmain.lfm b/app/formmain.lfm index 8a84e4d1e12..54eb6c913ca 100644 --- a/app/formmain.lfm +++ b/app/formmain.lfm @@ -1,11 +1,11 @@ object fmMain: TfmMain Left = 44 - Height = 518 + Height = 476 Top = 87 Width = 1236 AllowDropFiles = True Caption = 'CudaText' - ClientHeight = 518 + ClientHeight = 476 ClientWidth = 1236 Constraints.MinHeight = 200 Constraints.MinWidth = 300 @@ -28,7 +28,7 @@ object fmMain: TfmMain OnWindowStateChange = FormWindowStateChange object PanelSide: TATPanelSimple Left = 0 - Height = 518 + Height = 476 Top = 0 Width = 75 Align = alLeft @@ -39,7 +39,7 @@ object fmMain: TfmMain AnchorSideBottom.Side = asrBottom Left = 0 Height = 30 - Top = 488 + Top = 446 Width = 75 Anchors = [akLeft, akBottom] AutoSize = True @@ -53,7 +53,7 @@ object fmMain: TfmMain AnchorSideTop.Control = PanelSide AnchorSideBottom.Control = ToolbarSideMid Left = 0 - Height = 458 + Height = 416 Top = 0 Width = 75 Anchors = [akTop, akLeft, akBottom] @@ -72,7 +72,7 @@ object fmMain: TfmMain AnchorSideBottom.Control = ToolbarSideLow Left = 0 Height = 30 - Top = 458 + Top = 416 Width = 75 Anchors = [akLeft, akBottom] AutoSize = True @@ -84,7 +84,7 @@ object fmMain: TfmMain end object PanelAll: TATPanelSimple Left = 75 - Height = 518 + Height = 476 Top = 0 Width = 1161 Align = alClient @@ -102,13 +102,13 @@ object fmMain: TfmMain end object PanelMain: TATPanelSimple Left = 0 - Height = 494 + Height = 452 Top = 24 Width = 1161 Align = alClient object PanelEditors: TATPanelSimple Left = 0 - Height = 494 + Height = 452 Top = 0 Width = 1161 Align = alClient @@ -726,6 +726,12 @@ object fmMain: TfmMain OnPopup = PopupTextPopup Left = 560 Top = 96 + object mnuTextOpenUrl: TMenuItem + Caption = 'Open URL' + end + object mnuTextSepURL: TMenuItem + Caption = '-' + end object mnuTextUndo: TMenuItem Caption = 'Undo' end @@ -756,9 +762,6 @@ object fmMain: TfmMain object mnuTextGotoDef: TMenuItem Caption = 'Go to definition' end - object mnuTextOpenUrl: TMenuItem - Caption = 'Open URL' - end end object TimerTooltip: TTimer Enabled = False diff --git a/app/formmain.pas b/app/formmain.pas index 3f657e19100..0a103a7cae5 100644 --- a/app/formmain.pas +++ b/app/formmain.pas @@ -444,6 +444,7 @@ TfmMain = class(TForm) mnuTextSep2: TMenuItem; mnuTextSel: TMenuItem; mnuTextGotoDef: TMenuItem; + mnuTextSepUrl: TMenuItem; TimerMouseStop: TTimer; TimerStatusWork: TTimer; TimerAppIdle: TIdleTimer; @@ -8186,7 +8187,7 @@ procedure TfmMain.PopupTextPopup(Sender: TObject); UpdateMenuItemHotkey(mnuTextDelete, cCommand_TextDeleteSelection); UpdateMenuItemHotkey(mnuTextSel, cCommand_SelectAll); UpdateMenuItemHotkey(mnuTextGotoDef, cmd_GotoDefinition); - UpdateMenuItemHotkey(mnuTextOpenUrl, cmd_LinkAtCaret_Open); + UpdateMenuItemHotkey(mnuTextOpenUrl, cmd_LinkAtPopup_Open); Ed:= CurrentEditor; @@ -8206,7 +8207,11 @@ procedure TfmMain.PopupTextPopup(Sender: TObject); mnuTextRedo.Enabled:= not Ed.ModeReadOnly and (Ed.RedoCount>0); if Assigned(mnuTextOpenUrl) then - mnuTextOpenUrl.Enabled:= EditorGetLinkAtCaret(Ed)<>''; + begin + mnuTextOpenUrl.Visible:= EditorGetLinkAtScreenCoord(Ed, PopupText.PopupPoint)<>''; + if Assigned(mnuTextSepUrl) then + mnuTextSepUrl.Visible:= mnuTextOpenUrl.Visible; + end; end;