mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-11 06:34:14 +02:00
Take the right button away from the cable tool only, not from every tool
The cable feature suppressed the quick command ring for every running tool, so drawing a line or placing an element no longer got the ring a right drag shows -- a far wider change than the feature needed, and one nobody asked for (blocking review comment by ispyisail). The condition is now the cable tool alone. Diagram::cableToolIsRunning() says whether that is the running interface, and while it is, the right click cancels the line being drawn and opens neither the ring nor a context menu, neither QET's own nor the platform's -- which is the behaviour the cable tool needs and the only part that was ever intended. Everything else in mousePressEvent is upstream's original again: a gesture is tracked whatever else is running, a running tool sets m_gesture_over_tool so the press carries on to the scene and a drag ends the tool before the ring appears, and only the click which neither draws nor selects swallows the platform's menu. A structural diff of mousePressEvent against the commit before the cable feature shows three added conditions and nothing else.
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include "xml/terminalstripitemxml.h"
|
||||
#include "QPropertyUndoCommand/qpropertyundocommand.h"
|
||||
#include "diagramcontent.h"
|
||||
#include "diagramevent/diagrameventaddcable.h"
|
||||
#include "diagramevent/diagrameventinterface.h"
|
||||
#include "diagramposition.h"
|
||||
#include "factory/elementfactory.h"
|
||||
@@ -902,6 +903,23 @@ bool Diagram::eventInterfaceIsRunning() const
|
||||
return m_event_interface && m_event_interface->isRunning();
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Diagram::cableToolIsRunning
|
||||
@return true while the cable drawing tool is the running tool.
|
||||
|
||||
That tool is the one which takes the right mouse button away from
|
||||
everything else: while it runs, a right click cancels the line being
|
||||
drawn and must not open the quick command ring nor any context menu
|
||||
with it. Every other tool lets go of the button again and is
|
||||
surrounded by the ring the way it always was.
|
||||
*/
|
||||
bool Diagram::cableToolIsRunning() const
|
||||
{
|
||||
return m_event_interface
|
||||
&& m_event_interface->isRunning()
|
||||
&& qobject_cast<DiagramEventAddCable *>(m_event_interface);
|
||||
}
|
||||
|
||||
/**
|
||||
@brief Diagram::conductorsAutonumName
|
||||
@return the name of autonum to use.
|
||||
|
||||
Reference in New Issue
Block a user