From bc79bd9286fce1b394f1cbd803910c83313151dd Mon Sep 17 00:00:00 2001 From: Valeriy Kamyshniy Date: Wed, 19 Nov 2014 00:29:02 +0200 Subject: [PATCH] [Summary] Adding attributes for Gtk::Entry --- gtk2_ardour/waves_ui.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/gtk2_ardour/waves_ui.cc b/gtk2_ardour/waves_ui.cc index e5fd1d667e..10dad9afe5 100644 --- a/gtk2_ardour/waves_ui.cc +++ b/gtk2_ardour/waves_ui.cc @@ -705,6 +705,23 @@ WavesUI::set_attributes (Gtk::Widget& widget, const XMLNode& definition, const X } } + Gtk::Entry* entry = dynamic_cast (&widget); + if (entry) { + property = xml_property (definition, "horzalignment", styles, "center"); + std::transform(property.begin(), property.end(), property.begin(), ::tolower); + Gtk::AlignmentEnum xalign = Gtk::ALIGN_CENTER; + if (property == "start") { + xalign = Gtk::ALIGN_START; + } else if (property == "end") { + xalign = Gtk::ALIGN_END; + } else if (property == "center") { + xalign = Gtk::ALIGN_CENTER; + } else { + dbg_msg ("Invalid horizontal alignment for Gtk::Entry !"); + } + entry->set_alignment (xalign); + } + Gtk::Label* label = dynamic_cast (&widget); if (label) { property = xml_property (definition, "justify", styles, "left");