summaryrefslogtreecommitdiff
path: root/src/gui/widgets/textfield.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-07-08 23:36:21 +0300
committerAndrei Karas <akaras@inbox.ru>2012-07-13 01:02:41 +0300
commit83b7d186c7a26fa6fb7f6d1bd10a80f16afef8bf (patch)
tree9af436b864bd1f6e752bfba4b570dffa5f099644 /src/gui/widgets/textfield.cpp
parent2694837a25941c737236b68dff23aafa76954c8a (diff)
downloadplus-83b7d186c7a26fa6fb7f6d1bd10a80f16afef8bf.tar.gz
plus-83b7d186c7a26fa6fb7f6d1bd10a80f16afef8bf.tar.bz2
plus-83b7d186c7a26fa6fb7f6d1bd10a80f16afef8bf.tar.xz
plus-83b7d186c7a26fa6fb7f6d1bd10a80f16afef8bf.zip
Change textfield theming.
Diffstat (limited to 'src/gui/widgets/textfield.cpp')
-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()