Skip to content

Commit

Permalink
Zone: Step towards zones not bound to a single node (#43)
Browse files Browse the repository at this point in the history
Remaining stumble points:
 - AutoAction: Based on controlID
 - Context: Based on nodes
  • Loading branch information
JulienCochuyt committed Sep 1, 2024
1 parent a645a17 commit e60697f
Show file tree
Hide file tree
Showing 3 changed files with 129 additions and 97 deletions.
4 changes: 2 additions & 2 deletions addon/globalPlugins/webAccess/gui/criteriaEditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@



__version__ = "2024.07.19"
__version__ = "2024.07.25"
__authors__ = (
"Shirley Noël <[email protected]>",
"Julien Cochuyt <[email protected]>",
Expand Down Expand Up @@ -615,7 +615,7 @@ def initData(self, context):
rule = result.rule
if (
rule.type in (ruleTypes.PARENT, ruleTypes.ZONE)
and node in result.node
and result.containsNode(node)
):
parents.insert(0, rule.name)
self.contextParentCombo.Set(parents)
Expand Down
12 changes: 6 additions & 6 deletions addon/globalPlugins/webAccess/overlay.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-

# This file is part of Web Access for NVDA.
# Copyright (C) 2015-2021 Accessolutions (http://accessolutions.fr)
# Copyright (C) 2015-2024 Accessolutions (http://accessolutions.fr)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand All @@ -23,7 +23,7 @@
WebAccess overlay classes
"""

__version__ = "2021.03.12"
__version__ = "2024.07.24"
__author__ = "Julien Cochuyt <[email protected]>"


Expand Down Expand Up @@ -505,10 +505,10 @@ def _caretMovementScriptHelper(
msg += _("Press escape to cancel zone restriction.")
ui.message(msg)
if posConstant == textInfos.POSITION_FIRST:
pos = zone.startOffset
pos = zone.result.startOffset
posConstant = textInfos.offsets.Offsets(pos, pos)
elif posConstant == textInfos.POSITION_LAST:
pos = max(zone.endOffset - 1, zone.startOffset)
pos = max(zone.result.endOffset - 1, zone.result.startOffset)
posConstant = textInfos.offsets.Offsets(pos, pos)
super()._caretMovementScriptHelper(
gesture,
Expand Down Expand Up @@ -557,12 +557,12 @@ def _iterNodesByType(self, itemType, direction="next", pos=None):
direction
):
if zone:
if item.textInfo._startOffset < zone.startOffset:
if item.textInfo._startOffset < zone.result.startOffset:
if direction == "next":
continue
else:
return
elif item.textInfo._startOffset >= zone.endOffset:
elif item.textInfo._startOffset >= zone.result.endOffset:
if direction == "previous":
continue
else:
Expand Down
Loading

0 comments on commit e60697f

Please sign in to comment.