From d3d74b36bd58b425d9254297718c3af178b702db Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Sat, 22 Feb 2020 11:23:47 -0500 Subject: [PATCH] Allow version selection; make buttons the same size --- common/dialog_about/dialog_about.cpp | 10 ++++++---- common/dialog_about/dialog_about.h | 3 ++- common/dialog_about/dialog_about_base.cpp | 4 ++-- common/dialog_about/dialog_about_base.fbp | 4 ++-- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/common/dialog_about/dialog_about.cpp b/common/dialog_about/dialog_about.cpp index ed700e316d..3201bef54c 100644 --- a/common/dialog_about/dialog_about.cpp +++ b/common/dialog_about/dialog_about.cpp @@ -159,7 +159,7 @@ void DIALOG_ABOUT::createNotebooks() wxString version; buildVersionInfoData( version, true ); - createNotebookHtmlPage( m_auiNotebook, _( "Version" ), m_picVersion, version ); + createNotebookHtmlPage( m_auiNotebook, _( "Version" ), m_picVersion, version, true ); createNotebookPage( m_auiNotebook, _( "Developers" ) , m_picDevelopers, m_info.GetDevelopers() ); @@ -396,7 +396,8 @@ void DIALOG_ABOUT::createNotebookPageByCategory(wxAuiNotebook* aParent, const wx void DIALOG_ABOUT::createNotebookHtmlPage( wxAuiNotebook* aParent, const wxString& aCaption, - const wxBitmap& aIcon, const wxString& html ) + const wxBitmap& aIcon, const wxString& html, + bool aSelection ) { wxPanel* panel = new wxPanel( aParent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); @@ -417,9 +418,10 @@ void DIALOG_ABOUT::createNotebookHtmlPage( wxAuiNotebook* aParent, const wxStrin // end of HTML structure indicated by closing tags htmlPage.Append( wxT( "" ) ); + int flags = aSelection ? wxHW_SCROLLBAR_AUTO : ( wxHW_SCROLLBAR_AUTO | wxHW_NO_SELECTION ); + // the HTML page is going to be created with previously created HTML content - wxHtmlWindow* htmlWindow = new wxHtmlWindow( panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, - wxHW_SCROLLBAR_AUTO|wxHW_NO_SELECTION ); + auto htmlWindow = new wxHtmlWindow( panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, flags ); // HTML font set to font properties as they are used for widgets to have an unique look // under different platforms with HTML diff --git a/common/dialog_about/dialog_about.h b/common/dialog_about/dialog_about.h index b4a097fecc..267de914e5 100644 --- a/common/dialog_about/dialog_about.h +++ b/common/dialog_about/dialog_about.h @@ -91,7 +91,8 @@ private: void createNotebookHtmlPage( wxAuiNotebook* aParent, const wxString& aCaption, const wxBitmap& aIcon, - const wxString& aHtmlMessage ); + const wxString& aHtmlMessage, + bool aSelection = false ); wxStaticText* wxStaticTextMail( wxScrolledWindow* aParent, const wxString& email ); wxStaticBitmap* createStaticBitmap( wxScrolledWindow* aParent, wxBitmap* icon ); diff --git a/common/dialog_about/dialog_about_base.cpp b/common/dialog_about/dialog_about_base.cpp index 89d1adc495..10b2fc23ef 100644 --- a/common/dialog_about/dialog_about_base.cpp +++ b/common/dialog_about/dialog_about_base.cpp @@ -58,12 +58,12 @@ DIALOG_ABOUT_BASE::DIALOG_ABOUT_BASE( wxWindow* parent, wxWindowID id, const wxS m_btCopyVersionInfo = new wxButton( this, wxID_COPY, _("&Copy Version Info"), wxDefaultPosition, wxDefaultSize, 0 ); m_btCopyVersionInfo->SetToolTip( _("Copy KiCad version info to the clipboard") ); - bSizer5->Add( m_btCopyVersionInfo, 0, wxALL, 5 ); + bSizer5->Add( m_btCopyVersionInfo, 0, wxALL|wxEXPAND, 5 ); m_btReportBug = new wxButton( this, wxID_COPY, _("&Report Bug"), wxDefaultPosition, wxDefaultSize, 0 ); m_btReportBug->SetToolTip( _("Report a problem with KiCad") ); - bSizer5->Add( m_btReportBug, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); + bSizer5->Add( m_btReportBug, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 5 ); bSizer5->Add( 0, 0, 1, wxEXPAND, 5 ); diff --git a/common/dialog_about/dialog_about_base.fbp b/common/dialog_about/dialog_about_base.fbp index 90063bb602..045aa984f7 100644 --- a/common/dialog_about/dialog_about_base.fbp +++ b/common/dialog_about/dialog_about_base.fbp @@ -411,7 +411,7 @@ 5 - wxALL + wxALL|wxEXPAND 0 1 @@ -484,7 +484,7 @@ 5 - wxALIGN_CENTER_HORIZONTAL|wxALL + wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND 0 1