Use Gtk::Box for Win_GParted (!25)

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

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

[1] Gtkmm 3.2.0 NEWS file (actually first included in gtkmm 3.1.6
    unstable)
    https://gitlab.gnome.org/GNOME/gtkmm/blob/3.2.0/NEWS#L91
        Gtk:
        * All H* or V* specialized classes have been deprecated, to
          match the deprecations in the GTK+ C API.  You should now
          set the orientation instead.
          This includes HBox, VBox, HButtonBox, VButtonBox, HPaned,
          VPaned, HScale, VScale, HSeparator, VSeparator, HScrollbar and
          VScrollbar.

Closes !25 - Modern Gtk3 - part 1
This commit is contained in:
Luca Bacci 2019-02-27 16:10:37 +01:00 committed by Mike Fleetwood
parent 74bb981ed2
commit c02c3ee4b5
2 changed files with 14 additions and 9 deletions

View File

@ -218,8 +218,10 @@ private:
//gui stuff
Gtk::HPaned hpaned_main;
Gtk::VPaned vpaned_main;
Gtk::VBox vbox_main,vbox_info ;
Gtk::HBox hbox_toolbar, *hbox;
Gtk::Box vbox_main;
Gtk::Box vbox_info;
Gtk::Box hbox_toolbar;
Gtk::Box *hbox;
Gtk::Toolbar toolbar_main;
Gtk::MenuBar menubar_main;
Gtk::ComboBox combo_devices ;

View File

@ -93,8 +93,9 @@ Win_GParted::Win_GParted( const std::vector<Glib::ustring> & user_devices )
{
std::cout << e .what() << std::endl ;
}
//Pack the main box
// Pack the main box
vbox_main.set_orientation(Gtk::ORIENTATION_VERTICAL);
this ->add( vbox_main );
//menubar....
@ -290,7 +291,8 @@ void Win_GParted::init_menubar()
void Win_GParted::init_toolbar()
{
int index = 0 ;
//initialize and pack toolbar_main
// Initialize and pack toolbar_main
hbox_toolbar.set_orientation(Gtk::ORIENTATION_HORIZONTAL);
hbox_toolbar.pack_start( toolbar_main );
//NEW and DELETE
@ -542,7 +544,7 @@ Gtk::Menu * Win_GParted::create_format_menu()
//Add one entry to the Partition --> Format to --> (file system list) menu
void Win_GParted::create_format_menu_add_item( FSType filesystem, bool activate )
{
hbox = manage( new Gtk::HBox() ) ;
hbox = manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL));
//the colored square
hbox ->pack_start( * manage( new Gtk::Image( Utils::get_color_as_pixbuf( filesystem, 16, 16 ) ) ),
Gtk::PACK_SHRINK ) ;
@ -561,6 +563,7 @@ void Win_GParted::create_format_menu_add_item( FSType filesystem, bool activate
void Win_GParted::init_device_info()
{
vbox_info.set_orientation(Gtk::ORIENTATION_VERTICAL);
vbox_info.set_spacing( 5 );
int top = 0, bottom = 1;
@ -731,9 +734,9 @@ void Win_GParted::refresh_combo_devices()
Utils::mk_pixbuf(*this, Gtk::Stock::HARDDISK, Gtk::ICON_SIZE_LARGE_TOOLBAR);
treerow[ treeview_devices_columns .device ] = devices[ i ] .get_path() ;
treerow[ treeview_devices_columns .size ] = "(" + Utils::format_size( devices[ i ] .length, devices[ i ] .sector_size ) + ")" ;
//devices submenu....
hbox = manage( new Gtk::HBox() ) ;
// Devices submenu...
hbox = manage(new Gtk::Box(Gtk::ORIENTATION_HORIZONTAL));
hbox ->pack_start( * Utils::mk_label( devices[ i ] .get_path() ), Gtk::PACK_EXPAND_WIDGET ) ;
hbox ->pack_start( * Utils::mk_label( " (" + Utils::format_size( devices[ i ] .length, devices[ i ] .sector_size ) + ")" ),
Gtk::PACK_SHRINK ) ;