From c7f20e549dcb54b5b4a5125b8dd94b45ac955d19 Mon Sep 17 00:00:00 2001 From: Benau Date: Mon, 12 Oct 2015 07:33:09 +0800 Subject: [PATCH] Revert widget changes --- src/guiengine/layout_manager.cpp | 6 ++---- src/guiengine/widgets/label_widget.cpp | 6 +----- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/guiengine/layout_manager.cpp b/src/guiengine/layout_manager.cpp index 456c4342f..c91ec10be 100644 --- a/src/guiengine/layout_manager.cpp +++ b/src/guiengine/layout_manager.cpp @@ -537,9 +537,7 @@ void LayoutManager::doCalculateLayout(PtrVector& widgets, AbstractTopLev align.c_str(), widgets[n].m_properties[PROP_ID].c_str()); } - //Used to get text in label widget wrapped better - int padding = (int)(irr_driver->getFrameSize().Width*0.05f); - widgets[n].m_w = (int)(left_space*fraction) - padding; + widgets[n].m_w = (int)(left_space*fraction); if (widgets[n].m_properties[PROP_MAX_WIDTH].size() > 0) { const int max_width = atoi_p( widgets[n].m_properties[PROP_MAX_WIDTH].c_str() ); @@ -554,7 +552,7 @@ void LayoutManager::doCalculateLayout(PtrVector& widgets, AbstractTopLev widgets[n].m_w = 1; } - x += widgets[n].m_w + padding; + x += widgets[n].m_w; } else { diff --git a/src/guiengine/widgets/label_widget.cpp b/src/guiengine/widgets/label_widget.cpp index d3f5e8240..3f8e25ae1 100644 --- a/src/guiengine/widgets/label_widget.cpp +++ b/src/guiengine/widgets/label_widget.cpp @@ -60,11 +60,7 @@ LabelWidget::LabelWidget(bool title, bool bright) : Widget(WTYPE_LABEL) void LabelWidget::add() { rect widget_size = rect(m_x, m_y, m_x + m_w, m_y + m_h); - bool word_wrap; //Enable text wrapping unless explicitly stated not to - if (m_properties[PROP_WORD_WRAP] == "false") - word_wrap = false; - else - word_wrap = true; + const bool word_wrap = m_properties[PROP_WORD_WRAP] == "true"; stringw message = getText(); EGUI_ALIGNMENT align = EGUIA_UPPERLEFT;