make trash icons more explicit

preferencesAboutTextFull
Clément Fauconnier 3 years ago
parent 0f9196f5e5
commit ee4e283074
  1. 7
      resources/OpenBoard.qrc
  2. BIN
      resources/images/trash-delete-document.png
  3. BIN
      resources/images/trash-delete-folder.png
  4. BIN
      resources/images/trash-document-page.png
  5. BIN
      resources/images/trash-document.png
  6. BIN
      resources/images/trash-empty.png
  7. BIN
      resources/images/trash-folder.png
  8. BIN
      resources/images/trash-my-documents.png
  9. 55
      src/document/UBDocumentController.cpp
  10. 1
      src/document/UBDocumentController.h

@ -366,5 +366,12 @@
<file>images/desc.png</file> <file>images/desc.png</file>
<file>images/toolPalette/axesTool.png</file> <file>images/toolPalette/axesTool.png</file>
<file>images/numbersTool.svg</file> <file>images/numbersTool.svg</file>
<file>images/trash-my-documents.png</file>
<file>images/trash-empty.png</file>
<file>images/trash-folder.png</file>
<file>images/trash-delete-document.png</file>
<file>images/trash-delete-folder.png</file>
<file>images/trash-document.png</file>
<file>images/trash-document-page.png</file>
</qresource> </qresource>
</RCC> </RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

@ -1387,6 +1387,12 @@ void UBDocumentTreeView::hSliderRangeChanged(int min, int max)
} }
} }
void UBDocumentTreeView::mousePressEvent(QMouseEvent *event)
{
QTreeView::mousePressEvent(event);
UBApplication::documentController->updateActions();
}
void UBDocumentTreeView::dragEnterEvent(QDragEnterEvent *event) void UBDocumentTreeView::dragEnterEvent(QDragEnterEvent *event)
{ {
QTreeView::dragEnterEvent(event); QTreeView::dragEnterEvent(event);
@ -3429,20 +3435,57 @@ void UBDocumentController::updateActions()
switch (static_cast<int>(deletionForSelection)) { switch (static_cast<int>(deletionForSelection)) {
case MoveToTrash : case MoveToTrash :
if (mSelectionType == Folder)
{
mMainWindow->actionDelete->setIcon(QIcon(":/images/trash-folder.png"));
mMainWindow->actionDelete->setText(tr("Empty"));
}
else if (mSelectionType == Document)
{
mMainWindow->actionDelete->setIcon(QIcon(":/images/trash-document.png"));
mMainWindow->actionDelete->setText(tr("Trash"));
}
else if (mSelectionType == Page)
{
mMainWindow->actionDelete->setIcon(QIcon(":/images/trash-document-page.png"));
mMainWindow->actionDelete->setText(tr("Trash"));
}
else
{//can happen ?
mMainWindow->actionDelete->setIcon(QIcon(":/images/trash.png"));
mMainWindow->actionDelete->setText(tr("Trash"));
}
break;
case DeletePage : case DeletePage :
mMainWindow->actionDelete->setIcon(QIcon(":/images/trash.png")); mMainWindow->actionDelete->setIcon(QIcon(":/images/trash-document-page.png"));
mMainWindow->actionDelete->setText(tr("Trash")); mMainWindow->actionDelete->setText(tr("Trash"));
break; break;
case CompleteDelete : case CompleteDelete :
mMainWindow->actionDelete->setIcon(QIcon(":/images/toolbar/deleteDocument.png")); if (mSelectionType == Folder)
mMainWindow->actionDelete->setText(tr("Delete")); {
mMainWindow->actionDelete->setIcon(QIcon(":/images/trash-delete-folder.png"));
mMainWindow->actionDelete->setText(tr("Delete"));
}
else
{
mMainWindow->actionDelete->setIcon(QIcon(":/images/trash-delete-document.png"));
mMainWindow->actionDelete->setText(tr("Delete"));
}
break; break;
case EmptyFolder : case EmptyFolder :
mMainWindow->actionDelete->setIcon(QIcon(":/images/trash.png")); if (firstSelectedTreeIndex() == docModel->myDocumentsIndex())
mMainWindow->actionDelete->setText(tr("Empty")); {
mMainWindow->actionDelete->setIcon(QIcon(":/images/trash-my-documents.png"));
mMainWindow->actionDelete->setText(tr("Empty"));
}
else
{
mMainWindow->actionDelete->setIcon(QIcon(":/images/trash-folder.png"));
mMainWindow->actionDelete->setText(tr("Empty"));
}
break; break;
case EmptyTrash : case EmptyTrash :
mMainWindow->actionDelete->setIcon(QIcon(":/images/toolbar/deleteDocument.png")); mMainWindow->actionDelete->setIcon(QIcon(":/images/trash-empty.png"));
mMainWindow->actionDelete->setText(tr("Empty")); mMainWindow->actionDelete->setText(tr("Empty"));
break; break;
} }

@ -305,6 +305,7 @@ public slots:
void hSliderRangeChanged(int min, int max); void hSliderRangeChanged(int min, int max);
protected: protected:
void mousePressEvent(QMouseEvent *event) override;
void dragEnterEvent(QDragEnterEvent *event); void dragEnterEvent(QDragEnterEvent *event);
void dragLeaveEvent(QDragLeaveEvent *event); void dragLeaveEvent(QDragLeaveEvent *event);
void dragMoveEvent(QDragMoveEvent *event); void dragMoveEvent(QDragMoveEvent *event);

Loading…
Cancel
Save