summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/graphics/gui/CMakeLists.txt7
-rw-r--r--data/graphics/gui/Makefile.am7
-rw-r--r--data/graphics/gui/tab.pngbin329 -> 0 bytes
-rw-r--r--data/graphics/gui/tab.xml18
-rw-r--r--data/graphics/gui/tab_highlighted.xml18
-rw-r--r--data/graphics/gui/tab_hilight.pngbin316 -> 0 bytes
-rw-r--r--data/graphics/gui/tab_selected.xml18
-rw-r--r--data/graphics/gui/tab_unused.xml18
-rw-r--r--data/graphics/gui/tabselected.pngbin313 -> 0 bytes
-rw-r--r--data/graphics/gui/window.pngbin11901 -> 12406 bytes
-rw-r--r--src/gui/widgets/tab.cpp54
11 files changed, 91 insertions, 49 deletions
diff --git a/data/graphics/gui/CMakeLists.txt b/data/graphics/gui/CMakeLists.txt
index 83a1ff902..b03b856c7 100644
--- a/data/graphics/gui/CMakeLists.txt
+++ b/data/graphics/gui/CMakeLists.txt
@@ -34,9 +34,10 @@ SET (FILES
slider_hilight.png
speechbubble.xml
sticky_button.png
- tab.png
- tab_hilight.png
- tabselected.png
+ tab.xml
+ tab_highlighted.xml
+ tab_selected.xml
+ tab_unused.xml
target-cursor-in-range-l.png
target-cursor-in-range-m.png
target-cursor-in-range-s.png
diff --git a/data/graphics/gui/Makefile.am b/data/graphics/gui/Makefile.am
index 42d58b3e4..b8591a783 100644
--- a/data/graphics/gui/Makefile.am
+++ b/data/graphics/gui/Makefile.am
@@ -37,9 +37,10 @@ gui_DATA = \
slider_hilight.png \
speechbubble.xml \
sticky_button.png \
- tab.png \
- tab_hilight.png \
- tabselected.png \
+ tab.xml \
+ tab_highlighted.xml \
+ tab_selected.xml \
+ tab_unused.xml \
target-cursor-in-range-l.png \
target-cursor-in-range-m.png \
target-cursor-in-range-s.png \
diff --git a/data/graphics/gui/tab.png b/data/graphics/gui/tab.png
deleted file mode 100644
index 91eadf08f..000000000
--- a/data/graphics/gui/tab.png
+++ /dev/null
Binary files differ
diff --git a/data/graphics/gui/tab.xml b/data/graphics/gui/tab.xml
new file mode 100644
index 000000000..e00f7f907
--- /dev/null
+++ b/data/graphics/gui/tab.xml
@@ -0,0 +1,18 @@
+<skinset name="Default" image="window.png">
+ <widget type="Window" xpos="68" ypos="0">
+ <!-- Top Row -->
+ <part type="top-left-corner" xpos="0" ypos="0" width="10" height="5" />
+ <part type="top-edge" xpos="9" ypos="0" width="8" height="5" />
+ <part type="top-right-corner" xpos="16" ypos="0" width="10" height="5" />
+
+ <!-- Middle Row -->
+ <part type="left-edge" xpos="0" ypos="4" width="10" height="16" />
+ <part type="bg-quad" xpos="9" ypos="4" width="8" height="16" />
+ <part type="right-edge" xpos="16" ypos="4" width="10" height="16" />
+
+ <!-- Bottom Row -->
+ <part type="bottom-left-corner" xpos="0" ypos="19" width="10" height="5" />
+ <part type="bottom-edge" xpos="9" ypos="19" width="8" height="5" />
+ <part type="bottom-right-corner" xpos="16" ypos="19" width="10" height="5" />
+ </widget>
+</skinset>
diff --git a/data/graphics/gui/tab_highlighted.xml b/data/graphics/gui/tab_highlighted.xml
new file mode 100644
index 000000000..479a883fb
--- /dev/null
+++ b/data/graphics/gui/tab_highlighted.xml
@@ -0,0 +1,18 @@
+<skinset name="Default" image="window.png">
+ <widget type="Window" xpos="68" ypos="25">
+ <!-- Top Row -->
+ <part type="top-left-corner" xpos="0" ypos="0" width="10" height="5" />
+ <part type="top-edge" xpos="9" ypos="0" width="8" height="5" />
+ <part type="top-right-corner" xpos="16" ypos="0" width="10" height="5" />
+
+ <!-- Middle Row -->
+ <part type="left-edge" xpos="0" ypos="4" width="10" height="16" />
+ <part type="bg-quad" xpos="9" ypos="4" width="8" height="16" />
+ <part type="right-edge" xpos="16" ypos="4" width="10" height="16" />
+
+ <!-- Bottom Row -->
+ <part type="bottom-left-corner" xpos="0" ypos="19" width="10" height="5" />
+ <part type="bottom-edge" xpos="9" ypos="19" width="8" height="5" />
+ <part type="bottom-right-corner" xpos="16" ypos="19" width="10" height="5" />
+ </widget>
+</skinset>
diff --git a/data/graphics/gui/tab_hilight.png b/data/graphics/gui/tab_hilight.png
deleted file mode 100644
index f6b39942d..000000000
--- a/data/graphics/gui/tab_hilight.png
+++ /dev/null
Binary files differ
diff --git a/data/graphics/gui/tab_selected.xml b/data/graphics/gui/tab_selected.xml
new file mode 100644
index 000000000..f3869b9d0
--- /dev/null
+++ b/data/graphics/gui/tab_selected.xml
@@ -0,0 +1,18 @@
+<skinset name="Default" image="window.png">
+ <widget type="Window" xpos="68" ypos="50">
+ <!-- Top Row -->
+ <part type="top-left-corner" xpos="0" ypos="0" width="10" height="5" />
+ <part type="top-edge" xpos="9" ypos="0" width="8" height="5" />
+ <part type="top-right-corner" xpos="16" ypos="0" width="10" height="5" />
+
+ <!-- Middle Row -->
+ <part type="left-edge" xpos="0" ypos="4" width="10" height="16" />
+ <part type="bg-quad" xpos="9" ypos="4" width="8" height="16" />
+ <part type="right-edge" xpos="16" ypos="4" width="10" height="16" />
+
+ <!-- Bottom Row -->
+ <part type="bottom-left-corner" xpos="0" ypos="19" width="10" height="5" />
+ <part type="bottom-edge" xpos="9" ypos="19" width="8" height="5" />
+ <part type="bottom-right-corner" xpos="16" ypos="19" width="10" height="5" />
+ </widget>
+</skinset>
diff --git a/data/graphics/gui/tab_unused.xml b/data/graphics/gui/tab_unused.xml
new file mode 100644
index 000000000..95b48e695
--- /dev/null
+++ b/data/graphics/gui/tab_unused.xml
@@ -0,0 +1,18 @@
+<skinset name="Default" image="window.png">
+ <widget type="Window" xpos="68" ypos="75">
+ <!-- Top Row -->
+ <part type="top-left-corner" xpos="0" ypos="0" width="10" height="5" />
+ <part type="top-edge" xpos="9" ypos="0" width="8" height="5" />
+ <part type="top-right-corner" xpos="16" ypos="0" width="10" height="5" />
+
+ <!-- Middle Row -->
+ <part type="left-edge" xpos="0" ypos="4" width="10" height="16" />
+ <part type="bg-quad" xpos="9" ypos="4" width="8" height="16" />
+ <part type="right-edge" xpos="16" ypos="4" width="10" height="16" />
+
+ <!-- Bottom Row -->
+ <part type="bottom-left-corner" xpos="0" ypos="19" width="10" height="5" />
+ <part type="bottom-edge" xpos="9" ypos="19" width="8" height="5" />
+ <part type="bottom-right-corner" xpos="16" ypos="19" width="10" height="5" />
+ </widget>
+</skinset>
diff --git a/data/graphics/gui/tabselected.png b/data/graphics/gui/tabselected.png
deleted file mode 100644
index e2983060c..000000000
--- a/data/graphics/gui/tabselected.png
+++ /dev/null
Binary files differ
diff --git a/data/graphics/gui/window.png b/data/graphics/gui/window.png
index 1bdee4931..37395d0a2 100644
--- a/data/graphics/gui/window.png
+++ b/data/graphics/gui/window.png
Binary files differ
diff --git a/src/gui/widgets/tab.cpp b/src/gui/widgets/tab.cpp
index 4dbfe45e4..f7b353c7e 100644
--- a/src/gui/widgets/tab.cpp
+++ b/src/gui/widgets/tab.cpp
@@ -53,24 +53,18 @@ enum
TAB_COUNT // 4 - Must be last.
};
-struct TabData
+static std::string const data[TAB_COUNT] =
{
- char const *file;
- int gridX;
- int gridY;
-};
-
-static TabData const data[TAB_COUNT] =
-{
- { "tab.png", 0, 0 },
- { "tab_hilight.png", 9, 4 },
- { "tabselected.png", 16, 19 },
- { "tab.png", 25, 23 }
+ "tab.xml",
+ "tab_highlighted.xml",
+ "tab_selected.xml",
+ "tab_unused.xml"
};
ImageRect Tab::tabImg[TAB_COUNT];
-Tab::Tab() : gcn::Tab(),
+Tab::Tab() :
+ gcn::Tab(),
mTabColor(&Theme::getThemeColor(Theme::TAB)),
mVertexes(new GraphicsVertexes()),
mRedraw(true),
@@ -84,12 +78,6 @@ Tab::Tab() : gcn::Tab(),
Tab::~Tab()
{
mInstances--;
-
- if (mInstances == 0)
- {
- for (int mode = 0; mode < TAB_COUNT; mode++)
- for_each(tabImg[mode].grid, tabImg[mode].grid + 9, dtor<Image*>());
- }
delete mVertexes;
mVertexes = nullptr;
}
@@ -105,32 +93,12 @@ void Tab::init()
if (mInstances == 0)
{
// Load the skin
- Image *tab[TAB_COUNT];
-
- int a, x, y, mode;
-
- for (mode = 0; mode < TAB_COUNT; mode++)
+ if (Theme::instance())
{
- tab[mode] = Theme::getImageFromTheme(data[mode].file);
- if (!tab[mode])
- continue;
-
- a = 0;
- for (y = 0; y < 3; y++)
- {
- for (x = 0; x < 3; x++)
- {
- tabImg[mode].grid[a] = tab[mode]->getSubImage(
- data[x].gridX, data[y].gridY,
- data[x + 1].gridX - data[x].gridX + 1,
- data[y + 1].gridY - data[y].gridY + 1);
- if (tabImg[mode].grid[a])
- tabImg[mode].grid[a]->setAlpha(mAlpha);
- a++;
- }
- }
- tab[mode]->decRef();
+ for (int mode = 0; mode < TAB_COUNT; mode ++)
+ Theme::instance()->loadRect(tabImg[mode], data[mode]);
}
+ updateAlpha();
}
mInstances++;
}