aboutsummaryrefslogtreecommitdiffstatsci
diff options
context:
space:
mode:
-rw-r--r--Crow/Default.style9
-rw-r--r--Crow/src/Command/ToggleCommand.cs8
-rw-r--r--Crow/src/Interface.cs12
-rw-r--r--Crow/src/Widgets/PrivateContainer.cs15
-rw-r--r--Crow/src/Widgets/Widget.cs13
-rw-r--r--Directory.Build.props3
6 files changed, 24 insertions, 36 deletions
diff --git a/Crow/Default.style b/Crow/Default.style
index 6e14f802..ff3d7bcb 100644
--- a/Crow/Default.style
+++ b/Crow/Default.style
@@ -30,6 +30,13 @@ InactiveTabItem = "DarkGrey";
FolderIcon = "#Crow.Icons.folder.svg";
FileIcon = "#Crow.Icons.file.svg";
+FontSmall = "sans, 10";
+FontNormal = "sans, 12";
+FontBig = "sans, 16";
+
+Widget {
+ Font = "${FontNormal}";
+}
Border {
BorderWidth = "${ControlBorderWidth}";
Foreground = "${ControlBorderColor}";
@@ -146,7 +153,7 @@ MessageBox {
Background = "0.1,0.1,0.2,0.85";
Width = "Fit";
Caption="MessageBox";
- Font = "serif, 12";
+ Font = "${FontNormal}";
//MinimumSize = "200,120";
AlwaysOnTop = "true";
Resizable = "false";
diff --git a/Crow/src/Command/ToggleCommand.cs b/Crow/src/Command/ToggleCommand.cs
index 45032a22..3e97d55d 100644
--- a/Crow/src/Command/ToggleCommand.cs
+++ b/Crow/src/Command/ToggleCommand.cs
@@ -3,13 +3,9 @@
// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
using System;
-using System.ComponentModel;
-using System.Reflection;
-using System.Linq;
-using System.Threading.Tasks;
-using System.Reflection.Emit;
-namespace Crow {
+namespace Crow
+{
/// <summary>
/// helper class to bind in one step icon, caption, action, and validity tests to a controls
/// </summary>
diff --git a/Crow/src/Interface.cs b/Crow/src/Interface.cs
index ca45a243..09407be4 100644
--- a/Crow/src/Interface.cs
+++ b/Crow/src/Interface.cs
@@ -111,7 +111,7 @@ namespace Crow
if (crowAssemblies.Contains (a))
return;
crowAssemblies.Add (a);
- loadStylingFromAssembly (a);
+ init_internal ();
}
}
/// <summary>
@@ -202,7 +202,6 @@ namespace Crow
return false;
}
-
#region CTOR
static Interface ()
{
@@ -825,6 +824,7 @@ namespace Crow
ItemTemplates = new Dictionary<string, ItemTemplate> (initCapacity);
knownCrowWidgetTypes = new Dictionary<string, Type> (initCapacity);
knownExtMethods = new Dictionary<string, MethodInfo> (initCapacity);
+ sharedPictures = new Dictionary<string, sharedPicture> (initCapacity);
}
void loadThemeFiles () {
if (string.IsNullOrEmpty (Theme))
@@ -907,7 +907,7 @@ namespace Crow
/// <summary>
/// share a single store for picture resources among usage in different controls
/// </summary>
- internal Dictionary<string, sharedPicture> sharedPictures = new Dictionary<string, sharedPicture> ();
+ internal Dictionary<string, sharedPicture> sharedPictures;
static bool tryFindResource (Assembly a, string resId, out Stream stream) {
stream = null;
@@ -1223,13 +1223,15 @@ namespace Crow
PerformanceMeasure.Begin (PerformanceMeasure.Kind.Clipping);
Widget g = null;
+ lock (ClippingMutex) {
while (ClippingQueue.Count > 0) {
- lock (ClippingMutex) {
+
g = ClippingQueue.Dequeue ();
g.IsQueueForClipping = false;
- }
+
g.ClippingRegistration ();
}
+ }
PerformanceMeasure.End (PerformanceMeasure.Kind.Clipping);
DbgLogger.EndEvent (DbgEvtType.ClippingRegistration, true);
diff --git a/Crow/src/Widgets/PrivateContainer.cs b/Crow/src/Widgets/PrivateContainer.cs
index f5345523..a07563fc 100644
--- a/Crow/src/Widgets/PrivateContainer.cs
+++ b/Crow/src/Widgets/PrivateContainer.cs
@@ -213,7 +213,6 @@ namespace Crow
{
DbgLogger.StartEvent(DbgEvtType.GOUpdateCache, this);
- Rectangle rb = Slot + Parent.ClientRectangle.Position;
if (!Clipping.IsEmpty) {
using (IContext gr = IFace.Backend.CreateContext (bmp)) {
for (int i = 0; i < Clipping.NumRectangles; i++)
@@ -252,20 +251,6 @@ namespace Crow
#if DEBUG_STATS
public override long ChildCount => child == null ? 0 : 1 + child.ChildCount;
#endif
-
- /*public override bool IsVisible {
- get => base.IsVisible;
- set {
- if (value == isVisible)
- return;
-
- base.IsVisible = value;
-
- if (isVisible && child != null) {
- child.RegisterForRedraw();
- }
- }
- }*/
}
}
diff --git a/Crow/src/Widgets/Widget.cs b/Crow/src/Widgets/Widget.cs
index 1165bb7e..3ed1f324 100644
--- a/Crow/src/Widgets/Widget.cs
+++ b/Crow/src/Widgets/Widget.cs
@@ -118,13 +118,10 @@ namespace Crow
parentElem.AppendChild (xe);
}
- public Surface CreateIcon (int dragIconSize = 32) {
-#if VKVG
- Surface di = new Surface (IFace.vkvgDevice, dragIconSize, dragIconSize);
-#else
- ImageSurface di = new ImageSurface (Format.Argb32, dragIconSize, dragIconSize);
-#endif
- using (Context ctx = new Context (di)) {
+ public ISurface CreateIcon (int dragIconSize = 32) {
+
+ ISurface ico = IFace.Backend.CreateSurface (dragIconSize, dragIconSize);
+ using (IContext ctx = IFace.Backend.CreateContext (ico)) {
double div = Math.Max (LastPaintedSlot.Width, LastPaintedSlot.Height);
double s = (double)dragIconSize / div;
ctx.Scale (s, s);
@@ -138,7 +135,7 @@ namespace Crow
ctx.Paint ();
}
}
- return di;
+ return ico;
}
public string DesignName => LogName + design_id;
#endif
diff --git a/Directory.Build.props b/Directory.Build.props
index 8eb02d30..dcf84352 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -1,11 +1,12 @@
<Project>
<PropertyGroup>
+ <SolutionDir>$(MSBuildThisFileDirectory)</SolutionDir>
<OutputPath>$(SolutionDir)build\$(Configuration)\</OutputPath>
<License>MIT</License>
<Authors>Jean-Philippe Bruyère</Authors>
<LangVersion>7.3</LangVersion>
- <CrowVersion>1.1.0</CrowVersion>
+ <CrowVersion>1.2.0</CrowVersion>
<CrowPackageVersion>$(CrowVersion)-beta</CrowPackageVersion>
<!-- If you dont have a native libstb on your system, enable the managed version of stb here