diff --git a/src/gui/interface/ScrollPanel.cpp b/src/gui/interface/ScrollPanel.cpp index 0c4c5f25a..46c9f39f3 100644 --- a/src/gui/interface/ScrollPanel.cpp +++ b/src/gui/interface/ScrollPanel.cpp @@ -33,7 +33,7 @@ int ScrollPanel::GetScrollLimit() void ScrollPanel::SetScrollPosition(int position) { offsetY = position; - ViewportPosition.Y = position; + ViewportPosition.Y = -position; } void ScrollPanel::XOnMouseWheelInside(int localx, int localy, int d) diff --git a/src/gui/interface/Textbox.h b/src/gui/interface/Textbox.h index 281587076..49eaac1ef 100644 --- a/src/gui/interface/Textbox.h +++ b/src/gui/interface/Textbox.h @@ -74,36 +74,6 @@ protected: virtual void pasteIntoSelection(); }; -/*class Textbox : public Component -{ - friend class TextboxAction; -protected: - std::string text; - std::string displayText; - int cursor, cursorPosition; - TextboxAction *actionCallback; - bool masked; - bool border; -public: - Textbox(Point position, Point size, std::string textboxText); - virtual ~Textbox(); - - virtual void SetText(std::string text); - virtual void SetDisplayText(std::string text); - std::string GetText(); - void SetActionCallback(TextboxAction * action) { actionCallback = action; } - virtual void OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt); - - void SetHidden(bool hidden) { masked = hidden; } - bool GetHidden() { return masked; } - - void SetBorder(bool border) {this->border = border;} - - void TextPosition(); - - virtual void Draw(const Point& screenPos); -}; -}*/ } diff --git a/src/gui/profile/ProfileActivity.cpp b/src/gui/profile/ProfileActivity.cpp index 4f652d9f4..492ad0121 100644 --- a/src/gui/profile/ProfileActivity.cpp +++ b/src/gui/profile/ProfileActivity.cpp @@ -213,6 +213,7 @@ void ProfileActivity::setUserInfo(UserInfo newInfo) bio = new ui::Textbox(ui::Point(4, currentY), ui::Point(Size.X-12, -1), info.biography); ((ui::Textbox*)bio)->SetInputType(ui::Textbox::Multiline); ((ui::Textbox*)bio)->SetActionCallback(new BioChangedAction(this)); + ((ui::Textbox*)bio)->SetLimit(20000); } else bio = new ui::Label(ui::Point(4, currentY), ui::Point(Size.X-12, -1), info.biography); @@ -254,7 +255,10 @@ void ProfileActivity::OnTryExit(ExitMethod method) void ProfileActivity::ResizeArea() { + int oldSize = scrollPanel->InnerSize.Y; scrollPanel->InnerSize = ui::Point(Size.X, bio->Position.Y + bio->Size.Y + 10); + if (oldSize+scrollPanel->ViewportPosition.Y == scrollPanel->Size.Y) + scrollPanel->SetScrollPosition(scrollPanel->InnerSize.Y-scrollPanel->Size.Y); } ProfileActivity::~ProfileActivity()