diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2013-04-07 13:40:00 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2013-04-07 13:40:00 (GMT) |
| commit | b4fb55f86e9add3248166278bb566f210dacf636 (patch) | |
| tree | 2a1fa8d339fdf03741998873a523258a87dea739 /src/gui/preview/PreviewView.cpp | |
| parent | 8d312ecdfadb7c68d00caf01effe0c1e0a45cb76 (diff) | |
| download | powder-b4fb55f86e9add3248166278bb566f210dacf636.zip powder-b4fb55f86e9add3248166278bb566f210dacf636.tar.gz | |
Allow signing out and editing profile from the old login button, add a button to edit avatar (directs to the website at the moment) Allow viewing profiles by clicking avatars
Diffstat (limited to 'src/gui/preview/PreviewView.cpp')
| -rw-r--r-- | src/gui/preview/PreviewView.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gui/preview/PreviewView.cpp b/src/gui/preview/PreviewView.cpp index 4211732..27584c9 100644 --- a/src/gui/preview/PreviewView.cpp +++ b/src/gui/preview/PreviewView.cpp @@ -10,6 +10,7 @@ #include "gui/Style.h" #include "Format.h" #include "gui/search/Thumbnail.h" +#include "gui/profile/ProfileActivity.h" #include "client/Client.h" #include "gui/interface/ScrollPanel.h" #include "gui/interface/AvatarButton.h" @@ -47,6 +48,20 @@ public: } }; +class PreviewView::AvatarAction: public ui::AvatarButtonAction +{ + PreviewView * v; +public: + AvatarAction(PreviewView * v_){ v = v_; } + virtual void ActionCallback(ui::AvatarButton * sender) + { + if(sender->GetUsername().size() > 0) + { + new ProfileActivity(sender->GetUsername()); + } + } +}; + PreviewView::PreviewView(): ui::Window(ui::Point(-1, -1), ui::Point((XRES/2)+210, (YRES/2)+150)), savePreview(NULL), @@ -166,6 +181,7 @@ PreviewView::PreviewView(): if(showAvatars) { avatarButton = new ui::AvatarButton(ui::Point(4, (YRES/2)+4), ui::Point(34, 34), ""); + avatarButton->SetActionCallback(new AvatarAction(this)); AddComponent(avatarButton); } @@ -546,6 +562,7 @@ void PreviewView::NotifyCommentsChanged(PreviewModel * sender) if(showAvatars) { tempAvatar = new ui::AvatarButton(ui::Point(2, currentY+7), ui::Point(26, 26), comments->at(i)->authorName); + tempAvatar->SetActionCallback(new AvatarAction(this)); commentComponents.push_back(tempAvatar); commentsPanel->AddChild(tempAvatar); } |
