diff options
| author | jacob1 <jfu614@gmail.com> | 2013-07-21 21:05:55 (GMT) |
|---|---|---|
| committer | jacob1 <jfu614@gmail.com> | 2013-07-21 21:05:55 (GMT) |
| commit | e0913d2639dbec89d7ab795be8de12d1e9ec0efb (patch) | |
| tree | ebada7a67debd5985bc11faf9bd5c1739bad06bb /src/gui/preview/PreviewView.cpp | |
| parent | a63f5b875b9d31f8932ca62537ae7b863ef7f8b8 (diff) | |
| download | powder-e0913d2639dbec89d7ab795be8de12d1e9ec0efb.zip powder-e0913d2639dbec89d7ab795be8de12d1e9ec0efb.tar.gz | |
can change comment pages without the scrollwheel, click and hold scrollbar area to have it scroll to that point
Diffstat (limited to 'src/gui/preview/PreviewView.cpp')
| -rw-r--r-- | src/gui/preview/PreviewView.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/gui/preview/PreviewView.cpp b/src/gui/preview/PreviewView.cpp index 590798e..de17531 100644 --- a/src/gui/preview/PreviewView.cpp +++ b/src/gui/preview/PreviewView.cpp @@ -376,12 +376,23 @@ void PreviewView::OnMouseWheel(int x, int y, int d) c->NextCommentPage(); if(commentsPanel->GetScrollLimit() == -1 && d > 0) { - prevPage = true; - c->PrevCommentPage(); + if (c->PrevCommentPage()) + prevPage = true; } } +void PreviewView::OnMouseUp(int x, int y, unsigned int button) +{ + if(commentsPanel->GetScrollLimit() == 1) + c->NextCommentPage(); + if(commentsPanel->GetScrollLimit() == -1) + { + if (c->PrevCommentPage()) + prevPage = true; + } +} + void PreviewView::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt) { if ((key == KEY_ENTER || key == KEY_RETURN) && (!addCommentBox || !addCommentBox->IsFocused())) @@ -558,7 +569,7 @@ void PreviewView::NotifyCommentsChanged(PreviewModel * sender) } if(showAvatars) - tempUsername = new ui::Label(ui::Point(31, currentY+3), ui::Point(Size.X-((XRES/2) + 13), 16), comments->at(i)->authorNameFormatted); + tempUsername = new ui::Label(ui::Point(31, currentY+3), ui::Point(Size.X-((XRES/2) + 13 + 26), 16), comments->at(i)->authorNameFormatted); else tempUsername = new ui::Label(ui::Point(5, currentY+3), ui::Point(Size.X-((XRES/2) + 13), 16), comments->at(i)->authorNameFormatted); tempUsername->Appearance.HorizontalAlign = ui::Appearance::AlignLeft; @@ -593,8 +604,6 @@ void PreviewView::NotifyCommentsChanged(PreviewModel * sender) { prevPage = false; commentsPanel->SetScrollPosition(currentY); - //update positions of the comments so that it doesn't start at the top for a frame - commentsPanel->Tick(0); } } } |
