fixed a minor annoying with treeviewdrawing.(Really minor ;) )

* src/Win_GParted.cc,
  src/TreeView_Detail.cc: fixed a minor annoying with treeviewdrawing.(Really minor ;) )
This commit is contained in:
Bart Hakvoort 2004-12-02 20:29:42 +00:00
parent 9e1f785812
commit d907a129ab
3 changed files with 23 additions and 18 deletions

View File

@ -1,3 +1,8 @@
2004-12-02 Bart Hakvoort <gparted@users.sf.net>
* src/Win_GParted.cc,
src/TreeView_Detail.cc: fixed a minor annoying with treeviewdrawing.(Really minor ;) )
2004-12-01 Bart Hakvoort <gparted@users.sf.net> 2004-12-01 Bart Hakvoort <gparted@users.sf.net>
* src/Dialog_Partition_New.cc, * src/Dialog_Partition_New.cc,

View File

@ -37,35 +37,35 @@ TreeView_Detail::TreeView_Detail( )
//status_icon //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) //colored text in Partition column (used for darkgrey unallocated)
Gtk::CellRendererText *cell_renderer_text = dynamic_cast<Gtk::CellRendererText*>( this->get_column( 0 ) ->get_first_cell_renderer() ); Gtk::CellRendererText *cell_renderer_text = dynamic_cast<Gtk::CellRendererText*>( this->get_column( 0 ) ->get_first_cell_renderer( ) );
this->get_column( 0 ) ->add_attribute(cell_renderer_text->property_foreground(), treeview_detail_columns.text_color); this->get_column( 0 ) ->add_attribute( cell_renderer_text ->property_foreground( ), treeview_detail_columns .text_color );
//colored square in Type column //colored square in Filesystem column
cell_renderer_text = dynamic_cast<Gtk::CellRendererText*>( this->get_column( 1 ) ->get_first_cell_renderer() ); cell_renderer_text = dynamic_cast<Gtk::CellRendererText*>( this ->get_column( 1 ) ->get_first_cell_renderer( ) );
this->get_column( 1 ) ->add_attribute(cell_renderer_text->property_foreground(), treeview_detail_columns. color); this ->get_column( 1 ) ->add_attribute( cell_renderer_text ->property_foreground( ), treeview_detail_columns. color);
//colored text in Type column //colored text in Filesystem column
this->get_column( 1 ) ->pack_start( treeview_detail_columns .type, false ); 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... //this sucks :) get_cell_renderers doesn't return them in some order, so i have to check manually...
std::vector <Gtk::CellRenderer *> renderers = this->get_column( 1 ) ->get_cell_renderers( ) ; std::vector <Gtk::CellRenderer *> renderers = this ->get_column( 1 ) ->get_cell_renderers( ) ;
if ( renderers .front() != this->get_column( 1 ) ->get_first_cell_renderer() ) if ( renderers .front( ) != this ->get_column( 1 ) ->get_first_cell_renderer( ) )
cell_renderer_text = dynamic_cast<Gtk::CellRendererText*>( renderers .front() ) ; cell_renderer_text = dynamic_cast<Gtk::CellRendererText*>( renderers .front( ) ) ;
else else
cell_renderer_text = dynamic_cast<Gtk::CellRendererText*>( renderers .back() ) ; cell_renderer_text = dynamic_cast<Gtk::CellRendererText*>( 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 //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<Gtk::CellRendererText*>( this->get_column( t ) ->get_first_cell_renderer() ); cell_renderer_text = dynamic_cast<Gtk::CellRendererText*>( this ->get_column( t ) ->get_first_cell_renderer( ) );
cell_renderer_text->property_xalign () = 1; cell_renderer_text ->property_xalign( ) = 1;
} }
} }
@ -92,6 +92,8 @@ void TreeView_Detail::Load_Partitions( const std::vector<Partition> & partitions
//show logical partitions ( if any ) //show logical partitions ( if any )
this ->expand_all( ); this ->expand_all( );
this ->columns_autosize( );
} }
void TreeView_Detail::Set_Selected( const Partition & partition ) void TreeView_Detail::Set_Selected( const Partition & partition )

View File

@ -672,8 +672,6 @@ void Win_GParted::open_operationslist()
void Win_GParted::close_operationslist() void Win_GParted::close_operationslist()
{ {
treeview_detail .columns_autosize() ; //seemed a nice place for it..
int x,y; this ->get_size( x, y ); int x,y; this ->get_size( x, y );
y -= 210 ; //height of whole app - menubar - visualdisk - statusbar .... y -= 210 ; //height of whole app - menubar - visualdisk - statusbar ....
for ( int t = vpaned_main .get_position( ) ; t < y ; t+=5 ) for ( int t = vpaned_main .get_position( ) ; t < y ; t+=5 )