[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    [Accessibility] Using F8 to resize panels.
From:       Gary Cramblitt <garycramblitt () comcast ! net>
Date:       2005-10-16 17:35:22
Message-ID: 200510161335.22796.garycramblitt () comcast ! net
[Download RAW message or body]

I have committed kpanelkbsizer.h/cpp  to koffice/lib/kofficecore.  This 
enhancement is not currently activated; see kpanelkbdsizer.h for how to 
activate it.

With this enhancement, you can hit F8 to put KOffice apps into splitter and 
dockwindow resizing mode.  A "move" icon appears on the panel's handle.  
Pressing F8 again "rotates" through all the splitters and dockwindows in the 
app.  Shift-F8 rotates backwards through them.  Esc exits sizing mode.  In 
sizing mode, you can use the arrow keys and PgUp/PgDn keys to size splitters 
and dockwindows.  Pressing Enter (on numeric keypad) while on the handle of a 
dockwindow undocks/docks the window.  Use Shifted arrow keys to size the 
undocked window.

I haven't activated this yet because I'm still struggling with a few issues 
and could use some help:

1.  The first time the sizing icon appears, it correctly paints with a 
transparent background.  But when you press F8 again and the icon moves to 
the next handle, it takes the background with it.  I played around quite a 
bit with hiding/unhiding the icon, setting background, etc., with no luck.  
I'm thinking of switching to using a QCursor (similar to Alt+F3->Move), but 
this means I can't give the icon focus, which has other impacts.  (Of course, 
Xorg with the compositor thingy would solve this, but I don't think that is a 
viable solution now.)

2.  Since F8 conflicts with existing Krita shortcuts, I've made the F8 and 
Shift-F8 keys KShortcuts, which means user can assign different keys in the 
shortcut settings dialog, except that if they try to assign a multi-key 
sequence, it won't work.  The problem is that once a QDockWindow undocks and 
has focus, the KShortcut activate() signal doesn't fire anymore, so I have to 
handle F8/Shift+F8 in the eventFilter and I can see no reasonable way to 
handle multi-key sequences there.  Some way to attach a KShortcut to an 
undocked QDockWindow?  Some way to limit a KShortcut to a single key 
sequence?

3.  Sizing doesn't work reliably for dock windows.  This is a little hard to 
explain.  You have to play with it to understand what I mean.  For example, 
start Kivio and arrange the palettes so you have the "Bird's Eye" and 
"Geometry" palettes on the right side stacked vertically.  Press F8 until the 
sizer icon is on the horizontal handle between the two palettes.  Press 
DownArrow until the two palettes unstack into two different dock areas.  
Press UpArrow and they restack into a single dock area.  So far so good.  
But, now hit UpArrow until they won't resize anymore.  Resizing stops because 
the top palette is already at its minimum size.  Now hit DownArrow. Nothing 
happens, which is a problem.  You have to hit DownArrow enough times to make 
up for the ignored UpArrows you pressed.  Here's the relevant code in 
resizePanel method:

                    QSize fe = dockWindow->fixedExtent();
                    int h = fe.height();
                    if (h < 0) h = dockWindow->height();
                    h = h + adj;
                    if (h > 0) dockWindow->setFixedExtentHeight(h);

Notice that it is resizing the dockwindows by incrementing/decrementing the  
fixedExtentHeight.  Problems begin because when you first press F8, the 
fixedExtentHeight is -1, so it reverts to the current height.  Now, if I 
change the code to this:

                    QSize fe = dockWindow->fixedExtent();
                    int h = fe.height();
                    if (h < dockWindow->height()) h = dockWindow->height();
                    h = h + adj;
                    if (h > 0) dockWindow->setFixedExtentHeight(h);

it solves the problem I described, but now it is impossible to stack the 
unstacked palettes.  So it comes down to two choices, neither perfect.  

4.  While on the handle of a dockwindow, you can press F6, which will attempt 
to put focus on the dock window.  Interestingly, this permits focus to go to 
the palette tabs, which otherwise can't be reached using normal tab order.  
It seems to me that the tabs on palettes should be able to get focus by 
tabbing.  Is this a defect?


-- 
Gary Cramblitt (aka PhantomsDad)
KDE Text-to-Speech Maintainer
http://accessibility.kde.org/developer/kttsd/index.php
_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic