Go back to symbolic label widget alignment constants

Now that GParted requires Gtk3 there is no need to use floating point
numbers for compatibility with Gtk <= 2.22.  Replace with symbolic
alignment constants.

Relevant commit history:

*   6efa623401
    Add optional yalign argument to Utils::mk_label() method

*   be2689ad25
    Stop using deprecated widget alignment enumerators (#652044)
This commit is contained in:
Mike Fleetwood 2019-02-18 17:03:11 +00:00 committed by Curtis Gedak
parent 454ac64d19
commit 45fd146fd0
4 changed files with 17 additions and 20 deletions

View File

@ -126,7 +126,7 @@ public:
, bool use_markup = true
, bool wrap = false
, bool selectable = false
, float yalign = 0.5 /* ALIGN_CENTER */
, Gtk::Align yalign = Gtk::ALIGN_CENTER
) ;
static Glib::ustring num_to_str( Sector number ) ;
static Glib::ustring get_color( FSType filesystem );

View File

@ -314,9 +314,9 @@ void Dialog_Partition_Info::Display_Info()
{
//status
Glib::ustring str_temp ;
table->attach( *Utils::mk_label( "<b>" + Glib::ustring( _("Status:") ) + "</b>",
true, false, false, 0.0 /* ALIGN_TOP */ ),
1, 2, top, bottom, Gtk::FILL );
table->attach(*Utils::mk_label("<b>" + Glib::ustring(_("Status:")) + "</b>",
true, false, false, Gtk::ALIGN_START),
1, 2, top, bottom, Gtk::FILL);
if ( ! filesystem_accessible )
{
/* TO TRANSLATORS: Not accessible (Encrypted)
@ -433,8 +433,9 @@ void Dialog_Partition_Info::Display_Info()
filesystem_ptn.filesystem == FS_BTRFS )
{
//Members
table ->attach( * Utils::mk_label( "<b>" + Glib::ustring( _("Members:") ) + "</b>", true, false, false, 0.0 /* ALIGN_TOP */ ),
1, 2, top, bottom, Gtk::FILL ) ;
table->attach(* Utils::mk_label("<b>" + Glib::ustring(_("Members:")) + "</b>",
true, false, false, Gtk::ALIGN_START),
1, 2, top, bottom, Gtk::FILL);
std::vector<Glib::ustring> members ;
switch ( filesystem_ptn.filesystem )
@ -457,8 +458,9 @@ void Dialog_Partition_Info::Display_Info()
if ( filesystem_ptn.filesystem == FS_LVM2_PV )
{
//Logical Volumes
table ->attach( * Utils::mk_label( "<b>" + Glib::ustring( _("Logical Volumes:") ) + "</b>", true, false, false, 0.0 /* ALIGN_TOP */ ),
1, 2, top, bottom, Gtk::FILL );
table->attach(* Utils::mk_label("<b>" + Glib::ustring(_("Logical Volumes:")) + "</b>",
true, false, false, Gtk::ALIGN_START),
1, 2, top, bottom, Gtk::FILL);
std::vector<Glib::ustring> lvs = LVM2_PV_Info::get_vg_lvs( vgname );
table->attach( *Utils::mk_label( Glib::build_path( "\n", lvs ), true, false, true ),

View File

@ -57,15 +57,10 @@ Gtk::Label * Utils::mk_label( const Glib::ustring & text
, bool use_markup
, bool wrap
, bool selectable
, float yalign
, Gtk::Align yalign
)
{
//xalign 0.0 == Gtk::ALIGN_LEFT (gtkmm <= 2.22)
// == Gtk::ALIGN_START (gtkmm >= 2.24)
//yalign 0.5 == Gtk::ALIGN_CENTER
// 0.0 == Gtk::ALIGN_TOP (gtkmm <= 2.22)
// Gtk::ALIGN_START (gtkmm >= 2.24)
Gtk::Label * label = manage( new Gtk::Label( text, 0.0, yalign ) ) ;
Gtk::Label * label = manage(new Gtk::Label(text, Gtk::ALIGN_START, yalign));
label ->set_use_markup( use_markup ) ;
label ->set_line_wrap( wrap ) ;

View File

@ -3508,9 +3508,9 @@ bool Win_GParted::remove_non_empty_lvm2_pv_dialog( const OperationType optype )
1, 2, top++, bottom++, Gtk::FILL ) ;
//Members
table ->attach( * Utils::mk_label( "<b>" + Glib::ustring( members_label ) + "</b>",
true, false, false, 0.0 /* ALIGN_TOP */ ),
0, 1, top, bottom, Gtk::FILL ) ;
table->attach(* Utils::mk_label("<b>" + Glib::ustring(members_label) + "</b>",
true, false, false, Gtk::ALIGN_START),
0, 1, top, bottom, Gtk::FILL);
Glib::ustring members_str = "" ;
if ( ! members .empty() )
@ -3522,8 +3522,8 @@ bool Win_GParted::remove_non_empty_lvm2_pv_dialog( const OperationType optype )
members_str += members[i] ;
}
}
table ->attach( * Utils::mk_label( members_str, true, false, true, 0.0 /* ALIGN_TOP */ ),
1, 2, top++, bottom++, Gtk::FILL ) ;
table->attach(* Utils::mk_label(members_str, true, false, true, Gtk::ALIGN_START),
1, 2, top++, bottom++, Gtk::FILL);
dialog .add_button( Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL );
dialog .add_button( Gtk::Stock::DELETE, Gtk::RESPONSE_OK );