1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-23 18:18:00 +02:00

Merge pull request #2114 from MineBill/expose-more-colors

Remove some hardcoded colors to make the IDE more friendly to light themes.
This commit is contained in:
Brian Fiete 2025-01-29 11:27:47 -08:00 committed by GitHub
commit 852d29d770
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 82 additions and 44 deletions

View file

@ -413,6 +413,11 @@ namespace IDE.ui
g.PushColor(DarkTheme.COLOR_MENU_FOCUSED);
defer:loop g.PopColor();
}
else
{
g.PushColor(DarkTheme.COLOR_TEXT);
defer:loop g.PopColor();
}
let str = StringView(mEntryDisplay, index, @c.NextIndex - index);

View file

@ -877,7 +877,7 @@ namespace IDE.ui
// column header
using (g.PushClip(0, 0, mWidth, GS!(mColumnHeaderHeight)))
{
using (g.PushColor(0xFFFFFFFF))
using (g.PushColor(DarkTheme.COLOR_TEXT))
{
g.SetFont(mFont);
float strViewColumnStart = GS!(mColumnDisplayStart) + mBytesPerDisplayLine*GS!(mColumnDisplayStride) + GS!(mStrViewDisplayStartOffset);
@ -908,7 +908,7 @@ namespace IDE.ui
float displayAdj = (float)(-mShowPositionDisplayOffset * lineSpacing);
using (g.PushTranslate(0, displayAdj))
{
using (g.PushColor(0xFFFFFFFF))
using (g.PushColor(DarkTheme.COLOR_TEXT))
{
//ulong lineStart = mCurPosition / mBytesPerDisplayLine;
int lockSize = lineCount * mBytesPerDisplayLine;

View file

@ -652,17 +652,15 @@ namespace IDE.ui
subItem.mOnMouseClick.Add(new => ListViewItemClicked);
}
var listViewItem = (BreakpointListViewItem)root.GetChildAtIndex(breakIdx);
listViewItem.mTextColor = Color.White;
listViewItem.mTextColor = DarkTheme.COLOR_TEXT;
listViewItem.mIsBold = breakpoint.IsActiveBreakpoint();
var locString = scope String();
breakpoint.ToString_Location(locString);
listViewItem.Label = locString;
if (breakpoint.IsBound())
listViewItem.mTextColor = 0xFFFFFFFF;
else
listViewItem.mTextColor = 0x80FFFFFF;
if (!breakpoint.IsBound())
listViewItem.mTextColor = (0x00FFFFFF & DarkTheme.COLOR_TEXT) | 0x80000000;
// Condition
var subItem = listViewItem.GetSubItem(2);

View file

@ -369,14 +369,17 @@ namespace IDE.ui
{
base.Draw(g);
g.DrawString("Breakpoint Condition", mConditionEdit.mX, mConditionEdit.mY - GS!(20));
g.DrawString("Thread Id", mThreadEdit.mX, mThreadEdit.mY - GS!(20));
g.DrawString("Log String", mLogEdit.mX, mLogEdit.mY - GS!(20));
g.DrawString("Break on Hit Count", mHitCountCombo.mX, mHitCountEdit.mY - GS!(19));
using (g.PushColor(DarkTheme.COLOR_TEXT))
{
g.DrawString("Breakpoint Condition", mConditionEdit.mX, mConditionEdit.mY - GS!(20));
g.DrawString("Thread Id", mThreadEdit.mX, mThreadEdit.mY - GS!(20));
g.DrawString("Log String", mLogEdit.mX, mLogEdit.mY - GS!(20));
g.DrawString("Break on Hit Count", mHitCountCombo.mX, mHitCountEdit.mY - GS!(19));
var str = scope String();
str.AppendF("Current: {0}", mStartingHitCount);
g.DrawString(str, mWidth - GS!(16) - GS!(8), mHitCountEdit.mY - GS!(19), .Right);
var str = scope String();
str.AppendF("Current: {0}", mStartingHitCount);
g.DrawString(str, mWidth - GS!(16) - GS!(8), mHitCountEdit.mY - GS!(19), .Right);
}
}
}
}

View file

@ -255,7 +255,8 @@ namespace IDE.ui
{
using (g.PushClip(0, 0, width, height))
{
using (g.PushColor(0xFF00FF00))
// Using override to prevent the color turning black when using a dark text color.
using (g.PushColorOverride(0xFF00FF00))
{
float prevY = 0;
@ -439,10 +440,13 @@ namespace IDE.ui
using (g.PushColor(0x20FFFFFF))
g.FillRect(0, 0, mWidth, mHeight);
DrawData(g, mData, mTimes, dataRect.mX, dataRect.mY, dataRect.mWidth, dataRect.mHeight);
using (g.PushColor(DarkTheme.COLOR_TEXT))
{
DrawData(g, mData, mTimes, dataRect.mX, dataRect.mY, dataRect.mWidth, dataRect.mHeight);
g.SetFont(DarkTheme.sDarkTheme.mSmallBoldFont);
g.DrawString(mLabel, -GS!(0), -GS!(0), .Centered, dataRect.mX);
g.SetFont(DarkTheme.sDarkTheme.mSmallBoldFont);
g.DrawString(mLabel, -GS!(0), -GS!(0), .Centered, dataRect.mX);
}
}
}

View file

@ -322,11 +322,14 @@ namespace IDE.ui
{
base.Draw(g);
g.DrawString("Find what:", 6, mEditWidget.mY - GS!(18));
if (mReplaceWidget != null)
g.DrawString("Replace with:", GS!(6), mReplaceWidget.mY - GS!(18));
g.DrawString("Look in:", GS!(6), mLocationCombo.mY - GS!(18));
g.DrawString("Look at these file types:", GS!(6), mFileTypesCombo.mY - GS!(18));
using (g.PushColor(DarkTheme.COLOR_TEXT))
{
g.DrawString("Find what:", 6, mEditWidget.mY - GS!(18));
if (mReplaceWidget != null)
g.DrawString("Replace with:", GS!(6), mReplaceWidget.mY - GS!(18));
g.DrawString("Look in:", GS!(6), mLocationCombo.mY - GS!(18));
g.DrawString("Look at these file types:", GS!(6), mFileTypesCombo.mY - GS!(18));
}
}
public override void Update()

View file

@ -834,9 +834,12 @@ namespace IDE.ui
g.DrawString(label, widget.mX + GS!(6), widget.mY - GS!(20));
}
DrawLabel(mKindBar, mRegenerating ? "Regenerating ..." : "Generator");
for (var uiEntry in mUIEntries)
DrawLabel(uiEntry.mWidget, uiEntry.mLabel);
using (g.PushColor(DarkTheme.COLOR_TEXT))
{
DrawLabel(mKindBar, mRegenerating ? "Regenerating ..." : "Generator");
for (var uiEntry in mUIEntries)
DrawLabel(uiEntry.mWidget, uiEntry.mLabel);
}
}
public override void DrawAll(Graphics g)

View file

@ -140,7 +140,8 @@ namespace IDE.ui
{
base.Draw(g);
g.DrawString((mBreakpointKind == .Memory) ? "Breakpoint Address" : "Symbol Name", mAddressEdit.mX, mAddressEdit.mY - GS!(20));
using (g.PushColor(DarkTheme.COLOR_TEXT))
g.DrawString((mBreakpointKind == .Memory) ? "Breakpoint Address" : "Symbol Name", mAddressEdit.mX, mAddressEdit.mY - GS!(20));
//g.DrawString("Project Directory", mDialogEditWidget.mX, mDialogEditWidget.mY - 20);
}

View file

@ -95,9 +95,12 @@ namespace IDE.ui
{
base.Draw(g);
DrawLabel(g, mDescEdit, "Profile Description (Optional)");
DrawLabel(g, mThreadCombo, "Thread");
DrawLabel(g, mSampleRateEdit, "Sample Rate");
using (g.PushColor(DarkTheme.COLOR_TEXT))
{
DrawLabel(g, mDescEdit, "Profile Description (Optional)");
DrawLabel(g, mThreadCombo, "Thread");
DrawLabel(g, mSampleRateEdit, "Sample Rate");
}
}
public override void CalcSize()

View file

@ -684,6 +684,9 @@ namespace IDE.ui
{
base.Draw(g);
g.PushColor(DarkTheme.COLOR_TEXT);
defer g.PopColor();
g.SetFont(DarkTheme.sDarkTheme.mSmallFont);
g.DrawString("Session", mSessionComboBox.mX - GS!(2), mSessionComboBox.mY, .Right);
g.DrawString("Thread", mThreadComboBox.mX - GS!(2), mThreadComboBox.mY, .Right);

View file

@ -4746,7 +4746,8 @@ namespace IDE.ui
case 2: lineStr.AppendF("{0}", (lineIdx + 1) % 100);
default: lineStr.AppendF("{0}", lineIdx + 1);
}
g.DrawString(lineStr, 0, GS!(2) + ewc.mLineCoords[lineIdx], FontAlign.Right, editX - GS!(14));
using (g.PushColor(DarkTheme.COLOR_TEXT))
g.DrawString(lineStr, 0, GS!(2) + ewc.mLineCoords[lineIdx], FontAlign.Right, editX - GS!(14));
}
}
}

View file

@ -92,7 +92,8 @@ namespace IDE.ui
}
g.SetFont(s_Font);
g.DrawString(mPath, 10, 0, .Left, mWidth - 10);
using (g.PushColor(gApp.mSettings.mUISettings.mColors.mText))
g.DrawString(mPath, 10, 0, .Left, mWidth - 10);
}
public override void MouseEnter()