+ m_popup->addAction(action);
+ }
+}
+
+void DolphinContextMenu::setShiftIsPressed(bool pressed)
+{
+ m_shiftIsPressed = pressed;
+}
+
+void DolphinContextMenu::deleteOrTrashMenuEntry(Qt::Key key, bool pressed)
+{
+ if(m_mainWindow->activeViewContainer()->url().isLocalFile() && !m_showDeleteCommand && key == Qt::Key_Shift) {
+
+ // Set the current size as fixed size so that the menu isn't flickering when pressing shift.
+ m_popup->setFixedSize(m_popup->size());
+ if(pressed) {
+ m_mainWindow->actionCollection()->action("delete")->setVisible(true);
+ m_mainWindow->actionCollection()->action("move_to_trash")->setVisible(false);
+ }
+ else {
+ m_mainWindow->actionCollection()->action("delete")->setVisible(false);
+ m_mainWindow->actionCollection()->action("move_to_trash")->setVisible(true);
+ }
+
+ // This sets the menu back to a dynamic size followed by a forced resize incase the newly made visible action has bigger text.
+ m_popup->setFixedSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX));
+ m_popup->resize(m_popup->sizeHint());