Use Gtk::Box for Dialog_Partition_Info (!25)

Gtk::HBox and Gtk::VBox were deprecated in Gtkmm 3.2.  Replace with
plain Gtk::Box.

This commit makes the change for Dialog_Partition_Info.{h,cc}.

Closes !25 - Modern Gtk3 - part 1
This commit is contained in:
Luca Bacci 2019-02-27 16:26:58 +01:00 committed by Mike Fleetwood
parent bfeb123462
commit 363868bf5c
2 changed files with 8 additions and 7 deletions

View File

@ -50,10 +50,10 @@ private:
const Partition & partition; // (Alias to element in Win_GParted::display_partitions[] vector). const Partition & partition; // (Alias to element in Win_GParted::display_partitions[] vector).
Gtk::HBox *hbox ; Gtk::Box *hbox;
Gtk::DrawingArea drawingarea ; Gtk::DrawingArea drawingarea ;
Gtk::Frame *frame ; Gtk::Frame *frame ;
Gtk::VBox info_msg_vbox ; Gtk::Box info_msg_vbox;
Gtk::ScrolledWindow info_scrolled ; Gtk::ScrolledWindow info_scrolled ;
Glib::RefPtr<Pango::Layout> pango_layout; Glib::RefPtr<Pango::Layout> pango_layout;

View File

@ -47,11 +47,12 @@ Dialog_Partition_Info::Dialog_Partition_Info( const Partition & partition ) : pa
init_drawingarea() ; init_drawingarea() ;
//place info and optional messages in scrollable window // Place info and optional messages in scrollable window
info_msg_vbox.set_orientation(Gtk::ORIENTATION_VERTICAL);
info_msg_vbox .set_border_width( 6 ) ; info_msg_vbox .set_border_width( 6 ) ;
info_scrolled .set_policy( Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC ) ; info_scrolled .set_policy( Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC ) ;
info_scrolled .add( info_msg_vbox ) ; info_scrolled .add( info_msg_vbox ) ;
//As Gtk::VBox widget info_msg_vbox doesn't have a native scrolling capability a // As Gtk::Box widget info_msg_vbox doesn't have a native scrolling capability a
// Gtk::Viewport is automatically created to contain it when it is added to the // Gtk::Viewport is automatically created to contain it when it is added to the
// Gtk::ScrolledWindow widget info_scrolled. The Viewport widget is created with // Gtk::ScrolledWindow widget info_scrolled. The Viewport widget is created with
// shadow type GTK_SHADOW_IN by default. Change to GTK_SHADOW_NONE. // shadow type GTK_SHADOW_IN by default. Change to GTK_SHADOW_NONE.
@ -74,7 +75,7 @@ Dialog_Partition_Info::Dialog_Partition_Info( const Partition & partition ) : pa
{ {
Gtk::Image* image = Utils::mk_image(Gtk::Stock::DIALOG_WARNING, Gtk::ICON_SIZE_BUTTON); Gtk::Image* image = Utils::mk_image(Gtk::Stock::DIALOG_WARNING, Gtk::ICON_SIZE_BUTTON);
hbox = manage(new Gtk::HBox()); hbox = manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL));
hbox->pack_start(*image, Gtk::PACK_SHRINK); hbox->pack_start(*image, Gtk::PACK_SHRINK);
} }
@ -105,7 +106,7 @@ Dialog_Partition_Info::Dialog_Partition_Info( const Partition & partition ) : pa
concatenated_messages += "<i>" + messages[i].substr( 0, take ) + "</i>"; concatenated_messages += "<i>" + messages[i].substr( 0, take ) + "</i>";
} }
} }
Gtk::VBox *vbox( manage( new Gtk::VBox() ) ) ; Gtk::Box *vbox = manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL));
vbox ->set_border_width( 5 ) ; vbox ->set_border_width( 5 ) ;
vbox->pack_start( *Utils::mk_label( concatenated_messages, true, true, true ), Gtk::PACK_SHRINK ); vbox->pack_start( *Utils::mk_label( concatenated_messages, true, true, true ), Gtk::PACK_SHRINK );
frame ->add( *vbox ) ; frame ->add( *vbox ) ;
@ -169,7 +170,7 @@ void Dialog_Partition_Info::init_drawingarea()
frame ->set_shadow_type( Gtk::SHADOW_ETCHED_OUT ) ; frame ->set_shadow_type( Gtk::SHADOW_ETCHED_OUT ) ;
frame ->set_border_width( 10 ) ; frame ->set_border_width( 10 ) ;
hbox = manage( new Gtk::HBox() ) ; hbox = manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL));
hbox ->pack_start( *frame, Gtk::PACK_EXPAND_PADDING ) ; hbox ->pack_start( *frame, Gtk::PACK_EXPAND_PADDING ) ;
this ->get_vbox() ->pack_start( *hbox, Gtk::PACK_SHRINK ) ; this ->get_vbox() ->pack_start( *hbox, Gtk::PACK_SHRINK ) ;