diff options
Diffstat (limited to 'gui/widgets')
-rw-r--r-- | gui/widgets/edittext.cpp | 8 | ||||
-rw-r--r-- | gui/widgets/edittext.h | 4 | ||||
-rw-r--r-- | gui/widgets/scrollcontainer.cpp | 1 |
3 files changed, 7 insertions, 6 deletions
diff --git a/gui/widgets/edittext.cpp b/gui/widgets/edittext.cpp index ba9ef616ba..b73cb99ced 100644 --- a/gui/widgets/edittext.cpp +++ b/gui/widgets/edittext.cpp @@ -28,26 +28,26 @@ namespace GUI { -EditTextWidget::EditTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, const char *tooltip, uint32 cmd, uint32 finishCmd) +EditTextWidget::EditTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, const char *tooltip, uint32 cmd, uint32 finishCmd, ThemeEngine::FontStyle font) : EditableWidget(boss, x, y - 1, w, h + 2, tooltip, cmd) { setFlags(WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS | WIDGET_WANT_TICKLE); _type = kEditTextWidget; _finishCmd = finishCmd; setEditString(text); - setFontStyle(ThemeEngine::kFontStyleNormal); + setFontStyle(font); _leftPadding = _rightPadding = 0; } -EditTextWidget::EditTextWidget(GuiObject *boss, const String &name, const String &text, const char *tooltip, uint32 cmd, uint32 finishCmd) +EditTextWidget::EditTextWidget(GuiObject *boss, const String &name, const String &text, const char *tooltip, uint32 cmd, uint32 finishCmd, ThemeEngine::FontStyle font) : EditableWidget(boss, name, tooltip, cmd) { setFlags(WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS | WIDGET_WANT_TICKLE); _type = kEditTextWidget; _finishCmd = finishCmd; setEditString(text); - setFontStyle(ThemeEngine::kFontStyleNormal); + setFontStyle(font); _leftPadding = _rightPadding = 0; } diff --git a/gui/widgets/edittext.h b/gui/widgets/edittext.h index 9a1b698606..a20d40eb33 100644 --- a/gui/widgets/edittext.h +++ b/gui/widgets/edittext.h @@ -40,8 +40,8 @@ protected: int _rightPadding; public: - EditTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, const char *tooltip = 0, uint32 cmd = 0, uint32 finishCmd = 0); - EditTextWidget(GuiObject *boss, const String &name, const String &text, const char *tooltp = 0, uint32 cmd = 0, uint32 finishCmd = 0); + EditTextWidget(GuiObject *boss, int x, int y, int w, int h, const String &text, const char *tooltip = 0, uint32 cmd = 0, uint32 finishCmd = 0, ThemeEngine::FontStyle font = ThemeEngine::kFontStyleNormal); + EditTextWidget(GuiObject *boss, const String &name, const String &text, const char *tooltp = 0, uint32 cmd = 0, uint32 finishCmd = 0, ThemeEngine::FontStyle font = ThemeEngine::kFontStyleNormal); void setEditString(const String &str); diff --git a/gui/widgets/scrollcontainer.cpp b/gui/widgets/scrollcontainer.cpp index 7e3f50d3bb..5a0e408d1e 100644 --- a/gui/widgets/scrollcontainer.cpp +++ b/gui/widgets/scrollcontainer.cpp @@ -74,6 +74,7 @@ void ScrollContainerWidget::recalc() { h = max - min; if (h <= _limitH) _scrolledY = 0; + if (_scrolledY > h - _limitH) _scrolledY = 0; _verticalScroll->_numEntries = h; _verticalScroll->_currentPos = _scrolledY; |