@ -109,48 +109,53 @@ void KomposeDesktopWidget::initFonts()
// return (double)deskRect.width() / (double)deskRect.height();
// }
void KomposeDesktopWidget : : setInactive ( )
{
if ( hasFocus ( ) )
clearFocus ( ) ;
highlight = false ;
repaint ( ) ;
}
void KomposeDesktopWidget : : setActive ( )
{
if ( ! hasFocus ( ) )
setFocus ( ) ;
highlight = true ;
repaint ( ) ;
}
void KomposeDesktopWidget : : leaveEvent ( TQEvent * )
{
// Unset highlight if cursor moves out of our rect
unsetCursor ( ) ;
// Mark desktop as inactive if cursor moves out of our rect
// but not if it enters a child widget
TQRect deskRect ;
deskRect . setTopLeft ( mapToGlobal ( TQPoint ( 0 , 0 ) ) ) ;
deskRect . setWidth ( width ( ) ) ;
deskRect . setHeight ( height ( ) ) ;
if ( ! deskRect . contains ( TQCursor : : pos ( ) ) )
highlight = false ;
unsetCursor ( ) ;
repaint ( ) ;
setInactive ( ) ;
}
void KomposeDesktopWidget : : enterEvent ( TQEvent * )
{
setFocus ( ) ;
setCursor ( KCursor : : handCursor ( ) ) ;
highlight = true ;
repaint ( ) ;
setActive ( ) ;
}
void KomposeDesktopWidget : : focusInEvent ( TQFocusEvent * )
{
highlight = true ;
repaint ( ) ;
setActive ( ) ;
}
void KomposeDesktopWidget : : focusOutEvent ( TQFocusEvent * )
{
// Unset highlight if cursor moves out of our rect
// but not if it enters a child widget
TQRect deskRect ;
deskRect . setTopLeft ( mapToGlobal ( TQPoint ( 0 , 0 ) ) ) ;
deskRect . setWidth ( width ( ) ) ;
deskRect . setHeight ( height ( ) ) ;
if ( ! deskRect . contains ( TQCursor : : pos ( ) ) )
highlight = false ;
repaint ( ) ;
setInactive ( ) ;
}
void KomposeDesktopWidget : : mouseReleaseEvent ( TQMouseEvent * e )