Fix bug showing "&&" in About dialog

This commit is contained in:
David Capello 2015-05-05 13:41:27 -03:00
parent a489efdf03
commit 91c2872908
2 changed files with 9 additions and 5 deletions

View File

@ -40,13 +40,13 @@ void AboutCommand::onExecute(Context* context)
Box* box1 = new Box(JI_VERTICAL);
Grid* grid = new Grid(2, false);
Label* title = new Label(PACKAGE " v" VERSION);
Label* subtitle = new Label("Animated sprite editor && pixel art tool");
Label* subtitle = new Label("Animated sprite editor & pixel art tool");
Separator* authors_separator1 = new Separator("Authors:", JI_HORIZONTAL | JI_TOP);
Separator* authors_separator2 = new Separator("", JI_HORIZONTAL);
Label* author1 = new LinkLabel("http://davidcapello.com/", "David Capello");
Label* author1_desc = new Label("- Lead developer, graphics && maintainer");
Label* author1_desc = new Label("- Lead developer, graphics & maintainer");
Label* author2 = new LinkLabel("http://ilkke.blogspot.com/", "Ilija Melentijevic");
Label* author2_desc = new Label("- Default skin && graphics introduced in v0.8");
Label* author2_desc = new Label("- Default skin & graphics introduced in v0.8");
Label* author3 = new LinkLabel(WEBSITE_CONTRIBUTORS, "Contributors");
Box* bottom_box1 = new Box(JI_HORIZONTAL);
Box* bottom_box2 = new Box(JI_HORIZONTAL);

View File

@ -8,6 +8,7 @@
#include "config.h"
#endif
#include "she/font.h"
#include "ui/label.h"
#include "ui/message.h"
#include "ui/preferred_size_event.h"
@ -27,8 +28,11 @@ void Label::onPreferredSize(PreferredSizeEvent& ev)
{
gfx::Size sz(0, 0);
if (hasText())
sz = getTextSize();
if (hasText()) {
// Labels are not UIString
sz.w = getFont()->textLength(getText().c_str());
sz.h = getTextHeight();
}
sz.w += this->border_width.l + this->border_width.r;
sz.h += this->border_width.t + this->border_width.b;