diff --git a/melatonin/components/box_model.h b/melatonin/components/box_model.h index 6b7f35f..0068320 100644 --- a/melatonin/components/box_model.h +++ b/melatonin/components/box_model.h @@ -22,19 +22,31 @@ namespace melatonin addAndMakeVisible (widthLabel); widthLabel.addListener (this); + #if JUCE_MAJOR_VERSION == 8 + widthLabel.setFont (juce::FontOptions (20.0f)); + #else widthLabel.setFont (20.0f); + #endif widthLabel.setJustificationType (juce::Justification::centredRight); widthLabel.setColour (juce::Label::textColourId, colors::white); addAndMakeVisible (byLabel); byLabel.setText (juce::CharPointer_UTF8("\xc3\x97"), juce::dontSendNotification); + #if JUCE_MAJOR_VERSION == 8 + byLabel.setFont (juce::FontOptions (20.f)); + #else byLabel.setFont (20.f); + #endif byLabel.setJustificationType (juce::Justification::centred); byLabel.setColour (juce::Label::textColourId, colors::white); addAndMakeVisible (heightLabel); heightLabel.addListener (this); - heightLabel.setFont (20.0f); + #if JUCE_MAJOR_VERSION == 8 + heightLabel.setFont (juce::FontOptions (20.f)); + #else + heightLabel.setFont (20.f); + #endif heightLabel.setJustificationType (juce::Justification::centredLeft); heightLabel.setColour (juce::Label::textColourId, colors::white); diff --git a/melatonin/components/collapsable_panel.h b/melatonin/components/collapsable_panel.h index 782439a..62ffc76 100644 --- a/melatonin/components/collapsable_panel.h +++ b/melatonin/components/collapsable_panel.h @@ -67,7 +67,11 @@ namespace melatonin void drawToggleButton (juce::Graphics& g, juce::ToggleButton& button, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override { + #if JUCE_MAJOR_VERSION == 8 + auto font = juce::FontOptions ("Verdana", 14.5, juce::Font::FontStyleFlags::plain).withKerningFactor (0.1f); + #else auto font = juce::Font ("Verdana", 14.5, juce::Font::FontStyleFlags::plain).withExtraKerningFactor (0.1f); + #endif auto tickWidth = font.getHeight(); drawTickBox (g, button, 6.0f, ((float) button.getHeight() - tickWidth) * 0.5f, tickWidth, tickWidth, button.getToggleState(), button.isEnabled(), shouldDrawButtonAsHighlighted, shouldDrawButtonAsDown); diff --git a/melatonin/components/color_picker.h b/melatonin/components/color_picker.h index 480090f..fb74786 100644 --- a/melatonin/components/color_picker.h +++ b/melatonin/components/color_picker.h @@ -23,7 +23,11 @@ namespace melatonin g.setColour (colors::customBackground); g.fillRoundedRectangle (getLocalBounds().withSizeKeepingCentre (38, 16).toFloat(), 3); g.setColour (colors::label); + #if JUCE_MAJOR_VERSION == 8 + g.setFont (juce::FontOptions ("Verdana", 9, juce::Font::FontStyleFlags::bold)); + #else g.setFont (juce::Font ("Verdana", 9, juce::Font::FontStyleFlags::bold)); + #endif g.drawText (rgba ? "RGBA" : "HEX", getLocalBounds(), juce::Justification::centred); } @@ -98,14 +102,22 @@ namespace melatonin g.fillRoundedRectangle (colorValueBounds.withTrimmedBottom (1).toFloat(), 4); g.setColour (colors::text); + #if JUCE_MAJOR_VERSION == 8 + g.setFont (juce::FontOptions ("Verdana", 14.5, juce::Font::FontStyleFlags::plain)); + #else g.setFont (juce::Font ("Verdana", 14.5, juce::Font::FontStyleFlags::plain)); + #endif g.drawText (stringForColor (selectedColor), colorValueBounds.withTrimmedBottom (2), juce::Justification::centred); } if (model.colors.empty()) { g.setColour (colors::propertyName); + #if JUCE_MAJOR_VERSION == 8 + g.setFont (juce::FontOptions ("Verdana", 15, juce::Font::FontStyleFlags::plain)); + #else g.setFont (juce::Font ("Verdana", 15, juce::Font::FontStyleFlags::plain)); + #endif g.drawText ("No Color Properties", panelBounds.withTrimmedLeft (3).withTrimmedTop (2), juce::Justification::topLeft); } } diff --git a/melatonin/components/component_tree_view_item.h b/melatonin/components/component_tree_view_item.h index 753834b..7c09113 100644 --- a/melatonin/components/component_tree_view_item.h +++ b/melatonin/components/component_tree_view_item.h @@ -128,7 +128,11 @@ namespace melatonin g.setColour (colors::treeItemTextDisabled); auto name = componentString (component); + #if JUCE_MAJOR_VERSION == 8 + auto font = juce::FontOptions ("Verdana", 15, juce::Font::FontStyleFlags::plain); + #else auto font = juce::Font ("Verdana", 15, juce::Font::FontStyleFlags::plain); + #endif g.setFont (font); diff --git a/melatonin/components/fps_meter.h b/melatonin/components/fps_meter.h index f54eec9..7914c4f 100644 --- a/melatonin/components/fps_meter.h +++ b/melatonin/components/fps_meter.h @@ -121,7 +121,11 @@ namespace melatonin private: juce::Component* overlay = nullptr; juce::Rectangle bounds; + #if JUCE_MAJOR_VERSION == 8 + juce::Font font = juce::FontOptions (juce::Font::getDefaultMonospacedFontName(), 16.0f, juce::Font::plain); + #else juce::Font font = juce::Font (juce::Font::getDefaultMonospacedFontName(), 16.0f, juce::Font::plain); + #endif double lastTime = juce::Time::getMillisecondCounterHiRes(); double frameTime = 0; int fps = 0; diff --git a/melatonin/components/overlay.h b/melatonin/components/overlay.h index 15a176a..6bb48d8 100644 --- a/melatonin/components/overlay.h +++ b/melatonin/components/overlay.h @@ -19,14 +19,22 @@ namespace melatonin for (auto* l : labels) { + #if JUCE_MAJOR_VERSION == 8 + l->setFont (juce::FontOptions (13.f)); + #else l->setFont (13.f); + #endif l->setJustificationType (juce::Justification::centred); l->setColour (juce::Label::textColourId, colors::white); addAndMakeVisible (l); } + #if JUCE_MAJOR_VERSION == 8 + dimensions.setFont (juce::FontOptions (13.f)); + #else dimensions.setFont (13.f); + #endif dimensions.setJustificationType (juce::Justification::centred); dimensions.setColour (juce::Label::textColourId, colors::white); } diff --git a/melatonin/components/preview.h b/melatonin/components/preview.h index aedd7d0..d7255bd 100644 --- a/melatonin/components/preview.h +++ b/melatonin/components/preview.h @@ -19,7 +19,11 @@ namespace melatonin addAndMakeVisible (timingToggle); maxLabel.setColour (juce::Label::textColourId, colors::iconOff); maxLabel.setJustificationType (juce::Justification::centredTop); + #if JUCE_MAJOR_VERSION == 8 + maxLabel.setFont (juce::FontOptions ("Verdana", 18, juce::Font::FontStyleFlags::bold)); + #else maxLabel.setFont (juce::Font ("Verdana", 18, juce::Font::FontStyleFlags::bold)); + #endif // by default timings aren't on timingToggle.on = settings->props->getBoolValue ("showPerformanceTimings", false); diff --git a/melatonin/inspector_component.h b/melatonin/inspector_component.h index 27be586..4db0a8f 100644 --- a/melatonin/inspector_component.h +++ b/melatonin/inspector_component.h @@ -81,7 +81,11 @@ namespace melatonin tree.getViewport()->setScrollBarThickness (20); searchBox.setHelpText ("search"); + #if JUCE_MAJOR_VERSION == 8 + searchBox.setFont (juce::FontOptions ("Verdana", 17, juce::Font::FontStyleFlags::plain)); + #else searchBox.setFont (juce::Font ("Verdana", 17, juce::Font::FontStyleFlags::plain)); + #endif searchBox.setColour (juce::Label::backgroundColourId, juce::Colours::transparentBlack); searchBox.setColour (juce::Label::textColourId, colors::treeItemTextSelected); searchBox.setColour (juce::TextEditor::outlineColourId, juce::Colours::transparentBlack); diff --git a/melatonin/lookandfeel.h b/melatonin/lookandfeel.h index 100b063..4ddfc03 100644 --- a/melatonin/lookandfeel.h +++ b/melatonin/lookandfeel.h @@ -96,7 +96,11 @@ namespace melatonin // don't use the target app's font juce::Font getLabelFont (juce::Label& label) override { + #if JUCE_MAJOR_VERSION == 8 + return juce::FontOptions { "Verdana", label.getFont().getHeight(), label.getFont().getStyleFlags() }; + #else return { "Verdana", label.getFont().getHeight(), label.getFont().getStyleFlags() }; + #endif } // oh i dream of css resets...