mirror of https://github.com/aseprite/aseprite.git
Move drawTextBox() function inside Theme class
This commit is contained in:
parent
6c9c0066a0
commit
7e6fc5a815
|
@ -1567,8 +1567,8 @@ void SkinTheme::paintTextBox(ui::PaintEvent& ev)
|
|||
Graphics* g = ev.graphics();
|
||||
Widget* widget = static_cast<Widget*>(ev.getSource());
|
||||
|
||||
drawTextBox(g, widget, NULL, NULL,
|
||||
BGCOLOR, colors.textboxText());
|
||||
Theme::drawTextBox(g, widget, nullptr, nullptr,
|
||||
BGCOLOR, colors.textboxText());
|
||||
}
|
||||
|
||||
void SkinTheme::paintView(PaintEvent& ev)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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<char*>(widget->text().c_str());
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue