mirror of
https://github.com/YACReader/yacreader
synced 2026-03-02 02:43:04 -05:00
Fix YACReaderLibraryListWidget::mousePressEvent
This commit is contained in:
@ -75,9 +75,12 @@ void YACReaderLibraryListWidget::removeItem(int index)
|
|||||||
void YACReaderLibraryListWidget::mousePressEvent(QMouseEvent *event)
|
void YACReaderLibraryListWidget::mousePressEvent(QMouseEvent *event)
|
||||||
{
|
{
|
||||||
if (librariesList.count() > 0) {
|
if (librariesList.count() > 0) {
|
||||||
int h = librariesList.at(0)->height();
|
QWidget *child = childAt(event->pos());
|
||||||
int item = event->pos().y() / h;
|
while (child && child->parentWidget() != this) {
|
||||||
if (item != currentLibraryIndex) {
|
child = child->parentWidget();
|
||||||
|
}
|
||||||
|
int item = librariesList.indexOf(qobject_cast<YACReaderLibraryItemWidget *>(child));
|
||||||
|
if (item != -1 && item != currentLibraryIndex) {
|
||||||
setCurrentIndex(item);
|
setCurrentIndex(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user