Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Auto scroll profile viewer when textbox expands, add 20000 character …
…limit
  • Loading branch information
jacob1 committed Jul 10, 2015
1 parent 906b4a9 commit 85ce852
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/gui/interface/ScrollPanel.cpp
Expand Up @@ -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)
Expand Down
30 changes: 0 additions & 30 deletions src/gui/interface/Textbox.h
Expand Up @@ -74,36 +74,6 @@ class Textbox : public Label
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);
};
}*/
}


Expand Down
4 changes: 4 additions & 0 deletions src/gui/profile/ProfileActivity.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 85ce852

Please sign in to comment.