mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Initial theme support
This commit is contained in:
parent
b50fbdb51d
commit
657866c3bc
18 changed files with 573 additions and 197 deletions
|
@ -78,6 +78,7 @@ namespace Beefy.theme.dark
|
||||||
{
|
{
|
||||||
using (g.PushColor(mDisabled ? 0x80FFFFFF : Color.White))
|
using (g.PushColor(mDisabled ? 0x80FFFFFF : Color.White))
|
||||||
{
|
{
|
||||||
|
using (g.PushColor(DarkTheme.COLOR_TEXT))
|
||||||
DarkTheme.DrawUnderlined(g, mLabel, GS!(2), (mHeight - GS!(20)) / 2 + mLabelYOfs, .Centered, mWidth - GS!(4), .Truncate);
|
DarkTheme.DrawUnderlined(g, mLabel, GS!(2), (mHeight - GS!(20)) / 2 + mLabelYOfs, .Centered, mWidth - GS!(4), .Truncate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -132,6 +132,7 @@ namespace Beefy.theme.dark
|
||||||
float fontHeight = g.mFont.GetHeight();
|
float fontHeight = g.mFont.GetHeight();
|
||||||
|
|
||||||
//g.DrawString(label, mLabelX, (mHeight - GS!(24)) / 2, mLabelAlign, mWidth - mLabelX - GS!(24), FontOverflowMode.Ellipsis);
|
//g.DrawString(label, mLabelX, (mHeight - GS!(24)) / 2, mLabelAlign, mWidth - mLabelX - GS!(24), FontOverflowMode.Ellipsis);
|
||||||
|
using (g.PushColor(DarkTheme.COLOR_TEXT))
|
||||||
g.DrawString(label, mLabelX, (mHeight - fontHeight) / 2 - (int)GS!(3.5f), mLabelAlign, mWidth - mLabelX - GS!(24), FontOverflowMode.Ellipsis);
|
g.DrawString(label, mLabelX, (mHeight - fontHeight) / 2 - (int)GS!(3.5f), mLabelAlign, mWidth - mLabelX - GS!(24), FontOverflowMode.Ellipsis);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,7 +93,7 @@ namespace Beefy.theme.dark
|
||||||
{
|
{
|
||||||
public float mChildIndent;
|
public float mChildIndent;
|
||||||
public DarkTreeOpenButton mOpenButton;
|
public DarkTreeOpenButton mOpenButton;
|
||||||
public uint32 mTextColor = Color.White;
|
public uint32? mTextColor;
|
||||||
public uint32 mFocusColor = DarkTheme.COLOR_MENU_FOCUSED;
|
public uint32 mFocusColor = DarkTheme.COLOR_MENU_FOCUSED;
|
||||||
public uint32 mSelectColor = DarkTheme.COLOR_MENU_SELECTED;
|
public uint32 mSelectColor = DarkTheme.COLOR_MENU_SELECTED;
|
||||||
public float mTextAreaLengthOffset;
|
public float mTextAreaLengthOffset;
|
||||||
|
@ -205,6 +205,9 @@ namespace Beefy.theme.dark
|
||||||
for (var child in mChildItems)
|
for (var child in mChildItems)
|
||||||
child.RehupScale(oldScale, newScale);
|
child.RehupScale(oldScale, newScale);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mFocusColor = DarkTheme.COLOR_MENU_FOCUSED;
|
||||||
|
mSelectColor = DarkTheme.COLOR_MENU_SELECTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual float GetLabelOffset()
|
protected virtual float GetLabelOffset()
|
||||||
|
@ -320,7 +323,7 @@ namespace Beefy.theme.dark
|
||||||
wantWidth -= listView.mInsets.mRight;
|
wantWidth -= listView.mInsets.mRight;
|
||||||
}
|
}
|
||||||
|
|
||||||
using (g.PushColor(mTextColor))
|
using (g.PushColor(mTextColor ?? DarkTheme.COLOR_TEXT))
|
||||||
g.DrawString(mLabel, labelX, 0, .Left, wantWidth, ((nextContentColumn != -1) || (listView.mEndInEllipsis)) ? .Ellipsis : .Overflow);
|
g.DrawString(mLabel, labelX, 0, .Left, wantWidth, ((nextContentColumn != -1) || (listView.mEndInEllipsis)) ? .Ellipsis : .Overflow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -924,6 +927,7 @@ namespace Beefy.theme.dark
|
||||||
var column = mColumns[columnIdx];
|
var column = mColumns[columnIdx];
|
||||||
float drawXOfs = GS!(6);
|
float drawXOfs = GS!(6);
|
||||||
float drawWidth = column.mWidth - drawXOfs - GS!(6);
|
float drawWidth = column.mWidth - drawXOfs - GS!(6);
|
||||||
|
using (g.PushColor(DarkTheme.COLOR_TEXT))
|
||||||
g.DrawString(column.mLabel, drawXOfs, mHeaderLabelYOfs + GS!(2), FontAlign.Left, drawWidth, (columnIdx < mColumns.Count - 1) ? FontOverflowMode.Ellipsis : FontOverflowMode.Overflow);
|
g.DrawString(column.mLabel, drawXOfs, mHeaderLabelYOfs + GS!(2), FontAlign.Left, drawWidth, (columnIdx < mColumns.Count - 1) ? FontOverflowMode.Ellipsis : FontOverflowMode.Overflow);
|
||||||
|
|
||||||
if (columnIdx != 0)
|
if (columnIdx != 0)
|
||||||
|
|
|
@ -40,10 +40,13 @@ namespace Beefy.theme.dark
|
||||||
leftStr.RemoveToEnd(barIdx);
|
leftStr.RemoveToEnd(barIdx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
using (g.PushColor(DarkTheme.COLOR_TEXT))
|
||||||
|
{
|
||||||
g.DrawString(leftStr, GS!(36), 0);
|
g.DrawString(leftStr, GS!(36), 0);
|
||||||
if (!rightStr.IsEmpty)
|
if (!rightStr.IsEmpty)
|
||||||
g.DrawString(rightStr, mWidth - GS!(8), 0, .Right);
|
g.DrawString(rightStr, mWidth - GS!(8), 0, .Right);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (mMenuItem.mIconImage != null)
|
if (mMenuItem.mIconImage != null)
|
||||||
g.Draw(mMenuItem.mIconImage, GS!(4), 0);
|
g.Draw(mMenuItem.mIconImage, GS!(4), 0);
|
||||||
|
|
|
@ -59,7 +59,7 @@ namespace Beefy.theme.dark
|
||||||
public bool mIsEndTab;
|
public bool mIsEndTab;
|
||||||
public bool mIsRightTab;
|
public bool mIsRightTab;
|
||||||
public float mObscuredDir; // <0 = left, >0 = right
|
public float mObscuredDir; // <0 = left, >0 = right
|
||||||
public uint32 mTextColor = Color.White;
|
public uint32? mTextColor;
|
||||||
public float mTabWidthOffset = 30;
|
public float mTabWidthOffset = 30;
|
||||||
|
|
||||||
public this(bool isEnd = false)
|
public this(bool isEnd = false)
|
||||||
|
@ -130,7 +130,7 @@ namespace Beefy.theme.dark
|
||||||
if ((mLabel != null) && (drawWidth > GS!(16)))
|
if ((mLabel != null) && (drawWidth > GS!(16)))
|
||||||
{
|
{
|
||||||
//using (g.PushColor(((DarkTabbedView)mParent).mTextColor))
|
//using (g.PushColor(((DarkTabbedView)mParent).mTextColor))
|
||||||
using (g.PushColor(mTextColor))
|
using (g.PushColor(mTextColor ?? DarkTheme.COLOR_TEXT))
|
||||||
{
|
{
|
||||||
float textWidth = g.mFont.GetWidth(mLabel);
|
float textWidth = g.mFont.GetWidth(mLabel);
|
||||||
float useWidth = mWidth - GS!(12)*2;
|
float useWidth = mWidth - GS!(12)*2;
|
||||||
|
|
|
@ -186,6 +186,7 @@ namespace Beefy.theme.dark
|
||||||
COUNT
|
COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public static uint32 COLOR_TEXT = 0xFFFFFFFF;
|
||||||
public static uint32 COLOR_WINDOW = 0xFF595959;
|
public static uint32 COLOR_WINDOW = 0xFF595959;
|
||||||
public static uint32 COLOR_BKG = 0xFF262626;
|
public static uint32 COLOR_BKG = 0xFF262626;
|
||||||
public static uint32 COLOR_SELECTED_OUTLINE = 0xFFE6A800;
|
public static uint32 COLOR_SELECTED_OUTLINE = 0xFFE6A800;
|
||||||
|
@ -209,6 +210,17 @@ namespace Beefy.theme.dark
|
||||||
public Image mIconWarning ~ delete _;
|
public Image mIconWarning ~ delete _;
|
||||||
public Image mIconError ~ delete _;
|
public Image mIconError ~ delete _;
|
||||||
|
|
||||||
|
public String[3] mUIFileNames = .(new String(), new String(), new String()) ~
|
||||||
|
{
|
||||||
|
for (var val in _)
|
||||||
|
delete val;
|
||||||
|
};
|
||||||
|
|
||||||
|
public this()
|
||||||
|
{
|
||||||
|
sDarkTheme = this;
|
||||||
|
}
|
||||||
|
|
||||||
public static DesignToolboxEntry[] GetDesignToolboxEntries()
|
public static DesignToolboxEntry[] GetDesignToolboxEntries()
|
||||||
{
|
{
|
||||||
Get();
|
Get();
|
||||||
|
@ -320,22 +332,35 @@ namespace Beefy.theme.dark
|
||||||
COLOR_MENU_FOCUSED = Color.FromNative(bits[3]);
|
COLOR_MENU_FOCUSED = Color.FromNative(bits[3]);
|
||||||
COLOR_MENU_SELECTED = Color.FromNative(bits[4]);
|
COLOR_MENU_SELECTED = Color.FromNative(bits[4]);
|
||||||
|
|
||||||
|
int scaleIdx = 0;
|
||||||
|
|
||||||
String uiFileName = null;
|
String uiFileName = null;
|
||||||
switch (sSrcImgScale)
|
switch (sSrcImgScale)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
|
scaleIdx = 0;
|
||||||
uiFileName = "DarkUI.png";
|
uiFileName = "DarkUI.png";
|
||||||
case 2:
|
case 2:
|
||||||
|
scaleIdx = 1;
|
||||||
uiFileName = "DarkUI_2.png";
|
uiFileName = "DarkUI_2.png";
|
||||||
case 4:
|
case 4:
|
||||||
|
scaleIdx = 2;
|
||||||
uiFileName = "DarkUI_4.png";
|
uiFileName = "DarkUI_4.png";
|
||||||
default:
|
default:
|
||||||
Runtime.FatalError("Invalid scale");
|
Runtime.FatalError("Invalid scale");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String fileName = scope String()..Append(tempStr, BFApp.sApp.mInstallDir, "images/", uiFileName);
|
||||||
|
if (!mUIFileNames[scaleIdx].IsEmpty)
|
||||||
|
fileName.Set(mUIFileNames[scaleIdx]);
|
||||||
|
|
||||||
mIconError = LoadSizedImage("IconError");
|
mIconError = LoadSizedImage("IconError");
|
||||||
mIconWarning = LoadSizedImage("IconWarning");
|
mIconWarning = LoadSizedImage("IconWarning");
|
||||||
mThemeImage = Image.LoadFromFile(scope String()..Append(tempStr, BFApp.sApp.mInstallDir, "images/", uiFileName));
|
mThemeImage = Image.LoadFromFile(fileName);
|
||||||
|
if (mThemeImage == null)
|
||||||
|
{
|
||||||
|
// Fail (just crashes now)
|
||||||
|
}
|
||||||
|
|
||||||
for (int32 i = 0; i < (int32)ImageIdx.COUNT; i++)
|
for (int32 i = 0; i < (int32)ImageIdx.COUNT; i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -91,14 +91,22 @@ int main()
|
||||||
int baseWidth = 0;
|
int baseWidth = 0;
|
||||||
int baseHeight = 0;
|
int baseHeight = 0;
|
||||||
|
|
||||||
PSDReader readers[3];
|
bool isThemeDir = false;
|
||||||
ImageData* imageDatas[3];
|
|
||||||
|
PSDReader readers[2][3];
|
||||||
|
ImageData* imageDatas[2][3] = { NULL };
|
||||||
|
|
||||||
|
for (int pass = 0; pass < 2; pass++)
|
||||||
|
{
|
||||||
for (int size = 0; size < 3; size++)
|
for (int size = 0; size < 3; size++)
|
||||||
{
|
{
|
||||||
auto& reader = readers[size];
|
auto& reader = readers[pass][size];
|
||||||
auto& imageData = imageDatas[size];
|
auto& imageData = imageDatas[pass][size];
|
||||||
|
|
||||||
String fileName;
|
String fileName;
|
||||||
|
|
||||||
|
if (pass == 0)
|
||||||
|
{
|
||||||
if (size == 0)
|
if (size == 0)
|
||||||
fileName = "DarkUI.psd";
|
fileName = "DarkUI.psd";
|
||||||
else if (size == 1)
|
else if (size == 1)
|
||||||
|
@ -106,6 +114,25 @@ int main()
|
||||||
else
|
else
|
||||||
fileName = "DarkUI_4.psd";
|
fileName = "DarkUI_4.psd";
|
||||||
|
|
||||||
|
if (!FileExists(fileName))
|
||||||
|
{
|
||||||
|
isThemeDir = true;
|
||||||
|
fileName = "../../images/" + fileName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (size == 0)
|
||||||
|
fileName = "UI.psd";
|
||||||
|
else if (size == 1)
|
||||||
|
fileName = "UI_2.psd";
|
||||||
|
else
|
||||||
|
fileName = "UI_4.psd";
|
||||||
|
|
||||||
|
if (!FileExists(fileName))
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (!reader.Init(fileName))
|
if (!reader.Init(fileName))
|
||||||
{
|
{
|
||||||
if (size == 0)
|
if (size == 0)
|
||||||
|
@ -118,7 +145,7 @@ int main()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (size == 0)
|
if ((size == 0) && (pass == 0))
|
||||||
{
|
{
|
||||||
baseWidth = reader.mWidth;
|
baseWidth = reader.mWidth;
|
||||||
baseHeight = reader.mHeight;
|
baseHeight = reader.mHeight;
|
||||||
|
@ -134,23 +161,32 @@ int main()
|
||||||
|
|
||||||
imageData = reader.MergeLayers(NULL, layerIndices, NULL);
|
imageData = reader.MergeLayers(NULL, layerIndices, NULL);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int numCols = baseWidth / 20;
|
int numCols = baseWidth / 20;
|
||||||
int numRows = baseHeight / 20;
|
int numRows = baseHeight / 20;
|
||||||
|
|
||||||
auto _HasImage = [&](int col, int row, int size)
|
auto _HasImage = [&](int col, int row, int pass, int size)
|
||||||
{
|
{
|
||||||
int scale = 1 << size;
|
int scale = 1 << size;
|
||||||
auto srcImage = imageDatas[size];
|
auto srcImage = imageDatas[pass][size];
|
||||||
if (srcImage == NULL)
|
if (srcImage == NULL)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
int xStart = (col * 20 * scale);
|
||||||
|
int yStart = (row * 20 * scale);
|
||||||
|
|
||||||
|
if ((xStart < srcImage->mX) || (xStart + 20 * scale > srcImage->mX + srcImage->mWidth))
|
||||||
|
return false;
|
||||||
|
if ((yStart < srcImage->mY) || (yStart + 20 * scale > srcImage->mY + srcImage->mHeight))
|
||||||
|
return false;
|
||||||
|
|
||||||
for (int yOfs = 0; yOfs < 20 * scale; yOfs++)
|
for (int yOfs = 0; yOfs < 20 * scale; yOfs++)
|
||||||
{
|
{
|
||||||
for (int xOfs = 0; xOfs < 20 * scale; xOfs++)
|
for (int xOfs = 0; xOfs < 20 * scale; xOfs++)
|
||||||
{
|
{
|
||||||
int srcX = (col * 20 * scale) + xOfs;
|
int srcX = xStart + xOfs;
|
||||||
int srcY = (row * 20 * scale) + yOfs;
|
int srcY = yStart + yOfs;
|
||||||
auto color = srcImage->mBits[(srcX - srcImage->mX) + (srcY - srcImage->mY)*srcImage->mWidth];
|
auto color = srcImage->mBits[(srcX - srcImage->mX) + (srcY - srcImage->mY)*srcImage->mWidth];
|
||||||
if (color != 0)
|
if (color != 0)
|
||||||
return true;
|
return true;
|
||||||
|
@ -159,6 +195,40 @@ int main()
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
auto _HasUniqueThemeImage = [&](int col, int row, int size)
|
||||||
|
{
|
||||||
|
int scale = 1 << size;
|
||||||
|
auto srcImage0 = imageDatas[0][size];
|
||||||
|
if (srcImage0 == NULL)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
auto srcImage1 = imageDatas[1][size];
|
||||||
|
if (srcImage1 == NULL)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
int xStart = (col * 20 * scale);
|
||||||
|
int yStart = (row * 20 * scale);
|
||||||
|
|
||||||
|
if ((xStart < srcImage1->mX) || (xStart + 20 * scale > srcImage1->mX + srcImage1->mWidth))
|
||||||
|
return false;
|
||||||
|
if ((yStart < srcImage1->mY) || (yStart + 20 * scale > srcImage1->mY + srcImage1->mHeight))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
for (int yOfs = 0; yOfs < 20 * scale; yOfs++)
|
||||||
|
{
|
||||||
|
for (int xOfs = 0; xOfs < 20 * scale; xOfs++)
|
||||||
|
{
|
||||||
|
int srcX = xStart + xOfs;
|
||||||
|
int srcY = yStart + yOfs;
|
||||||
|
auto color0 = srcImage0->mBits[(srcX - srcImage0->mX) + (srcY - srcImage0->mY)*srcImage0->mWidth];
|
||||||
|
auto color1 = srcImage1->mBits[(srcX - srcImage1->mX) + (srcY - srcImage1->mY)*srcImage1->mWidth];
|
||||||
|
if (color0 != color1)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
for (int size = 0; size < 3; size++)
|
for (int size = 0; size < 3; size++)
|
||||||
{
|
{
|
||||||
int scale = 1 << size;
|
int scale = 1 << size;
|
||||||
|
@ -168,37 +238,77 @@ int main()
|
||||||
PNGData pngData;
|
PNGData pngData;
|
||||||
pngData.CreateNew(outWidth, outHeight);
|
pngData.CreateNew(outWidth, outHeight);
|
||||||
|
|
||||||
if (size < 2)
|
if ((size < 2) && (!isThemeDir))
|
||||||
{
|
{
|
||||||
ConvImage("IconError", size);
|
ConvImage("IconError", size);
|
||||||
ConvImage("IconWarning", size);
|
ConvImage("IconWarning", size);
|
||||||
}
|
}
|
||||||
|
|
||||||
String fileName;
|
String fileName;
|
||||||
|
if (isThemeDir)
|
||||||
|
{
|
||||||
|
if (size == 0)
|
||||||
|
fileName = "UI.png";
|
||||||
|
else if (size == 1)
|
||||||
|
fileName = "UI_2.png";
|
||||||
|
else
|
||||||
|
fileName = "UI_4.png";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
if (size == 0)
|
if (size == 0)
|
||||||
fileName = "DarkUI.png";
|
fileName = "DarkUI.png";
|
||||||
else if (size == 1)
|
else if (size == 1)
|
||||||
fileName = "DarkUI_2.png";
|
fileName = "DarkUI_2.png";
|
||||||
else
|
else
|
||||||
fileName = "DarkUI_4.png";
|
fileName = "DarkUI_4.png";
|
||||||
|
}
|
||||||
|
|
||||||
for (int col = 0; col < numCols; col++)
|
|
||||||
{
|
|
||||||
for (int row = 0; row < numRows; row++)
|
for (int row = 0; row < numRows; row++)
|
||||||
{
|
{
|
||||||
if ((size == 2) && (col == 11) && (row == 7))
|
for (int col = 0; col < numCols; col++)
|
||||||
{
|
{
|
||||||
NOP;
|
int srcPass = 0;
|
||||||
}
|
|
||||||
|
|
||||||
int srcSize = size;
|
int srcSize = size;
|
||||||
if (!_HasImage(col, row, size))
|
|
||||||
|
if (_HasImage(col, row, 1, size)) // Theme has image of appropriate size
|
||||||
{
|
{
|
||||||
if (_HasImage(col, row, 2))
|
srcPass = 1;
|
||||||
|
srcSize = size;
|
||||||
|
}
|
||||||
|
else if (_HasUniqueThemeImage(col, row, 2)) // Use resized theme image
|
||||||
{
|
{
|
||||||
|
srcPass = 1;
|
||||||
srcSize = 2;
|
srcSize = 2;
|
||||||
}
|
}
|
||||||
else
|
else if (_HasUniqueThemeImage(col, row, 1)) // Use resized theme image
|
||||||
|
{
|
||||||
|
srcPass = 1;
|
||||||
|
srcSize = 2;
|
||||||
|
}
|
||||||
|
else if (_HasUniqueThemeImage(col, row, 0)) // Use resized theme image instead
|
||||||
|
{
|
||||||
|
srcPass = 1;
|
||||||
|
srcSize = 0;
|
||||||
|
}
|
||||||
|
else if (_HasImage(col, row, 0, size)) // Use original image
|
||||||
|
{
|
||||||
|
srcPass = 0;
|
||||||
|
srcSize = size;
|
||||||
|
}
|
||||||
|
else if (_HasImage(col, row, 0, 2)) // Use resized original image
|
||||||
|
{
|
||||||
|
srcPass = 0;
|
||||||
|
srcSize = 2;
|
||||||
|
}
|
||||||
|
else if (_HasImage(col, row, 0, 1)) // Use resized original image
|
||||||
|
{
|
||||||
|
srcPass = 0;
|
||||||
|
srcSize = 1;
|
||||||
|
}
|
||||||
|
else // Use resized original image
|
||||||
|
{
|
||||||
|
srcPass = 0;
|
||||||
srcSize = 0;
|
srcSize = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,7 +323,7 @@ int main()
|
||||||
int srcX = (col * 20 * srcScale) + xOfs * srcScale / scale;
|
int srcX = (col * 20 * srcScale) + xOfs * srcScale / scale;
|
||||||
int srcY = (row * 20 * srcScale) + yOfs * srcScale / scale;
|
int srcY = (row * 20 * srcScale) + yOfs * srcScale / scale;
|
||||||
|
|
||||||
auto srcImage = imageDatas[srcSize];
|
auto srcImage = imageDatas[srcPass][srcSize];
|
||||||
if ((srcX >= srcImage->mX) && (srcY >= srcImage->mY) &&
|
if ((srcX >= srcImage->mX) && (srcY >= srcImage->mY) &&
|
||||||
(srcX < srcImage->mX + srcImage->mWidth) &&
|
(srcX < srcImage->mX + srcImage->mWidth) &&
|
||||||
(srcY < srcImage->mY + srcImage->mHeight))
|
(srcY < srcImage->mY + srcImage->mHeight))
|
||||||
|
|
|
@ -108,6 +108,7 @@
|
||||||
<PrecompiledHeaderFile>
|
<PrecompiledHeaderFile>
|
||||||
</PrecompiledHeaderFile>
|
</PrecompiledHeaderFile>
|
||||||
<AdditionalIncludeDirectories>../../;../../BeefySysLib/platform/win;../../BeefySysLib/third_party</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>../../;../../BeefySysLib/platform/win;../../BeefySysLib/third_party</AdditionalIncludeDirectories>
|
||||||
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
|
@ -146,6 +147,7 @@
|
||||||
<PrecompiledHeaderFile>
|
<PrecompiledHeaderFile>
|
||||||
</PrecompiledHeaderFile>
|
</PrecompiledHeaderFile>
|
||||||
<AdditionalIncludeDirectories>../../;../../BeefySysLib/platform/win;../../BeefySysLib/third_party</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>../../;../../BeefySysLib/platform/win;../../BeefySysLib/third_party</AdditionalIncludeDirectories>
|
||||||
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Console</SubSystem>
|
<SubSystem>Console</SubSystem>
|
||||||
|
|
BIN
IDE/dist/images/ImgCreate.exe
vendored
BIN
IDE/dist/images/ImgCreate.exe
vendored
Binary file not shown.
|
@ -6997,7 +6997,7 @@ namespace IDE
|
||||||
public void SetScale(float scale, bool force = false)
|
public void SetScale(float scale, bool force = false)
|
||||||
{
|
{
|
||||||
PhysSetScale(scale, force);
|
PhysSetScale(scale, force);
|
||||||
gApp.mSettings.mEditorSettings.mUIScale = DarkTheme.sScale * 100.0f;
|
gApp.mSettings.mUISettings.mScale = DarkTheme.sScale * 100.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SysKeyDown(KeyDownEvent evt)
|
void SysKeyDown(KeyDownEvent evt)
|
||||||
|
@ -10736,6 +10736,7 @@ namespace IDE
|
||||||
Font.AddFontFailEntry("Segoe UI", scope String()..AppendF("{}fonts/NotoSans-Regular.ttf", mInstallDir));
|
Font.AddFontFailEntry("Segoe UI", scope String()..AppendF("{}fonts/NotoSans-Regular.ttf", mInstallDir));
|
||||||
|
|
||||||
DarkTheme aTheme = new DarkTheme();
|
DarkTheme aTheme = new DarkTheme();
|
||||||
|
mSettings.mUISettings.Apply(); // Apply again to set actual theme
|
||||||
aTheme.Init();
|
aTheme.Init();
|
||||||
ThemeFactory.mDefault = aTheme;
|
ThemeFactory.mDefault = aTheme;
|
||||||
|
|
||||||
|
@ -10879,7 +10880,7 @@ namespace IDE
|
||||||
int dpi = mMainWindow.GetDPI();
|
int dpi = mMainWindow.GetDPI();
|
||||||
if (dpi >= 120)
|
if (dpi >= 120)
|
||||||
{
|
{
|
||||||
mSettings.mEditorSettings.mUIScale = 100 * Math.Min(dpi / 96.0f, 4.0f);
|
mSettings.mUISettings.mScale = 100 * Math.Min(dpi / 96.0f, 4.0f);
|
||||||
mSettings.Apply();
|
mSettings.Apply();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,10 @@ using Beefy.widgets;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using Beefy.utils;
|
using Beefy.utils;
|
||||||
using IDE.util;
|
using IDE.util;
|
||||||
|
using Beefy.theme.dark;
|
||||||
|
using System.IO;
|
||||||
|
using IDE.ui;
|
||||||
|
using System.Diagnostics;
|
||||||
|
|
||||||
namespace IDE
|
namespace IDE
|
||||||
{
|
{
|
||||||
|
@ -228,7 +232,8 @@ namespace IDE
|
||||||
/*String appDataPath = scope String();
|
/*String appDataPath = scope String();
|
||||||
Platform.GetStrHelper(appDataPath, scope (outPtr, outSize, outResult) =>
|
Platform.GetStrHelper(appDataPath, scope (outPtr, outSize, outResult) =>
|
||||||
{
|
{
|
||||||
Platform.BfpDirectory_GetSysDirectory(.AppData_Local, outPtr, outSize, (Platform.BfpFileResult*)outResult);
|
Platform.BfpDirectory_GetSysDirectory(.AppData_Local, outPtr, outSize,
|
||||||
|
(Platform.BfpFileResult*)outResult);
|
||||||
});*/
|
});*/
|
||||||
|
|
||||||
mSymbolSearchPath.Add(new String("https://msdl.microsoft.com/download/symbols"));
|
mSymbolSearchPath.Add(new String("https://msdl.microsoft.com/download/symbols"));
|
||||||
|
@ -258,6 +263,240 @@ namespace IDE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class Colors
|
||||||
|
{
|
||||||
|
public Color mText = 0xFFFFFFFF;
|
||||||
|
public Color mWindow = 0xFF595959;
|
||||||
|
public Color mBackground = 0xFF262626;
|
||||||
|
public Color mSelectedOutline = 0xFFE6A800;
|
||||||
|
public Color mMenuFocused = 0xFFFFA000;
|
||||||
|
public Color mMenuSelected = 0xFFD0A070;
|
||||||
|
|
||||||
|
public Color mCode = 0xFFFFFFFF;
|
||||||
|
public Color mKeyword = 0xFFE1AE9A;
|
||||||
|
public Color mLiteral = 0XFFC8A0FF;
|
||||||
|
public Color mIdentifier = 0xFFFFFFFF;
|
||||||
|
public Color mType = 0XFF66D9EF;
|
||||||
|
public Color mComment = 0XFF75715E;
|
||||||
|
public Color mMethod = 0XFFA6E22A;
|
||||||
|
public Color mTypeRef = 0XFF66D9EF;
|
||||||
|
public Color mNamespace = 0xFF7BEEB7;
|
||||||
|
public Color mDisassemblyText = 0xFFB0B0B0;
|
||||||
|
public Color mDisassemblyFileName = 0XFFFF0000;
|
||||||
|
public Color mError = 0xFFFF0000;
|
||||||
|
public Color mBuildError = 0xFFFF8080;
|
||||||
|
public Color mBuildWarning = 0xFFFFFF80;
|
||||||
|
public Color mVisibleWhiteSpace = 0xFF9090C0;
|
||||||
|
|
||||||
|
public void Deserialize(StructuredData sd)
|
||||||
|
{
|
||||||
|
void GetColor(String name, ref Color color)
|
||||||
|
{
|
||||||
|
sd.Get(name, ref *(int32*)&color);
|
||||||
|
}
|
||||||
|
|
||||||
|
GetColor("Text", ref mText);
|
||||||
|
GetColor("Code", ref mCode);
|
||||||
|
GetColor("Keyword", ref mKeyword);
|
||||||
|
GetColor("Literal", ref mLiteral);
|
||||||
|
GetColor("Identifier", ref mIdentifier);
|
||||||
|
GetColor("Type", ref mType);
|
||||||
|
GetColor("Comment", ref mComment);
|
||||||
|
GetColor("Method", ref mMethod);
|
||||||
|
GetColor("TypeRef", ref mTypeRef);
|
||||||
|
GetColor("Namespace", ref mNamespace);
|
||||||
|
GetColor("DisassemblyText", ref mDisassemblyText);
|
||||||
|
GetColor("DisassemblyFileName", ref mDisassemblyFileName);
|
||||||
|
GetColor("Error", ref mError);
|
||||||
|
GetColor("BuildError", ref mBuildError);
|
||||||
|
GetColor("BuildWarning", ref mBuildWarning);
|
||||||
|
GetColor("VisibleWhiteSpace", ref mVisibleWhiteSpace);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Apply()
|
||||||
|
{
|
||||||
|
SourceEditWidgetContent.sTextColors[0] = mCode;
|
||||||
|
SourceEditWidgetContent.sTextColors[1] = mKeyword;
|
||||||
|
SourceEditWidgetContent.sTextColors[2] = mLiteral;
|
||||||
|
SourceEditWidgetContent.sTextColors[3] = mIdentifier;
|
||||||
|
SourceEditWidgetContent.sTextColors[4] = mType;
|
||||||
|
SourceEditWidgetContent.sTextColors[5] = mComment;
|
||||||
|
SourceEditWidgetContent.sTextColors[6] = mMethod;
|
||||||
|
SourceEditWidgetContent.sTextColors[7] = mTypeRef;
|
||||||
|
SourceEditWidgetContent.sTextColors[8] = mNamespace;
|
||||||
|
SourceEditWidgetContent.sTextColors[9] = mDisassemblyText;
|
||||||
|
SourceEditWidgetContent.sTextColors[10] = mDisassemblyFileName;
|
||||||
|
SourceEditWidgetContent.sTextColors[11] = mError;
|
||||||
|
SourceEditWidgetContent.sTextColors[12] = mBuildError;
|
||||||
|
SourceEditWidgetContent.sTextColors[13] = mBuildWarning;
|
||||||
|
SourceEditWidgetContent.sTextColors[14] = mVisibleWhiteSpace;
|
||||||
|
|
||||||
|
DarkTheme.COLOR_TEXT = mText;
|
||||||
|
DarkTheme.COLOR_BKG = mBackground;
|
||||||
|
DarkTheme.COLOR_SELECTED_OUTLINE = mSelectedOutline;
|
||||||
|
DarkTheme.COLOR_MENU_FOCUSED = mMenuFocused;
|
||||||
|
DarkTheme.COLOR_MENU_SELECTED = mMenuSelected;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UISettings
|
||||||
|
{
|
||||||
|
public Colors mColors = new .() ~ delete _;
|
||||||
|
public float mScale = 100;
|
||||||
|
public List<String> mTheme = new .() ~ DeleteContainerAndItems!(_);
|
||||||
|
|
||||||
|
public void SetDefaults()
|
||||||
|
{
|
||||||
|
DeleteAndNullify!(mColors);
|
||||||
|
mColors = new .();
|
||||||
|
mScale = 100;
|
||||||
|
ClearAndDeleteItems(mTheme);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Apply()
|
||||||
|
{
|
||||||
|
DeleteAndNullify!(mColors);
|
||||||
|
mColors = new .();
|
||||||
|
|
||||||
|
if (DarkTheme.sDarkTheme == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (int scale < 3)
|
||||||
|
DarkTheme.sDarkTheme.mUIFileNames[scale].Clear();
|
||||||
|
|
||||||
|
void LoadTheme(StringView themeFilePath)
|
||||||
|
{
|
||||||
|
if (!File.Exists(themeFilePath))
|
||||||
|
return;
|
||||||
|
|
||||||
|
StructuredData sd = scope .();
|
||||||
|
if (sd.Load(themeFilePath) case .Err)
|
||||||
|
return;
|
||||||
|
|
||||||
|
using (sd.Open("Colors"))
|
||||||
|
mColors.Deserialize(sd);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let theme in mTheme)
|
||||||
|
{
|
||||||
|
String relPath = scope .()..Append(gApp.mInstallDir, "themes/");
|
||||||
|
String absPath = scope .();
|
||||||
|
Path.GetAbsolutePath(theme, relPath, absPath);
|
||||||
|
|
||||||
|
if (absPath.EndsWith(".TOML", .OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
LoadTheme(absPath);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
absPath.Append("/");
|
||||||
|
|
||||||
|
bool needsRebuild = false;
|
||||||
|
let origImageTime = File.GetLastWriteTime(scope String(absPath, "../../images/DarkUI.png")).GetValueOrDefault();
|
||||||
|
|
||||||
|
if (origImageTime != default)
|
||||||
|
{
|
||||||
|
DateTime maxSrcImgTime = default;
|
||||||
|
DateTime minDestImgTime = default;
|
||||||
|
|
||||||
|
for (int scale < 3)
|
||||||
|
{
|
||||||
|
String srcImgPath = scope .(absPath);
|
||||||
|
String destImgPath = scope .(absPath);
|
||||||
|
switch (scale)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
srcImgPath.Append("UI.psd");
|
||||||
|
destImgPath.Append("UI.png");
|
||||||
|
case 1:
|
||||||
|
srcImgPath.Append("UI_2.psd");
|
||||||
|
destImgPath.Append("UI_2.png");
|
||||||
|
case 2:
|
||||||
|
srcImgPath.Append("UI_4.psd");
|
||||||
|
destImgPath.Append("UI_2.png");
|
||||||
|
}
|
||||||
|
maxSrcImgTime = Math.Max(maxSrcImgTime, File.GetLastWriteTime(srcImgPath).GetValueOrDefault());
|
||||||
|
let destImageTime = File.GetLastWriteTime(destImgPath).GetValueOrDefault();
|
||||||
|
if (scale == 0)
|
||||||
|
minDestImgTime = destImageTime;
|
||||||
|
else
|
||||||
|
minDestImgTime = Math.Min(minDestImgTime, destImageTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (maxSrcImgTime > minDestImgTime)
|
||||||
|
needsRebuild = true;
|
||||||
|
if (origImageTime > minDestImgTime)
|
||||||
|
needsRebuild = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (needsRebuild)
|
||||||
|
{
|
||||||
|
String imgCreatePath = scope String(absPath, "../../images/ImgCreate.exe");
|
||||||
|
|
||||||
|
ProcessStartInfo procInfo = scope ProcessStartInfo();
|
||||||
|
procInfo.UseShellExecute = false;
|
||||||
|
procInfo.RedirectStandardError = true;
|
||||||
|
procInfo.RedirectStandardOutput = true;
|
||||||
|
procInfo.SetFileName(imgCreatePath);
|
||||||
|
procInfo.SetWorkingDirectory(absPath);
|
||||||
|
procInfo.CreateNoWindow = true;
|
||||||
|
|
||||||
|
SpawnedProcess process = scope SpawnedProcess();
|
||||||
|
if (process.Start(procInfo) case .Ok)
|
||||||
|
{
|
||||||
|
//Windows.MessageBoxA(default, "Rebuilding theme images...", "Rebuilding Theme", Windows.MB_OK);
|
||||||
|
process.WaitFor();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int scale < 3)
|
||||||
|
{
|
||||||
|
String imgPath = scope .(absPath);
|
||||||
|
switch (scale)
|
||||||
|
{
|
||||||
|
case 0: imgPath.Append("UI.png");
|
||||||
|
case 1: imgPath.Append("UI_2.png");
|
||||||
|
case 2: imgPath.Append("UI_4.png");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (File.Exists(imgPath))
|
||||||
|
{
|
||||||
|
DarkTheme.sDarkTheme.mUIFileNames[scale].Set(imgPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String themeFilePath = scope .()..Append(absPath, "theme.toml");
|
||||||
|
LoadTheme(themeFilePath);
|
||||||
|
String userFilePath = scope .()..Append(absPath, "user.toml");
|
||||||
|
LoadTheme(userFilePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
mColors.Apply();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Serialize(StructuredData sd)
|
||||||
|
{
|
||||||
|
sd.Add("Scale", mScale);
|
||||||
|
using (sd.CreateArray("Theme"))
|
||||||
|
{
|
||||||
|
for (let str in mTheme)
|
||||||
|
sd.Add(str);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Deserialize(StructuredData sd)
|
||||||
|
{
|
||||||
|
sd.Get("Scale", ref mScale);
|
||||||
|
ClearAndDeleteItems(mTheme);
|
||||||
|
for (sd.Enumerate("Theme"))
|
||||||
|
{
|
||||||
|
var str = new String();
|
||||||
|
sd.GetCurString(str);
|
||||||
|
mTheme.Add(str);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public class EditorSettings
|
public class EditorSettings
|
||||||
{
|
{
|
||||||
public enum LockWhileDebuggingKind
|
public enum LockWhileDebuggingKind
|
||||||
|
@ -275,42 +514,8 @@ namespace IDE
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Colors
|
|
||||||
{
|
|
||||||
public Color mUIColorR = Color.Get(255, 0, 0);
|
|
||||||
public Color mUIColorG = Color.Get(0, 255, 0);
|
|
||||||
public Color mUIColorB = Color.Get(0, 0, 255);
|
|
||||||
public Color mText = 0xFFFFFFFF;
|
|
||||||
public Color mKeyword = 0xFFE1AE9A;
|
|
||||||
public Color mLiteral = 0XFFC8A0FF;
|
|
||||||
public Color mIdentifier = 0xFFFFFFFF;
|
|
||||||
public Color mType = 0XFF66D9EF;
|
|
||||||
public Color mComment = 0XFF75715E;
|
|
||||||
public Color mMethod = 0XFFA6E22A;
|
|
||||||
public Color mTypeRef = 0XFF66D9EF;
|
|
||||||
public Color mNamespace = 0xFF7BEEB7;
|
|
||||||
public Color mDisassemblyText = 0xFFB0B0B0;
|
|
||||||
public Color mDisassemblyFileName = 0XFFFF0000;
|
|
||||||
public Color mError = 0xFFFF0000;
|
|
||||||
public Color mBuildError = 0xFFFF8080;
|
|
||||||
public Color mBuildWarning = 0xFFFFFF80;
|
|
||||||
public Color mVisibleWhiteSpace = 0xFF9090C0;
|
|
||||||
|
|
||||||
public void Serialize(StructuredData sd)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Deserialize(StructuredData sd)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> mFonts = new .() ~ DeleteContainerAndItems!(_);
|
public List<String> mFonts = new .() ~ DeleteContainerAndItems!(_);
|
||||||
public float mFontSize = 12;
|
public float mFontSize = 12;
|
||||||
public float mUIScale = 100;
|
|
||||||
public Colors mColors = new .() ~ delete _;
|
|
||||||
public AutoCompleteShowKind mAutoCompleteShowKind = .PanelIfVisible;
|
public AutoCompleteShowKind mAutoCompleteShowKind = .PanelIfVisible;
|
||||||
public bool mAutoCompleteRequireControl = true;
|
public bool mAutoCompleteRequireControl = true;
|
||||||
public bool mAutoCompleteRequireTab = false;
|
public bool mAutoCompleteRequireTab = false;
|
||||||
|
@ -319,7 +524,8 @@ namespace IDE
|
||||||
public bool mShowLocatorAnim = true;
|
public bool mShowLocatorAnim = true;
|
||||||
public bool mHiliteCursorReferences = true;
|
public bool mHiliteCursorReferences = true;
|
||||||
public bool mLockEditing;
|
public bool mLockEditing;
|
||||||
public LockWhileDebuggingKind mLockEditingWhenDebugging = .WhenNotHotSwappable; // Only applicable for non-Beef sources
|
public LockWhileDebuggingKind mLockEditingWhenDebugging = .WhenNotHotSwappable;// Only applicable for
|
||||||
|
// non-Beef sources
|
||||||
public bool mPerforceAutoCheckout = true;
|
public bool mPerforceAutoCheckout = true;
|
||||||
public bool mSpellCheckEnabled = true;
|
public bool mSpellCheckEnabled = true;
|
||||||
public bool mShowLineNumbers = true;
|
public bool mShowLineNumbers = true;
|
||||||
|
@ -333,7 +539,6 @@ namespace IDE
|
||||||
sd.Add(str);
|
sd.Add(str);
|
||||||
}
|
}
|
||||||
sd.Add("FontSize", mFontSize);
|
sd.Add("FontSize", mFontSize);
|
||||||
sd.Add("UIScale", mUIScale);
|
|
||||||
sd.Add("AutoCompleteShowKind", mAutoCompleteShowKind);
|
sd.Add("AutoCompleteShowKind", mAutoCompleteShowKind);
|
||||||
sd.Add("AutoCompleteRequireControl", mAutoCompleteRequireControl);
|
sd.Add("AutoCompleteRequireControl", mAutoCompleteRequireControl);
|
||||||
sd.Add("AutoCompleteRequireTab", mAutoCompleteRequireTab);
|
sd.Add("AutoCompleteRequireTab", mAutoCompleteRequireTab);
|
||||||
|
@ -347,9 +552,6 @@ namespace IDE
|
||||||
sd.Add("SpellCheckEnabled", mSpellCheckEnabled);
|
sd.Add("SpellCheckEnabled", mSpellCheckEnabled);
|
||||||
sd.Add("ShowLineNumbers", mShowLineNumbers);
|
sd.Add("ShowLineNumbers", mShowLineNumbers);
|
||||||
sd.Add("FreeCursorMovement", mFreeCursorMovement);
|
sd.Add("FreeCursorMovement", mFreeCursorMovement);
|
||||||
|
|
||||||
using (sd.CreateObject("Colors"))
|
|
||||||
mColors.Serialize(sd);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Deserialize(StructuredData sd)
|
public void Deserialize(StructuredData sd)
|
||||||
|
@ -361,8 +563,8 @@ namespace IDE
|
||||||
sd.GetCurString(str);
|
sd.GetCurString(str);
|
||||||
mFonts.Add(str);
|
mFonts.Add(str);
|
||||||
}
|
}
|
||||||
|
sd.Get("UIScale", ref gApp.mSettings.mUISettings.mScale); // Legacy
|
||||||
sd.Get("FontSize", ref mFontSize);
|
sd.Get("FontSize", ref mFontSize);
|
||||||
sd.Get("UIScale", ref mUIScale);
|
|
||||||
sd.Get("AutoCompleteShowKind", ref mAutoCompleteShowKind);
|
sd.Get("AutoCompleteShowKind", ref mAutoCompleteShowKind);
|
||||||
sd.Get("AutoCompleteRequireControl", ref mAutoCompleteRequireControl);
|
sd.Get("AutoCompleteRequireControl", ref mAutoCompleteRequireControl);
|
||||||
sd.Get("AutoCompleteRequireTab", ref mAutoCompleteRequireTab);
|
sd.Get("AutoCompleteRequireTab", ref mAutoCompleteRequireTab);
|
||||||
|
@ -376,9 +578,6 @@ namespace IDE
|
||||||
sd.Get("SpellCheckEnabled", ref mSpellCheckEnabled);
|
sd.Get("SpellCheckEnabled", ref mSpellCheckEnabled);
|
||||||
sd.Get("ShowLineNumbers", ref mShowLineNumbers);
|
sd.Get("ShowLineNumbers", ref mShowLineNumbers);
|
||||||
sd.Get("FreeCursorMovement", ref mFreeCursorMovement);
|
sd.Get("FreeCursorMovement", ref mFreeCursorMovement);
|
||||||
|
|
||||||
using (sd.Open("Colors"))
|
|
||||||
mColors.Deserialize(sd);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetDefaults()
|
public void SetDefaults()
|
||||||
|
@ -402,6 +601,8 @@ namespace IDE
|
||||||
if (gApp.mSpellChecker != null)
|
if (gApp.mSpellChecker != null)
|
||||||
DeleteAndNullify!(gApp.mSpellChecker);
|
DeleteAndNullify!(gApp.mSpellChecker);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -693,8 +894,9 @@ namespace IDE
|
||||||
|
|
||||||
public bool mLoadedSettings;
|
public bool mLoadedSettings;
|
||||||
|
|
||||||
public CompilerSettings mCompilerSettings = new .() ~ delete _;
|
public UISettings mUISettings = new .() ~ delete _;
|
||||||
public EditorSettings mEditorSettings = new .() ~ delete _;
|
public EditorSettings mEditorSettings = new .() ~ delete _;
|
||||||
|
public CompilerSettings mCompilerSettings = new .() ~ delete _;
|
||||||
public VSSettings mVSSettings = new .() ~ delete _;
|
public VSSettings mVSSettings = new .() ~ delete _;
|
||||||
public DebuggerSettings mDebuggerSettings = new .() ~ delete _;
|
public DebuggerSettings mDebuggerSettings = new .() ~ delete _;
|
||||||
public KeySettings mKeySettings = new .() ~ delete _;
|
public KeySettings mKeySettings = new .() ~ delete _;
|
||||||
|
@ -703,6 +905,7 @@ namespace IDE
|
||||||
public bool mEnableDevMode;
|
public bool mEnableDevMode;
|
||||||
public TutorialsFinished mTutorialsFinished = .();
|
public TutorialsFinished mTutorialsFinished = .();
|
||||||
|
|
||||||
|
|
||||||
public this()
|
public this()
|
||||||
{
|
{
|
||||||
SetDefaults();
|
SetDefaults();
|
||||||
|
@ -711,6 +914,7 @@ namespace IDE
|
||||||
public void SetDefaults()
|
public void SetDefaults()
|
||||||
{
|
{
|
||||||
mVSSettings.SetDefaults();
|
mVSSettings.SetDefaults();
|
||||||
|
mUISettings.SetDefaults();
|
||||||
mEditorSettings.SetDefaults();
|
mEditorSettings.SetDefaults();
|
||||||
mCompilerSettings.SetDefaults();
|
mCompilerSettings.SetDefaults();
|
||||||
mDebuggerSettings.SetDefaults();
|
mDebuggerSettings.SetDefaults();
|
||||||
|
@ -730,6 +934,8 @@ namespace IDE
|
||||||
let sd = scope StructuredData();
|
let sd = scope StructuredData();
|
||||||
sd.CreateNew();
|
sd.CreateNew();
|
||||||
sd.Add("FileVersion", 1);
|
sd.Add("FileVersion", 1);
|
||||||
|
using (sd.CreateObject("UI"))
|
||||||
|
mUISettings.Serialize(sd);
|
||||||
using (sd.CreateObject("Editor"))
|
using (sd.CreateObject("Editor"))
|
||||||
mEditorSettings.Serialize(sd);
|
mEditorSettings.Serialize(sd);
|
||||||
using (sd.CreateObject("Keys"))
|
using (sd.CreateObject("Keys"))
|
||||||
|
@ -782,6 +988,8 @@ namespace IDE
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mLoadedSettings = true;
|
mLoadedSettings = true;
|
||||||
|
using (sd.Open("UI"))
|
||||||
|
mUISettings.Deserialize(sd);
|
||||||
using (sd.Open("Editor"))
|
using (sd.Open("Editor"))
|
||||||
mEditorSettings.Deserialize(sd);
|
mEditorSettings.Deserialize(sd);
|
||||||
using (sd.Open("Keys"))
|
using (sd.Open("Keys"))
|
||||||
|
@ -826,11 +1034,13 @@ namespace IDE
|
||||||
|
|
||||||
public void Apply()
|
public void Apply()
|
||||||
{
|
{
|
||||||
gApp.mSettings.mEditorSettings.mUIScale = Math.Clamp(gApp.mSettings.mEditorSettings.mUIScale, 50, 400);
|
gApp.mSettings.mUISettings.mScale = Math.Clamp(gApp.mSettings.mUISettings.mScale, 50, 400);
|
||||||
gApp.mSettings.mEditorSettings.mFontSize = Math.Clamp(gApp.mSettings.mEditorSettings.mFontSize, 6.0f, 72.0f);
|
gApp.mSettings.mEditorSettings.mFontSize = Math.Clamp(gApp.mSettings.mEditorSettings.mFontSize, 6.0f, 72.0f);
|
||||||
|
|
||||||
|
mUISettings.Apply();
|
||||||
|
|
||||||
Font.ClearFontNameCache();
|
Font.ClearFontNameCache();
|
||||||
gApp.PhysSetScale(gApp.mSettings.mEditorSettings.mUIScale / 100.0f, true);
|
gApp.PhysSetScale(gApp.mSettings.mUISettings.mScale / 100.0f, true);
|
||||||
|
|
||||||
DeleteAndNullify!(gApp.mKeyChordState);
|
DeleteAndNullify!(gApp.mKeyChordState);
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ using System.Collections;
|
||||||
using Beefy.widgets;
|
using Beefy.widgets;
|
||||||
using Beefy.theme.dark;
|
using Beefy.theme.dark;
|
||||||
using Beefy.theme;
|
using Beefy.theme;
|
||||||
|
using Beefy.gfx;
|
||||||
|
|
||||||
namespace IDE.ui
|
namespace IDE.ui
|
||||||
{
|
{
|
||||||
|
@ -187,7 +188,7 @@ namespace IDE.ui
|
||||||
|
|
||||||
var (category, propEntry) = AddPropertiesItem(root, "Distinct Build Options");
|
var (category, propEntry) = AddPropertiesItem(root, "Distinct Build Options");
|
||||||
var subItem = (DarkListViewItem)category.CreateSubItem(1);
|
var subItem = (DarkListViewItem)category.CreateSubItem(1);
|
||||||
subItem.mTextColor = 0xFFC0C0C0;
|
subItem.mTextColor = Color.Mult(DarkTheme.COLOR_TEXT, 0xFFC0C0C0);
|
||||||
subItem.Label = "<Add New>...";
|
subItem.Label = "<Add New>...";
|
||||||
subItem.mOnMouseDown.Add(new (evt) =>
|
subItem.mOnMouseDown.Add(new (evt) =>
|
||||||
{
|
{
|
||||||
|
|
|
@ -49,7 +49,7 @@ namespace IDE.ui
|
||||||
|
|
||||||
public override void Draw(Graphics g)
|
public override void Draw(Graphics g)
|
||||||
{
|
{
|
||||||
uint32 color = Color.White;
|
uint32 color = DarkTheme.COLOR_TEXT;
|
||||||
let projectPanel = ((ProjectListView)mListView).mProjectPanel;
|
let projectPanel = ((ProjectListView)mListView).mProjectPanel;
|
||||||
|
|
||||||
ProjectItem projectItem;
|
ProjectItem projectItem;
|
||||||
|
@ -57,14 +57,14 @@ namespace IDE.ui
|
||||||
if ((projectItem != null) && (projectItem.mParentFolder != null))
|
if ((projectItem != null) && (projectItem.mParentFolder != null))
|
||||||
{
|
{
|
||||||
if (projectItem.mIncludeKind == .Manual)
|
if (projectItem.mIncludeKind == .Manual)
|
||||||
color = 0xFFE0E0FF;
|
color = Color.Mult(color, 0xFFE0E0FF);
|
||||||
else if (projectItem.mIncludeKind == .Ignore)
|
else if (projectItem.mIncludeKind == .Ignore)
|
||||||
color = 0xFF909090;
|
color = Color.Mult(color, 0xFF909090);
|
||||||
|
|
||||||
if (let projectSource = projectItem as ProjectSource)
|
if (let projectSource = projectItem as ProjectSource)
|
||||||
{
|
{
|
||||||
if (projectSource.mLoadFailed)
|
if (projectSource.mLoadFailed)
|
||||||
color = 0xFFFF0000;
|
color = Color.Mult(color, 0xFFFF0000);
|
||||||
}
|
}
|
||||||
|
|
||||||
mTextColor = color;
|
mTextColor = color;
|
||||||
|
@ -1931,9 +1931,9 @@ namespace IDE.ui
|
||||||
listViewItem.mIsBold = checkProject == IDEApp.sApp.mWorkspace.mStartupProject;
|
listViewItem.mIsBold = checkProject == IDEApp.sApp.mWorkspace.mStartupProject;
|
||||||
|
|
||||||
var projectOptions = IDEApp.sApp.GetCurProjectOptions(checkProject);
|
var projectOptions = IDEApp.sApp.GetCurProjectOptions(checkProject);
|
||||||
listViewItem.mTextColor = (projectOptions != null) ? Color.White : 0xFFA0A0A0;
|
listViewItem.mTextColor = Color.Mult(DarkTheme.COLOR_TEXT, (projectOptions != null) ? Color.White : 0xFFA0A0A0);
|
||||||
if (checkProject.mFailed)
|
if (checkProject.mFailed)
|
||||||
listViewItem.mTextColor = 0xFFE04040;
|
listViewItem.mTextColor = Color.Mult(DarkTheme.COLOR_TEXT, 0xFFE04040);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -633,7 +633,7 @@ namespace IDE.ui
|
||||||
var root = (DarkListViewItem)mPropPage.mPropertiesListView.GetRoot();
|
var root = (DarkListViewItem)mPropPage.mPropertiesListView.GetRoot();
|
||||||
var (category, ?) = AddPropertiesItem(root, "Resources");
|
var (category, ?) = AddPropertiesItem(root, "Resources");
|
||||||
category.mIsBold = true;
|
category.mIsBold = true;
|
||||||
category.mTextColor = 0xFFE8E8E8;
|
category.mTextColor = Color.Mult(DarkTheme.COLOR_TEXT, 0xFFE8E8E8);
|
||||||
var (listViewItem, propEntry) = AddPropertiesItem(category, "Icon File", "mIconFile");
|
var (listViewItem, propEntry) = AddPropertiesItem(category, "Icon File", "mIconFile");
|
||||||
(listViewItem, propEntry) = AddPropertiesItem(category, "Manifest File", "mManifestFile");
|
(listViewItem, propEntry) = AddPropertiesItem(category, "Manifest File", "mManifestFile");
|
||||||
category.Open(true, true);
|
category.Open(true, true);
|
||||||
|
@ -655,7 +655,7 @@ namespace IDE.ui
|
||||||
var root = (DarkListViewItem)mPropPage.mPropertiesListView.GetRoot();
|
var root = (DarkListViewItem)mPropPage.mPropertiesListView.GetRoot();
|
||||||
var (category, ?) = AddPropertiesItem(root, "General");
|
var (category, ?) = AddPropertiesItem(root, "General");
|
||||||
category.mIsBold = true;
|
category.mIsBold = true;
|
||||||
category.mTextColor = 0xFFE8E8E8;
|
category.mTextColor = Color.Mult(DarkTheme.COLOR_TEXT, 0xFFE8E8E8);
|
||||||
AddPropertiesItem(category, "Options", "mOptions");
|
AddPropertiesItem(category, "Options", "mOptions");
|
||||||
//parent.MakeParent();
|
//parent.MakeParent();
|
||||||
category.Open(true, true);
|
category.Open(true, true);
|
||||||
|
@ -713,7 +713,7 @@ namespace IDE.ui
|
||||||
|
|
||||||
var (listViewItem, propItem) = AddPropertiesItem(category, projectName);
|
var (listViewItem, propItem) = AddPropertiesItem(category, projectName);
|
||||||
if (IDEApp.sApp.mWorkspace.FindProject(projectName) == null)
|
if (IDEApp.sApp.mWorkspace.FindProject(projectName) == null)
|
||||||
listViewItem.mTextColor = 0xFFFF6060;
|
listViewItem.mTextColor = Color.Mult(DarkTheme.COLOR_TEXT, 0xFFFF6060);
|
||||||
|
|
||||||
var subItem = listViewItem.CreateSubItem(1);
|
var subItem = listViewItem.CreateSubItem(1);
|
||||||
|
|
||||||
|
@ -794,7 +794,7 @@ namespace IDE.ui
|
||||||
var root = (DarkListViewItem)mPropPage.mPropertiesListView.GetRoot();
|
var root = (DarkListViewItem)mPropPage.mPropertiesListView.GetRoot();
|
||||||
var (category, ?) = AddPropertiesItem(root, "General");
|
var (category, ?) = AddPropertiesItem(root, "General");
|
||||||
category.mIsBold = true;
|
category.mIsBold = true;
|
||||||
category.mTextColor = 0xFFE8E8E8;
|
category.mTextColor = Color.Mult(DarkTheme.COLOR_TEXT, 0xFFE8E8E8);
|
||||||
|
|
||||||
AddPropertiesItem(category, "Startup Object", "mStartupObject");
|
AddPropertiesItem(category, "Startup Object", "mStartupObject");
|
||||||
AddPropertiesItem(category, "Default Namespace", "mDefaultNamespace");
|
AddPropertiesItem(category, "Default Namespace", "mDefaultNamespace");
|
||||||
|
@ -812,13 +812,13 @@ namespace IDE.ui
|
||||||
var root = (DarkListViewItem)mPropPage.mPropertiesListView.GetRoot();
|
var root = (DarkListViewItem)mPropPage.mPropertiesListView.GetRoot();
|
||||||
var (category, propEntry) = AddPropertiesItem(root, "General");
|
var (category, propEntry) = AddPropertiesItem(root, "General");
|
||||||
category.mIsBold = true;
|
category.mIsBold = true;
|
||||||
category.mTextColor = 0xFFE8E8E8;
|
category.mTextColor = Color.Mult(DarkTheme.COLOR_TEXT, 0xFFE8E8E8);
|
||||||
AddPropertiesItem(category, "Preprocessor Macros", "mBeefOptions.mPreprocessorMacros");
|
AddPropertiesItem(category, "Preprocessor Macros", "mBeefOptions.mPreprocessorMacros");
|
||||||
category.Open(true, true);
|
category.Open(true, true);
|
||||||
|
|
||||||
(category, propEntry) = AddPropertiesItem(root, "Code Generation");
|
(category, propEntry) = AddPropertiesItem(root, "Code Generation");
|
||||||
category.mIsBold = true;
|
category.mIsBold = true;
|
||||||
category.mTextColor = cHeaderColor;
|
category.mTextColor = Color.Mult(DarkTheme.COLOR_TEXT, cHeaderColor);
|
||||||
AddPropertiesItem(category, "Reloc Model", "mBeefOptions.mRelocType");
|
AddPropertiesItem(category, "Reloc Model", "mBeefOptions.mRelocType");
|
||||||
AddPropertiesItem(category, "PIC Level", "mBeefOptions.mPICLevel");
|
AddPropertiesItem(category, "PIC Level", "mBeefOptions.mPICLevel");
|
||||||
AddPropertiesItem(category, "Optimization Level", "mBeefOptions.mOptimizationLevel",
|
AddPropertiesItem(category, "Optimization Level", "mBeefOptions.mOptimizationLevel",
|
||||||
|
@ -843,7 +843,7 @@ namespace IDE.ui
|
||||||
var root = (DarkListViewItem)mPropPage.mPropertiesListView.GetRoot();
|
var root = (DarkListViewItem)mPropPage.mPropertiesListView.GetRoot();
|
||||||
var (category, propEntry) = AddPropertiesItem(root, "General");
|
var (category, propEntry) = AddPropertiesItem(root, "General");
|
||||||
category.mIsBold = true;
|
category.mIsBold = true;
|
||||||
category.mTextColor = cHeaderColor;
|
category.mTextColor = Color.Mult(DarkTheme.COLOR_TEXT, cHeaderColor);
|
||||||
AddPropertiesItem(category, "Compiler", "mCOptions.mCompilerType");
|
AddPropertiesItem(category, "Compiler", "mCOptions.mCompilerType");
|
||||||
AddPropertiesItem(category, "Other C Flags", "mCOptions.mOtherCFlags");
|
AddPropertiesItem(category, "Other C Flags", "mCOptions.mOtherCFlags");
|
||||||
AddPropertiesItem(category, "Other C++ Flags", "mCOptions.mOtherCPPFlags");
|
AddPropertiesItem(category, "Other C++ Flags", "mCOptions.mOtherCPPFlags");
|
||||||
|
@ -856,7 +856,7 @@ namespace IDE.ui
|
||||||
|
|
||||||
(category, propEntry) = AddPropertiesItem(root, "Code Generation", "");
|
(category, propEntry) = AddPropertiesItem(root, "Code Generation", "");
|
||||||
category.mIsBold = true;
|
category.mIsBold = true;
|
||||||
category.mTextColor = cHeaderColor;
|
category.mTextColor = Color.Mult(DarkTheme.COLOR_TEXT, cHeaderColor);
|
||||||
AddPropertiesItem(category, "Disable C++ Exceptions", "mCOptions.mDisableExceptions",
|
AddPropertiesItem(category, "Disable C++ Exceptions", "mCOptions.mDisableExceptions",
|
||||||
scope String[] { "No", "Yes (-fno-exceptions)" }); // -fno-exceptions
|
scope String[] { "No", "Yes (-fno-exceptions)" }); // -fno-exceptions
|
||||||
AddPropertiesItem(category, "SIMD Instructions", "mCOptions.mSIMD"); // -msse, -msse2, -msse4.1, -mno-sse
|
AddPropertiesItem(category, "SIMD Instructions", "mCOptions.mSIMD"); // -msse, -msse2, -msse4.1, -mno-sse
|
||||||
|
@ -880,7 +880,7 @@ namespace IDE.ui
|
||||||
|
|
||||||
(category, propEntry) = AddPropertiesItem(root, "Warnings", "");
|
(category, propEntry) = AddPropertiesItem(root, "Warnings", "");
|
||||||
category.mIsBold = true;
|
category.mIsBold = true;
|
||||||
category.mTextColor = cHeaderColor;
|
category.mTextColor = Color.Mult(DarkTheme.COLOR_TEXT, cHeaderColor);
|
||||||
AddPropertiesItem(category, "All warnings", "mCOptions.mAllWarnings",
|
AddPropertiesItem(category, "All warnings", "mCOptions.mAllWarnings",
|
||||||
scope String[] { "No", "Yes (-Wall)" }); // -Wall
|
scope String[] { "No", "Yes (-Wall)" }); // -Wall
|
||||||
AddPropertiesItem(category, "Effective C++ Violations", "mCOptions.mEffectiveCPPViolations",
|
AddPropertiesItem(category, "Effective C++ Violations", "mCOptions.mEffectiveCPPViolations",
|
||||||
|
|
|
@ -850,7 +850,7 @@ namespace IDE.ui
|
||||||
{
|
{
|
||||||
var item = (CategoryListViewItem)parent.CreateChildItem();
|
var item = (CategoryListViewItem)parent.CreateChildItem();
|
||||||
item.Label = name;
|
item.Label = name;
|
||||||
item.mFocusColor = 0xFFA0A0A0;
|
item.mFocusColor = Color.Mult(DarkTheme.COLOR_TEXT, 0xFFA0A0A0);
|
||||||
item.mOnMouseDown.Add(new => CategoryValueClicked);
|
item.mOnMouseDown.Add(new => CategoryValueClicked);
|
||||||
item.mCategoryIdx = (int32)mCategoryListViewItems.Count;
|
item.mCategoryIdx = (int32)mCategoryListViewItems.Count;
|
||||||
mCategoryListViewItems.Add(item);
|
mCategoryListViewItems.Add(item);
|
||||||
|
@ -1494,12 +1494,12 @@ namespace IDE.ui
|
||||||
if (i < strVals.Count)
|
if (i < strVals.Count)
|
||||||
{
|
{
|
||||||
childItem.Label = StackStringFormat!("#{0}", i + 1);
|
childItem.Label = StackStringFormat!("#{0}", i + 1);
|
||||||
childSubItem.mTextColor = Color.White;
|
childSubItem.mTextColor = DarkTheme.COLOR_TEXT;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
childItem.Label = "";
|
childItem.Label = "";
|
||||||
childSubItem.mTextColor = 0xFFC0C0C0;
|
childSubItem.mTextColor = Color.Mult(DarkTheme.COLOR_TEXT, 0xFFC0C0C0);
|
||||||
}
|
}
|
||||||
childSubItem.Label = curValue;
|
childSubItem.Label = curValue;
|
||||||
FixLabel(childSubItem);
|
FixLabel(childSubItem);
|
||||||
|
@ -1563,14 +1563,14 @@ namespace IDE.ui
|
||||||
if (areDifferent)
|
if (areDifferent)
|
||||||
{
|
{
|
||||||
valueItem.Label = "<Multiple Values>";
|
valueItem.Label = "<Multiple Values>";
|
||||||
valueItem.mTextColor = 0xFFC0C0C0;
|
valueItem.mTextColor = Color.Mult(DarkTheme.COLOR_TEXT, 0xFFC0C0C0);
|
||||||
}
|
}
|
||||||
else if (propEntry.mColorOverride.HasValue)
|
else if (propEntry.mColorOverride.HasValue)
|
||||||
valueItem.mTextColor = propEntry.mColorOverride.Value;
|
valueItem.mTextColor = propEntry.mColorOverride.Value;
|
||||||
else if (isNotSet)
|
else if (isNotSet)
|
||||||
valueItem.mTextColor = 0xFFC0C0C0;
|
valueItem.mTextColor = Color.Mult(DarkTheme.COLOR_TEXT, 0xFFC0C0C0);
|
||||||
else
|
else
|
||||||
valueItem.mTextColor = 0xFFFFFFFF;
|
valueItem.mTextColor = Color.Mult(DarkTheme.COLOR_TEXT, 0xFFFFFFFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetEnumDisp(String enumDisp)
|
void GetEnumDisp(String enumDisp)
|
||||||
|
@ -2000,7 +2000,7 @@ namespace IDE.ui
|
||||||
{
|
{
|
||||||
var item = (DarkListViewItem)parent.CreateChildItem();
|
var item = (DarkListViewItem)parent.CreateChildItem();
|
||||||
item.Label = name;
|
item.Label = name;
|
||||||
item.mFocusColor = 0xFFA0A0A0;
|
item.mFocusColor = Color.Mult(DarkTheme.COLOR_TEXT, 0xFFA0A0A0);
|
||||||
item.mOnMouseDown.Add(new => PropValueClicked);
|
item.mOnMouseDown.Add(new => PropValueClicked);
|
||||||
let propEntry = SetupPropertiesItem(item, name, propName, optionValues, flags);
|
let propEntry = SetupPropertiesItem(item, name, propName, optionValues, flags);
|
||||||
return (item, propEntry);
|
return (item, propEntry);
|
||||||
|
|
|
@ -11,6 +11,7 @@ namespace IDE.ui
|
||||||
{
|
{
|
||||||
enum CategoryType
|
enum CategoryType
|
||||||
{
|
{
|
||||||
|
UI,
|
||||||
Editor,
|
Editor,
|
||||||
Keys,
|
Keys,
|
||||||
Compiler,
|
Compiler,
|
||||||
|
@ -52,8 +53,9 @@ namespace IDE.ui
|
||||||
mTitle = new String("Settings Properties");
|
mTitle = new String("Settings Properties");
|
||||||
|
|
||||||
var root = (DarkListViewItem)mCategorySelector.GetRoot();
|
var root = (DarkListViewItem)mCategorySelector.GetRoot();
|
||||||
var item = AddCategoryItem(root, "Editor");
|
var item = AddCategoryItem(root, "UI");
|
||||||
item.Focused = true;
|
item.Focused = true;
|
||||||
|
AddCategoryItem(root, "Editor");
|
||||||
AddCategoryItem(root, "Keys");
|
AddCategoryItem(root, "Keys");
|
||||||
AddCategoryItem(root, "Compiler");
|
AddCategoryItem(root, "Compiler");
|
||||||
AddCategoryItem(root, "Debugger");
|
AddCategoryItem(root, "Debugger");
|
||||||
|
@ -65,6 +67,21 @@ namespace IDE.ui
|
||||||
mHideVSHelper = true;
|
mHideVSHelper = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PopulateUIOptions()
|
||||||
|
{
|
||||||
|
mCurPropertiesTarget = gApp.mSettings.mUISettings;
|
||||||
|
|
||||||
|
var root = (DarkListViewItem)mPropPage.mPropertiesListView.GetRoot();
|
||||||
|
var (category, propEntry) = AddPropertiesItem(root, "General");
|
||||||
|
category.mIsBold = true;
|
||||||
|
category.mTextColor = Color.Mult(DarkTheme.COLOR_TEXT, cHeaderColor);
|
||||||
|
|
||||||
|
AddPropertiesItem(category, "Scale", "mScale");
|
||||||
|
AddPropertiesItem(category, "Theme", "mTheme");
|
||||||
|
|
||||||
|
category.Open(true, true);
|
||||||
|
}
|
||||||
|
|
||||||
void PopulateEditorOptions()
|
void PopulateEditorOptions()
|
||||||
{
|
{
|
||||||
mCurPropertiesTarget = gApp.mSettings.mEditorSettings;
|
mCurPropertiesTarget = gApp.mSettings.mEditorSettings;
|
||||||
|
@ -72,10 +89,9 @@ namespace IDE.ui
|
||||||
var root = (DarkListViewItem)mPropPage.mPropertiesListView.GetRoot();
|
var root = (DarkListViewItem)mPropPage.mPropertiesListView.GetRoot();
|
||||||
var (category, propEntry) = AddPropertiesItem(root, "General");
|
var (category, propEntry) = AddPropertiesItem(root, "General");
|
||||||
category.mIsBold = true;
|
category.mIsBold = true;
|
||||||
category.mTextColor = cHeaderColor;
|
category.mTextColor = Color.Mult(DarkTheme.COLOR_TEXT, cHeaderColor);
|
||||||
AddPropertiesItem(category, "Font", "mFonts");
|
AddPropertiesItem(category, "Font", "mFonts");
|
||||||
AddPropertiesItem(category, "Font Size", "mFontSize");
|
AddPropertiesItem(category, "Font Size", "mFontSize");
|
||||||
AddPropertiesItem(category, "UI Scale", "mUIScale");
|
|
||||||
AddPropertiesItem(category, "Autocomplete", "mAutoCompleteShowKind");
|
AddPropertiesItem(category, "Autocomplete", "mAutoCompleteShowKind");
|
||||||
AddPropertiesItem(category, "Autocomplete Require Control", "mAutoCompleteRequireControl");
|
AddPropertiesItem(category, "Autocomplete Require Control", "mAutoCompleteRequireControl");
|
||||||
AddPropertiesItem(category, "Autocomplete Require Tab", "mAutoCompleteRequireTab");
|
AddPropertiesItem(category, "Autocomplete Require Tab", "mAutoCompleteRequireTab");
|
||||||
|
@ -108,15 +124,6 @@ namespace IDE.ui
|
||||||
AddPropertiesItem(category, "Free Cursor Movement", "mFreeCursorMovement");
|
AddPropertiesItem(category, "Free Cursor Movement", "mFreeCursorMovement");
|
||||||
|
|
||||||
category.Open(true, true);
|
category.Open(true, true);
|
||||||
|
|
||||||
(category, propEntry) = AddPropertiesItem(root, "Colors");
|
|
||||||
category.mIsBold = true;
|
|
||||||
category.mTextColor = cHeaderColor;
|
|
||||||
AddPropertiesItem(category, "UI Red", "mColors.mUIColorR");
|
|
||||||
AddPropertiesItem(category, "UI Green", "mColors.mUIColorG");
|
|
||||||
AddPropertiesItem(category, "UI Blue", "mColors.mUIColorB");
|
|
||||||
AddPropertiesItem(category, "Text", "mColors.mText");
|
|
||||||
category.Open(true, true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PopulateCompilerOptions()
|
void PopulateCompilerOptions()
|
||||||
|
@ -126,7 +133,7 @@ namespace IDE.ui
|
||||||
var root = (DarkListViewItem)mPropPage.mPropertiesListView.GetRoot();
|
var root = (DarkListViewItem)mPropPage.mPropertiesListView.GetRoot();
|
||||||
var (category, propEntry) = AddPropertiesItem(root, "General");
|
var (category, propEntry) = AddPropertiesItem(root, "General");
|
||||||
category.mIsBold = true;
|
category.mIsBold = true;
|
||||||
category.mTextColor = cHeaderColor;
|
category.mTextColor = Color.Mult(DarkTheme.COLOR_TEXT, cHeaderColor);
|
||||||
AddPropertiesItem(category, "Worker Threads", "mWorkerThreads");
|
AddPropertiesItem(category, "Worker Threads", "mWorkerThreads");
|
||||||
category.Open(true, true);
|
category.Open(true, true);
|
||||||
}
|
}
|
||||||
|
@ -194,7 +201,7 @@ namespace IDE.ui
|
||||||
let keyEntry = (KeyEntry)propEntry.mTarget;
|
let keyEntry = (KeyEntry)propEntry.mTarget;
|
||||||
|
|
||||||
let listViewItem = (DarkListViewItem)propEntry.mListViewItem.GetSubItem(1);
|
let listViewItem = (DarkListViewItem)propEntry.mListViewItem.GetSubItem(1);
|
||||||
listViewItem.mTextColor = keyEntry.mHasConflict ? 0xFFFF8080 : 0xFFFFFFFF;
|
listViewItem.mTextColor = Color.Mult(DarkTheme.COLOR_TEXT, keyEntry.mHasConflict ? 0xFFFF8080 : 0xFFFFFFFF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -279,11 +286,15 @@ namespace IDE.ui
|
||||||
var targetDict = scope Dictionary<Object, Object>();
|
var targetDict = scope Dictionary<Object, Object>();
|
||||||
switch ((CategoryType)mPropPage.mCategoryType)
|
switch ((CategoryType)mPropPage.mCategoryType)
|
||||||
{
|
{
|
||||||
|
case .UI:
|
||||||
|
Settings.UISettings uiSettings = scope .();
|
||||||
|
uiSettings.SetDefaults();
|
||||||
|
targetDict[gApp.mSettings.mUISettings] = uiSettings;
|
||||||
|
UpdateFromTarget(targetDict);
|
||||||
case .Editor:
|
case .Editor:
|
||||||
Settings.EditorSettings editorSettings = scope .();
|
Settings.EditorSettings editorSettings = scope .();
|
||||||
editorSettings.SetDefaults();
|
editorSettings.SetDefaults();
|
||||||
targetDict[gApp.mSettings.mEditorSettings] = editorSettings;
|
targetDict[gApp.mSettings.mEditorSettings] = editorSettings;
|
||||||
targetDict[gApp.mSettings.mEditorSettings.mColors] = editorSettings.mColors;
|
|
||||||
UpdateFromTarget(targetDict);
|
UpdateFromTarget(targetDict);
|
||||||
case .Keys:
|
case .Keys:
|
||||||
Settings.KeySettings keySettings = scope .();
|
Settings.KeySettings keySettings = scope .();
|
||||||
|
@ -346,6 +357,8 @@ namespace IDE.ui
|
||||||
|
|
||||||
switch ((CategoryType)categoryTypeInt)
|
switch ((CategoryType)categoryTypeInt)
|
||||||
{
|
{
|
||||||
|
case .UI:
|
||||||
|
PopulateUIOptions();
|
||||||
case .Editor:
|
case .Editor:
|
||||||
PopulateEditorOptions();
|
PopulateEditorOptions();
|
||||||
case .Keys:
|
case .Keys:
|
||||||
|
|
|
@ -244,11 +244,14 @@ namespace IDE.ui
|
||||||
int32 column;
|
int32 column;
|
||||||
sourceViewPanel.GetCursorPosition(out line, out column);
|
sourceViewPanel.GetCursorPosition(out line, out column);
|
||||||
|
|
||||||
|
using (g.PushColor(DarkTheme.COLOR_TEXT))
|
||||||
|
{
|
||||||
if (gApp.mSettings.mEnableDevMode)
|
if (gApp.mSettings.mEnableDevMode)
|
||||||
g.DrawString(StackStringFormat!("Idx {0}", sourceViewPanel.mEditWidget.Content.CursorTextPos), mWidth - GS!(240), 0);
|
g.DrawString(StackStringFormat!("Idx {0}", sourceViewPanel.mEditWidget.Content.CursorTextPos), mWidth - GS!(240), 0);
|
||||||
g.DrawString(StackStringFormat!("Ln {0}", line + 1), mWidth - GS!(150), 0);
|
g.DrawString(StackStringFormat!("Ln {0}", line + 1), mWidth - GS!(150), 0);
|
||||||
g.DrawString(StackStringFormat!("Col {0}", column + 1), mWidth - GS!(78), 0);
|
g.DrawString(StackStringFormat!("Col {0}", column + 1), mWidth - GS!(78), 0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
using (g.PushColor(0xFF101010))
|
using (g.PushColor(0xFF101010))
|
||||||
{
|
{
|
||||||
|
@ -330,6 +333,7 @@ namespace IDE.ui
|
||||||
if (mCancelSymSrvButton != null)
|
if (mCancelSymSrvButton != null)
|
||||||
mCancelSymSrvButton.mX = completionRect.Right - GS!(16);
|
mCancelSymSrvButton.mX = completionRect.Right - GS!(16);
|
||||||
|
|
||||||
|
using (g.PushColor(DarkTheme.COLOR_TEXT))
|
||||||
g.DrawString(str, x, statusLabelPos, FontAlign.Centered, len);
|
g.DrawString(str, x, statusLabelPos, FontAlign.Centered, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -373,6 +377,7 @@ namespace IDE.ui
|
||||||
|
|
||||||
if (gApp.mSettings.mEnableDevMode)
|
if (gApp.mSettings.mEnableDevMode)
|
||||||
{
|
{
|
||||||
|
using (g.PushColor(DarkTheme.COLOR_TEXT))
|
||||||
g.DrawString(StackStringFormat!("FPS: {0}", gApp.mLastFPS), GS!(32), 0);
|
g.DrawString(StackStringFormat!("FPS: {0}", gApp.mLastFPS), GS!(32), 0);
|
||||||
|
|
||||||
String resolveStr = scope String();
|
String resolveStr = scope String();
|
||||||
|
|
|
@ -469,7 +469,7 @@ namespace IDE.ui
|
||||||
var root = (DarkListViewItem)mPropPage.mPropertiesListView.GetRoot();
|
var root = (DarkListViewItem)mPropPage.mPropertiesListView.GetRoot();
|
||||||
var (category, propEntry) = AddPropertiesItem(root, "General");
|
var (category, propEntry) = AddPropertiesItem(root, "General");
|
||||||
category.mIsBold = true;
|
category.mIsBold = true;
|
||||||
category.mTextColor = cHeaderColor;
|
category.mTextColor = Color.Mult(DarkTheme.COLOR_TEXT, cHeaderColor);
|
||||||
AddPropertiesItem(category, "Toolset", "mToolsetType");
|
AddPropertiesItem(category, "Toolset", "mToolsetType");
|
||||||
AddPropertiesItem(category, "Build Type", "mBuildKind");
|
AddPropertiesItem(category, "Build Type", "mBuildKind");
|
||||||
|
|
||||||
|
@ -722,7 +722,7 @@ namespace IDE.ui
|
||||||
var root = (DarkListViewItem)mPropPage.mPropertiesListView.GetRoot();
|
var root = (DarkListViewItem)mPropPage.mPropertiesListView.GetRoot();
|
||||||
var (category, propEntry) = AddPropertiesItem(root, "General");
|
var (category, propEntry) = AddPropertiesItem(root, "General");
|
||||||
category.mIsBold = true;
|
category.mIsBold = true;
|
||||||
category.mTextColor = cHeaderColor;
|
category.mTextColor = Color.Mult(DarkTheme.COLOR_TEXT, cHeaderColor);
|
||||||
AddPropertiesItem(category, "Preprocessor Macros", "mPreprocessorMacros");
|
AddPropertiesItem(category, "Preprocessor Macros", "mPreprocessorMacros");
|
||||||
AddPropertiesItem(category, "Incremental Build", "mIncrementalBuild");
|
AddPropertiesItem(category, "Incremental Build", "mIncrementalBuild");
|
||||||
AddPropertiesItem(category, "Intermediate Type", "mIntermediateType");
|
AddPropertiesItem(category, "Intermediate Type", "mIntermediateType");
|
||||||
|
@ -738,10 +738,10 @@ namespace IDE.ui
|
||||||
if (allocType == .Custom)
|
if (allocType == .Custom)
|
||||||
{
|
{
|
||||||
mallocSubItem.Label = mallocPropEntry.mCurValue.Get<String>();
|
mallocSubItem.Label = mallocPropEntry.mCurValue.Get<String>();
|
||||||
mallocSubItem.mTextColor = 0xFFFFFFFF;
|
mallocSubItem.mTextColor = Color.Mult(DarkTheme.COLOR_TEXT, 0xFFFFFFFF);
|
||||||
mallocPropEntry.mDisabled = false;
|
mallocPropEntry.mDisabled = false;
|
||||||
freeSubItem.Label = freePropEntry.mCurValue.Get<String>();
|
freeSubItem.Label = freePropEntry.mCurValue.Get<String>();
|
||||||
freeSubItem.mTextColor = 0xFFFFFFFF;
|
freeSubItem.mTextColor = Color.Mult(DarkTheme.COLOR_TEXT, 0xFFFFFFFF);
|
||||||
freePropEntry.mDisabled = false;
|
freePropEntry.mDisabled = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -767,9 +767,9 @@ namespace IDE.ui
|
||||||
freeSubItem.Label = "tcfree";
|
freeSubItem.Label = "tcfree";
|
||||||
}
|
}
|
||||||
|
|
||||||
mallocSubItem.mTextColor = 0xFFC0C0C0;
|
mallocSubItem.mTextColor = Color.Mult(DarkTheme.COLOR_TEXT, 0xFFC0C0C0);
|
||||||
mallocPropEntry.mDisabled = true;
|
mallocPropEntry.mDisabled = true;
|
||||||
freeSubItem.mTextColor = 0xFFC0C0C0;
|
freeSubItem.mTextColor = Color.Mult(DarkTheme.COLOR_TEXT, 0xFFC0C0C0);
|
||||||
freePropEntry.mDisabled = true;
|
freePropEntry.mDisabled = true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -786,7 +786,7 @@ namespace IDE.ui
|
||||||
|
|
||||||
(category, propEntry) = AddPropertiesItem(root, "Debug");
|
(category, propEntry) = AddPropertiesItem(root, "Debug");
|
||||||
category.mIsBold = true;
|
category.mIsBold = true;
|
||||||
category.mTextColor = cHeaderColor;
|
category.mTextColor = Color.Mult(DarkTheme.COLOR_TEXT, cHeaderColor);
|
||||||
AddPropertiesItem(category, "Debug Info", "mEmitDebugInfo");
|
AddPropertiesItem(category, "Debug Info", "mEmitDebugInfo");
|
||||||
AddPropertiesItem(category, "Runtime Checks", "mRuntimeChecks",
|
AddPropertiesItem(category, "Runtime Checks", "mRuntimeChecks",
|
||||||
scope String[] { "No", "Yes" });
|
scope String[] { "No", "Yes" });
|
||||||
|
@ -818,7 +818,7 @@ namespace IDE.ui
|
||||||
var root = (DarkListViewItem)mPropPage.mPropertiesListView.GetRoot();
|
var root = (DarkListViewItem)mPropPage.mPropertiesListView.GetRoot();
|
||||||
var (category, propEntry) = AddPropertiesItem(root, "General");
|
var (category, propEntry) = AddPropertiesItem(root, "General");
|
||||||
category.mIsBold = true;
|
category.mIsBold = true;
|
||||||
category.mTextColor = cHeaderColor;
|
category.mTextColor = Color.Mult(DarkTheme.COLOR_TEXT, cHeaderColor);
|
||||||
AddPropertiesItem(category, "SIMD Instructions", "mCSIMDSetting");
|
AddPropertiesItem(category, "SIMD Instructions", "mCSIMDSetting");
|
||||||
AddPropertiesItem(category, "Optimization Level", "mCOptimizationLevel");
|
AddPropertiesItem(category, "Optimization Level", "mCOptimizationLevel");
|
||||||
category.Open(true, true);
|
category.Open(true, true);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue