From c02c3ee4b5b8aeb6560366bcf66138fca9f2a3b7 Mon Sep 17 00:00:00 2001 From: Luca Bacci Date: Wed, 27 Feb 2019 16:10:37 +0100 Subject: [PATCH] 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 --- include/Win_GParted.h | 6 ++++-- src/Win_GParted.cc | 17 ++++++++++------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/include/Win_GParted.h b/include/Win_GParted.h index 49626fd7..f18850ff 100644 --- a/include/Win_GParted.h +++ b/include/Win_GParted.h @@ -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 ; diff --git a/src/Win_GParted.cc b/src/Win_GParted.cc index c0cde730..da199a31 100644 --- a/src/Win_GParted.cc +++ b/src/Win_GParted.cc @@ -93,8 +93,9 @@ Win_GParted::Win_GParted( const std::vector & 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 ) ;