Fix issue #280 - Close button doesn't appear in some windows

Thanks to @DocHoncho for the help.
See https://github.com/aseprite/aseprite/pull/6
This commit is contained in:
David Capello 2013-11-23 17:25:21 -03:00
parent a1f3e290c2
commit 7dc8e548be
3 changed files with 3 additions and 2 deletions

View File

@ -56,6 +56,7 @@ namespace ui {
#define JI_DECORATIVE 0x0200 // To decorate windows.
#define JI_INITIALIZED 0x0400 // The widget was already initialized by a theme.
#define JI_DIRTY 0x0800 // The widget (or one child) is dirty (update_region != empty).
#define JI_HASTEXT 0x1000 // The widget has text (at least setText() was called one time).
class GuiSystem {
public:

View File

@ -61,7 +61,6 @@ Widget::Widget(WidgetType type)
this->m_theme = CurrentTheme::get();
this->m_align = 0;
this->m_text = "";
this->m_font = this->m_theme ? this->m_theme->default_font: NULL;
this->m_bgColor = ui::ColorNone;
@ -154,6 +153,7 @@ void Widget::setTextf(const char *format, ...)
void Widget::setTextQuiet(const base::string& text)
{
m_text = text;
flags |= JI_HASTEXT;
}
FONT *Widget::getFont() const

View File

@ -105,7 +105,7 @@ namespace ui {
// Text property.
bool hasText() const { return !m_text.empty(); }
bool hasText() const { return (flags & JI_HASTEXT) == JI_HASTEXT; }
const base::string& getText() const { return m_text; }
int getTextInt() const;