* ./hurricane/src/hviewer :
- Change: more ergonomic selection mode commands. Now clicking on "nothing" automatically switch off selection displaying.
This commit is contained in:
parent
f102af2832
commit
abbc94ea90
|
@ -84,7 +84,8 @@ namespace Hurricane {
|
|||
|
||||
bool SelectCommand::mouseReleaseEvent ( CellWidget* widget, QMouseEvent* event )
|
||||
{
|
||||
if ( !isActive() ) return false;
|
||||
if ( !isActive() )
|
||||
_startPoint = _stopPoint = event->pos();
|
||||
|
||||
setActive ( false );
|
||||
setDrawingEnabled ( false );
|
||||
|
@ -97,13 +98,14 @@ namespace Hurricane {
|
|||
|
||||
//widget->unselectAll ();
|
||||
widget->selectOccurrencesUnder ( widget->screenToDbuBox(selectArea) );
|
||||
bool somethingSelected = !widget->getSelectorSet().empty();
|
||||
|
||||
if ( !widget->getState()->showSelection() )
|
||||
widget->setShowSelection ( true );
|
||||
if ( widget->getState()->showSelection() != somethingSelected )
|
||||
widget->setShowSelection ( somethingSelected );
|
||||
else
|
||||
widget->refresh ();
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -98,9 +98,10 @@ namespace Hurricane {
|
|||
|
||||
QRect zoomArea = QRect ( _startPoint, _stopPoint );
|
||||
if ( ( abs(zoomArea.width ()) > getDrawingThreshold() )
|
||||
&& ( abs(zoomArea.height()) > getDrawingThreshold() ) )
|
||||
widget->reframe ( widget->screenToDbuBox(zoomArea) );
|
||||
//else {
|
||||
&& ( abs(zoomArea.height()) > getDrawingThreshold() ) ) {
|
||||
widget->reframe ( widget->screenToDbuBox(zoomArea) );
|
||||
return true;
|
||||
} // else {
|
||||
// cerr << Warning("Rejecting too small zoom request.") << endl;
|
||||
// widget->update ();
|
||||
//}
|
||||
|
|
Loading…
Reference in New Issue