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

89 commits

Author SHA1 Message Date
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
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
9ce2feaf41 TextEditor: Improve Unicode editing behaviour and performance 2025-03-13 12:16:16 +01:00
attila
d7d8155da9 Fix some doxygen issues 2024-08-22 17:05:03 +02:00
reuk
4533077b75
LookAndFeel: Allow specifying a default typeface metrics kind to use 2024-04-18 14:16:00 +01:00
reuk
4f2c287f9b
Font: Deprecate old Font constructors 2024-04-18 14:16:00 +01:00
Tom Poole
94d98a2b10 Update licensing information 2024-04-16 11:39:35 +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
9cfbccca8e
Accessibility: Make createAccessibilityHandler public to allow calls from derived classes 2023-02-09 17:54:18 +00:00
reuk
06798ab897
TextInputTarget: Add password keyboard type 2022-12-07 13:12:02 +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
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
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
Tom Poole
dea3fe60e4 Update copyright banners 2022-04-04 12:36:32 +01:00
ed
90eb878d16 Accessibility: Make createAccessibilityHandler() private in Component subclasses 2021-09-07 11:23:17 +01:00
ed
3fd4f7a231 TextEditor: Take border size into account when calculating text bounds 2021-06-01 11:22:35 +01:00
ed
361b29edb6 Offset TextEditor::getTextBounds() by viewport position 2021-05-20 18:24:57 +01:00
ed
533f68219b Fixed some Doxygen issues 2021-05-11 11:48:52 +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
7c96f18663 TextEditor: Fixed a bug where the horizontal viewport scrollbar could be shown unnecessarily 2021-02-23 17:02:55 +00: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
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
jules
9a06be6d61 Some minor cleanups 2019-06-17 15:48:56 +01:00
ed
c6502e2a83 Added a TextEditor::getTextToShowWhenEmpty() method 2019-04-29 14:21:47 +01:00
ed
a234721110 Added various clang-tidy modernize-* fixes 2019-01-31 15:15:31 +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
Tom Poole
ab863a6dc2 Replaced all usage of ScopedPointer with std::unique_ptr 2018-04-19 20:27:47 +01:00
Lukasz Kozakiewicz
c8b9bc79ba AlertWindow: ensure a native keyboard is hidden when alert window gets dismissed. 2018-04-09 18:56:38 +02:00
ed
cdbc28c18b Add documentation tags 2018-03-15 12:10:32 +00:00
jules
80a7718286 Added some event lambda callbacks for TextEditor and simplified a bit more code using them 2018-01-03 16:34:11 +00:00
jules
a7e3339f86 Got rid of some very old legacy VC6 workaround typedefs 2018-01-03 09:25:19 +00:00
jules
d73f9bdd74 Fix to TextEditor caret positioning 2017-10-13 10:41:21 +01:00
jules
dd4230586f Noticed that we still had some template whitespace workarounds for older compilers, so tidied them up 2017-10-11 12:26:05 +01:00
jules
d00a459480 Added method TextEditor::setJustification() 2017-09-22 14:37:13 +01:00
jules
6290e95152 Whitespace 2017-09-21 19:49:18 +01:00
jules
c309a5b244 Avoided forcing TextEditor to be always opaque 2017-09-21 19:48:19 +01:00
jules
eda613c6db Moved all "namespace juce" declarations from module headers to the individual .h and .cpp source files. This makes life a lot easier for Intellisense and other IDE autocompletion tools 2017-09-08 08:59:55 +01:00
ed
919e3e36ec Added TextEditor::applyColourToAllText() method 2017-06-02 11:39:02 +01:00
hogliux
b5afccc37c Updated file headers and the README with the JUCE 5 license 2017-04-27 14:43:04 +01:00
jules
d6bf2e8cf9 Added line spacing to TextEditor and methods to set/get the current line spacing 2017-03-10 17:07:34 +00:00
hogliux
2da1bc5f41 Replace include guards with "#pragma once" 2017-02-01 17:18:07 +00:00
tpoole
255dc1d1ba Fixed documentation typo 2016-10-19 15:49:03 +01:00
hogliux
62ac568b77 Made sure that colours are updated when the look and feel of a TextEditor changes 2016-10-16 12:50:42 +02:00