Add text colour to Edit Text & Graphics Properties.

Fixes https://gitlab.com/kicad/code/kicad/issues/11459
This commit is contained in:
Jeff Young 2022-05-03 22:55:35 +01:00
parent 7eeefdb3c5
commit e80c5a4e4e
4 changed files with 129 additions and 13 deletions

View File

@ -126,6 +126,8 @@ DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS( SCH_
m_lineStyle->Append( DEFAULT_STYLE );
m_lineStyle->Append( INDETERMINATE_ACTION );
m_textColorSwatch->SetSwatchColor( COLOR4D::UNSPECIFIED, false );
m_textColorSwatch->SetDefaultColor( COLOR4D::UNSPECIFIED );
m_colorSwatch->SetSwatchColor( COLOR4D::UNSPECIFIED, false );
m_colorSwatch->SetDefaultColor( COLOR4D::UNSPECIFIED );
m_fillColorSwatch->SetSwatchColor( COLOR4D::UNSPECIFIED, false );
@ -260,6 +262,9 @@ void DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS::processItem( const SCH_SHEET_PATH& aS
if( !m_textSize.IsIndeterminate() )
eda_text->SetTextSize( wxSize( m_textSize.GetValue(), m_textSize.GetValue() ) );
if( m_setTextColor->GetValue() )
eda_text->SetTextColor( m_textColorSwatch->GetSwatchColor() );
if( m_hAlign->GetStringSelection() != INDETERMINATE_ACTION )
eda_text->SetHorizJustify( EDA_TEXT::MapHorizJustify( m_hAlign->GetSelection() - 1 ) );

View File

@ -182,11 +182,14 @@ DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_BASE::DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_
fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 );
m_setTextColor = new wxCheckBox( m_specifiedValues, wxID_ANY, _("Text color:"), wxDefaultPosition, wxDefaultSize, 0 );
fgSizer1->Add( m_setTextColor, 0, wxALL, 5 );
fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 );
m_textColorSwatch = new COLOR_SWATCH( m_specifiedValues, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
m_textColorSwatch->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
m_textColorSwatch->SetMinSize( wxSize( 48,24 ) );
fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 );
fgSizer1->Add( m_textColorSwatch, 0, wxALL, 5 );
m_textSizeLabel = new wxStaticText( m_specifiedValues, wxID_ANY, _("Text size:"), wxDefaultPosition, wxDefaultSize, 0 );
m_textSizeLabel->Wrap( -1 );

View File

@ -1938,22 +1938,128 @@
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Text color:</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_setTextColor</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="width">0</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="spacer" expanded="1">
<property name="height">0</property>
<property name="flag">wxALL</property>
<property name="proportion">0</property>
<object class="CustomControl" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="class">COLOR_SWATCH</property>
<property name="close_button">1</property>
<property name="construction"></property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="declaration"></property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg">wxSYS_COLOUR_WINDOW</property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="include"></property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">48,24</property>
<property name="moveable">1</property>
<property name="name">m_textColorSwatch</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="width">0</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="settings"></property>
<property name="show">1</property>
<property name="size"></property>
<property name="subclass">COLOR_SWATCH; widgets/color_swatch.h; Not forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="0">

View File

@ -67,6 +67,8 @@ class DIALOG_GLOBAL_EDIT_TEXT_AND_GRAPHICS_BASE : public DIALOG_SHIM
wxPanel* m_specifiedValues;
wxStaticText* m_fontLabel;
FONT_CHOICE* m_fontCtrl;
wxCheckBox* m_setTextColor;
COLOR_SWATCH* m_textColorSwatch;
wxStaticText* m_textSizeLabel;
wxTextCtrl* m_textSizeCtrl;
wxStaticText* m_textSizeUnits;