mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
LookAndFeel: Allow specifying a default typeface metrics kind to use
This commit is contained in:
parent
fa81badb30
commit
4533077b75
26 changed files with 82 additions and 60 deletions
|
|
@ -382,7 +382,7 @@ private:
|
|||
ColourSelector& owner;
|
||||
|
||||
Colour currentColour;
|
||||
Font labelFont { FontOptions { 14.0f, Font::bold } };
|
||||
Font labelFont { withDefaultMetrics (FontOptions { 14.0f, Font::bold }) };
|
||||
int labelWidth = 0;
|
||||
Label colourLabel;
|
||||
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ public:
|
|||
if (keyNum < 0)
|
||||
setSize (h, h);
|
||||
else
|
||||
setSize (jlimit (h * 4, h * 8, 6 + Font (FontOptions { (float) h * 0.6f }).getStringWidth (getName())), h);
|
||||
setSize (jlimit (h * 4, h * 8, 6 + Font (withDefaultMetrics (FontOptions { (float) h * 0.6f })).getStringWidth (getName())), h);
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
@ -321,7 +321,7 @@ public:
|
|||
|
||||
void paintItem (Graphics& g, int width, int height) override
|
||||
{
|
||||
g.setFont (FontOptions ((float) height * 0.7f, Font::bold));
|
||||
g.setFont (owner.withDefaultMetrics (FontOptions ((float) height * 0.7f, Font::bold)));
|
||||
g.setColour (owner.findColour (KeyMappingEditorComponent::textColourId));
|
||||
|
||||
g.drawText (TRANS (categoryName), 2, 0, width - 2, height, Justification::centredLeft, true);
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ LivePropertyEditorBase::LivePropertyEditorBase (LiveValueBase& v, CodeDocument&
|
|||
findOriginalValueInCode();
|
||||
selectOriginalValue();
|
||||
|
||||
name.setFont (FontOptions { 13.0f });
|
||||
name.setFont (withDefaultMetrics (FontOptions { 13.0f }));
|
||||
name.setText (v.name, dontSendNotification);
|
||||
valueEditor.setMultiLine (v.isString());
|
||||
valueEditor.setReturnKeyStartsNewLine (v.isString());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue