@@ -737,6 +737,14 @@ void QtCodeArea::activateLocationId(Id locationId, bool fromMouse)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QtCodeArea::copySelection()
|
||||||
|
{
|
||||||
|
if (textCursor().hasSelection())
|
||||||
|
{
|
||||||
|
copy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void QtCodeArea::resizeEvent(QResizeEvent* e)
|
void QtCodeArea::resizeEvent(QResizeEvent* e)
|
||||||
{
|
{
|
||||||
QPlainTextEdit::resizeEvent(e);
|
QPlainTextEdit::resizeEvent(e);
|
||||||
|
|||||||
@@ -94,6 +94,8 @@ public:
|
|||||||
bool moveFocusInLine(size_t lineNumber, Id locationId, bool forward);
|
bool moveFocusInLine(size_t lineNumber, Id locationId, bool forward);
|
||||||
void activateLocationId(Id locationId, bool fromMouse);
|
void activateLocationId(Id locationId, bool fromMouse);
|
||||||
|
|
||||||
|
void copySelection();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void resizeEvent(QResizeEvent* event) override;
|
virtual void resizeEvent(QResizeEvent* event) override;
|
||||||
virtual void mouseReleaseEvent(QMouseEvent* event) override;
|
virtual void mouseReleaseEvent(QMouseEvent* event) override;
|
||||||
|
|||||||
@@ -404,6 +404,14 @@ void QtCodeFile::focusBottom()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QtCodeFile::copySelection()
|
||||||
|
{
|
||||||
|
for (QtCodeSnippet* snippet: m_snippets)
|
||||||
|
{
|
||||||
|
snippet->copySelection();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void QtCodeFile::clickedMinimizeButton()
|
void QtCodeFile::clickedMinimizeButton()
|
||||||
{
|
{
|
||||||
MessageChangeFileView msg(
|
MessageChangeFileView msg(
|
||||||
|
|||||||
@@ -71,6 +71,8 @@ public:
|
|||||||
void focusTop();
|
void focusTop();
|
||||||
void focusBottom();
|
void focusBottom();
|
||||||
|
|
||||||
|
void copySelection();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void clickedMinimizeButton();
|
void clickedMinimizeButton();
|
||||||
void clickedSnippetButton();
|
void clickedSnippetButton();
|
||||||
|
|||||||
@@ -370,6 +370,14 @@ void QtCodeFileList::moveFocus(const CodeFocusHandler::Focus& focus, CodeFocusHa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QtCodeFileList::copySelection()
|
||||||
|
{
|
||||||
|
for (QtCodeFile* file: m_files)
|
||||||
|
{
|
||||||
|
file->copySelection();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void QtCodeFileList::maximizeFirstFile()
|
void QtCodeFileList::maximizeFirstFile()
|
||||||
{
|
{
|
||||||
if (m_files.size())
|
if (m_files.size())
|
||||||
|
|||||||
@@ -62,6 +62,8 @@ public:
|
|||||||
void setFocusOnTop() override;
|
void setFocusOnTop() override;
|
||||||
void moveFocus(const CodeFocusHandler::Focus& focus, CodeFocusHandler::Direction direction) override;
|
void moveFocus(const CodeFocusHandler::Focus& focus, CodeFocusHandler::Direction direction) override;
|
||||||
|
|
||||||
|
void copySelection() override;
|
||||||
|
|
||||||
void maximizeFirstFile();
|
void maximizeFirstFile();
|
||||||
|
|
||||||
std::pair<QtCodeFile*, Id> getFirstFileWithActiveLocationId() const;
|
std::pair<QtCodeFile*, Id> getFirstFileWithActiveLocationId() const;
|
||||||
|
|||||||
@@ -261,6 +261,14 @@ void QtCodeFileSingle::moveFocus(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QtCodeFileSingle::copySelection()
|
||||||
|
{
|
||||||
|
if (m_area)
|
||||||
|
{
|
||||||
|
m_area->copySelection();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const FilePath& QtCodeFileSingle::getCurrentFilePath() const
|
const FilePath& QtCodeFileSingle::getCurrentFilePath() const
|
||||||
{
|
{
|
||||||
return m_currentFilePath;
|
return m_currentFilePath;
|
||||||
|
|||||||
@@ -56,6 +56,8 @@ public:
|
|||||||
void setFocusOnTop() override;
|
void setFocusOnTop() override;
|
||||||
void moveFocus(const CodeFocusHandler::Focus& focus, CodeFocusHandler::Direction direction) override;
|
void moveFocus(const CodeFocusHandler::Focus& focus, CodeFocusHandler::Direction direction) override;
|
||||||
|
|
||||||
|
void copySelection() override;
|
||||||
|
|
||||||
const FilePath& getCurrentFilePath() const;
|
const FilePath& getCurrentFilePath() const;
|
||||||
bool hasFileCached(const FilePath& filePath) const;
|
bool hasFileCached(const FilePath& filePath) const;
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,8 @@ public:
|
|||||||
virtual void moveFocus(
|
virtual void moveFocus(
|
||||||
const CodeFocusHandler::Focus& focus, CodeFocusHandler::Direction direction) = 0;
|
const CodeFocusHandler::Focus& focus, CodeFocusHandler::Direction direction) = 0;
|
||||||
|
|
||||||
|
virtual void copySelection() = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void ensureWidgetVisibleAnimated(
|
void ensureWidgetVisibleAnimated(
|
||||||
const QWidget* parentWidget,
|
const QWidget* parentWidget,
|
||||||
|
|||||||
@@ -785,6 +785,13 @@ void QtCodeNavigator::keyPressEvent(QKeyEvent* event)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case Qt::Key_C:
|
||||||
|
if (ctrl && !alt && !shift)
|
||||||
|
{
|
||||||
|
m_current->copySelection();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
QWidget::keyPressEvent(event);
|
QWidget::keyPressEvent(event);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -227,6 +227,11 @@ void QtCodeSnippet::focusBottom()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QtCodeSnippet::copySelection()
|
||||||
|
{
|
||||||
|
m_codeArea->copySelection();
|
||||||
|
}
|
||||||
|
|
||||||
void QtCodeSnippet::ensureLocationIdVisible(Id locationId, bool animated)
|
void QtCodeSnippet::ensureLocationIdVisible(Id locationId, bool animated)
|
||||||
{
|
{
|
||||||
m_codeArea->ensureLocationIdVisible(locationId, width(), animated);
|
m_codeArea->ensureLocationIdVisible(locationId, width(), animated);
|
||||||
|
|||||||
@@ -59,6 +59,8 @@ public:
|
|||||||
void focusTop();
|
void focusTop();
|
||||||
void focusBottom();
|
void focusBottom();
|
||||||
|
|
||||||
|
void copySelection();
|
||||||
|
|
||||||
void ensureLocationIdVisible(Id locationId, bool animated);
|
void ensureLocationIdVisible(Id locationId, bool animated);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|||||||
Reference in New Issue
Block a user