Skip to content

Commit

Permalink
Syntax: Update QtQuick event handling related enums for Qt 6
Browse files Browse the repository at this point in the history
  • Loading branch information
ratijas committed Nov 17, 2023
1 parent 9d9b1da commit a73ae7d
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 14 deletions.
39 changes: 27 additions & 12 deletions Support/QML.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -1529,6 +1529,17 @@ contexts:
- include: else-pop
- include: else-pop

- match: InputDevice{{identifier_break}}
scope: support.class.builtin.qml
set:
- match: '{{dot_accessor}}'
scope: punctuation.accessor.js
set:
- include: support-property-qtquick-inputdevice
- include: object-property
- include: else-pop
- include: else-pop

- match: InputMethod{{identifier_break}}
scope: support.class.builtin.qml
set:
Expand Down Expand Up @@ -1872,13 +1883,8 @@ contexts:
pop: true

support-property-qtquick-eventpoint:
- match: |-
(?x:(?:
# State
Pressed|Updated|Stationary|Released
# GrabTransition
|GrabPassive|UngrabPassive|CancelGrabPassive|OverrideGrabPassive|GrabExclusive|UngrabExclusive|CancelGrabExclusive
)){{identifier_break}}
# State
- match: (?:Unknown|Stationary|Pressed|Updated|Released){{identifier_break}}
scope: support.constant.builtin.qml
pop: true

Expand Down Expand Up @@ -1958,6 +1964,17 @@ contexts:
scope: support.constant.builtin.qml
pop: true

support-property-qtquick-inputdevice:
- match: |-
(?x:(?:
# DeviceType
Unknown|Mouse|TouchScreen|TouchPad|Puck|Stylus|Airbrush|Keyboard|AllDevices
# Capability
|None|Position|Area|Pressure|Velocity|NormalizedPosition|MouseEmulation|PixelScroll|Scroll|Hover|Rotation|XTilt|YTilt|TangentialPressure|ZPosition|All
)){{identifier_break}}
scope: support.constant.builtin.qml
pop: true
support-property-qtquick-inputmethod:
- match: (?:Click|ContextMenu){{identifier_break}}
scope: support.constant.builtin.qml
Expand Down Expand Up @@ -2032,12 +2049,10 @@ contexts:
support-property-qtquick-pointerdevice:
- match: |-
(?x:(?:
# DeviceType
UnknownDevice|Mouse|TouchScreen|TouchPad|Puck|Stylus|Airbrush|AllDevices
# PointerType
|GenericPointer|Finger|Pen|Eraser|Cursor|AllPointerTypes
# CapabilityFlag
|Position|Area|Pressure|Velocity|MouseEmulation|Scroll|Hover|Rotation|XTilt|YTilt
Unknown|Generic|Finger|Pen|Eraser|Cursor|AllPointerTypes
# GrabTransition
|GrabPassive|UngrabPassive|CancelGrabPassive|OverrideGrabPassive|GrabExclusive|UngrabExclusive|CancelGrabExclusive
)){{identifier_break}}
scope: support.constant.builtin.qml
pop: true
Expand Down
10 changes: 8 additions & 2 deletions Support/tests/syntax_test_QML.qml
Original file line number Diff line number Diff line change
Expand Up @@ -843,8 +843,9 @@ Expressions {
Easing.OutQuad
// ^^^^^^ support.class.builtin.qml
// ^^^^^^^ support.constant.builtin.qml
EventPoint.GrabPassive
// ^^^^^^^^^^^ support.constant.builtin.qml
EventPoint.Unknown, EventPoint.Stationary
// ^^^^^^^ support.constant.builtin.qml
// ^^^^^^^^^^ support.constant.builtin.qml
Flickable.FollowBoundsBehavior, Flickable.VerticalFlick
// ^^^^^^^^^^^^^^^^^^^^ support.constant.builtin.qml
// ^^^^^^^^^^^^^ support.constant.builtin.qml
Expand All @@ -865,6 +866,11 @@ Expressions {
Image.AlignRight, Image.Tile
// ^^^^^^^^^^ support.constant.builtin.qml
// ^^^^ support.constant.builtin.qml
InputDevice.Unknown, InputDevice.Stylus, InputDevice.None, InputDevice.All
// ^^^^^^^ support.constant.builtin.qml
// ^^^^^^ support.constant.builtin.qml
// ^^^^ support.constant.builtin.qml
// ^^^ support.constant.builtin.qml
InputMethod.ContextMenu
// ^^^^^^^^^^^ support.constant.builtin.qml
Item.BottomRight
Expand Down

0 comments on commit a73ae7d

Please sign in to comment.