[apps] Probability: enable to copy content of non-editable calculations

This commit is contained in:
Émilie Feral
2017-12-21 17:35:01 +01:00
committed by EmilieNumworks
parent 26bbfa85ec
commit 30e6d0b3f0
2 changed files with 10 additions and 0 deletions

View File

@@ -82,6 +82,15 @@ void CalculationController::didBecomeFirstResponder() {
app()->setFirstResponder(&m_selectableTableView);
}
bool CalculationController::handleEvent(Ion::Events::Event event) {
if (event == Ion::Events::Copy && selectedColumn() > 0) {
CalculationCell * myCell = static_cast<CalculationCell *>(m_selectableTableView.selectedCell());
Clipboard::sharedClipboard()->store(myCell->editableTextCell()->textField()->text());
return true;
}
return false;
}
View * CalculationController::view() {
return &m_contentView;
}

View File

@@ -17,6 +17,7 @@ public:
/* Responder */
void didEnterResponderChain(Responder * previousResponder) override;
void didBecomeFirstResponder() override;
bool handleEvent(Ion::Events::Event event) override;
/* ViewController */
View * view() override;