Copied focusNeighbourChild with slight modifications.

Charmingly, this seems to work nicely.

Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
pull/8/head
Mavridis Philippe 3 years ago
parent a857ed1c14
commit cc13befa92
No known key found for this signature in database
GPG Key ID: F8D2D7E2F989A494

@ -280,7 +280,41 @@ void KomposeFullscreenWidget::keyReleaseEvent ( TQKeyEvent *e )
bool KomposeFullscreenWidget::focusNeighbourDesk( int direction )
{
bool successfull = false;
if ( !children()->containsRef(focusWidget()) )
{
kdDebug() << "KomposeFullscreenWidget::keyReleaseEvent - No widget focussed. Focussing first" << endl;
const TQObjectList *lst = children();
if ( lst )
{
TQObjectListIterator it( *lst );
TQWidget *widget;
while ( (widget = (TQWidget*)it.current() ) )
{
if ( widget->inherits("KomposeDesktopWidget") )
{
kdDebug() << "KomposeFullscreenWidget::keyReleaseEvent - Focussing " << widget->className() << endl;
widget->setFocus();
successfull = true;
break;
}
++it;
}
}
}
else
{
KomposeWidget *widget;
if ( ( widget = layout->getNeighbour( dynamic_cast<KomposeWidget*>(focusWidget()), direction, WLAYOUT_BOTH ) ) != 0 )
{
kdDebug() << "KomposeFullscreenWidget::keyReleaseEvent - Focussing " << widget->className() << endl;
widget->setFocus();
successfull = true;
}
}
return successfull;
}
int KomposeFullscreenWidget::getHeightForWidth ( int w ) const

Loading…
Cancel
Save