|
LMMS
|
#include <juce_NativeScaleFactorNotifier.h>
Public Member Functions | |
| NativeScaleFactorNotifier (Component *comp, std::function< void(float)> onScaleChanged) | |
| ~NativeScaleFactorNotifier () override | |
Private Attributes | |
| ComponentPeer * | peer = nullptr |
| std::function< void(float)> | scaleChanged |
Calls a function every time the native scale factor of a component's peer changes.
This is used in the VST and VST3 wrappers to ensure that the editor's scale is kept in sync with the scale of its containing component.
| juce::NativeScaleFactorNotifier::NativeScaleFactorNotifier | ( | Component * | comp, |
| std::function< void(float)> | onScaleChanged ) |
Constructs an instance.
While the instance is alive, it will listen for changes to the scale factor of the comp's peer, and will call onScaleChanged whenever this scale factor changes.
| comp | The component to observe |
| onScaleChanged | A function that will be called when the backing scale factor changes |
|
override |
|
inlineoverrideprivatevirtual |
This callback happens when the component that is being watched is moved relative to its top-level peer window, or when it is resized.
Implements juce::ComponentMovementWatcher.
|
overrideprivatevirtual |
Called when the component's position or size changes.
| component | the component that was moved or resized |
| wasMoved | true if the component's top-left corner has just moved |
| wasResized | true if the component's width or height has just changed |
Reimplemented from juce::ComponentMovementWatcher.
|
overrideprivatevirtual |
This callback happens when the component's top-level peer is changed.
Implements juce::ComponentMovementWatcher.
|
inlineoverrideprivatevirtual |
This callback happens when the component's visibility state changes, possibly due to one of its parents being made visible or invisible.
Implements juce::ComponentMovementWatcher.
|
overrideprivatevirtual |
Called when the component is made visible or invisible.
| component | the component that changed |
Reimplemented from juce::ComponentMovementWatcher.
|
overrideprivatevirtual |
Called when the scale factor changes.
Implements juce::ComponentPeer::ScaleFactorListener.
|
private |
|
private |