Prechádzať zdrojové kódy

Bug fix: "Copy key fingerprints to clipboard" command link was scaled incorrectly

Source commit: b286435b157bb40f8523ad2a88b21894428aa1bf
Martin Prikryl 6 mesiacov pred
rodič
commit
d70637ea00

+ 1 - 1
source/forms/MessageDlg.cpp

@@ -869,7 +869,6 @@ TForm * __fastcall TMessageForm::Create(const UnicodeString & Msg,
         LinkControl->Caption = ActionAlias;
         LinkControl->Alignment = taRightJustify;
         LinkControl->Anchors = TAnchors() << akRight << akTop;
-        LinkActionLabel(LinkControl);
         LinkControl->OnClick = Result->ButtonSubmit;
         Result->FButtonSubmitEvents[LinkControl] = OnSubmit;
       }
@@ -1103,6 +1102,7 @@ TForm * __fastcall TMessageForm::Create(const UnicodeString & Msg,
   if (LinkControl != NULL)
   {
     LinkControl->Parent = Panel;
+    LinkActionLabel(LinkControl);
     LinkControl->Left = Panel->ClientWidth - HorzMargin - LinkControl->Width;
     LinkControl->Top = VertMargin + IconTextHeight + VertMargin;
     IconTextHeight += VertMargin + LinkControl->Height;

+ 2 - 0
source/windows/VCLCommon.cpp

@@ -2301,6 +2301,8 @@ void __fastcall LinkLabel(TStaticText * StaticText, UnicodeString Url,
 //---------------------------------------------------------------------------
 void __fastcall LinkActionLabel(TStaticText * StaticText)
 {
+  // Must be called only after setting Parent, as it modifies Font and hence clears ParentFont
+  DebugAssert(StaticText->Parent != NULL);
   DoLinkLabel(StaticText);
 
   StaticText->Font->Color = LinkColor;