summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-10-18 19:56:54 +0300
committerAndrei Karas <akaras@inbox.ru>2012-10-18 19:56:54 +0300
commitce455b0e3cd02b6796cab746addd1ff41a6b7ca8 (patch)
treef8e425c177ceb887184be3b00eea94c0168d519d
parentc7ad8d093591214a32cacc79fa25d8e118493093 (diff)
downloadmanaverse-ce455b0e3cd02b6796cab746addd1ff41a6b7ca8.tar.gz
manaverse-ce455b0e3cd02b6796cab746addd1ff41a6b7ca8.tar.bz2
manaverse-ce455b0e3cd02b6796cab746addd1ff41a6b7ca8.tar.xz
manaverse-ce455b0e3cd02b6796cab746addd1ff41a6b7ca8.zip
Fix in ok dialog size and button position.
-rw-r--r--data/graphics/gui/CMakeLists.txt1
-rw-r--r--data/graphics/gui/Makefile.am1
-rw-r--r--data/graphics/gui/ok.xml24
-rw-r--r--data/themes/enchilado/CMakeLists.txt1
-rw-r--r--data/themes/enchilado/Makefile.am1
-rw-r--r--data/themes/enchilado/ok.xml24
-rw-r--r--data/themes/jewelry/CMakeLists.txt1
-rw-r--r--data/themes/jewelry/Makefile.am1
-rw-r--r--data/themes/jewelry/ok.xml31
-rw-r--r--data/themes/pink/CMakeLists.txt1
-rw-r--r--data/themes/pink/Makefile.am1
-rw-r--r--data/themes/pink/ok.xml24
-rw-r--r--data/themes/unity/CMakeLists.txt1
-rw-r--r--data/themes/unity/Makefile.am1
-rw-r--r--data/themes/unity/ok.xml25
-rw-r--r--data/themes/wood/CMakeLists.txt1
-rw-r--r--data/themes/wood/Makefile.am1
-rw-r--r--data/themes/wood/ok.xml24
-rw-r--r--src/gui/okdialog.cpp11
19 files changed, 169 insertions, 6 deletions
diff --git a/data/graphics/gui/CMakeLists.txt b/data/graphics/gui/CMakeLists.txt
index 985a6224c..afb60b61d 100644
--- a/data/graphics/gui/CMakeLists.txt
+++ b/data/graphics/gui/CMakeLists.txt
@@ -29,6 +29,7 @@ SET (FILES
label.xml
listbox.xml
mouse.png
+ ok.xml
playerbox_background.xml
popup.xml
progress-indicator.png
diff --git a/data/graphics/gui/Makefile.am b/data/graphics/gui/Makefile.am
index 7120f40c7..1e3d802f8 100644
--- a/data/graphics/gui/Makefile.am
+++ b/data/graphics/gui/Makefile.am
@@ -32,6 +32,7 @@ gui_DATA = \
label.xml \
listbox.xml \
mouse.png \
+ ok.xml \
playerbox_background.xml \
popup.xml \
progress-indicator.png \
diff --git a/data/graphics/gui/ok.xml b/data/graphics/gui/ok.xml
new file mode 100644
index 000000000..9b19fa7f8
--- /dev/null
+++ b/data/graphics/gui/ok.xml
@@ -0,0 +1,24 @@
+<skinset name="Default" image="window.png">
+ <widget type="Window">
+ <option name="buttonPadding" value="8" />
+
+ <!-- Top Row -->
+ <part type="top-left-corner" xpos="0" ypos="0" width="4" height="4" />
+ <part type="top-edge" xpos="4" ypos="0" width="32" height="4" />
+ <part type="top-right-corner" xpos="36" ypos="0" width="4" height="4" />
+
+ <!-- Middle Row -->
+ <part type="left-edge" xpos="0" ypos="4" width="4" height="216" />
+ <part type="bg-quad" xpos="4" ypos="4" width="32" height="216" />
+ <part type="right-edge" xpos="36" ypos="4" width="4" height="216" />
+
+ <!-- Bottom Row -->
+ <part type="bottom-left-corner" xpos="0" ypos="220" width="4" height="4" />
+ <part type="bottom-edge" xpos="4" ypos="220" width="32" height="4" />
+ <part type="bottom-right-corner" xpos="36" ypos="220" width="4" height="4" />
+
+ <part type="closeImage" xpos="130" ypos="0" width="15" height="15" />
+ <part type="stickyImageUp" xpos="130" ypos="51" width="15" height="15" />
+ <part type="stickyImageDown" xpos="145" ypos="51" width="15" height="15" />
+ </widget>
+</skinset>
diff --git a/data/themes/enchilado/CMakeLists.txt b/data/themes/enchilado/CMakeLists.txt
index 97dca0a2f..dab8ddb41 100644
--- a/data/themes/enchilado/CMakeLists.txt
+++ b/data/themes/enchilado/CMakeLists.txt
@@ -4,6 +4,7 @@ SET (FILES
equipment.xml
info.xml
inventory.xml
+ ok.xml
popup.xml
progressbar.xml
quests.xml
diff --git a/data/themes/enchilado/Makefile.am b/data/themes/enchilado/Makefile.am
index 5eb839b18..da0917225 100644
--- a/data/themes/enchilado/Makefile.am
+++ b/data/themes/enchilado/Makefile.am
@@ -7,6 +7,7 @@ gui_DATA = \
equipment.xml \
info.xml \
inventory.xml \
+ ok.xml \
popup.xml \
progressbar.xml \
quests.xml \
diff --git a/data/themes/enchilado/ok.xml b/data/themes/enchilado/ok.xml
new file mode 100644
index 000000000..bed8ab7e3
--- /dev/null
+++ b/data/themes/enchilado/ok.xml
@@ -0,0 +1,24 @@
+<skinset name="Default" image="window.png">
+ <widget type="Window" xpos="190" ypos="30">
+ <option name="buttonPadding" value="8" />
+
+ <!-- Top Row -->
+ <part type="top-left-corner" xpos="0" ypos="0" width="10" height="10" />
+ <part type="top-edge" xpos="11" ypos="0" width="127" height="10" />
+ <part type="top-right-corner" xpos="139" ypos="0" width="12" height="10" />
+
+ <!-- Middle Row -->
+ <part type="left-edge" xpos="0" ypos="11" width="10" height="81" />
+ <part type="bg-quad" xpos="11" ypos="11" width="127" height="81" />
+ <part type="right-edge" xpos="139" ypos="11" width="12" height="81" />
+
+ <!-- Bottom Row -->
+ <part type="bottom-left-corner" xpos="0" ypos="93" width="10" height="12" />
+ <part type="bottom-edge" xpos="11" ypos="93" width="127" height="12" />
+ <part type="bottom-right-corner" xpos="139" ypos="93" width="12" height="12" />
+
+ <part type="closeImage" xpos="-60" ypos="-30" width="15" height="15" />
+ <part type="stickyImageUp" xpos="-60" ypos="21" width="15" height="15" />
+ <part type="stickyImageDown" xpos="-45" ypos="21" width="15" height="15" />
+ </widget>
+</skinset>
diff --git a/data/themes/jewelry/CMakeLists.txt b/data/themes/jewelry/CMakeLists.txt
index e1cd1fb19..637489452 100644
--- a/data/themes/jewelry/CMakeLists.txt
+++ b/data/themes/jewelry/CMakeLists.txt
@@ -27,6 +27,7 @@ SET (FILES
map.xml
mouse.png
npc.xml
+ ok.xml
playerbox_background.xml
popup.xml
progressbar.xml
diff --git a/data/themes/jewelry/Makefile.am b/data/themes/jewelry/Makefile.am
index f86c44649..d574c154f 100644
--- a/data/themes/jewelry/Makefile.am
+++ b/data/themes/jewelry/Makefile.am
@@ -30,6 +30,7 @@ gui_DATA = \
map.xml \
mouse.png \
npc.xml \
+ ok.xml \
playerbox_background.xml \
popup.xml \
progressbar.xml \
diff --git a/data/themes/jewelry/ok.xml b/data/themes/jewelry/ok.xml
new file mode 100644
index 000000000..6e5799a1e
--- /dev/null
+++ b/data/themes/jewelry/ok.xml
@@ -0,0 +1,31 @@
+<skinset name="Default" image="window.png">
+ <widget type="Window" xpos="260" ypos="0">
+ <option name="buttonPadding" value="8" />
+ <option name="captionoffsetx" value="20" />
+ <option name="captionoffsety" value="7" />
+ <option name="titlebarBold" value="1" />
+ <option name="titlebarHeight" value="35" />
+ <option name="padding" value="10" />
+
+ <!-- Top Row -->
+ <part type="top-left-corner" width="32" height="32" />
+ <part type="top-edge" xpos="33" ypos="0" width="64" height="32" />
+ <part type="top-right-corner" xpos="98" ypos="0" width="32" height="32" />
+
+ <!-- Middle Row -->
+ <part type="left-edge" xpos="0" ypos="33" width="32" height="32" />
+ <part type="bg-quad" xpos="33" ypos="33" width="64" height="32" />
+ <part type="right-edge" xpos="98" ypos="33" width="32" height="32" />
+
+ <!-- Bottom Row -->
+ <part type="bottom-left-corner" xpos="0" ypos="66" width="32" height="32" />
+ <part type="bottom-edge" xpos="33" ypos="66" width="64" height="32" />
+ <part type="bottom-right-corner" xpos="98" ypos="66" width="32" height="32" />
+
+ <part type="closeImage" xpos="-163" ypos="0" width="22" height="22" />
+ <part type="closeImageHighlighted" xpos="-138" ypos="0" width="22" height="22" />
+ <!--<part type="stickyImageUp" xpos="-130" ypos="51" width="16" height="16" />
+ <part type="stickyImageDown" xpos="-99" ypos="51" width="16" height="16" />-->
+
+ </widget>
+</skinset>
diff --git a/data/themes/pink/CMakeLists.txt b/data/themes/pink/CMakeLists.txt
index 77eb0d96e..82598e776 100644
--- a/data/themes/pink/CMakeLists.txt
+++ b/data/themes/pink/CMakeLists.txt
@@ -5,6 +5,7 @@ SET (FILES
equipment.xml
info.xml
inventory.xml
+ ok.xml
popup.xml
progress-indicator.png
progressbar.xml
diff --git a/data/themes/pink/Makefile.am b/data/themes/pink/Makefile.am
index 345ca2ac8..6af7350a5 100644
--- a/data/themes/pink/Makefile.am
+++ b/data/themes/pink/Makefile.am
@@ -8,6 +8,7 @@ gui_DATA = \
equipment.xml \
info.xml \
inventory.xml \
+ ok.xml \
popup.xml \
progress-indicator.png \
progressbar.xml \
diff --git a/data/themes/pink/ok.xml b/data/themes/pink/ok.xml
new file mode 100644
index 000000000..00b902f09
--- /dev/null
+++ b/data/themes/pink/ok.xml
@@ -0,0 +1,24 @@
+<skinset name="Default" image="window.png">
+ <widget type="Window" xpos="250" ypos="0">
+ <option name="buttonPadding" value="8" />
+
+ <!-- Top Row -->
+ <part type="top-left-corner" xpos="0" ypos="0" width="10" height="10" />
+ <part type="top-edge" xpos="0" ypos="10" width="10" height="10" />
+ <part type="top-right-corner" xpos="0" ypos="20" width="10" height="10" />
+
+ <!-- Middle Row -->
+ <part type="left-edge" xpos="0" ypos="30" width="10" height="10" />
+ <part type="bg-quad" xpos="0" ypos="40" width="10" height="10" />
+ <part type="right-edge" xpos="0" ypos="50" width="10" height="10" />
+
+ <!-- Bottom Row -->
+ <part type="bottom-left-corner" xpos="0" ypos="60" width="10" height="10" />
+ <part type="bottom-edge" xpos="0" ypos="70" width="10" height="10" />
+ <part type="bottom-right-corner" xpos="10" ypos="0" width="132" height="134" />
+
+ <part type="closeImage" xpos="-120" ypos="0" width="15" height="15" />
+ <part type="stickyImageUp" xpos="-120" ypos="51" width="15" height="15" />
+ <part type="stickyImageDown" xpos="-105" ypos="51" width="15" height="15" />
+ </widget>
+</skinset>
diff --git a/data/themes/unity/CMakeLists.txt b/data/themes/unity/CMakeLists.txt
index 453e628d0..6eda666a7 100644
--- a/data/themes/unity/CMakeLists.txt
+++ b/data/themes/unity/CMakeLists.txt
@@ -6,6 +6,7 @@ SET (FILES
info.xml
inventory.xml
npc.xml
+ ok.xml
popup.xml
progressbar.xml
quests.xml
diff --git a/data/themes/unity/Makefile.am b/data/themes/unity/Makefile.am
index ea9df94aa..f6c6fc91e 100644
--- a/data/themes/unity/Makefile.am
+++ b/data/themes/unity/Makefile.am
@@ -9,6 +9,7 @@ gui_DATA = \
info.xml \
inventory.xml \
npc.xml \
+ ok.xml \
popup.xml \
progressbar.xml \
quests.xml \
diff --git a/data/themes/unity/ok.xml b/data/themes/unity/ok.xml
new file mode 100644
index 000000000..5ebf31e3e
--- /dev/null
+++ b/data/themes/unity/ok.xml
@@ -0,0 +1,25 @@
+<skinset name="Default" image="window.png">
+ <widget type="Window" xpos="260" ypos="0">
+ <option name="padding" value="10" />
+ <option name="buttonPadding" value="8" />
+
+ <!-- Top Row -->
+ <part type="top-left-corner" xpos="0" ypos="0" width="10" height="10" />
+ <part type="top-edge" xpos="11" ypos="0" width="127" height="10" />
+ <part type="top-right-corner" xpos="139" ypos="0" width="12" height="10" />
+
+ <!-- Middle Row -->
+ <part type="left-edge" xpos="0" ypos="11" width="10" height="81" />
+ <part type="bg-quad" xpos="11" ypos="11" width="127" height="81" />
+ <part type="right-edge" xpos="139" ypos="11" width="12" height="81" />
+
+ <!-- Bottom Row -->
+ <part type="bottom-left-corner" xpos="0" ypos="93" width="10" height="12" />
+ <part type="bottom-edge" xpos="11" ypos="93" width="127" height="12" />
+ <part type="bottom-right-corner" xpos="139" ypos="93" width="12" height="12" />
+
+ <part type="closeImage" xpos="-130" ypos="0" width="15" height="15" />
+ <part type="stickyImageUp" xpos="-130" ypos="51" width="15" height="15" />
+ <part type="stickyImageDown" xpos="-115" ypos="51" width="15" height="15" />
+ </widget>
+</skinset>
diff --git a/data/themes/wood/CMakeLists.txt b/data/themes/wood/CMakeLists.txt
index 6af25f0bf..c65e18222 100644
--- a/data/themes/wood/CMakeLists.txt
+++ b/data/themes/wood/CMakeLists.txt
@@ -6,6 +6,7 @@ SET (FILES
inventory.xml
item_shortcut_bgr.png
mouse.png
+ ok.xml
popup.xml
progressbar.xml
quests.xml
diff --git a/data/themes/wood/Makefile.am b/data/themes/wood/Makefile.am
index 2bbbcad78..d16bfac19 100644
--- a/data/themes/wood/Makefile.am
+++ b/data/themes/wood/Makefile.am
@@ -9,6 +9,7 @@ gui_DATA = \
inventory.xml \
item_shortcut_bgr.png \
mouse.png \
+ ok.xml \
popup.xml \
progressbar.xml \
quests.xml \
diff --git a/data/themes/wood/ok.xml b/data/themes/wood/ok.xml
new file mode 100644
index 000000000..f328e63b9
--- /dev/null
+++ b/data/themes/wood/ok.xml
@@ -0,0 +1,24 @@
+<skinset name="Default" image="window.png">
+ <widget type="Window" xpos="260" ypos="0">
+ <option name="buttonPadding" value="8" />
+
+ <!-- Top Row -->
+ <part type="top-left-corner" width="10" height="10" />
+ <part type="top-edge" xpos="11" ypos="0" width="127" height="10" />
+ <part type="top-right-corner" xpos="139" ypos="0" width="12" height="10" />
+
+ <!-- Middle Row -->
+ <part type="left-edge" xpos="0" ypos="11" width="10" height="81" />
+ <part type="bg-quad" xpos="11" ypos="11" width="127" height="81" />
+ <part type="right-edge" xpos="139" ypos="11" width="12" height="81" />
+
+ <!-- Bottom Row -->
+ <part type="bottom-left-corner" xpos="0" ypos="93" width="10" height="12" />
+ <part type="bottom-edge" xpos="11" ypos="93" width="127" height="12" />
+ <part type="bottom-right-corner" xpos="139" ypos="93" width="12" height="12" />
+
+ <part type="closeImage" xpos="-130" ypos="0" width="15" height="15" />
+ <part type="stickyImageUp" xpos="-130" ypos="51" width="15" height="15" />
+ <part type="stickyImageDown" xpos="-115" ypos="51" width="15" height="15" />
+ </widget>
+</skinset>
diff --git a/src/gui/okdialog.cpp b/src/gui/okdialog.cpp
index 5a2e39022..b06ba832c 100644
--- a/src/gui/okdialog.cpp
+++ b/src/gui/okdialog.cpp
@@ -59,14 +59,13 @@ OkDialog::OkDialog(const std::string &title, const std::string &msg,
if (width < okButton->getWidth())
width = okButton->getWidth();
- width = mTextBox->getWidth() + fontHeight;
- setContentSize(width, height + fontHeight + okButton->getHeight());
- mTextBox->setPosition(getPadding(), getPadding());
+ width = mTextBox->getWidth();
+ setContentSize(width, mTextBox->getHeight() + okButton->getHeight()
+ + getOption("buttonPadding", 8));
+ mTextBox->setPosition(0, 0);
- // 8 is the padding that GUIChan adds to button widgets
- // (top and bottom combined)
okButton->setPosition((width - okButton->getWidth()) / 2,
- height + getOption("buttonPadding", 8));
+ mTextBox->getHeight() + getOption("buttonPadding", 8));
add(mTextBox);
add(okButton);