mirror of
https://github.com/beefytech/Beef.git
synced 2025-07-12 19:26:00 +02:00
Added option to highlight current line when editing source files
This commit is contained in:
parent
5053cace5c
commit
28a0d118e5
5 changed files with 29 additions and 4 deletions
|
@ -22,6 +22,7 @@ namespace Beefy.theme.dark
|
|||
public bool mWantsCheckScrollPosition;
|
||||
public uint32 mViewWhiteSpaceColor;
|
||||
public bool mScrollToStartOnLostFocus;
|
||||
public bool mHiliteCurrentLine;
|
||||
|
||||
protected static uint32[] sDefaultColors = new uint32[] ( Color.White ) ~ delete _;
|
||||
|
||||
|
@ -480,9 +481,20 @@ namespace Beefy.theme.dark
|
|||
}
|
||||
|
||||
if (aX != -1)
|
||||
{
|
||||
{
|
||||
if (mHiliteCurrentLine && selStartIdx == selEndIdx)
|
||||
{
|
||||
float totalLineWidth = mEditWidget.mWidth - mTextInsets.mLeft - mTextInsets.mRight - 1;
|
||||
if (mEditWidget.mVertScrollbar != null)
|
||||
totalLineWidth -= mEditWidget.mVertScrollbar.Width;
|
||||
|
||||
float thickness = 2 * (lineSpacing / 18);
|
||||
using (g.PushColor(DarkTheme.COLOR_CURRENT_LINE_HILITE))
|
||||
g.OutlineRect(0, curY, totalLineWidth, lineSpacing + thickness, thickness);
|
||||
}
|
||||
|
||||
float brightness = (float)Math.Cos(Math.Max(0.0f, mCursorBlinkTicks - 20) / 9.0f);
|
||||
brightness = Math.Max(0, Math.Min(1.0f, brightness * 2.0f + 1.6f));
|
||||
brightness = Math.Clamp(brightness * 2.0f + 1.6f, 0, 1);
|
||||
if (mEditWidget.mVertPos.IsMoving)
|
||||
brightness = 0; // When we animate a pgup or pgdn, it's weird seeing the cursor scrolling around
|
||||
|
||||
|
@ -503,7 +515,7 @@ namespace Beefy.theme.dark
|
|||
}
|
||||
else
|
||||
{
|
||||
using (g.PushColor(Color.Mult(cursorColor, Color.Get(brightness))))
|
||||
using (g.PushColor(Color.Mult(cursorColor, Color.Get(brightness))))
|
||||
g.FillRect(aX, curY, Math.Max(1.0f, GS!(1)), lineSpacing);
|
||||
}
|
||||
drewCursor = true;
|
||||
|
|
|
@ -191,6 +191,7 @@ namespace Beefy.theme.dark
|
|||
public static uint32 COLOR_SELECTED_OUTLINE = 0xFFCFAE11;
|
||||
public static uint32 COLOR_MENU_FOCUSED = 0xFFE5A910;
|
||||
public static uint32 COLOR_MENU_SELECTED = 0xFFCB9B80;
|
||||
public static uint32 COLOR_CURRENT_LINE_HILITE = 0xFF4C4C54;
|
||||
|
||||
public static float sScale = 1.0f;
|
||||
public static int32 sSrcImgScale = 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue