aboutsummaryrefslogtreecommitdiffstatsci
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2025-02-13 08:02:13 +0100
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>2025-02-13 08:02:13 +0100
commitfd4ca65c552512784f7a077aa34f3e34c0a79122 (patch)
tree6a5b7d5b49cebba460161b105a7803c3f89660d4
parent243204e61bde6321719c7a4b33ac39d9d4c97383 (diff)
dock window floating debug, other wips
-rw-r--r--Backends/CairoBackend/Crow.CairoBackend.csproj2
-rw-r--r--Backends/CairoBackend/src/ImageBackend.cs2
-rw-r--r--Backends/SkiaBackend/Crow.SkiaBackend.csproj3
-rw-r--r--Backends/SkiaBackend/src/Surface.cs2
-rw-r--r--Backends/VkvgBackend/Crow.VkvgBackend.csproj2
-rw-r--r--Backends/VkvgBackend/src/DefaultBackend.cs25
-rw-r--r--Crow/Default.style1
-rw-r--r--Crow/Templates/DockWindow.template2
-rw-r--r--Crow/src/Widgets/DockWindow.cs18
-rw-r--r--Crow/src/styling/StyleReader.cs2
-rw-r--r--Directory.Build.props2
-rw-r--r--Samples/common/samples.style17
12 files changed, 57 insertions, 21 deletions
diff --git a/Backends/CairoBackend/Crow.CairoBackend.csproj b/Backends/CairoBackend/Crow.CairoBackend.csproj
index 37908375..50563bd7 100644
--- a/Backends/CairoBackend/Crow.CairoBackend.csproj
+++ b/Backends/CairoBackend/Crow.CairoBackend.csproj
@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
- <AssemblyVersion>1.1.0</AssemblyVersion>
+ <AssemblyVersion>1.2.0</AssemblyVersion>
<PackageVersion>$(AssemblyVersion)-beta</PackageVersion>
<Title>C.R.O.W Cairo Backend</Title>
diff --git a/Backends/CairoBackend/src/ImageBackend.cs b/Backends/CairoBackend/src/ImageBackend.cs
index c8ff7f5e..20a5c64e 100644
--- a/Backends/CairoBackend/src/ImageBackend.cs
+++ b/Backends/CairoBackend/src/ImageBackend.cs
@@ -65,7 +65,7 @@ namespace Crow.CairoBackend
{
IContext ctx = base.PrepareUIFrame (existingContext, clipping);
- //clear(ctx);
+ clear(ctx);
for (int i = 0; i < clipping.NumRectangles; i++)
ctx.Rectangle (clipping.GetRectangle (i));
diff --git a/Backends/SkiaBackend/Crow.SkiaBackend.csproj b/Backends/SkiaBackend/Crow.SkiaBackend.csproj
index b713fe9f..5601bf91 100644
--- a/Backends/SkiaBackend/Crow.SkiaBackend.csproj
+++ b/Backends/SkiaBackend/Crow.SkiaBackend.csproj
@@ -13,7 +13,8 @@
</ItemGroup>
<ItemGroup>
- <PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="2.88.0-preview.155" />
+ <!--<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="2.88.0-preview.155" />-->
+ <PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="3.118.0-preview.1.2" />
<PackageReference Include="Svg.Skia" Version="0.5.10" />
<PackageReference Include="vke" Version="0.2.4-beta" />
<!--<PackageReference Include="SkiaSharp" Version=" 2.88.0-preview.155" />-->
diff --git a/Backends/SkiaBackend/src/Surface.cs b/Backends/SkiaBackend/src/Surface.cs
index 843ae6bf..52b9b52c 100644
--- a/Backends/SkiaBackend/src/Surface.cs
+++ b/Backends/SkiaBackend/src/Surface.cs
@@ -54,7 +54,7 @@ namespace Crow.SkiaBackend
internal vke.Image Img => img;
- public void Flush() => skSurf.Flush ();
+ public void Flush() => skSurf.Canvas.Flush();
public void Resize(int width, int height)
{
diff --git a/Backends/VkvgBackend/Crow.VkvgBackend.csproj b/Backends/VkvgBackend/Crow.VkvgBackend.csproj
index 13303e95..0f0e2fe6 100644
--- a/Backends/VkvgBackend/Crow.VkvgBackend.csproj
+++ b/Backends/VkvgBackend/Crow.VkvgBackend.csproj
@@ -15,7 +15,7 @@
<ItemGroup>
<PackageReference Include="vke" Version="0.2.0-beta" />
- <PackageReference Include="vkvg.net" Version="0.7.0-beta" />
+ <PackageReference Include="vkvg.net" Version="0.8.0-beta" />
<ProjectReference Include="..\..\Drawing2D\Drawing2D.csproj" />
</ItemGroup>
diff --git a/Backends/VkvgBackend/src/DefaultBackend.cs b/Backends/VkvgBackend/src/DefaultBackend.cs
index eeed4d0a..41243a03 100644
--- a/Backends/VkvgBackend/src/DefaultBackend.cs
+++ b/Backends/VkvgBackend/src/DefaultBackend.cs
@@ -61,8 +61,17 @@ namespace Crow.VkvgBackend
graphicQueue = new Queue (dev, VkQueueFlags.Graphics);
dev.Activate (enabledFeatures);
- vkvgDev = new Device (
- instance.Handle, phy.Handle, dev.VkDev.Handle, graphicQueue.qFamIndex, samples);
+ DeviceCreateInfo info = new DeviceCreateInfo {
+ samples = this.samples,
+ deferredResolve = false,
+ inst = instance.Handle,
+ phy = phy.Handle,
+ vkdev = dev.VkDev.Handle,
+ qFamIdx = graphicQueue.qFamIndex,
+ qIndex = 0
+ };
+
+ vkvgDev = new vkvg.Device (info);
surf = new Surface (vkvgDev, (int)width, (int)height);
}
@@ -126,8 +135,16 @@ namespace Crow.VkvgBackend
cmdPool.SetName ("main CmdPool");
- vkvgDev = new Device (
- instance.Handle, phy.Handle, dev.VkDev.Handle, graphicQueue.qFamIndex, samples);
+ DeviceCreateInfo info = new DeviceCreateInfo {
+ samples = this.samples,
+ deferredResolve = false,
+ inst = instance.Handle,
+ phy = phy.Handle,
+ vkdev = dev.VkDev.Handle,
+ qFamIdx = graphicQueue.qFamIndex,
+ qIndex = 0
+ };
+ vkvgDev = new vkvg.Device (info);
vkvgDev.SetDpy (72,72);
createMainSurface ((uint)width, (uint)height);
diff --git a/Crow/Default.style b/Crow/Default.style
index ff3d7bcb..98c5276b 100644
--- a/Crow/Default.style
+++ b/Crow/Default.style
@@ -118,6 +118,7 @@ TextBox {
Height = "Fit";
//Text = "TextBox";
Margin = "1";
+ BubbleEvents= "None";
}
Menu {
Margin = "0";
diff --git a/Crow/Templates/DockWindow.template b/Crow/Templates/DockWindow.template
index f54974fb..9e927b7f 100644
--- a/Crow/Templates/DockWindow.template
+++ b/Crow/Templates/DockWindow.template
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<Border Name="SizeHandle" BorderWidth="1" Foreground="Black" CornerRadius="{./CornerRadius}" StickyMouse="8" StickyMouseEnabled="{./IsFloating}"
Background="{./Background}">
- <VerticalStack Spacing="0">
+ <VerticalStack Spacing="0" Name="MoveHandle">
<HorizontalStack Visible="{./IsDocked}" Height="Fit" Margin="1" Background="vgradient|0:0.3,0.5,0.8,0.9|1:0.1,0.1,0.1,0.9">
<Label Text="{./CurDir}" TextAlignment="Left" Width="Stretched"
Foreground="White" />
diff --git a/Crow/src/Widgets/DockWindow.cs b/Crow/src/Widgets/DockWindow.cs
index 620d31f3..0fc8a825 100644
--- a/Crow/src/Widgets/DockWindow.cs
+++ b/Crow/src/Widgets/DockWindow.cs
@@ -277,7 +277,10 @@ namespace Crow
} else
throw new Exception ("docking error");
- IFace.AddWidget (this);
+ if (floatingGroup is null)
+ IFace.AddWidget (this);
+ else
+ floatingGroup.AddChild(this);
Left = IFace.MousePosition.X - 10;
Top = IFace.MousePosition.Y - 10;
@@ -299,8 +302,13 @@ namespace Crow
Undock ();
return true;
}
- void dock () {
- IFace.RemoveWidget (this);
+ void unfloat () {
+ if (Parent == IFace) {
+ IFace.RemoveWidget (this);
+ } else {
+ floatingGroup = Parent as Group;
+ floatingGroup.RemoveChild(this);
+ }
undockingMousePosOrig = IFace.MousePosition;
//undockingMousePosOrig = lastMousePos;
@@ -312,7 +320,7 @@ namespace Crow
}
void Dock (DockWindow target) {
lock (IFace.UpdateMutex) {
- dock ();
+ unfloat ();
if (target.LogicalParent is TabView tv) {
tv.AddItem (this);
@@ -341,7 +349,7 @@ namespace Crow
}
void Dock (DockStack target){
lock (IFace.UpdateMutex) {
- dock ();
+ unfloat ();
target.Dock (this);
}
diff --git a/Crow/src/styling/StyleReader.cs b/Crow/src/styling/StyleReader.cs
index e0bc07b9..62162eef 100644
--- a/Crow/src/styling/StyleReader.cs
+++ b/Crow/src/styling/StyleReader.cs
@@ -210,6 +210,8 @@ namespace Crow
token.Append (ReadChar ());
while (nextCharIsValidCharName)
token.Append (ReadChar ());
+ } else {
+ throw new ParserException (line, column, $"Unexpected char ({ReadChar ()})", resId);
}
break;
}
diff --git a/Directory.Build.props b/Directory.Build.props
index d5e60c55..eb7ad1da 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -6,7 +6,7 @@
<Authors>Jean-Philippe Bruyère</Authors>
<LangVersion>7.3</LangVersion>
- <CrowVersion>1.3.0</CrowVersion>
+ <CrowVersion>1.3.1</CrowVersion>
<CrowPackageVersion>$(CrowVersion)-beta</CrowPackageVersion>
<!-- If you dont have a native libstb on your system, enable the managed version of stb here
diff --git a/Samples/common/samples.style b/Samples/common/samples.style
index fe188ebd..85012c13 100644
--- a/Samples/common/samples.style
+++ b/Samples/common/samples.style
@@ -2,12 +2,12 @@ TestCst = "This is a constant test.";
FpsLabel {
Width = "30";
- Font = "droid, 10";
+ Font = "mono, 10";
Margin = "0";
TextAlignment = "Center";
}
FpsDisp {
- Font = "droid bold, 10";
+ Font = "mono bold, 10";
Width = "60";
Margin = "0";
CornerRadius = "3";
@@ -36,11 +36,11 @@ CheckBox3 {
Unchecked = "{Background=Jet}";
}
labPerf {
- Font = "droid, 8";
+ Font = "mono, 8";
Width = "50%";
}
labPerfVal{
- Font = "droid, 8";
+ Font = "mono, 8";
Width = "50%";
}
DbgLogViewer{
@@ -62,7 +62,14 @@ DockStack {
//DragLeave="{Background=Transparent}";
//EndDrag="{Background=Jet}";
}
-
+SimpleDockWin {
+ Template= "#ui.dockwinsimple.itmp";
+ Background = "Yellow";
+ Width="200";
+ Height="200";
+ Movable="true";
+ CacheEnabled="false";
+}
valignStyle {
Template="#ui.enumSingleSVG.itmp";
Checked="{Background=MediumSeaGreen}";