diff --git a/src/app/ui/skin/skin_theme.cpp b/src/app/ui/skin/skin_theme.cpp index 60656d638..84b8f424f 100644 --- a/src/app/ui/skin/skin_theme.cpp +++ b/src/app/ui/skin/skin_theme.cpp @@ -1567,8 +1567,8 @@ void SkinTheme::paintTextBox(ui::PaintEvent& ev) Graphics* g = ev.graphics(); Widget* widget = static_cast(ev.getSource()); - drawTextBox(g, widget, NULL, NULL, - BGCOLOR, colors.textboxText()); + Theme::drawTextBox(g, widget, nullptr, nullptr, + BGCOLOR, colors.textboxText()); } void SkinTheme::paintView(PaintEvent& ev) diff --git a/src/ui/intern.h b/src/ui/intern.h index ecc5e092c..67d7bfbbc 100644 --- a/src/ui/intern.h +++ b/src/ui/intern.h @@ -1,5 +1,5 @@ // Aseprite UI Library -// Copyright (C) 2001-2013, 2015 David Capello +// Copyright (C) 2001-2016 David Capello // // This file is released under the terms of the MIT license. // Read LICENSE.txt for more information. @@ -36,11 +36,6 @@ namespace ui { } // namespace details - // theme.cpp - - void drawTextBox(Graphics* g, Widget* textbox, - int* w, int* h, gfx::Color bg, gfx::Color fg); - } // namespace ui #endif diff --git a/src/ui/textbox.cpp b/src/ui/textbox.cpp index ded466bdb..fac13a1e0 100644 --- a/src/ui/textbox.cpp +++ b/src/ui/textbox.cpp @@ -156,7 +156,7 @@ void TextBox::onSizeHint(SizeHintEvent& ev) int w = 0; int h = 0; - drawTextBox(NULL, this, &w, &h, gfx::ColorNone, gfx::ColorNone); + Theme::drawTextBox(nullptr, this, &w, &h, gfx::ColorNone, gfx::ColorNone); if (this->align() & WORDWRAP) { View* view = View::getView(this); @@ -170,7 +170,7 @@ void TextBox::onSizeHint(SizeHintEvent& ev) } w = MAX(min, width); - drawTextBox(NULL, this, &w, &h, gfx::ColorNone, gfx::ColorNone); + Theme::drawTextBox(nullptr, this, &w, &h, gfx::ColorNone, gfx::ColorNone); w = min; } diff --git a/src/ui/theme.cpp b/src/ui/theme.cpp index f30304d95..4bd151874 100644 --- a/src/ui/theme.cpp +++ b/src/ui/theme.cpp @@ -79,8 +79,9 @@ Theme* get_theme() return current_theme; } -void drawTextBox(Graphics* g, Widget* widget, - int* w, int* h, gfx::Color bg, gfx::Color fg) +// static +void Theme::drawTextBox(Graphics* g, Widget* widget, + int* w, int* h, gfx::Color bg, gfx::Color fg) { View* view = View::getView(widget); char* text = const_cast(widget->text().c_str()); diff --git a/src/ui/theme.h b/src/ui/theme.h index 6d3407ad4..1c3d4565c 100644 --- a/src/ui/theme.h +++ b/src/ui/theme.h @@ -8,6 +8,7 @@ #define UI_THEME_H_INCLUDED #pragma once +#include "gfx/color.h" #include "gfx/size.h" #include "ui/base.h" #include "ui/cursor_type.h" @@ -23,6 +24,7 @@ namespace she { namespace ui { class Cursor; + class Graphics; class PaintEvent; class Widget; @@ -72,6 +74,9 @@ namespace ui { virtual void paintPopupWindow(PaintEvent& ev) = 0; virtual void paintTooltip(PaintEvent& ev) = 0; + static void drawTextBox(Graphics* g, Widget* textbox, + int* w, int* h, gfx::Color bg, gfx::Color fg); + protected: virtual void onRegenerate() = 0;