From aec242842f3ad05ea02618084e4056877c49ec6f Mon Sep 17 00:00:00 2001 From: Julien Cochuyt Date: Wed, 21 Apr 2021 13:11:26 +0200 Subject: [PATCH] Elements List: Don't remove the label of a filled spin button input field (#12317) Fix-up of PR #6131 --- source/browseMode.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/source/browseMode.py b/source/browseMode.py index cae9ee5f741..0729e0aecf8 100644 --- a/source/browseMode.py +++ b/source/browseMode.py @@ -1,6 +1,6 @@ # A part of NonVisual Desktop Access (NVDA) -# Copyright (C) 2007-2020 NV Access Limited, Babbage B.V., James Teh, Leonard de Ruijter, -# Thomas Stivers +# Copyright (C) 2007-2021 NV Access Limited, Babbage B.V., James Teh, Leonard de Ruijter, +# Thomas Stivers, Accessolutions, Julien Cochuyt # This file is covered by the GNU General Public License. # See the file COPYING for more details. @@ -252,7 +252,15 @@ def _getLabelForProperties(self, labelPropertyGetter): realStates = labelPropertyGetter("states") labeledStates = " ".join(controlTypes.processAndLabelStates(role, realStates, OutputReason.FOCUS)) if self.itemType == "formField": - if role in (controlTypes.ROLE_BUTTON,controlTypes.ROLE_DROPDOWNBUTTON,controlTypes.ROLE_TOGGLEBUTTON,controlTypes.ROLE_SPLITBUTTON,controlTypes.ROLE_MENUBUTTON,controlTypes.ROLE_DROPDOWNBUTTONGRID,controlTypes.ROLE_SPINBUTTON,controlTypes.ROLE_TREEVIEWBUTTON): + if role in ( + controlTypes.ROLE_BUTTON, + controlTypes.ROLE_DROPDOWNBUTTON, + controlTypes.ROLE_TOGGLEBUTTON, + controlTypes.ROLE_SPLITBUTTON, + controlTypes.ROLE_MENUBUTTON, + controlTypes.ROLE_DROPDOWNBUTTONGRID, + controlTypes.ROLE_TREEVIEWBUTTON + ): # Example output: Mute; toggle button; pressed labelParts = (content or name or unlabeled, roleText, labeledStates) else: