mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
PopupMenu: Move IdealSize modifiers to LookAndFeel
This commit is contained in:
parent
8be4c49c19
commit
e360d83057
4 changed files with 31 additions and 2 deletions
|
|
@ -3,6 +3,31 @@
|
|||
# Version 8.0.4
|
||||
|
||||
|
||||
## Change
|
||||
|
||||
HeaderItemComponent::getIdealSize no longer applies modifiers to the result
|
||||
directly. Instead, these changes have been moved to the respective LookAndFeel
|
||||
methods, enabling better customization.
|
||||
|
||||
**Possible Issues**
|
||||
|
||||
Code that overrides LookAndFeel::getIdealPopupMenuItemSize and relied on the
|
||||
previous modifiers applied in HeaderItemComponent::getIdealSize may now behave
|
||||
differently.
|
||||
|
||||
**Workaround**
|
||||
|
||||
Review any overrides of LookAndFeel::getIdealPopupMenuItemSize and apply the
|
||||
necessary adjustments to account for any missing modifiers or changes in
|
||||
behavior.
|
||||
|
||||
**Rationale**
|
||||
|
||||
The previous approach did not allow users to customize the applied modifiers
|
||||
through the LookAndFeel class. Moving this logic to LookAndFeel methods ensures
|
||||
consistent and flexible customization.
|
||||
|
||||
|
||||
## Change
|
||||
|
||||
The behavior of AudioTransportSource::hasStreamFinished has been updated to
|
||||
|
|
|
|||
|
|
@ -899,6 +899,9 @@ void LookAndFeel_V2::getIdealPopupMenuItemSizeWithOptions (const String& text,
|
|||
standardMenuItemHeight,
|
||||
idealWidth,
|
||||
idealHeight);
|
||||
|
||||
idealHeight += idealHeight / 2;
|
||||
idealWidth += idealWidth / 4;
|
||||
}
|
||||
|
||||
void LookAndFeel_V2::drawPopupMenuBackground (Graphics& g, int width, int height)
|
||||
|
|
|
|||
|
|
@ -884,6 +884,9 @@ void LookAndFeel_V4::getIdealPopupMenuItemSize (const String& text, const bool i
|
|||
idealHeight = standardMenuItemHeight > 0 ? standardMenuItemHeight : roundToInt (font.getHeight() * 1.3f);
|
||||
idealWidth = GlyphArrangement::getStringWidthInt (font, text) + idealHeight * 2;
|
||||
}
|
||||
|
||||
idealHeight += idealHeight / 2;
|
||||
idealWidth += idealWidth / 4;
|
||||
}
|
||||
|
||||
void LookAndFeel_V4::drawMenuBarBackground (Graphics& g, int width, int height,
|
||||
|
|
|
|||
|
|
@ -90,8 +90,6 @@ struct HeaderItemComponent final : public PopupMenu::CustomComponent
|
|||
idealWidth,
|
||||
idealHeight,
|
||||
options);
|
||||
idealHeight += idealHeight / 2;
|
||||
idealWidth += idealWidth / 4;
|
||||
}
|
||||
|
||||
std::unique_ptr<AccessibilityHandler> createAccessibilityHandler() override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue