[gparted] prepare-for-gtk3: Prepare for removal of Gtk::Widget::modify_fg() (#7)



commit 53793527668a344fe54ceb61a1afdc39c24c5c45
Author: Luca Bacci <luca bacci982 gmail com>
Date:   Thu Aug 9 09:41:09 2018 +0200

    prepare-for-gtk3: Prepare for removal of Gtk::Widget::modify_fg() (#7)
    
    The Gtk::Widget::modify_fs() API was removed in Gtkmm3 [1] and also
    there is no direct replacement.  GParted uses this in one place.  So
    instead use the C gtk_widget_modify_fg() version that is still present
    in Gtk3.
    
    This is just a temporary change to port GParted to Gtk3.  In future this
    will be replaced as part of the switch from Gdk::Color to Gtk::RGBA,
    since Gdk::Color was deprecated in Gtkmm 3.10 [2].
    
    Reference:
    
    [1] https://gitlab.gnome.org/GNOME/gtkmm/commit/ee432e21901c8ee7f68f6562c46f9e5e6ef17de7
        commit message "... Remove the modify_*() methods, ..."
    
    [2] Gtkmm 3.10 Gdk::Color Class Reference
        https://developer.gnome.org/gtkmm/3.10/classGdk_1_1Color.html#details
            Deprecated:
            Use Gdk::RGBA instead.
    
    Closes #7 - Port to Gtk3

 src/Dialog_Rescue_Data.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/Dialog_Rescue_Data.cc b/src/Dialog_Rescue_Data.cc
index 3d7cd4ac..2f8a03ed 100644
--- a/src/Dialog_Rescue_Data.cc
+++ b/src/Dialog_Rescue_Data.cc
@@ -19,6 +19,7 @@
 #include "Dialog_Rescue_Data.h"
 #include "Partition.h"
 
+#include <gtk/gtk.h>
 #include <gtkmm/messagedialog.h>
 #include <gtkmm/stock.h>
 #include <gtkmm/checkbutton.h>
@@ -67,7 +68,7 @@ void Dialog_Rescue_Data::draw_dialog()
                
                Gtk::Label *inconsis_label=manage(Utils::mk_label(msg_label));
                Gdk::Color c( "red" );
-               inconsis_label->modify_fg(Gtk::STATE_NORMAL, c );
+               gtk_widget_modify_fg(GTK_WIDGET(inconsis_label->gobj()), GTK_STATE_NORMAL, c.gobj());
                this->get_vbox()->pack_end(*inconsis_label, Gtk::PACK_SHRINK, 5);
        }
        message->append("</b></big>");


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