mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Book list: Fix a regression in the previous release that broke dragging to select multiple books
This commit is contained in:
parent
37f042affc
commit
c56109c1f3
@ -1177,6 +1177,14 @@ class BooksView(QTableView): # {{{
|
|||||||
|
|
||||||
def handle_mouse_press_event(self, ev):
|
def handle_mouse_press_event(self, ev):
|
||||||
m = ev.modifiers()
|
m = ev.modifiers()
|
||||||
|
b = ev.button()
|
||||||
|
if (
|
||||||
|
m == Qt.KeyboardModifier.NoModifier and b == Qt.MouseButton.LeftButton and
|
||||||
|
self.editTriggers() & QAbstractItemView.EditTrigger.SelectedClicked
|
||||||
|
):
|
||||||
|
index = self.indexAt(ev.pos())
|
||||||
|
self.last_mouse_press_on_row = index.row()
|
||||||
|
|
||||||
if m & Qt.KeyboardModifier.ShiftModifier:
|
if m & Qt.KeyboardModifier.ShiftModifier:
|
||||||
# Shift-Click in QTableView is badly behaved.
|
# Shift-Click in QTableView is badly behaved.
|
||||||
index = self.indexAt(ev.pos())
|
index = self.indexAt(ev.pos())
|
||||||
@ -1240,9 +1248,11 @@ class BooksView(QTableView): # {{{
|
|||||||
# edit triggers contain SelectedClicked and the clicked row is
|
# edit triggers contain SelectedClicked and the clicked row is
|
||||||
# already selected, so do it ourselves
|
# already selected, so do it ourselves
|
||||||
index = self.indexAt(ev.pos())
|
index = self.indexAt(ev.pos())
|
||||||
sm = self.selectionModel()
|
last_press, self.last_mouse_press_on_row = getattr(self, 'last_mouse_press_on_row', -111), -112
|
||||||
if index.isValid() and sm.isSelected(index):
|
if index.row() == last_press:
|
||||||
self.select_rows((index,), using_ids=False, change_current=False, scroll=False)
|
sm = self.selectionModel()
|
||||||
|
if index.isValid() and sm.isSelected(index):
|
||||||
|
self.select_rows((index,), using_ids=False, change_current=False, scroll=False)
|
||||||
QTableView.mouseReleaseEvent(self, ev)
|
QTableView.mouseReleaseEvent(self, ev)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -13,10 +13,12 @@
|
|||||||
#include <winrt/Windows.Foundation.Collections.h>
|
#include <winrt/Windows.Foundation.Collections.h>
|
||||||
#include <winrt/Windows.Storage.Streams.h>
|
#include <winrt/Windows.Storage.Streams.h>
|
||||||
#include <winrt/Windows.Media.SpeechSynthesis.h>
|
#include <winrt/Windows.Media.SpeechSynthesis.h>
|
||||||
|
#include <winrt/Windows.Media.Playback.h>
|
||||||
|
|
||||||
using namespace winrt::Windows::Foundation;
|
using namespace winrt::Windows::Foundation;
|
||||||
using namespace winrt::Windows::Foundation::Collections;
|
using namespace winrt::Windows::Foundation::Collections;
|
||||||
using namespace winrt::Windows::Media::SpeechSynthesis;
|
using namespace winrt::Windows::Media::SpeechSynthesis;
|
||||||
|
using namespace winrt::Windows::Media::Playback;
|
||||||
using namespace winrt::Windows::Storage::Streams;
|
using namespace winrt::Windows::Storage::Streams;
|
||||||
|
|
||||||
static PyObject*
|
static PyObject*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user