diff options
Diffstat (limited to 'src/gui/widgets/avatarlistbox.cpp')
-rw-r--r-- | src/gui/widgets/avatarlistbox.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp index 0235d104..6ec4d1e8 100644 --- a/src/gui/widgets/avatarlistbox.cpp +++ b/src/gui/widgets/avatarlistbox.cpp @@ -65,11 +65,11 @@ AvatarListBox::~AvatarListBox() void AvatarListBox::draw(gcn::Graphics *gcnGraphics) { - AvatarListModel* model = dynamic_cast<AvatarListModel*>(mListModel); - - if (!model) + if (!mListModel) return; + AvatarListModel* model = static_cast<AvatarListModel*>(mListModel); + updateAlpha(); Graphics *graphics = static_cast<Graphics*>(gcnGraphics); @@ -140,15 +140,12 @@ void AvatarListBox::mousePressed(gcn::MouseEvent &event) setSelected(y / getFont()->getHeight()); distributeActionEvent(); - if (event.getClickCount() == 2) + if (event.getClickCount() == 2 && mListModel) { int selected = getSelected(); - AvatarListModel *model = dynamic_cast<AvatarListModel*>(mListModel); - if (model) - { - chatWindow->addWhisperTab(model->getAvatarAt(selected) - ->getName(), true); - } + AvatarListModel *model = static_cast<AvatarListModel*>(mListModel); + chatWindow->addWhisperTab(model->getAvatarAt(selected)->getName(), + true); } } // TODO: Add support for context menu |