Browse Source

Minor fix for code editor caret display.

tags/2021-05-28
jules 13 years ago
parent
commit
f4898a18ab
2 changed files with 5 additions and 5 deletions
  1. +0
    -1
      modules/juce_gui_basics/keyboard/juce_CaretComponent.cpp
  2. +5
    -4
      modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.cpp

+ 0
- 1
modules/juce_gui_basics/keyboard/juce_CaretComponent.cpp View File

@@ -26,7 +26,6 @@
CaretComponent::CaretComponent (Component* const keyFocusOwner)
: owner (keyFocusOwner)
{
setAlwaysOnTop (true);
setInterceptsMouseClicks (false, false);
}


+ 5
- 4
modules/juce_gui_extra/code_editor/juce_CodeEditorComponent.cpp View File

@@ -312,7 +312,8 @@ public:
jassert (dynamic_cast <CodeEditorComponent*> (getParentComponent()) != nullptr);
const CodeEditorComponent& editor = *static_cast <CodeEditorComponent*> (getParentComponent());
g.fillAll (editor.findColour (lineNumberBackgroundId));
g.fillAll (editor.findColour (CodeEditorComponent::backgroundColourId)
.overlaidWith (editor.findColour (lineNumberBackgroundId)));
const Rectangle<int> 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();
}


Loading…
Cancel
Save