* ./hurricane/src/hviewer :

- Change: more ergonomic selection mode commands. Now clicking on "nothing"
        automatically switch off selection displaying.
This commit is contained in:
Jean-Paul Chaput 2009-03-18 15:33:08 +00:00
parent f102af2832
commit abbc94ea90
2 changed files with 10 additions and 7 deletions

View File

@ -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;
}

View File

@ -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 ();
//}