Skip to content

Commit

Permalink
UI|Home: Column highlight is updated after mouse wheel events
Browse files Browse the repository at this point in the history
Mouse wheel events register as mouse activity in a column.
  • Loading branch information
skyjake committed Feb 27, 2016
1 parent 85fa2bd commit 142ac1a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions doomsday/apps/client/src/ui/home/columnwidget.cpp
Expand Up @@ -30,6 +30,9 @@ using namespace de;

DENG_GUI_PIMPL(ColumnWidget)
{
/**
* Procedural image for drawing the background of a column.
*/
struct BackgroundImage : public StyleProceduralImage
{
Animation colorAnim { 0, Animation::Linear };
Expand Down Expand Up @@ -172,11 +175,12 @@ void ColumnWidget::setHighlighted(bool highlighted)
bool ColumnWidget::dispatchEvent(Event const &event, bool (Widget::*memberFunc)(Event const &))
{
// Observe mouse clicks occurring in the column.
if(event.isMouse() && event.type() == Event::MouseButton)
if(event.type() == Event::MouseButton ||
event.type() == Event::MouseWheel)
{
MouseEvent const &mouse = event.as<MouseEvent>();
if(mouse.state() == MouseEvent::Pressed &&
d->scrollArea->contentRect().contains(mouse.pos()))
if((mouse.motion() == MouseEvent::Wheel || mouse.state() == MouseEvent::Pressed) &&
rule().recti().contains(mouse.pos()))
{
emit mouseActivity(this);
}
Expand Down

0 comments on commit 142ac1a

Please sign in to comment.