fixed some issues introduced with last commit on selection

preferencesAboutTextFull
Clément Fauconnier 3 years ago
parent 67611680e4
commit bc3921ebdd
  1. 10
      src/document/UBDocumentController.cpp
  2. 2
      src/document/UBDocumentController.h
  3. 5
      src/gui/UBThumbnailWidget.cpp
  4. 1
      src/gui/UBThumbnailWidget.h

@ -1401,7 +1401,6 @@ void UBDocumentTreeView::hSliderRangeChanged(int min, int max)
void UBDocumentTreeView::mousePressEvent(QMouseEvent *event) void UBDocumentTreeView::mousePressEvent(QMouseEvent *event)
{ {
QTreeView::mousePressEvent(event); QTreeView::mousePressEvent(event);
UBApplication::documentController->updateActions();
} }
void UBDocumentTreeView::dragEnterEvent(QDragEnterEvent *event) void UBDocumentTreeView::dragEnterEvent(QDragEnterEvent *event)
@ -1942,9 +1941,11 @@ void UBDocumentController::TreeViewSelectionChanged(const QModelIndex &current,
//We have just to pass a null proxy to disable the display of thumbnail //We have just to pass a null proxy to disable the display of thumbnail
UBDocumentProxy *currentDocumentProxy = 0; UBDocumentProxy *currentDocumentProxy = 0;
if(current_index.isValid() && mDocumentUI->documentTreeView->selectionModel()->selectedRows(0).size() == 1){ if(current_index.isValid() && mDocumentUI->documentTreeView->selectionModel()->selectedRows(0).size() == 1)
{
currentDocumentProxy = docModel->proxyData(current_index); currentDocumentProxy = docModel->proxyData(current_index);
setDocument(currentDocumentProxy, false); setDocument(currentDocumentProxy, false);
clearThumbnailsSelection();
} }
//N/C - NNE - 20140414 : END //N/C - NNE - 20140414 : END
@ -3907,3 +3908,8 @@ void UBDocumentController::expandAll()
mDocumentUI->documentTreeView->setAnimated(true); mDocumentUI->documentTreeView->setAnimated(true);
} }
void UBDocumentController::clearThumbnailsSelection()
{
mDocumentUI->thumbnailWidget->clearSelection();
}

@ -458,6 +458,8 @@ class UBDocumentController : public UBDocumentContainer
QModelIndex findNextSiblingNotSelected(const QModelIndex &index, QItemSelectionModel *selectionModel); QModelIndex findNextSiblingNotSelected(const QModelIndex &index, QItemSelectionModel *selectionModel);
bool parentIsSelected(const QModelIndex& child, QItemSelectionModel *selectionModel); bool parentIsSelected(const QModelIndex& child, QItemSelectionModel *selectionModel);
void clearThumbnailsSelection();
signals: signals:
void exportDone(); void exportDone();
void reorderDocumentsRequested(); void reorderDocumentsRequested();

@ -232,6 +232,11 @@ QList<QGraphicsItem*> UBThumbnailWidget::selectedItems()
return sortedSelectedItems; return sortedSelectedItems;
} }
void UBThumbnailWidget::clearSelection()
{
mThumbnailsScene.clearSelection();
}
void UBThumbnailWidget::mousePressEvent(QMouseEvent *event) void UBThumbnailWidget::mousePressEvent(QMouseEvent *event)
{ {

@ -66,6 +66,7 @@ class UBThumbnailWidget : public QGraphicsView
QList<QGraphicsItem*> selectedItems(); QList<QGraphicsItem*> selectedItems();
void selectItemAt(int pIndex, bool extend = false); void selectItemAt(int pIndex, bool extend = false);
void unselectItemAt(int pIndex); void unselectItemAt(int pIndex);
void clearSelection();
qreal thumbnailWidth() qreal thumbnailWidth()
{ {

Loading…
Cancel
Save