Calls a function every time the native scale factor of a component's peer changes. More...
#include <juce_NativeScaleFactorNotifier.h>


Public Member Functions | |
| NativeScaleFactorNotifier (Component *comp, std::function< void(float)> onScaleChanged) | |
| Constructs an instance. | |
| ~NativeScaleFactorNotifier () override | |
Private Member Functions | |
| void | componentBeingDeleted (Component &) override |
| virtual void | componentBroughtToFront (Component &component) |
| Called when the component is brought to the top of the z-order. | |
| virtual void | componentChildrenChanged (Component &component) |
| Called when the component has children added or removed, or their z-order changes. | |
| virtual void | componentEnablementChanged (Component &component) |
| virtual void | componentMovedOrResized (bool wasMoved, bool wasResized)=0 |
| This callback happens when the component that is being watched is moved relative to its top-level peer window, or when it is resized. | |
| void | componentMovedOrResized (bool, bool) override |
| This callback happens when the component that is being watched is moved relative to its top-level peer window, or when it is resized. | |
| void | componentMovedOrResized (Component &, bool wasMoved, bool wasResized) override |
| virtual void | componentNameChanged (Component &component) |
| Called when the component's name is changed. | |
| void | componentParentHierarchyChanged (Component &) override |
| void | componentPeerChanged () override |
| This callback happens when the component's top-level peer is changed. | |
| void | componentVisibilityChanged () override |
| This callback happens when the component's visibility state changes, possibly due to one of its parents being made visible or invisible. | |
| virtual void | componentVisibilityChanged ()=0 |
| This callback happens when the component's visibility state changes, possibly due to one of its parents being made visible or invisible. | |
| void | componentVisibilityChanged (Component &) override |
| Component * | getComponent () const noexcept |
| Returns the component that's being watched. | |
| void | nativeScaleFactorChanged (double newScaleFactor) override |
| Called when the scale factor changes. | |
| void | registerWithParentComps () |
| void | unregister () |
Private Attributes | |
| WeakReference< Component > | component |
| Rectangle< int > | lastBounds |
| uint32 | lastPeerID = 0 |
| ComponentPeer * | peer = nullptr |
| bool | reentrant = false |
| Array< Component * > | registeredParentComps |
| std::function< void(float)> | scaleChanged |
| bool | wasShowing |
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.
@tags{GUI}
| 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 |
|
overridevirtualinherited |
Reimplemented from juce::ComponentListener.
|
virtualinherited |
Called when the component is brought to the top of the z-order.
| component | the component that was moved |
Reimplemented in juce::DropShadower, and juce::FocusOutline.
|
virtualinherited |
Called when the component has children added or removed, or their z-order changes.
| component | the component whose children have changed |
Reimplemented in juce::DropShadower, and juce::RelativeCoordinatePositionerBase.
|
virtualinherited |
|
privatevirtual |
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.
|
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 |
Reimplemented from juce::ComponentMovementWatcher.
|
virtualinherited |
Called when the component's name is changed.
| component | the component that had its name changed |
Reimplemented in juce::MultiDocumentPanel.
|
overridevirtualinherited |
Reimplemented from juce::ComponentListener.
|
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.
|
privatevirtual |
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 |
Reimplemented from juce::ComponentMovementWatcher.
|
inlinenoexceptinherited |
Returns the component that's being watched.
Referenced by juce::PeerListener::componentPeerChanged().
|
overrideprivatevirtual |
Called when the scale factor changes.
Implements juce::ComponentPeer::ScaleFactorListener.
|
privateinherited |
|
privateinherited |
|
privateinherited |
|
privateinherited |
|
privateinherited |
|
private |
|
privateinherited |
|
private |
|
privateinherited |