summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/widgets/textfield.cpp34
1 files changed, 2 insertions, 32 deletions
diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp
index 5dc0d4a6f..4b71bd795 100644
--- a/src/gui/widgets/textfield.cpp
+++ b/src/gui/widgets/textfield.cpp
@@ -67,35 +67,8 @@ TextField::TextField(const std::string &text, bool loseFocusOnTab,
if (instances == 0)
{
- // Load the skin
- Image *textbox = Theme::getImageFromTheme("deepbox.png");
- int gridx[4] = {0, 3, 28, 31};
- int gridy[4] = {0, 3, 28, 31};
- int a = 0, x, y;
-
- for (y = 0; y < 3; y++)
- {
- for (x = 0; x < 3; x++)
- {
- if (textbox)
- {
- skin.grid[a] = textbox->getSubImage(
- gridx[x], gridy[y],
- gridx[x + 1] - gridx[x] + 1,
- gridy[y + 1] - gridy[y] + 1);
- if (skin.grid[a])
- skin.grid[a]->setAlpha(Client::getGuiAlpha());
- }
- else
- {
- skin.grid[a] = nullptr;
- }
- a++;
- }
- }
-
- if (textbox)
- textbox->decRef();
+ if (Theme::instance())
+ Theme::instance()->loadRect(skin, "textfield_background.xml");
}
instances++;
@@ -110,9 +83,6 @@ TextField::TextField(const std::string &text, bool loseFocusOnTab,
TextField::~TextField()
{
instances--;
-
- if (instances == 0)
- for_each(skin.grid, skin.grid + 9, dtor<Image*>());
}
void TextField::updateAlpha()