1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-07-06 16:25:59 +02:00

Merge branch 'master' into BookmarkPanel

This commit is contained in:
Simon Lübeß 2022-08-13 18:02:49 +02:00
commit 6884b9fc21
267 changed files with 26197 additions and 17792 deletions

View file

@ -792,9 +792,23 @@ namespace Beefy
BFApp_SetCursor((int32)cursor);
}
public virtual void* GetClipboardData(String format, out int32 size)
public virtual void* GetClipboardData(String format, out int32 size, int waitTime = 500)
{
return BFApp_GetClipboardData(format, out size);
Stopwatch sw = null;
repeat
{
if (sw != null)
Thread.Sleep(1);
void* result = BFApp_GetClipboardData(format, out size);
if (size != -1)
return result;
if (waitTime == 0)
return null;
if (sw == null)
sw = scope:: .()..Start();
}
while (waitTime < sw.ElapsedMilliseconds);
return null;
}
public virtual void ReleaseClipboardData(void* ptr)
@ -802,9 +816,9 @@ namespace Beefy
BFApp_ReleaseClipboardData(ptr);
}
public virtual bool GetClipboardText(String outStr)
public virtual bool GetClipboardText(String outStr, int waitTime = 500)
{
return GetClipboardTextData("text", outStr);
return GetClipboardTextData("text", outStr, waitTime);
}
public virtual bool GetClipboardText(String outStr, String extra)
@ -813,10 +827,10 @@ namespace Beefy
return GetClipboardTextData("text", outStr);
}
public bool GetClipboardTextData(String format, String outStr)
public bool GetClipboardTextData(String format, String outStr, int waitTime = 500)
{
int32 aSize;
void* clipboardData = GetClipboardData(format, out aSize);
void* clipboardData = GetClipboardData(format, out aSize, waitTime);
if (clipboardData == null)
return false;

View file

@ -170,7 +170,7 @@ namespace Beefy
if (autoRetry)
{
if (fileOpenErr == .SharingViolation)
retry = true;
retry = i != 99;
}
if (!retry)
return .Err(.OpenError(fileOpenErr));

View file

@ -33,7 +33,7 @@ namespace Beefy.theme.dark
}
public virtual void MouseDown(float x, float y, int btn, int btnCount)
public virtual void MouseDown(Rect rect, float x, float y, int btn, int btnCount)
{
}
@ -63,6 +63,7 @@ namespace Beefy.theme.dark
public bool mScrollToStartOnLostFocus;
public bool mHiliteCurrentLine;
public Dictionary<int32, Embed> mEmbeds = new .() ~ DeleteDictionaryAndValues!(_);
public Embed mEmbedSelected;
public Range? mLineRange;
protected static uint32[] sDefaultColors = new uint32[] ( Color.White ) ~ delete _;
@ -457,6 +458,12 @@ namespace Beefy.theme.dark
LineStartsChanged();
}
public override void ClearText()
{
mLineRange = null;
base.ClearText();
}
public virtual float DrawText(Graphics g, String str, float x, float y, uint16 typeIdAndFlags)
{
using (g.PushColor(mTextColors[typeIdAndFlags & 0xFF]))