summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-12-15 23:52:30 +0300
committerAndrei Karas <akaras@inbox.ru>2012-12-16 00:28:38 +0300
commit661a14c66685de67ec560005c285267fe7098c62 (patch)
tree66a0cf5a2f07f9b1bf4f932577e2d47663b49a41
parent54ff2f6fec70e66d7a8b4a96b28fa7d46f2304a3 (diff)
downloadmv-661a14c66685de67ec560005c285267fe7098c62.tar.gz
mv-661a14c66685de67ec560005c285267fe7098c62.tar.bz2
mv-661a14c66685de67ec560005c285267fe7098c62.tar.xz
mv-661a14c66685de67ec560005c285267fe7098c62.zip
Fix a bit jewelry theme for drop down list.
Fix drop down position.
-rw-r--r--data/themes/jewelry/CMakeLists.txt1
-rw-r--r--data/themes/jewelry/Makefile.am1
-rw-r--r--data/themes/jewelry/popuplist.xml18
-rw-r--r--src/gui/widgets/dropdown.cpp3
-rw-r--r--src/gui/widgets/popup.h4
-rw-r--r--src/gui/widgets/popuplist.cpp12
6 files changed, 32 insertions, 7 deletions
diff --git a/data/themes/jewelry/CMakeLists.txt b/data/themes/jewelry/CMakeLists.txt
index 4e9e05c16..11f654b25 100644
--- a/data/themes/jewelry/CMakeLists.txt
+++ b/data/themes/jewelry/CMakeLists.txt
@@ -39,6 +39,7 @@ SET (FILES
ok.xml
playerbox.xml
popup.xml
+ popuplist.xml
progressbar.xml
quests.xml
radio.xml
diff --git a/data/themes/jewelry/Makefile.am b/data/themes/jewelry/Makefile.am
index 50892e5dc..50513df95 100644
--- a/data/themes/jewelry/Makefile.am
+++ b/data/themes/jewelry/Makefile.am
@@ -42,6 +42,7 @@ gui_DATA = \
ok.xml \
playerbox.xml \
popup.xml \
+ popuplist.xml \
progressbar.xml \
quests.xml \
radio.xml \
diff --git a/data/themes/jewelry/popuplist.xml b/data/themes/jewelry/popuplist.xml
new file mode 100644
index 000000000..f8cc88055
--- /dev/null
+++ b/data/themes/jewelry/popuplist.xml
@@ -0,0 +1,18 @@
+<skinset name="Default" image="window.png">
+ <widget type="Window" xpos="41" ypos="186">
+ <!-- Top Row -->
+ <part type="top-left-corner" xpos="0" ypos="0" width="5" height="5" />
+ <part type="top-edge" xpos="5" ypos="0" width="20" height="5" />
+ <part type="top-right-corner" xpos="27" ypos="0" width="5" height="5" />
+
+ <!-- Middle Row -->
+ <part type="left-edge" xpos="0" ypos="5" width="5" height="20" />
+ <part type="bg-quad" xpos="5" ypos="5" width="20" height="20" />
+ <part type="right-edge" xpos="27" ypos="5" width="5" height="20" />
+
+ <!-- Bottom Row -->
+ <part type="bottom-left-corner" xpos="0" ypos="27" width="5" height="5" />
+ <part type="bottom-edge" xpos="5" ypos="27" width="20" height="5" />
+ <part type="bottom-right-corner" xpos="27" ypos="27" width="5" height="5" />
+ </widget>
+</skinset>
diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp
index 6c3e3e9cc..8c8f6843f 100644
--- a/src/gui/widgets/dropdown.cpp
+++ b/src/gui/widgets/dropdown.cpp
@@ -436,7 +436,7 @@ void DropDown::dropDown()
const int pad2 = pad * 2;
// here width should be adjusted on some other parameters
- mPopup->setWidth(getWidth() - pad2 + 10);
+ mPopup->setWidth(getWidth() - pad2 + 8);
mPopup->show(x - mPadding - frame - 1, y + getHeight());
mPopup->requestMoveToTop();
mPopup->requestFocus();
@@ -449,7 +449,6 @@ void DropDown::foldUp()
{
mDroppedDown = false;
adjustHeight();
-// mInternalFocusHandler.focusNone();
}
}
diff --git a/src/gui/widgets/popup.h b/src/gui/widgets/popup.h
index ac4cc6e94..410e14059 100644
--- a/src/gui/widgets/popup.h
+++ b/src/gui/widgets/popup.h
@@ -168,13 +168,15 @@ class Popup : public Container, public gcn::MouseListener,
void widgetMoved(const gcn::Event &event) override;
+ protected:
+ int mPadding; /**< Holds the padding of the popup. */
+
private:
std::string mPopupName; /**< Name of the popup */
int mMinWidth; /**< Minimum popup width */
int mMinHeight; /**< Minimum popup height */
int mMaxWidth; /**< Maximum popup width */
int mMaxHeight; /**< Maximum popup height */
- int mPadding; /**< Holds the padding of the popup. */
Skin *mSkin; /**< Skin in use by this popup */
ImageCollection *mVertexes;
diff --git a/src/gui/widgets/popuplist.cpp b/src/gui/widgets/popuplist.cpp
index eb711ddeb..586dd5172 100644
--- a/src/gui/widgets/popuplist.cpp
+++ b/src/gui/widgets/popuplist.cpp
@@ -36,20 +36,22 @@ PopupList::PopupList(DropDown *const widget,
gcn::FocusListener(),
mListModel(listModel),
mListBox(new ListBox(widget, listModel)),
- mScrollArea(new ScrollArea),
+ mScrollArea(new ScrollArea(mListBox, false)),
mDropDown(widget)
{
setFocusable(true);
mListBox->setDistributeMousePressed(true);
mListBox->addSelectionListener(this);
- mScrollArea->setContent(mListBox);
+ mScrollArea->setPosition(mPadding, mPadding);
add(mScrollArea);
if (getParent())
getParent()->addFocusListener(this);
if (gui)
gui->addGlobalFocusListener(this);
+
+ adjustSize();
}
PopupList::~PopupList()
@@ -104,9 +106,11 @@ void PopupList::setListModel(gcn::ListModel *model)
void PopupList::adjustSize()
{
- mScrollArea->setWidth(getWidth() - 8);
- mScrollArea->setHeight(getHeight() - 8);
+ const int pad2 = 2 * mPadding;
+ mScrollArea->setWidth(getWidth() - pad2);
+ mScrollArea->setHeight(getHeight() - pad2);
mListBox->adjustSize();
+ mListBox->setWidth(getWidth() - pad2);
}
void PopupList::valueChanged(const gcn::SelectionEvent& event A_UNUSED)