[gparted] Remove remaining vestiges of coloured text from the partition list



commit 85b6858702ccfe654fe0e336afc5d4b675b01107
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Sun Sep 18 21:06:57 2016 +0100

    Remove remaining vestiges of coloured text from the partition list
    
    This commit stopped setting the text colours in the Partition, File
    System and Mount Point columns to avoid hard coding text colours making
    them impossible to read when using GNOME's High Contrast Inverse theme:
        ff2a6c00dd0790257f5d044b2e53dc5b60dc5f17
        Changes post gparted-0.3.6 - code recreation from Source Forge
    
        * src/TreeView_Detail.cc: Removed text_color hard coding
          - Removed hard coding of Partition and Filesystem text_color
            which was based on if partition was TYPE_UNALLOCATED.
          - Removed hard coding of Mount text_color which was based
            on if partition was busy.  Lock symbol provides this indicator.
          - Closes GParted bug #413810 - Don't hardcode text colour in
            partition list
    
    Now remove the remaining vestiges left behind.  Remove the unused color
    text and mount_text_color columns from the tree model.  Also remove
    setting of the column attributes which set the colour of the text in the
    tree view from those unused columns in the tree model.
    
    Unnecessary history.  Added by:
        b179990dc97c800567dd385aaffcfe992772012a
        show greyed-out mountpoint of unmounted partitions in the treeview
        as an improved way to identify partitions
        Bug #333027 -  Displaying unmounted partitions' default mount points
        in grey
    
    and by commit only in CVS history:
        Bart Hakvoort <...> 2004-08-22 15:06:45
        Made text in Partition column darkgrey for unallocated. this offers
        more visual difference between partitions and unallocated space

 include/TreeView_Detail.h |    5 +----
 src/TreeView_Detail.cc    |   36 +++++++++++-------------------------
 2 files changed, 12 insertions(+), 29 deletions(-)
---
diff --git a/include/TreeView_Detail.h b/include/TreeView_Detail.h
index 059fc3b..2fa7ff7 100644
--- a/include/TreeView_Detail.h
+++ b/include/TreeView_Detail.h
@@ -77,8 +77,6 @@ private:
                Gtk::TreeModelColumn<Glib::ustring> used;
                Gtk::TreeModelColumn<Glib::ustring> unused;
                Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > color ;
-               Gtk::TreeModelColumn<Glib::ustring> text_color;
-               Gtk::TreeModelColumn<Glib::ustring> mount_text_color;
                Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > icon1 ;
                Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Pixbuf> > icon2 ;
                Gtk::TreeModelColumn<Glib::ustring> flags;
@@ -89,8 +87,7 @@ private:
                {
                        add( path ); add( name ); add( filesystem ); add( mountpoint ); add( label );
                        add( size ); add( used ); add( unused ); add( color );
-                       add( text_color ); add( mount_text_color ); add( icon1 );
-                       add( icon2 ); add( flags ); add( partition_ptr );
+                       add( icon1 ); add( icon2 ); add( flags ); add( partition_ptr );
                }
        };
        
diff --git a/src/TreeView_Detail.cc b/src/TreeView_Detail.cc
index 24debb2..d303bb1 100644
--- a/src/TreeView_Detail.cc
+++ b/src/TreeView_Detail.cc
@@ -20,6 +20,10 @@
 #include "../include/PartitionLUKS.h"
 #include "../include/PartitionVector.h"
 
+#include <vector>
+#include <gtkmm/cellrenderer.h>
+#include <gtkmm/cellrenderertext.h>
+
 namespace GParted
 { 
 
@@ -43,37 +47,19 @@ TreeView_Detail::TreeView_Detail()
        append_column( _("Used"), treeview_detail_columns .used );
        append_column( _("Unused"), treeview_detail_columns .unused );
        append_column( _("Flags"), treeview_detail_columns .flags );
-       
-       //icons
+
+       // Tree view column "Partition"; add icon cells.
        get_column( 0 ) ->pack_start( treeview_detail_columns .icon2, false );
        get_column( 0 ) ->pack_start( treeview_detail_columns .icon1, false );
 
-       //PARTITION
-       //colored text in Partition column 
-       Gtk::CellRendererText *cell_renderer_text = 
-               dynamic_cast<Gtk::CellRendererText*>( get_column( 0 ) ->get_first_cell_renderer() );
-       get_column( 0 ) ->add_attribute( cell_renderer_text ->property_foreground(), 
-                                        treeview_detail_columns .text_color );
-       
-       //FILE SYSTEM
-       //file system text
+       // Tree view column "File System"; add file system text cell.
        get_column( 2 )->pack_start( treeview_detail_columns.filesystem, true );
-
-       //colored text in File System column 
-       std::vector<Gtk::CellRenderer*> renderers = get_column( 2 )->get_cell_renderers();
-       cell_renderer_text = dynamic_cast<Gtk::CellRendererText*>( renderers .back() ) ;
-       get_column( 2 )->add_attribute( cell_renderer_text->property_foreground(),
-                                       treeview_detail_columns.text_color );
-
-       //pixbuf and text are both left aligned
+       // Color pixbuf cell is left aligned.
        get_column( 2 )->get_first_cell_renderer()->property_xalign() = Gtk::ALIGN_LEFT;
+       // File system text cell is left aligned.
+       std::vector<Gtk::CellRenderer*> renderers = get_column( 2 )->get_cell_renderers();
+       Gtk::CellRendererText *cell_renderer_text = dynamic_cast<Gtk::CellRendererText*>( renderers.back() );
        cell_renderer_text ->property_xalign() = Gtk::ALIGN_LEFT ;
-       
-       //MOUNT POINT
-       //colored text in mount point column 
-       cell_renderer_text = dynamic_cast<Gtk::CellRendererText*>( get_column( 3 )->get_first_cell_renderer() 
);
-       get_column( 3 )->add_attribute( cell_renderer_text->property_foreground(),
-                                       treeview_detail_columns.mount_text_color );
 
        //set alignment of numeric columns to right
        for( short t = 5 ; t < 8 ; t++ )


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]