From c3dd886783c3fea2fb0f95c228e74b1b79827b5c Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sat, 7 Jan 2023 01:23:07 -0500 Subject: [PATCH] Fix LED text colour and correct width attribute validation --- src/dialogxml/widgets/button.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/dialogxml/widgets/button.cpp b/src/dialogxml/widgets/button.cpp index bc6617ce..7d02562b 100644 --- a/src/dialogxml/widgets/button.cpp +++ b/src/dialogxml/widgets/button.cpp @@ -161,12 +161,10 @@ static const std::set labelledButtons{BTN_TINY, BTN_LED, BTN_PUSH}; void cButton::validatePostParse(ticpp::Element& elem, std::string fname, const std::set& attrs, const std::multiset& elems) { cControl::validatePostParse(elem, fname, attrs, elems); if(getType() == CTRL_BTN && !attrs.count("type")) throw xMissingAttr(elem.Value(), "type", elem.Row(), elem.Column(), fname); - if(labelledButtons.count(type) && !lbl.empty()) { + if(labelledButtons.count(type)) { if(!attrs.count("color") && !attrs.count("colour") && parent->getBg() == cDialog::BG_DARK) setColour(sf::Color::White); - // led and tiny with no width seems to work correctly, - // does this test is needed for push button ? - if(type!=BTN_LED && type!=BTN_TINY && !attrs.count("width")) + if(!lbl.empty() && !attrs.count("width")) throw xMissingAttr(elem.Value(), "width", elem.Row(), elem.Column(), fname); } }