mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 04:54:29 -04:00
added a border to selected/mouseHover elements in the grid view
This commit is contained in:
23
custom_widgets/yacreader_flow.cpp
Normal file
23
custom_widgets/yacreader_flow.cpp
Normal file
@ -0,0 +1,23 @@
|
||||
#include "yacreader_flow.h"
|
||||
|
||||
#include <QMouseEvent>
|
||||
|
||||
|
||||
YACReaderFlow::YACReaderFlow(QWidget * parent,FlowType flowType) : PictureFlow(parent,flowType) {}
|
||||
|
||||
void YACReaderFlow::mousePressEvent(QMouseEvent* event)
|
||||
{
|
||||
if(event->x() > (width()+slideSize().width())/2)
|
||||
showNext();
|
||||
else
|
||||
if(event->x() < (width()-slideSize().width())/2)
|
||||
showPrevious();
|
||||
//else (centered cover space)
|
||||
}
|
||||
|
||||
void YACReaderFlow::mouseDoubleClickEvent(QMouseEvent* event)
|
||||
{
|
||||
if((event->x() > (width()-slideSize().width())/2)&&(event->x() < (width()+slideSize().width())/2))
|
||||
emit selected(centerIndex());
|
||||
}
|
||||
|
Reference in New Issue
Block a user