diff --git a/common/page_layout/ws_painter.cpp b/common/page_layout/ws_painter.cpp index c16e7f6db5..9829647d40 100644 --- a/common/page_layout/ws_painter.cpp +++ b/common/page_layout/ws_painter.cpp @@ -301,6 +301,8 @@ void KIGFX::WS_PAINTER::draw( const WS_DRAW_ITEM_TEXT* aItem, int aLayer ) const m_gal->SetStrokeColor( m_renderSettings.GetColor( aItem, aLayer ) ); m_gal->SetLineWidth( aItem->GetThickness() ); m_gal->SetTextAttributes( aItem ); + m_gal->SetIsFill( false ); + m_gal->SetIsStroke( true ); m_gal->StrokeText( aItem->GetShownText(), VECTOR2D( 0, 0 ), 0.0 ); m_gal->Restore(); } diff --git a/pagelayout_editor/design_inspector.cpp b/pagelayout_editor/design_inspector.cpp index a3fc1c2758..c05432db7f 100644 --- a/pagelayout_editor/design_inspector.cpp +++ b/pagelayout_editor/design_inspector.cpp @@ -167,11 +167,15 @@ public: }; // Column ids for m_gridListItems -#define COL_BITMAP 0 -#define COL_TYPENAME 1 -#define COL_COUNT 2 -#define COL_COMMENT 3 -#define COL_TEXTSTRING 4 +enum COL_INDEX +{ + COL_BITMAP, + COL_TYPENAME, + COL_REPEAT_NUMBER, + COL_COMMENT, + COL_TEXTSTRING, + COL_COUNT //Sentinel +}; DIALOG_INSPECTOR::DIALOG_INSPECTOR( PL_EDITOR_FRAME* aParent ) : @@ -194,6 +198,7 @@ DIALOG_INSPECTOR::~DIALOG_INSPECTOR() void DIALOG_INSPECTOR::ReCreateDesignList() { wxWindowUpdateLocker dummy( this ); // Avoid flicker when rebuilding the tree + const PAGE_INFO& page_info = m_editorFrame->GetPageLayout().GetPageSettings(); if( m_gridListItems->GetNumberRows() > 1 ) m_gridListItems->DeleteRows( 1, m_gridListItems->GetNumberRows() - 1 ); @@ -205,16 +210,18 @@ void DIALOG_INSPECTOR::ReCreateDesignList() wxFileName fn( ((PL_EDITOR_FRAME*) GetParent())->GetCurrFileName() ); if( fn.GetName().IsEmpty() ) - SetTitle( "" ); + SetTitle( "" ); else SetTitle( fn.GetName() ); - // The first item is the entire page + // The first item is the layout: Display info about the page: fmt, size... int row = 0; - GetGridList()->SetCellValue( row, COL_TYPENAME, _( "Page" ) ); - GetGridList()->SetCellValue( row, COL_COMMENT, _( "A4" ) ); - GetGridList()->SetCellValue( row, COL_COUNT, "-" ); - GetGridList()->SetCellValue( row, COL_TEXTSTRING, _( "The current page" ) ); + GetGridList()->SetCellValue( row, COL_TYPENAME, _( "Layout" ) ); + GetGridList()->SetCellValue( row, COL_COMMENT, page_info.GetType() ); // Display page format name + GetGridList()->SetCellValue( row, COL_REPEAT_NUMBER, "-" ); + wxSize page_sizeIU = m_editorFrame->GetPageSizeIU(); + GetGridList()->SetCellValue( row, COL_TEXTSTRING, wxString::Format( _( "Size: %.1fx%.1fmm" ), + Iu2Millimeter( page_sizeIU.x ), Iu2Millimeter( page_sizeIU.y ) ) ); GetGridList()->SetCellRenderer (row, COL_BITMAP, new BitmapGridCellRenderer( root_xpm ) ); GetGridList()->SetReadOnly( row, COL_BITMAP ); m_itemsList.push_back( nullptr ); // this item is not a WS_DATA_ITEM, just a pseudo item @@ -252,7 +259,7 @@ void DIALOG_INSPECTOR::ReCreateDesignList() GetGridList()->SetCellRenderer (row, COL_BITMAP, new BitmapGridCellRenderer( img ) ); GetGridList()->SetReadOnly( row, COL_BITMAP ); GetGridList()->SetCellValue( row, COL_TYPENAME,item->GetClassName() ); - GetGridList()->SetCellValue( row, COL_COUNT, + GetGridList()->SetCellValue( row, COL_REPEAT_NUMBER, wxString::Format( "%d", item->m_RepeatCount ) ); GetGridList()->SetCellValue( row, COL_COMMENT, item->m_Info ); @@ -265,6 +272,31 @@ void DIALOG_INSPECTOR::ReCreateDesignList() m_itemsList.push_back( item ); row++; } + + // Now resize the columns: + int cols_to_resize[] = + { + COL_BITMAP, COL_TYPENAME, COL_REPEAT_NUMBER, COL_COMMENT, COL_TEXTSTRING, COL_COUNT + }; + + for( int ii = 0; ; ii++ ) + { + int col = cols_to_resize[ii]; + + if( col == COL_COUNT ) + break; + + if( col == COL_BITMAP ) + { + #define BITMAP_SIZE 16 + GetGridList()->SetColMinimalWidth( col, BITMAP_SIZE*2 ); + GetGridList()->AutoSizeColumn( col, false ); + } + else + GetGridList()->AutoSizeColumn( col ); + + GetGridList()->AutoSizeColLabelSize( col ); + } } diff --git a/pagelayout_editor/dialogs/dialog_design_inspector_base.cpp b/pagelayout_editor/dialogs/dialog_design_inspector_base.cpp index 0cffa1ee03..f5c77d5f60 100644 --- a/pagelayout_editor/dialogs/dialog_design_inspector_base.cpp +++ b/pagelayout_editor/dialogs/dialog_design_inspector_base.cpp @@ -33,8 +33,8 @@ DIALOG_INSPECTOR_BASE::DIALOG_INSPECTOR_BASE( wxWindow* parent, wxWindowID id, c m_gridListItems->EnableDragColMove( false ); m_gridListItems->EnableDragColSize( true ); m_gridListItems->SetColLabelSize( 30 ); - m_gridListItems->SetColLabelValue( 0, _("Type") ); - m_gridListItems->SetColLabelValue( 1, _("Name") ); + m_gridListItems->SetColLabelValue( 0, _("-") ); + m_gridListItems->SetColLabelValue( 1, _("Type") ); m_gridListItems->SetColLabelValue( 2, _("Count") ); m_gridListItems->SetColLabelValue( 3, _("Comment") ); m_gridListItems->SetColLabelValue( 4, _("Text") ); diff --git a/pagelayout_editor/dialogs/dialog_design_inspector_base.fbp b/pagelayout_editor/dialogs/dialog_design_inspector_base.fbp index a7fd6e63b6..feafae7cdf 100644 --- a/pagelayout_editor/dialogs/dialog_design_inspector_base.fbp +++ b/pagelayout_editor/dialogs/dialog_design_inspector_base.fbp @@ -146,7 +146,7 @@ 1 wxALIGN_CENTER 30 - "Type" "Name" "Count" "Comment" "Text" + "-" "Type" "Count" "Comment" "Text" wxALIGN_CENTER 5