mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-05 10:40:42 +00:00
Unselect graph when selecting from another one, switch from Control to Shift key
This commit is contained in:
parent
8599598607
commit
3fe43ef621
@ -1061,7 +1061,7 @@ void gGraph::keyReleaseEvent(QKeyEvent *event)
|
||||
if (!m_graphview) return;
|
||||
|
||||
if (m_graphview->selectionInProgress() && m_graphview->metaSelect()) {
|
||||
if (!(event->modifiers() & Qt::ControlModifier)) {
|
||||
if (!(event->modifiers() & Qt::ShiftModifier)) {
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1384,11 +1384,19 @@ void gGraphView::mousePressEvent(QMouseEvent *event)
|
||||
}
|
||||
|
||||
{
|
||||
if (m_metaselect) {
|
||||
if (m_selected_graph) {
|
||||
m_selected_graph->m_selecting_area = false;
|
||||
}
|
||||
}
|
||||
// send event to graph..
|
||||
m_point_clicked = QPoint(event->x(), event->y());
|
||||
|
||||
//QMouseEvent e(event->type(),m_point_clicked,event->button(),event->buttons(),event->modifiers());
|
||||
|
||||
|
||||
m_button_down = true;
|
||||
m_metaselect = event->modifiers() && Qt::ControlModifier;
|
||||
m_metaselect = event->modifiers() && Qt::ShiftModifier;
|
||||
m_horiz_travel = 0;
|
||||
m_graph_index = i;
|
||||
m_selected_graph = m_graphs[i];
|
||||
@ -1441,11 +1449,16 @@ void gGraphView::mousePressEvent(QMouseEvent *event)
|
||||
}
|
||||
|
||||
{
|
||||
if (m_metaselect) {
|
||||
if (m_selected_graph) {
|
||||
m_selected_graph->m_selecting_area = false;
|
||||
}
|
||||
}
|
||||
// send event to graph..
|
||||
m_point_clicked = QPoint(event->x(), event->y());
|
||||
//QMouseEvent e(event->type(),m_point_clicked,event->button(),event->buttons(),event->modifiers());
|
||||
m_button_down = true;
|
||||
m_metaselect = event->modifiers() && Qt::ControlModifier;
|
||||
m_metaselect = event->modifiers() && Qt::ShiftModifier;
|
||||
|
||||
m_horiz_travel = 0;
|
||||
m_graph_index = i;
|
||||
@ -1559,7 +1572,7 @@ void gGraphView::mouseReleaseEvent(QMouseEvent *event)
|
||||
// The graph that got the button press gets the release event
|
||||
if (m_button_down) {
|
||||
m_button_down = false;
|
||||
m_metaselect = event->modifiers() & Qt::ControlModifier;
|
||||
m_metaselect = event->modifiers() & Qt::ShiftModifier;
|
||||
|
||||
if (m_metaselect) {
|
||||
m_point_released = event->pos();
|
||||
@ -1571,7 +1584,7 @@ void gGraphView::mouseReleaseEvent(QMouseEvent *event)
|
||||
|
||||
void gGraphView::keyReleaseEvent(QKeyEvent *event)
|
||||
{
|
||||
if (m_metaselect && !(event->modifiers() & Qt::ControlModifier)) {
|
||||
if (m_metaselect && !(event->modifiers() & Qt::ShiftModifier)) {
|
||||
QMouseEvent mevent(QEvent::MouseButtonRelease, m_point_released, Qt::LeftButton, Qt::LeftButton, event->modifiers());
|
||||
if (m_graph_index>=0)
|
||||
m_graphs[m_graph_index]->mouseReleaseEvent(&mevent);
|
||||
@ -1791,8 +1804,9 @@ void gGraphView::wheelEvent(QWheelEvent *event)
|
||||
void gGraphView::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
if (m_button_down) {
|
||||
m_metaselect = event->modifiers() & Qt::ControlModifier;
|
||||
m_metaselect = event->modifiers() & Qt::ShiftModifier;
|
||||
}
|
||||
|
||||
if (event->key() == Qt::Key_Tab) {
|
||||
event->ignore();
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user