]> O.S.I.I.S - jp/crow.git/commitdiff
debug v1.2.0-beta
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sat, 4 Nov 2023 15:09:36 +0000 (16:09 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sat, 4 Nov 2023 15:09:36 +0000 (16:09 +0100)
Crow/Default.style
Crow/src/Command/ToggleCommand.cs
Crow/src/Interface.cs
Crow/src/Widgets/PrivateContainer.cs
Crow/src/Widgets/Widget.cs
Directory.Build.props

index 6e14f802e223f7c4b4cd0c1af27b0a56edb6d5c3..ff3d7bcb03f8ee8f1c06c2e03452f23b4d99191b 100644 (file)
@@ -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";
index 45032a22693aaaf4cc0c64f7c567a86635d36266..3e97d55db878508a643df1d896c43782065ee44f 100644 (file)
@@ -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>
index ca45a243b7521619ae2a62171fcbdb5fa8c16d37..09407be43005b42397f27fc76fec778156b05d34 100644 (file)
@@ -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);
index f5345523794d4d9c47032ac285a7721ec2bd6a0f..a07563fc63454d9afee6cf3002fc35ea3a79e79a 100644 (file)
@@ -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();
-                               }
-                       }
-               }*/
        }
 }
 
index 1165bb7e0f1a983dedee7558fae42f96b77ffe1c..3ed1f324c4d3b804bc1a09412c714db9d5d70e7d 100644 (file)
@@ -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
index 8eb02d30ae8ebcdb2509403bfbdb873f8fca7035..dcf8435282f41e3a04b32ffe56d0d4e06432965b 100644 (file)
@@ -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