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

161 commits

Author SHA1 Message Date
reuk
5d7208bb54
ModifierKeys: Avoid direct access to currentModifiers when reading but not writing 2025-06-19 14:42:49 +01:00
attila
8ea8cdac6d TextEditor: Allow soft breaks inside words in multi-line mode
This restores the JUCE 7 behaviour.
2025-06-10 12:49:23 +02:00
reuk
b20df8d713
PopupMenu: Add missing target components for menus created by built-in widgets 2025-06-03 16:08:56 +01:00
attila
a272b35261 TextEditor: Fix lines being invisible beyond the word wrap width 2025-05-21 17:47:20 +02:00
attila
0e4287df52 ShapedTextOptions: Rename maxWidth to wordWrapWidth
The old name didn't communicate it clearly enough what the parameter was
used for. This started to show when alignmentWidth was added.
2025-05-21 17:47:20 +02:00
attila
6a53ddcb77 TextEditor: Restore JUCE 7 behaviour for the first line's alignment when line spacing > 1 2025-04-23 18:11:26 +02:00
attila
56b7b7621e TextEditor: Fix caret size in first and last position when line spacing is non-unity 2025-04-23 18:11:26 +02:00
attila
d2d5e9bdd2 TextEditor: Fix setLineSpacing
Applies the previously missed line spacing value of the TextEditor.

The changes in JustifiedText fix calculating the vertical position of
the first line for the case where ShapedTextOptions has the following
settings:

isBaselineAtZero() == false,
getHeight().has_value() == false
getLeading() > 1.0f

This case however is only triggered by the TextEditor, as with all
functions in GlyphArrangement at least one setting is different.
2025-04-23 18:11:26 +02:00
attila
e23969f3ce TextEditor: Fix drawing text in the wrong colour 2025-04-23 18:11:26 +02:00
attila
9083cd9135 Fix TextEditor crash when Font resolution fails 2025-04-02 15:33:27 +02:00
attila
bd015f5c97 Fix psabi warning emitted by GCC on ARM64
The type std::pair<Point<float>, float> inherits from an empty base on
C++17. Due to a bug in GCC 10.1 this would prevent the compiler from
treating it as a HFA type, and it would use a different register to pass
it, than it does in newer GCC versions. Because of this ABI change an
ABI warning is emitted by GCC today, hinting at this fact.

By using a custom struct that does not inherit from an empty base we are
avoiding emitting this warning.
2025-03-25 10:20:57 +01:00
attila
5f5a247f82 TextEditor: Fix centred and right alignment when word wrap is disabled 2025-03-20 21:12:32 +01:00
attila
ae4bca24f4 TextEditor: Fix crash when the caret is beyond a newline in the last position 2025-03-18 15:14:10 +01:00
attila
432a7e1c9a Fix C++20 compilation 2025-03-14 10:03:11 +01:00
attila
9ce2feaf41 TextEditor: Improve Unicode editing behaviour and performance 2025-03-13 12:16:16 +01:00
reuk
90f37e27ea Windows: Fix DLL build
There were a few "ambiguous operator new/delete" errors that were due to
inheriting from a private base class that used the leak detector. These
errors are resolved by adding the leak detector to the derived classes.

JUCE_API was missing from a few useful types, notably the ARA hosting
types.
2024-10-22 13:24:46 +01:00
reuk
29213e07a1
Font: Deprecate getStringWidth and getGlyphPositions 2024-09-18 19:13:09 +01:00
Tom Poole
94d98a2b10 Update licensing information 2024-04-16 11:39:35 +01:00
Tom Poole
6bf9bb9a2e Add final specifiers in implementation files 2023-10-10 16:12:38 +01:00
Tom Poole
4153d59e39 Formatting 2023-10-02 15:42:20 +01:00
reuk
e4b8569b12
TextEditor: Avoid giving away keyboard focus unconditionally in destructor
While improving Android IME support (da38c1ed), text editor destructors
were updated to explicitly pass keyboard focus elsewhere.
As far as I remember, the change was intended to prevent the text input
system from trying to send input events to components while they were
being destroyed, in which case the TextInputTarget and Component bases
may be 'valid', but the data members referenced by the TextInputTarget
implementation may have been destroyed.

The motivation for removing these lines is that giving away focus and
sending a focus event can cause all components to become unfocused. This
is problematic in the case of slider text editors - pressing 'enter'
will cause the TextEditor to be destroyed, but the parent component will
fail to gain focus, so pressing 'tab' will not have any effect.
2023-07-31 19:36:32 +01:00
reuk
3387ca362c
TextEditor: Avoid moveCaretTo(Start|End)OfLine moving to the previous line 2023-07-31 18:35:41 +01:00
Anthony Nicholls
ba50a35364 Widgets: stop calling repaint in lookAndFeelChanged()
- A repaint will always occur from a lookAndFeelChanged
2023-03-22 14:59:15 +00:00
reuk
da38c1ed2a
TextInputTarget: Improve IME support on Android 2022-12-07 13:12:02 +00:00
reuk
06798ab897
TextInputTarget: Add password keyboard type 2022-12-07 13:12:02 +00:00
reuk
31e68c66fa
TextEditor: Use NullCheckedInvocation 2022-11-02 11:38:41 +00:00
reuk
dc8bc918d2
TextEditor: Fix bug where text could be pasted twice from the popup menu
This bug was introduced in 140f8fedb1
2022-09-29 12:05:43 +01:00
attila
2e1809ec33 Fix key up behaviour in a multiline TextEditor
A regression was introduced in d564e4931. Before that commit you
could use key up to jump into position zero of a multiline TextEditor
if the cursor was somewhere in the first line. Since that commit the
keypress had no effect. This change restores the earlier behaviour.
2022-09-28 15:07:30 +02:00
attila
d564e49312 TextEditor: Change caret positioning when clicking before text and between lines
This commit fixes an issue when using large lineSpacing, where the caret
would jump to the end of the previous line when clicking between lines.
With the new behaviour the line spacing is considered to belong to the
previous line.

The commit also changes the behaviour observed when clicking in the
empty space before the first line. Until now the caret would jump into
the first character position. Now it behaves as if the space before the
first line would belong to the first line.
2022-09-15 12:30:40 +02:00
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