From d907a129ab6b69162fe2c555bad8c05c331b4139 Mon Sep 17 00:00:00 2001 From: Bart Hakvoort Date: Thu, 2 Dec 2004 20:29:42 +0000 Subject: [PATCH] fixed a minor annoying with treeviewdrawing.(Really minor ;) ) * src/Win_GParted.cc, src/TreeView_Detail.cc: fixed a minor annoying with treeviewdrawing.(Really minor ;) ) --- ChangeLog | 5 +++++ src/TreeView_Detail.cc | 34 ++++++++++++++++++---------------- src/Win_GParted.cc | 2 -- 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3061af12..7b1107ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-12-02 Bart Hakvoort + + * src/Win_GParted.cc, + src/TreeView_Detail.cc: fixed a minor annoying with treeviewdrawing.(Really minor ;) ) + 2004-12-01 Bart Hakvoort * src/Dialog_Partition_New.cc, diff --git a/src/TreeView_Detail.cc b/src/TreeView_Detail.cc index ce7c3f69..10e25027 100644 --- a/src/TreeView_Detail.cc +++ b/src/TreeView_Detail.cc @@ -37,35 +37,35 @@ TreeView_Detail::TreeView_Detail( ) //status_icon - this->get_column( 0 ) ->pack_start( treeview_detail_columns.status_icon,false ); + this->get_column( 0 ) ->pack_start( treeview_detail_columns.status_icon, false ); //colored text in Partition column (used for darkgrey unallocated) - Gtk::CellRendererText *cell_renderer_text = dynamic_cast( this->get_column( 0 ) ->get_first_cell_renderer() ); - this->get_column( 0 ) ->add_attribute(cell_renderer_text->property_foreground(), treeview_detail_columns.text_color); + Gtk::CellRendererText *cell_renderer_text = dynamic_cast( this->get_column( 0 ) ->get_first_cell_renderer( ) ); + this->get_column( 0 ) ->add_attribute( cell_renderer_text ->property_foreground( ), treeview_detail_columns .text_color ); - //colored square in Type column - cell_renderer_text = dynamic_cast( this->get_column( 1 ) ->get_first_cell_renderer() ); - this->get_column( 1 ) ->add_attribute(cell_renderer_text->property_foreground(), treeview_detail_columns. color); + //colored square in Filesystem column + cell_renderer_text = dynamic_cast( this ->get_column( 1 ) ->get_first_cell_renderer( ) ); + this ->get_column( 1 ) ->add_attribute( cell_renderer_text ->property_foreground( ), treeview_detail_columns. color); - //colored text in Type column - this->get_column( 1 ) ->pack_start( treeview_detail_columns .type, false ); + //colored text in Filesystem column + this ->get_column( 1 ) ->pack_start( treeview_detail_columns .type, true ); //this sucks :) get_cell_renderers doesn't return them in some order, so i have to check manually... - std::vector renderers = this->get_column( 1 ) ->get_cell_renderers( ) ; + std::vector renderers = this ->get_column( 1 ) ->get_cell_renderers( ) ; - if ( renderers .front() != this->get_column( 1 ) ->get_first_cell_renderer() ) - cell_renderer_text = dynamic_cast( renderers .front() ) ; + if ( renderers .front( ) != this ->get_column( 1 ) ->get_first_cell_renderer( ) ) + cell_renderer_text = dynamic_cast( renderers .front( ) ) ; else - cell_renderer_text = dynamic_cast( renderers .back() ) ; + cell_renderer_text = dynamic_cast( renderers .back( ) ) ; - this->get_column( 1 ) ->add_attribute(cell_renderer_text->property_foreground(), treeview_detail_columns. text_color); + this ->get_column( 1 ) ->add_attribute(cell_renderer_text ->property_foreground( ), treeview_detail_columns .text_color ); //set alignment of numeric columns to right - for( short t=2;t<5;t++) + for( short t = 2 ; t < 5 ; t++ ) { - cell_renderer_text = dynamic_cast( this->get_column( t ) ->get_first_cell_renderer() ); - cell_renderer_text->property_xalign () = 1; + cell_renderer_text = dynamic_cast( this ->get_column( t ) ->get_first_cell_renderer( ) ); + cell_renderer_text ->property_xalign( ) = 1; } } @@ -92,6 +92,8 @@ void TreeView_Detail::Load_Partitions( const std::vector & partitions //show logical partitions ( if any ) this ->expand_all( ); + + this ->columns_autosize( ); } void TreeView_Detail::Set_Selected( const Partition & partition ) diff --git a/src/Win_GParted.cc b/src/Win_GParted.cc index b3915553..851ab0f8 100644 --- a/src/Win_GParted.cc +++ b/src/Win_GParted.cc @@ -672,8 +672,6 @@ void Win_GParted::open_operationslist() void Win_GParted::close_operationslist() { - treeview_detail .columns_autosize() ; //seemed a nice place for it.. - int x,y; this ->get_size( x, y ); y -= 210 ; //height of whole app - menubar - visualdisk - statusbar .... for ( int t = vpaned_main .get_position( ) ; t < y ; t+=5 )