1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-11 23:54:18 +00:00
Commit graph

132 commits

Author SHA1 Message Date
reuk
5cf1a964fc
iOS: Add proper UITextInput implementation
This provides an improved user experience, allowing cursor movement
directly from the keyboard.
2022-07-29 18:54:50 +01:00
Tom Poole
4f884c8a54 TextEditor: Call repaint on clear 2022-07-11 13:18:59 +01:00
reuk
53484db875
Accessibility: Avoid allowing TextEditor and Viewport internal components to be accessibility-focused
The TextHolderComponent and Viewport::componentHolder don't have any
accessible semantics, so they shouldn't be included in the accessible
component hierarchy.
2022-06-13 15:29:57 +01:00
reuk
1c10e0c79b
Android: Fix problems with accessible text navigation
Previously, when navigating in a text editor by words, the cursor would
get 'stuck' after moving a single word. This issue should now be
resolved.

Additionally, the cursor position was not updated properly when
adjusting a selection, and would instead be moved to the end of the
selected range. With this patch applied, the cursor should now be set to
the correct position when modifying selections. When extending a
selection backwards, the cursor will display at the beginning of the
selected range, rather than the end.

Finally, most Android apps announce the 'skipped' characters or words
whenever the cursor is moved, but this feature was broken in JUCE. This
patch enables this feature.
2022-06-13 15:29:57 +01:00
reuk
140f8fedb1
TextEditor: Add option to dismiss the virtual keyboard on touches outside
Previously, individual components had to ask the peer to hide and show
the keyboard, by calling textInputRequired() and
dismissPendingTextInput() respectively. When an onscreen keyboard (OSK)
was required, most Peer implementation would directly hide/show the OSK
inside these function. However, the iOS ComponentPeer implementation
instead listened to the application's global keyboard focus, and only
opened the OSK when the focused component was also a TextInputTarget
with active input.

The iOS scheme seems like a better design, as it enforces that the OSK
hiding and showing is synced with the keyboard focus of the application.
In the other implementations, it was possible for a Component to call
textInputRequired even when it didn't have the keyboard focus, putting
the application into an inconsistent state. The iOS scheme also makes
the TextInputTarget interface more useful, as it enforces that the OSK
will only display for components that implement TextInputTarget, and
return true from isTextInputActive().

This patch changes all Peer implementations to match the iOS
implementation, improving consistency. Each time the global keyboard
focus changes, refreshTextInputTarget is called automatically, and the
OSK is shown if the focused component is a TextInputTarget that returns
true from isTextInputActive, and hidden otherwise. Components can also
call refreshTextInputTarget manually. This should be done whenever the
component updates the return value of isTextInputActive(). Effectively,
the Peer is now responsible for keeping track of the focused
TextInputTarget, rather than allowing individual components to hide and
show the OSK at will.

Additionally, this patch adds an option to the TextEditor to
automatically dismiss the OSK when the mouse is clicked outside of the
editor. This should improve user experience on mobile platforms, where
touches on sibling components may cause a TextEditor to gain keyboard
focus and unnecessarily display the OSK.
2022-06-09 16:55:19 +01:00
Tom Poole
2ec861d99e Update licensing banners to JUCE 7 2022-05-16 17:55:48 +01:00
attila
627afffeb4 Android: Fix dismissing screen keyboard when interacting with TextEditor 2022-04-27 18:49:44 +02:00
Tom Poole
dea3fe60e4 Update copyright banners 2022-04-04 12:36:32 +01:00
attila
2b3abd3ca6 MacOS: Fix TextEditor when using marked text (e.g. Korean) 2022-01-04 17:20:11 +01:00
ed
1fe8fa467b TextEditor: Fix floating-point -> integer bounds conversion of text selection bounds 2021-11-09 15:35:52 +00:00
ed
6f8c464747 TextEditor: Fix a highlighting bug 2021-08-16 16:07:40 +01:00
ed
c3cb59d6ae TextEditor: Avoid some potential nullptr dereferences in the Iterator class 2021-08-16 16:07:40 +01:00
ed
a5c3b81f82 Use C++14 lambda capture initialisers for initialising deletion checkers 2021-07-12 11:58:29 +01:00
ed
c559d31e90 Accessibility: Override Accessibility::getHelp() for JUCE widgets that support tooltips 2021-07-05 12:07:30 +01:00
ed
a7f33da900 Accessibility: Set caret position when passed an empty range selection in CodeEditorComponent and TextEditor AccessibilityTextInterface implementations 2021-06-11 13:48:07 +01:00
ed
8b2f3088d7 Accessibility: Added AccessibilityTextInterface::isReadOnly() method and AccessibilityRole::label to distinguish between navigable and selectable read-only text elements and simple labels 2021-06-07 19:38:29 +01:00
ed
3fd4f7a231 TextEditor: Take border size into account when calculating text bounds 2021-06-01 11:22:35 +01:00
ed
13e7ffbdfb Accessibility: Use AccessibilityTextValueInterface for read-only text in Label, TextEditor and CodeEditorComponent 2021-05-28 14:48:59 +01:00
ed
083a5af323 TextEditor: Offset selection fill bounds by viewport position to fix bug with multi-line highlighting 2021-05-26 16:54:38 +01:00
ed
361b29edb6 Offset TextEditor::getTextBounds() by viewport position 2021-05-20 18:24:57 +01:00
ed
333983947e Accessibility: Removed widget_handlers 2021-05-20 18:24:56 +01:00
ed
ec990202b1 Accessibility: Added VoiceOver (macOS) and Narrator (Windows) accessibility screen reader support to juce_gui_basics 2021-05-10 10:53:14 +01:00
ed
665fac678f TextEditor: Enable horizontal scrollbars for multi-line editors with word wrapping disabled 2021-04-29 17:05:00 +01:00
ed
f5dac0780d TextEditor: Only start new lines when shouldStartNewLine == true when splitting long atoms 2021-04-26 15:05:00 +01:00
ed
7fb45db0d2 TextEditor: Always return positive integers from getMaximumTextWidth/Height() 2021-04-26 15:03:52 +01:00
ed
b9c8a1475f TextEditor: New line atoms should have zero width 2021-04-23 16:17:23 +01:00
ed
b644d7b675 TextEditor: Fixed a wrapping bug when right-justified 2021-04-23 16:17:23 +01:00
ed
b5bb5273c1 TextEditor: Use caret position relative to the Component top-left when calculating scroll amounts in scrollEditorToPositionCaret() and scrollToMakeSureCursorIsVisible() 2021-04-20 17:24:49 +01:00
ed
24c2953369 TextEditor: Call checkLayout() before moving caret and repainting text in remove() 2021-04-20 17:24:49 +01:00
ed
841aae5b18 TextEditor: Call scrollToMakeSureCursorIsVisible() after updating layout when undoing/redoing 2021-04-20 17:24:49 +01:00
ed
c145434adf TextEditor: Fixed a bug causing the caret to disappear at the end of lines 2021-04-20 17:24:49 +01:00
ed
a533e86044 TextEditor: Fixed a bug updating the text holder size for single-line editors 2021-04-07 14:12:11 +01:00
ed
7c96f18663 TextEditor: Fixed a bug where the horizontal viewport scrollbar could be shown unnecessarily 2021-02-23 17:02:55 +00:00
reuk
46d24cc1ab
TextEditor: Avoid starting timer unnecessarily when setting text 2021-02-18 10:54:29 +00:00
ed
8ee13b78ba Avoid drawing TextEditor "empty" text when it isn't visible 2020-11-16 16:10:13 +00:00
ed
56252ca098 Fixed a bug in TextEditor::setSelectAllWhenFocused() 2020-10-09 14:46:23 +01:00
reuk
c897a4f2cb Linux: Fix some clang 10 warnings 2020-09-24 12:52:45 +01:00
ed
508d6de04e Underline whitespace atoms in TextEditor when font is underlined 2020-08-04 10:26:41 +01:00
ed
12bff68e34 Added vertical justification support to TextEditor 2020-08-03 18:28:21 +01:00
reuk
394c4fd475 Clang: Fix warnings when building with clang 10 2020-07-01 10:00:43 +01:00
ed
009d685179 Updated all license headers 2020-06-29 08:30:22 +01:00
Tom Poole
894e7d2bd2 Updated all license headers 2020-04-23 17:30:39 +01:00
reuk
327f817b9b Copyrights: Update commercial/gpl headers to be gpl-only 2020-04-09 15:22:56 +01:00
ed
6881795d40 Ensure that font width is correct when changing the TextEditor password character 2019-07-12 17:53:19 +01:00
Tom Poole
79d3e8b3f5 Windows: Removed some VS2013 workarounds 2019-07-11 15:28:41 +01:00
jules
9a06be6d61 Some minor cleanups 2019-06-17 15:48:56 +01:00
ed
b88d5adab7 Always call TextEditor::checkFocus() when focus is gained to ensure that the software keyboard is shown on Android when a TextEditor has content 2019-04-16 10:24:55 +01:00
ed
9715e77e0f Only call ComponentPeer::textInputRequired() from TextEditor::checkFocus() if the focus status has changed to fix the soft input keyboard constantly re-opening on Android 2019-03-19 17:48:52 +00:00
jules
cadac817c6 Enabled some more warning flags in Xcode, and fixed the problems they caused 2019-01-11 09:52:10 +00:00
ed
eaf0f990d4 Replaced all uses of static_cast<Type&&> with std::move 2018-11-28 17:29:20 +00:00