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

318 commits

Author SHA1 Message Date
reuk
83e5264c86
Formatting: Remove double-dots from comments and other strings 2025-11-18 15:47:42 +00:00
reuk
cfc006aaf9
SidePanel: Add an option to restrict content to the safe screen area
A major benefit of this change is that the menu in the DemoRunner will
now display reasonably on mobile devices with notches or other
decorations.
2025-06-03 16:08:20 +01:00
reuk
b72e43620c
Grid: Fix cell ordering comparison
Previously, the set Comparator behaved the same way, regardless of the
value of columnFirst. This is incorrect; the set should be sorted such
that the final item in the set has the greatest cross-dimension.

There was also an off-by-one error in the result of
getHighestCrossDimension(). The highestCrossDimension data member is
exclusive, but the cell values in the occupiedCells set are inclusive.
We need to add 1 to the maximum cell cross-dimension in order to convert
it to an exclusive value.
2024-11-21 13:42:54 +00:00
reuk
8fa09ae8ab
Grid: Refactor to move columnFirst data member to set Comparator 2024-11-21 13:41:09 +00:00
reuk
d4107836cd
Grid: Convert nonstatic member function to static 2024-11-21 13:41:08 +00:00
reuk
ad5a755b10
Viewport: Avoid stack overflows when displaying transformed content components
For some transforms, the program could get stuck in the following loop:
- The content component emits a resized/moved notification, leading to
  the initial call to Viewport::updateVisibleArea.
- New positions are computed for the viewport scrollbars, and scrollbar
  listeners are notified synchronously that the scrollbars have been
  updated.
- The viewport itself listens to the scrollbars, so it receives a
  notification and updates the position of the content component.
- The scrollbar position (quantised to an integer) resolves to a
  component position (also quantised to an integer) that differs from
  the existing position, so the new position is applied.
- The viewport now attempts to set the scrollbars to the correct
  position in response, and notifies listeners that the scrollbars
  have moved...

Normally, the recursion would exit at the point where the component position
is set to its current position. If we're unlucky, though, converting
from view pos to scrollbar pos, then scrollbar pos back to view pos may
result in a view pos that differs from the original value.

This fix adds a new exit condition from the recursion. On receiving a
scrollbar move notification, we check whether the scrollbar position
computed from the current view position matches the incoming scrollbar
position. If it does, there's no need to compute and apply a new view
position from the incoming scrollbar position.
2024-10-02 11:35:38 +01:00
attila
bc3600cde8 Animation: Add juce_animation module 2024-04-16 17:43:21 +01:00
Tom Poole
94d98a2b10 Update licensing information 2024-04-16 11:39:35 +01:00
reuk
047448fbce
Warnings: Add missing overrides 2024-01-30 11:37:30 +00:00
reuk
65b6c85594 ConcertinaPanel: Move call that was mistakenly added to move constructor 2023-11-03 08:54:16 +00:00
reuk
884bb756c8
ConcertinaPanel: Avoid dangling mouse listener when reusing header components 2023-11-02 12:08:02 +00:00
reuk
94ee60041f
Enumerate: Replace some non-ranged loops 2023-10-31 10:57:43 +00:00
Tom Poole
6bf9bb9a2e Add final specifiers in implementation files 2023-10-10 16:12:38 +01:00
Anthony Nicholls
158220ddfa Formatting: Use nested namespace definitions 2023-10-09 14:49:18 +01:00
Tom Poole
4153d59e39 Formatting 2023-10-02 15:42:20 +01:00
Tom Poole
ff0cb4ad5b Use NullCheckedInvocation in more places 2023-10-02 13:40:10 +01:00
Tom Poole
2fb19ffd8f Fix some LLVM 17 compiler warnings 2023-09-25 11:21:11 +01:00
reuk
a8fa44e05c
X11: Ask the host to manage client-initiated resizes 2023-07-24 14:20:16 +01:00
reuk
1c1cbdf18d
ComponentBoundsConstrainer: Add new decorator constrainer 2023-05-31 15:15:25 +01:00
attila
909f6c43d2 Grid: Fix incorrect computation
One issue affected the situation where the provided bounds wouldn't
start at (0, 0). Such bounds are regularly acquired by calling
Rectangle::reduced().

The other issue affected the width calculation of fractional items.
The error wasn't correctly integrated during the computation, and as a
consequence the last fractional element would exhibit all the
accumulated error.
2023-05-04 17:01:02 +02:00
attila
a6761f9eb8 Grid: Ensure that items with absolute sizes will maintain correctly rounded dimensions
Prior to this commit all Grid calculations were carried out using
floating point numbers. The dimensions of all items would then be
rounded with the same function to calculate the integer dimensions used
for Component layout. This resulted in layout solutions where the width
or height of items with dimensions specified using the absolute Px
quantity could differ from the correctly rounded value of these values.

This commit ensures that the width and height of these items are always
correct and their cumulative error in size is distributed among items
with fractional dimensions.
2023-04-26 11:05:53 +02:00
reuk
28414a6af8
Global: Avoid floating-point equality checks where possible 2023-04-04 19:55:11 +01:00
Oli
d264d95595 StretchableLayoutManager: Prevent zero size layouts 2023-04-04 10:06:40 +01:00
Anthony Nicholls
cff722a4af GUI Basics: Refactor juce_gui_basics file structure
- Created a new detail namespace
- Moved shared module implementation details into the detail namespace
- Split dependencies so source files only rely on details in the detail namespace
- Removed all code from the juce_gui_basics.cpp file
2023-03-16 08:53:12 +00:00
reuk
9cfbccca8e
Accessibility: Make createAccessibilityHandler public to allow calls from derived classes 2023-02-09 17:54:18 +00:00
reuk
eee7200629 SidePanel: Fix shadow drawing artefact on hi-res screens 2022-12-14 18:59:44 +00:00
reuk
28f2157912
Convert ignoreUnused to [[maybe_unused]] 2022-12-01 11:41:50 +00:00
attila
44dd0649fd Grid: Fix layout for very small items
Until this commit Items with a size of 1 could be rounded to
bounds with a size of 0 or 2 due to floating point errors, leading
to slightly too large or disappearing items. The new approach
preserves the size of items.
2022-09-22 18:18:59 +02:00
attila
3acc71f7df MultiDocumentPanel: Fix reporting wrong active document, avoid reordering 2022-07-11 15:13:08 +02:00
attila
27924e4996 Viewport: Stop ongoing physical drag upon user interaction
An animated drag operation will now stop if the user interacts with
the content area again before the animation is finished. It is also
stopped if the user interacts with the scrollbars.
2022-06-30 15:10:15 +00:00
reuk
7eb99ed8ec
Grid: Avoid hangs when positioning auto-placement items that are too large for the explicit grid
Previously, positioning such an item would hang while trying to find an
appropriate position for the item, because no position in the grid was
suitable, and implicit cells in the layout direction would be added
until a viable position was found.

We now ensure that there are enough cells in the cross direction to hold
each of the auto-placement items before trying to position those items.
2022-06-24 18:53: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
Tom Poole
2ec861d99e Update licensing banners to JUCE 7 2022-05-16 17:55:48 +01:00
Tom Poole
669782cdf4 Viewport: Fix a scrolling bug when internal components have a transform applied 2022-04-27 12:02:10 +01:00
reuk
858aab823a
ComponentBoundsConstrainer: Properly constrain secondary windows in plugins 2022-04-22 14:18:50 +01:00
Tom Poole
dea3fe60e4 Update copyright banners 2022-04-04 12:36:32 +01:00
reuk
1d1d743b9f
Build: Add -Wdeprecated to recommended flags and fix new warnings 2022-02-23 10:56:10 +00:00
reuk
84db4b186f
ComponentBoundsConstrainer: Refactor 2022-02-18 16:43:25 +00:00
reuk
4cf74dfff6 Viewport: Improve drag-to-scroll on devices that can accept simultaneous mouse and touch input
Some Windows 11 devices have both touch screens and mouse inputs, and
these can be used simultaneously.

The Viewport (and ListBox) now check the input source of each mouse
down. If the source is not a mouse, the viewport will always enter
drag-to-scroll mode, regardless of the result of isScrollOnDragEnabled.
2022-02-07 14:24:11 +00:00
attila
6575d24a81 ComponentPeer: Deprecate getFrameSize() 2022-02-03 21:46:36 +01:00
Tom Poole
c072b1bc8e Fix some typos 2022-01-25 11:48:46 +00:00
reuk
e247e06fb7
FlexBox: Refactor and tidy implementation 2021-11-19 16:35:21 +00:00
reuk
0dad809264
FlexBox: Add tests, and fix layout bugs 2021-11-19 16:35:20 +00:00
reuk
4d572411e0
FlexBox: Update the default value of FlexItem::alignSelf to match CSS implementations 2021-10-26 16:52:16 +01:00
reuk
6bc51f97e4
Grid: Avoid crashing in performLayout when the grid contains no items 2021-10-14 12:40:25 +01:00
ed
051e0ed6d6 Fix leak on MultiDocumentPanel destruction 2021-10-07 14:30:32 +01:00
reuk
c3c171acaf
Grid: Fix behaviour with negative row/column indices
Negative indices should count backwards from the last explicit
row/column number. If the resulting line number would appear before
the first explicit row/column, implicit grid lines should be added
before the first explicit row/column.
2021-09-28 11:31:49 +01:00
reuk
c802319241
Viewport: Stop touches on other components from interrupting scrolling
Previously, a touch on a component outside the Viewport would interrupt
and cancel a scroll gesture inside the Viewport.

Now, the Viewport will respond to all drag events from the input source
that started the drag, allowing the Viewport to be scrolled with one
input source while adjusting other controls with another input source.

The FontsDemo is useful for testing this behaviour, as it has two
Viewports on a single screen, along with some other controls.
2021-09-27 15:46:28 +01:00
ed
90eb878d16 Accessibility: Make createAccessibilityHandler() private in Component subclasses 2021-09-07 11:23:17 +01:00
ed
8d6ba3b54e Accessibility: Use AccessibilityRole::ignored for UI elements that should not be accessible to screen readers but have accessible children 2021-09-07 11:23:17 +01:00