Re: [Libreoffice] [PATCH] vcl: Printing UI page range autofocus
Hi, At 06:50 22-10-2011, Maxim Iorsh wrote: When the user selects Pages radio button in the Range section, it is very reasonable to expect that she would now want to specify the range. Thus moving the focus automatically to the page range edit box would save the user a mouse click. Unrequested focus changes that are not announced in advance are not good practice for accessibility reasons. 1. When a screen reader user (typically a blind user) encounters a set of radio buttons, the only way to find out what the buttons are, is going through them with the up/down arrow. If the focus changes to the page range input field when she puts the focus on the Pages radio button, the label for the radio button will either not be read by the screen reader or the labels for the radio button and the edit field will be run together, which might lead to confusion. 2. Keyboard users (not only blind users) move through dialogs like the Print dialog with the Tab key and the Shift+Tab key. The latter is for navigating backwards. With this patch, what happens when the user presses Shift+Tab from the Page Range field in order to move back to the radio buttons? Does the focus immediately get pushed back to the edit field, making backwards navigation impossible? Best regards, Christophe Code is contributed under the LGPLv3+ / MPL. Signed-off-by: Maxim Iorsh io...@users.sourceforge.net --- vcl/source/window/printdlg.cxx | 21 + 1 files changed, 21 insertions(+), 0 deletions(-) -- Christophe Strobbe K.U.Leuven - Dept. of Electrical Engineering - SCD Research Group on Document Architectures Kasteelpark Arenberg 10 bus 2442 B-3001 Leuven-Heverlee BELGIUM tel: +32 16 32 85 51 http://www.docarch.be/ Twitter: @RabelaisA11y --- Open source for accessibility: results from the AEGIS project www.aegis-project.eu --- Please don't invite me to Facebook, Quechup or other social networks. You may have agreed to their privacy policy, but I haven't. ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] [PATCH] vcl: Printing UI page range autofocus
Hi Maxime, On Mon, 2011-10-24 at 14:52 +0200, Christophe Strobbe wrote: At 06:50 22-10-2011, Maxim Iorsh wrote: When the user selects Pages radio button in the Range section, it is very reasonable to expect that she would now want to specify the range. Thus moving the focus automatically to the page range edit box would save the user a mouse click. Which looks nice ! :-) Unrequested focus changes that are not announced in advance are not good practice for accessibility reasons. Unfortunately, I suspect Christophe is right, so - presumably we need to do this in a slightly more cunning fashion (ditto for the PDF case). I wonder what ways those could be - personally I love the easier to use, more ergonomic UI change you suggest - and surely it'd help improve life for impaired people too if they could find out about it. The tab navigation ordering is already somewhat strange in the print dialog with the Print in reverse page order appearing in the chain before the radio buttons above it - which might be worth fixing too. On Mon, 2011-10-24 at 14:52 +0200, Christophe Strobbe wrote: 1. When a screen reader user (typically a blind user) encounters a set of radio buttons, the only way to find out what the buttons are, is going through them with the up/down arrow. Surely the screen reader knows these are part of a radio button group and has relations it can use to read out the options ? 2. Keyboard users (not only blind users) move through dialogs like the Print dialog with the Tab key and the Shift+Tab key. The latter is for navigating backwards. With this patch, what happens when the user presses Shift+Tab from the Page Range field in order to move back to the radio buttons ? It works fine; you go from the entry back to the Pages button (which is already selected so we don't get a new selection event) and then you can use up and down arrows. Does the focus immediately get pushed back to the edit field, making backwards navigation impossible? So no, this is fine, but good to check. For what it is worth the current situation for a blind user tabbing through that dialog is pretty horrible too - the 'tab' goes from 'All Pages' to the 'Pages' entry field (which is not insensitive when the Page range thing is unselected), and so on. So - IMHO, if the Pages entry (which we auto-focus) has a suitable label (saying 'Page range') that a screen reader can read, and we handle insensitivity better there - we already made the UI rather better for the impaired. More ideally, if we can clobber the up/down arrow on the keyboard to move to previous / next radio button in the group we improve things all around - right ? [ and fixing the tab chain looks like it would be nice too - but I'm not clear on the APIs for doing that - is it really just the order of instantiation of the widgets in vcl/source/window/printdlg.cxx eg. ? ]. How does that sound ? and thanks Maxim for caring enough to improve these rough edges ! :-) All the best, Michael. -- michael.me...@suse.com , Pseudo Engineer, itinerant idiot ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] [PATCH] vcl: Printing UI page range autofocus
Hi Michael, Christophe, The accessibility issue is important indeed. I think a solution could be to automatically move the focus only in response to mouse click, and not keys (either tab or up/down arrow). This could solve the problem of keyboard / screen reader users. From the technical point of view, maybe a global solution would be most appropriate here. I mean, the function GrabFocus() could be modified to work only for mouse clicks. I think it is mostly responsible for such focus movements. Thank you, -- Maxim. On Mon, Oct 24, 2011 at 3:24 PM, Michael Meeks michael.me...@suse.comwrote: Hi Maxime, On Mon, 2011-10-24 at 14:52 +0200, Christophe Strobbe wrote: At 06:50 22-10-2011, Maxim Iorsh wrote: When the user selects Pages radio button in the Range section, it is very reasonable to expect that she would now want to specify the range. Thus moving the focus automatically to the page range edit box would save the user a mouse click. Which looks nice ! :-) Unrequested focus changes that are not announced in advance are not good practice for accessibility reasons. Unfortunately, I suspect Christophe is right, so - presumably we need to do this in a slightly more cunning fashion (ditto for the PDF case). I wonder what ways those could be - personally I love the easier to use, more ergonomic UI change you suggest - and surely it'd help improve life for impaired people too if they could find out about it. The tab navigation ordering is already somewhat strange in the print dialog with the Print in reverse page order appearing in the chain before the radio buttons above it - which might be worth fixing too. On Mon, 2011-10-24 at 14:52 +0200, Christophe Strobbe wrote: 1. When a screen reader user (typically a blind user) encounters a set of radio buttons, the only way to find out what the buttons are, is going through them with the up/down arrow. Surely the screen reader knows these are part of a radio button group and has relations it can use to read out the options ? 2. Keyboard users (not only blind users) move through dialogs like the Print dialog with the Tab key and the Shift+Tab key. The latter is for navigating backwards. With this patch, what happens when the user presses Shift+Tab from the Page Range field in order to move back to the radio buttons ? It works fine; you go from the entry back to the Pages button (which is already selected so we don't get a new selection event) and then you can use up and down arrows. Does the focus immediately get pushed back to the edit field, making backwards navigation impossible? So no, this is fine, but good to check. For what it is worth the current situation for a blind user tabbing through that dialog is pretty horrible too - the 'tab' goes from 'All Pages' to the 'Pages' entry field (which is not insensitive when the Page range thing is unselected), and so on. So - IMHO, if the Pages entry (which we auto-focus) has a suitable label (saying 'Page range') that a screen reader can read, and we handle insensitivity better there - we already made the UI rather better for the impaired. More ideally, if we can clobber the up/down arrow on the keyboard to move to previous / next radio button in the group we improve things all around - right ? [ and fixing the tab chain looks like it would be nice too - but I'm not clear on the APIs for doing that - is it really just the order of instantiation of the widgets in vcl/source/window/printdlg.cxx eg. ? ]. How does that sound ? and thanks Maxim for caring enough to improve these rough edges ! :-) All the best, Michael. -- michael.me...@suse.com , Pseudo Engineer, itinerant idiot ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] [PATCH] vcl: Printing UI page range autofocus
When the user selects Pages radio button in the Range section, it is very reasonable to expect that she would now want to specify the range. Thus moving the focus automatically to the page range edit box would save the user a mouse click. Code is contributed under the LGPLv3+ / MPL. Signed-off-by: Maxim Iorsh io...@users.sourceforge.net --- vcl/source/window/printdlg.cxx | 21 + 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index 969030c..5a59281 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -2300,6 +2300,27 @@ IMPL_LINK( PrintDialog, UIOption_RadioHdl, RadioButton*, i_pBtn ) sal_Int32 nVal = it-second; pVal-Value = nVal; +// when page range option is selected, focus on range input. +if (pVal-Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( PrintContent ) ) +nVal == 1) +{ +std::map rtl::OUString, std::vector Window* ::const_iterator pit = maPropertyToWindowMap.find( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( PageRange ) ) ); +if( pit != maPropertyToWindowMap.end() ) +{ +const std::vector Window* rWindows( pit-second ); +if( ! rWindows.empty() ) +{ +// we should have an Edit for this one +Edit* pRange = dynamic_cast Edit* ( rWindows.front() ); +if( pRange ) +{ +pRange-SetSelection( Selection( 0, 0x ) ); // select all +pRange-GrabFocus(); +} +} +} +} + checkOptionalControlDependencies(); // update preview and page settings ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice