Commit 45fd146f authored by Mike Fleetwood's avatar Mike Fleetwood Committed by Curtis Gedak

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:

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

*   be2689ad
    Stop using deprecated widget alignment enumerators (#652044)
parent 454ac64d
Pipeline #70258 passed with stages
in 33 minutes and 10 seconds
......@@ -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 );
......
......@@ -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 ),
......
......@@ -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 ) ;
......
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment