aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rw-r--r--gui/widget.cpp12
-rw-r--r--gui/widget.h2
2 files changed, 10 insertions, 4 deletions
diff --git a/gui/widget.cpp b/gui/widget.cpp
index 9fa864e7b9..82007c588f 100644
--- a/gui/widget.cpp
+++ b/gui/widget.cpp
@@ -303,17 +303,23 @@ void ButtonWidget::setLabel(const Common::String &label) {
StaticTextWidget::setLabel(cleanupHotkey(label));
}
-ButtonWidget *addClearButton(GuiObject *boss, const Common::String &name, uint32 cmd) {
+ButtonWidget *addClearButton(GuiObject *boss, const Common::String &name, uint32 cmd, int x, int y, int w, int h) {
ButtonWidget *button;
#ifndef DISABLE_FANCY_THEMES
if (g_gui.xmlEval()->getVar("Globals.ShowSearchPic") == 1 && g_gui.theme()->supportsImages()) {
- button = new PicButtonWidget(boss, name, _("Clear value"), cmd);
+ if (!name.empty())
+ button = new PicButtonWidget(boss, name, _("Clear value"), cmd);
+ else
+ button = new PicButtonWidget(boss, x, y, w, h, _("Clear value"), cmd);
((PicButtonWidget *)button)->useThemeTransparency(true);
((PicButtonWidget *)button)->setGfx(g_gui.theme()->getImageSurface(ThemeEngine::kImageEraser));
} else
#endif
- button = new ButtonWidget(boss, name, "C", _("Clear value"), cmd);
+ if (!name.empty())
+ button = new ButtonWidget(boss, name, "C", _("Clear value"), cmd);
+ else
+ button = new ButtonWidget(boss, x, y, w, h, "C", _("Clear value"), cmd);
return button;
}
diff --git a/gui/widget.h b/gui/widget.h
index 9894dc4526..789fc09231 100644
--- a/gui/widget.h
+++ b/gui/widget.h
@@ -354,7 +354,7 @@ protected:
void drawWidget();
};
-ButtonWidget *addClearButton(GuiObject *boss, const Common::String &name, uint32 cmd);
+ButtonWidget *addClearButton(GuiObject *boss, const Common::String &name, uint32 cmd, int x=0, int y=0, int w=0, int h=0);
} // End of namespace GUI