diff --git a/include/Dialog_Partition_Name.h b/include/Dialog_Partition_Name.h index 31627d27..02f05df9 100644 --- a/include/Dialog_Partition_Name.h +++ b/include/Dialog_Partition_Name.h @@ -20,9 +20,8 @@ #include "Partition.h" #include "i18n.h" +#include #include -#include -#include #include namespace GParted diff --git a/src/Dialog_Partition_Name.cc b/src/Dialog_Partition_Name.cc index da2b5cda..dcf79e99 100644 --- a/src/Dialog_Partition_Name.cc +++ b/src/Dialog_Partition_Name.cc @@ -17,6 +17,11 @@ #include "Dialog_Partition_Name.h" #include "Partition.h" +#include +#include +#include +#include + namespace GParted { @@ -29,38 +34,28 @@ Dialog_Partition_Name::Dialog_Partition_Name( const Partition & partition, int m /* TO TRANSLATORS: dialog title, looks like Set partition name on /dev/hda3 */ this->set_title( String::ucompose( _("Set partition name on %1"), partition.get_path() ) ); - { - int top = 0, bottom = 1; + // HBox to hole the label and entry box line + Gtk::HBox *hbox( manage( new Gtk::HBox() ) ); + hbox->set_border_width( 5 ); + hbox->set_spacing( 10 ); + get_vbox()->pack_start( *hbox, Gtk::PACK_SHRINK ); - // Create table to hold name and entry box - Gtk::Table *table( manage( new Gtk::Table() ) ); + // Only line: "Name: [EXISTINGNAME ]" + hbox->pack_start( *Utils::mk_label( "" + Glib::ustring(_("Name:")) + "" ), + Gtk::PACK_SHRINK ); - table->set_border_width( 5 ); - table->set_col_spacings( 10 ); - get_vbox()->pack_start( *table, Gtk::PACK_SHRINK ); - table->attach( *Utils::mk_label( "" + Glib::ustring(_("Name:")) + "" ), - 0, 1, - top, bottom, - Gtk::FILL ); - // Create text entry box - entry = manage( new Gtk::Entry() ); + entry = manage( new Gtk::Entry() ); + // NOTE: This limits the Gtk::Entry size in UTF-8 characters but partition names + // are defined in terms of ASCII characters, or for GPT, UTF-16LE code points. + // See Utils::get_max_partition_name_length(). So for certain extended characters + // this limit will be too generous. + entry->set_max_length( max_length ); - // NOTE: This limits the Gtk::Entry size in UTF-8 characters but partition - // names are defined in terms of ASCII characters, or for GPT, UTF-16LE - // code points. See Utils::get_max_partition_name_length(). So for - // certain extended characters this limit will be too generous. - entry->set_max_length( max_length ); - - entry->set_width_chars( 30 ); - entry->set_activates_default( true ); - entry->set_text( partition.name ); - entry->select_region( 0, entry->get_text_length() ); - // Add entry box to table - table->attach( *entry, - 1, 2, - top++, bottom++, - Gtk::FILL ); - } + entry->set_width_chars( 30 ); + entry->set_activates_default( true ); + entry->set_text( partition.name ); + entry->select_region( 0, entry->get_text_length() ); + hbox->pack_start( *entry, Gtk::PACK_SHRINK ); this->add_button( Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL ); this->add_button( Gtk::Stock::OK, Gtk::RESPONSE_OK );