diff options
-rw-r--r-- | gui/PopUpWidget.cpp | 7 | ||||
-rw-r--r-- | gui/PopUpWidget.h | 2 | ||||
-rw-r--r-- | gui/dialog.h | 1 |
3 files changed, 7 insertions, 3 deletions
diff --git a/gui/PopUpWidget.cpp b/gui/PopUpWidget.cpp index ca87c8d9df..acdc0feae6 100644 --- a/gui/PopUpWidget.cpp +++ b/gui/PopUpWidget.cpp @@ -252,8 +252,8 @@ void PopUpDialog::drawMenuEntry(int entry, bool hilite) { g_gui.fillRect(x, y, w, kLineHeight, hilite ? g_gui._textcolorhi : g_gui._bgcolor); if (name.size() == 0) { // Draw a seperator - g_gui.hLine(x, y + kLineHeight / 2, x + w - 1, g_gui._color); - g_gui.hLine(x + 1, y + 1 + kLineHeight / 2, x + w - 1, g_gui._shadowcolor); + g_gui.hLine(x - 1, y + kLineHeight / 2, x + w, g_gui._shadowcolor); + g_gui.hLine(x, y + 1 + kLineHeight / 2, x + w, g_gui._color); } else { g_gui.drawString(name, x + 1, y + 2, w - 2, hilite ? g_gui._bgcolor : g_gui._textcolor); } @@ -273,6 +273,9 @@ PopUpWidget::PopUpWidget(GuiObject *boss, int x, int y, int w, int h, const Stri _type = kPopUpWidget; _selectedItem = -1; + + if (!_label.isEmpty() && _labelWidth == 0) + _labelWidth = g_gui.getStringWidth(_label); } void PopUpWidget::handleMouseDown(int x, int y, int button, int clickCount) { diff --git a/gui/PopUpWidget.h b/gui/PopUpWidget.h index 4b20415e72..963485e28d 100644 --- a/gui/PopUpWidget.h +++ b/gui/PopUpWidget.h @@ -53,7 +53,7 @@ protected: uint _labelWidth; public: - PopUpWidget(GuiObject *boss, int x, int y, int w, int h, const String &label, uint labelWidth); + PopUpWidget(GuiObject *boss, int x, int y, int w, int h, const String &label, uint labelWidth = 0); void handleMouseDown(int x, int y, int button, int clickCount); diff --git a/gui/dialog.h b/gui/dialog.h index 46cf2bac7e..5fd197ac7d 100644 --- a/gui/dialog.h +++ b/gui/dialog.h @@ -78,6 +78,7 @@ protected: ButtonWidget *addButton(int x, int y, const Common::String &label, uint32 cmd, char hotkey); void setResult(int result) { _result = result; } + int getResult() const { return _result; } }; #endif |