diff --git a/modules/juce_gui_basics/keyboard/juce_CaretComponent.cpp b/modules/juce_gui_basics/keyboard/juce_CaretComponent.cpp index 9e258038d8..e6bdde39ca 100644 --- a/modules/juce_gui_basics/keyboard/juce_CaretComponent.cpp +++ b/modules/juce_gui_basics/keyboard/juce_CaretComponent.cpp @@ -26,7 +26,6 @@ CaretComponent::CaretComponent (Component* const keyFocusOwner) : owner (keyFocusOwner) { - setAlwaysOnTop (true); setInterceptsMouseClicks (false, false); } diff --git a/modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.cpp b/modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.cpp index 62dfffc5eb..9570c17091 100644 --- a/modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.cpp +++ b/modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.cpp @@ -312,7 +312,8 @@ public: jassert (dynamic_cast (getParentComponent()) != nullptr); const CodeEditorComponent& editor = *static_cast (getParentComponent()); - g.fillAll (editor.findColour (lineNumberBackgroundId)); + g.fillAll (editor.findColour (CodeEditorComponent::backgroundColourId) + .overlaidWith (editor.findColour (lineNumberBackgroundId))); const Rectangle clip (g.getClipBounds()); const int lineHeight = editor.lineHeight; @@ -379,14 +380,14 @@ CodeEditorComponent::CodeEditorComponent (CodeDocument& doc, CodeTokeniser* cons setMouseCursor (MouseCursor::IBeamCursor); setWantsKeyboardFocus (true); + addAndMakeVisible (caret = getLookAndFeel().createCaretComponent (this)); + addAndMakeVisible (&verticalScrollBar); verticalScrollBar.setSingleStepSize (1.0); addAndMakeVisible (&horizontalScrollBar); horizontalScrollBar.setSingleStepSize (1.0); - addAndMakeVisible (caret = getLookAndFeel().createCaretComponent (this)); - Font f (12.0f); f.setTypefaceName (Font::getDefaultMonospacedFontName()); setFont (f); @@ -446,7 +447,7 @@ void CodeEditorComponent::setLineNumbersShown (const bool shouldBeShown) gutter = nullptr; if (shouldBeShown) - addAndMakeVisible (gutter = new GutterComponent(), 0); + addAndMakeVisible (gutter = new GutterComponent()); resized(); }