Formatting.

This commit is contained in:
Jeff Young 2021-10-14 20:45:38 +01:00
parent 27813e443a
commit 672b27f91a
7 changed files with 29 additions and 28 deletions

View File

@ -116,14 +116,14 @@ wxFlexGridSizer* DIALOG_ABOUT::createFlexGridSizer()
void DIALOG_ABOUT::createNotebooks()
{
createNotebookHtmlPage( m_notebook, _( "About" ), IMAGES::INFORMATION,
m_info.GetDescription() );
m_info.GetDescription() );
wxString version = GetVersionInfoData( m_titleName, true );
createNotebookHtmlPage( m_notebook, _( "Version" ), IMAGES::VERSION, version, true );
createNotebookPageByCategory( m_notebook, _( "Developers" ) , IMAGES::DEVELOPERS,
m_info.GetDevelopers() );
m_info.GetDevelopers() );
createNotebookPage( m_notebook, _( "Doc Writers" ), IMAGES::DOCWRITERS,
m_info.GetDocWriters() );
@ -308,7 +308,7 @@ void DIALOG_ABOUT::createNotebookPageByCategory( wxNotebook* aParent, const wxSt
if( sub_contributor->GetExtra() != wxEmptyString )
{
wxStaticText* mail = wxStaticTextRef( m_scrolledWindow1,
sub_contributor->GetExtra() );
sub_contributor->GetExtra() );
fgSizer1->Add( mail, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
}
else
@ -360,8 +360,7 @@ void DIALOG_ABOUT::createNotebookPageByCategory( wxNotebook* aParent, const wxSt
// Email address of contributor at third column
if ( contributor->GetExtra() != wxEmptyString )
{
wxStaticText* mail = wxStaticTextRef( m_scrolledWindow1,
contributor->GetExtra() );
wxStaticText* mail = wxStaticTextRef( m_scrolledWindow1, contributor->GetExtra() );
fgSizer1->Add( mail, 0, wxALIGN_LEFT|wxBOTTOM, 2 );
}
else
@ -395,7 +394,8 @@ void DIALOG_ABOUT::createNotebookHtmlPage( wxNotebook* aParent, const wxString&
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
auto htmlWindow = new HTML_WINDOW( panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, flags );
HTML_WINDOW* htmlWindow = new HTML_WINDOW( 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
@ -431,13 +431,9 @@ wxStaticBitmap* DIALOG_ABOUT::createStaticBitmap( wxScrolledWindow* aParent, wxB
wxDefaultPosition, wxDefaultSize, 0 );
if( aIcon )
{
bitmap->SetBitmap( *aIcon );
}
else
{
bitmap->SetBitmap( KiBitmap( BITMAPS::right ) );
}
return bitmap;
}

View File

@ -208,7 +208,8 @@ void DIALOG_COLOR_PICKER::initDefinedColors( CUSTOM_COLORS_LIST* aPredefinedColo
for( int jj = 0; jj < NBCOLORS; ++jj, grid_col++ )
{
if( grid_col * table_row_count >= NBCOLORS )
{ // the current grid row is filled, and we must fill the next grid row
{
// the current grid row is filled, and we must fill the next grid row
grid_col = 0;
grid_row++;
}
@ -617,10 +618,12 @@ void DIALOG_COLOR_PICKER::onRGBMouseDrag( wxMouseEvent& event )
return;
}
if( m_selectedCursor != &m_cursorBitmapRed &&
m_selectedCursor != &m_cursorBitmapGreen &&
m_selectedCursor != &m_cursorBitmapBlue )
if( m_selectedCursor != &m_cursorBitmapRed
&& m_selectedCursor != &m_cursorBitmapGreen
&& m_selectedCursor != &m_cursorBitmapBlue )
{
return;
}
// Adjust the HSV cursor position to follow the mouse cursor
// The cursor position is relative to the m_bitmapHSV wxBitmap center
@ -711,8 +714,10 @@ bool DIALOG_COLOR_PICKER::setHSvaluesFromCursor( const wxPoint& aMouseCursor )
double dist_from_centre = hypot( (double)mousePos.x, (double)mousePos.y );
if( dist_from_centre > half_size )
{
// Saturation cannot be calculated:
return false;
}
m_cursorBitmapHSV = mousePos;

View File

@ -33,16 +33,15 @@
DIALOG_LIST_HOTKEYS::DIALOG_LIST_HOTKEYS( EDA_BASE_FRAME* aParent, TOOL_MANAGER* aToolMgr ):
DIALOG_SHIM( aParent, wxID_ANY, _( "Hotkey List" ) )
{
const auto margin = KIUI::GetStdMargin();
auto main_sizer = new wxBoxSizer( wxVERTICAL );
const int margin = KIUI::GetStdMargin();
wxBoxSizer* main_sizer = new wxBoxSizer( wxVERTICAL );
m_hk_list = new PANEL_HOTKEYS_EDITOR( aParent, this, true );
m_hk_list->AddHotKeys( aToolMgr );
main_sizer->Add( m_hk_list, 1, wxTOP | wxLEFT | wxRIGHT | wxEXPAND, margin );
auto sdb_sizer = new wxStdDialogButtonSizer;
wxStdDialogButtonSizer* sdb_sizer = new wxStdDialogButtonSizer;
sdb_sizer->AddButton( new wxButton( this, wxID_OK ) );
sdb_sizer->Realize();

View File

@ -93,7 +93,9 @@ bool DIALOG_IMAGE_EDITOR::CheckValues()
if( !IsOK( this, wxString::Format( _( "This scale results in an image which is very large "
"(%.1f mm or %.2f in). Are you sure?" ),
25.4 / 300 * size_max, size_max /300.0 ) ) )
{
return false;
}
}
return true;

View File

@ -39,15 +39,14 @@ bool HTML_WINDOW::SetPage( const wxString& aSource )
{
m_pageSource = aSource;
wxString fgColor =
wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT ).GetAsString( wxC2S_HTML_SYNTAX );
wxString bgColor =
wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ).GetAsString( wxC2S_HTML_SYNTAX );
wxString linkColor =
wxSystemSettings::GetColour( wxSYS_COLOUR_HOTLIGHT ).GetAsString( wxC2S_HTML_SYNTAX );
wxColour fgColor = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT );
wxColour bgColor = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW );
wxColour linkColor = wxSystemSettings::GetColour( wxSYS_COLOUR_HOTLIGHT );
wxString html = wxString::Format( wxT( "<html>\n<body text='%s' bgcolor='%s' link='%s'>\n" ),
fgColor, bgColor, linkColor );
fgColor.GetAsString( wxC2S_HTML_SYNTAX ),
bgColor.GetAsString( wxC2S_HTML_SYNTAX ),
linkColor.GetAsString( wxC2S_HTML_SYNTAX ) );
html.Append( aSource );
html.Append( wxT( "\n</body>\n</html>" ) );

View File

@ -98,9 +98,9 @@ LIB_TREE::LIB_TREE( wxWindow* aParent, LIB_TABLE* aLibTable,
{
wxPoint html_size = ConvertDialogToPixels( wxPoint( 80, 80 ) );
m_details_ctrl =
new HTML_WINDOW( this, wxID_ANY, wxDefaultPosition,
wxSize( html_size.x, html_size.y ), wxHW_SCROLLBAR_AUTO );
m_details_ctrl = new HTML_WINDOW( this, wxID_ANY, wxDefaultPosition,
wxSize( html_size.x, html_size.y ),
wxHW_SCROLLBAR_AUTO );
sizer->Add( m_details_ctrl, 2, wxTOP | wxEXPAND, 5 );
}