summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2024-05-27 13:29:39 +0200
committerMichael Weghorn <m.weghorn@posteo.de>2024-05-28 06:46:55 +0200
commit98f9e9aa6c0dcfdb1ae9ec0ca9a3f6a557ae7396 (patch)
treee3aaff65e784384edd063be279d063cbd1461c69 /include
parentae94c420e6269f99cdaa611d19e73fc92ebd234b (diff)
tdf#160971 vcl a11y: Make combobox text selection mode style-able
When selecting an entry of an editable combobox, the whole text of the text entry currently gets selected. That matches the behavior observed with a sample Windows Forms application. However, both native GTK and Qt applications behave differently and do not select the combobox entry text (s. tdf#160971 comment 11 and the referenced sample programs and screencasts). The extra text (un)selection makes the Orca screen reader on Linux announce an extra "selection deleted" every time another entry is selected using the up/down keys e.g. in the font selection combobox in Writer's Formatting toolbar when using the qt6 VCL plugin and the combobox popup is not shown. Introduce a new style setting to define the text selection behavior when switching between entries in a ComboBox and take that into account in `ComboBox::ImplSelectHdl`. The default behaviour remains unchanged. Behavior for the Qt and GTK based VCL plugins will be aligned more with the behavior of corresponding native widgets in separate upcoming commits. Change-Id: Ia2c77245049d708885cbd374c20ce1892259329b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168102 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'include')
-rw-r--r--include/vcl/settings.hxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx
index e21091385bc7..7c2fcc633b77 100644
--- a/include/vcl/settings.hxx
+++ b/include/vcl/settings.hxx
@@ -205,6 +205,13 @@ enum class ToolbarIconSize
Size32 = 3,
};
+/** Text selection behavior when selecting an entry in an editable combobox. */
+enum class ComboBoxTextSelectionMode
+{
+ SelectText, // select the whole text of the new entry
+ CursorToEnd // don't select text, put text cursor to end of text
+};
+
#define STYLE_CURSOR_NOBLINKTIME SAL_MAX_UINT64
class VCL_DLLPUBLIC StyleSettings
@@ -627,6 +634,9 @@ public:
// the default LineWidth for ListBox UI previews (LineStyle, LineDash, LineStartEnd). Default is 1.
static sal_uInt16 GetListBoxPreviewDefaultLineWidth();
+ void SetComboBoxTextSelectionMode(ComboBoxTextSelectionMode eMode);
+ ComboBoxTextSelectionMode GetComboBoxTextSelectionMode() const;
+
// defines if previews which contain potentially transparent objects (e.g. the dash/line/LineStartEnd previews and others)
// use the default transparent visualization background (checkered background) as it has got standard in graphic programs nowadays
void SetPreviewUsesCheckeredBackground(bool bNew);