From e254d8cd29262548dbacc58d13f834aac70d8963 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Sat, 11 Jul 2020 22:42:46 +0000 Subject: [PATCH] Fix about dialog padding on GTK builds. As expected, the required padding difference between wxStaticText and wxHyperlinkCtrl varies depending on the platform. Restore the original padding which was correct for windows and add the extra padding required for GTK builds. Someone with MacOS should verify if the padding looks correct and change the padding for MacOS as required. --- common/dialog_about/dialog_about.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/common/dialog_about/dialog_about.cpp b/common/dialog_about/dialog_about.cpp index c544ffd021..f30d3bdd82 100644 --- a/common/dialog_about/dialog_about.cpp +++ b/common/dialog_about/dialog_about.cpp @@ -197,6 +197,18 @@ void DIALOG_ABOUT::createNotebookPageByCategory( wxAuiNotebook* aParent, const w const wxBitmap& aIcon, const CONTRIBUTORS& aContributors) { + // The left justification between wxStaticText and wxHyperlinkCtrl is different so + // we must pad to make the alignment look decent. + // + // @todo Just make all of the contributor lists HTML so the alignment is consistent. + wxString padding; + + // Of course the padding is different depending on the platform so we adjust the + // padding accordingly. +#if defined( __WXGTK__ ) + padding += " "; +#endif + wxBoxSizer* bSizer = new wxBoxSizer( wxHORIZONTAL ); wxScrolledWindow* m_scrolledWindow1 = new wxScrolledWindow( aParent, wxID_ANY, @@ -257,7 +269,7 @@ void DIALOG_ABOUT::createNotebookPageByCategory( wxAuiNotebook* aParent, const w if( sub_contributor->GetUrl().IsEmpty() ) { ctrl = new wxStaticText( m_scrolledWindow1, wxID_ANY, - wxT( " • " ) + sub_contributor->GetName(), + padding + wxT( "• " ) + sub_contributor->GetName(), wxDefaultPosition, wxDefaultSize, 0 ); } @@ -268,7 +280,8 @@ void DIALOG_ABOUT::createNotebookPageByCategory( wxAuiNotebook* aParent, const w wxT( "• " ) + sub_contributor->GetName(), sub_contributor->GetUrl(), wxDefaultPosition, - wxDefaultSize ); + wxDefaultSize, + wxBORDER_NONE | wxHL_CONTEXTMENU | wxHL_ALIGN_LEFT ); } m_staticText1->Wrap( -1 );