6d8be225ca
StatusView now allows the selecting of accounts through a MenuButton with BitmapMenuItems― the button for selecting an account is nice and discrete, just showing the bitmap of a protocol (in leiu of a label). No functional changes, other than this menu. I tried making all AccountsMenus use BitmapMenuItems, but that gets unweildy pretty quickly― for now they remain in this menu. Maybe optional ownership of bitmaps in BitmapMenuItems and caching of protocol items would help.
44 lines
860 B
C++
44 lines
860 B
C++
/*
|
|
* Copyright 2009, Pier Luigi Fiorini. All rights reserved.
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
#ifndef _STATUS_VIEW_H
|
|
#define _STATUS_VIEW_H
|
|
|
|
#include <View.h>
|
|
|
|
#include "AppConstants.h"
|
|
|
|
class BPopUpMenu;
|
|
|
|
class BitmapView;
|
|
class MenuButton;
|
|
class NicknameTextControl;
|
|
class Server;
|
|
|
|
class StatusView : public BView {
|
|
public:
|
|
StatusView(const char* name, Server* server);
|
|
|
|
virtual void AttachedToWindow();
|
|
virtual void MessageReceived(BMessage* msg);
|
|
|
|
void SetName(BString name);
|
|
void SetStatus(UserStatus status);
|
|
void SetAvatarIcon(const BBitmap* bitmap);
|
|
|
|
private:
|
|
void _PopulateAccountMenu();
|
|
|
|
NicknameTextControl* fNickname;
|
|
BitmapView* fAvatar;
|
|
BPopUpMenu* fStatusMenu;
|
|
|
|
MenuButton* fAccountsButton;
|
|
BPopUpMenu* fAccountsMenu;
|
|
|
|
Server* fServer;
|
|
};
|
|
|
|
#endif // _STATUS_VIEW_H
|