From 17a29e6b0dea1607c7094c9bf1df4d65f57bf033 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Sat, 4 Nov 2023 16:09:36 +0100 Subject: [PATCH] debug --- Crow/Default.style | 9 ++++++++- Crow/src/Command/ToggleCommand.cs | 8 ++------ Crow/src/Interface.cs | 12 +++++++----- Crow/src/Widgets/PrivateContainer.cs | 15 --------------- Crow/src/Widgets/Widget.cs | 13 +++++-------- Directory.Build.props | 3 ++- 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 +{ /// /// helper class to bind in one step icon, caption, action, and validity tests to a controls /// 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 (); } } /// @@ -202,7 +202,6 @@ namespace Crow return false; } - #region CTOR static Interface () { @@ -825,6 +824,7 @@ namespace Crow ItemTemplates = new Dictionary (initCapacity); knownCrowWidgetTypes = new Dictionary (initCapacity); knownExtMethods = new Dictionary (initCapacity); + sharedPictures = new Dictionary (initCapacity); } void loadThemeFiles () { if (string.IsNullOrEmpty (Theme)) @@ -907,7 +907,7 @@ namespace Crow /// /// share a single store for picture resources among usage in different controls /// - internal Dictionary sharedPictures = new Dictionary (); + internal Dictionary 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 @@ + $(MSBuildThisFileDirectory) $(SolutionDir)build\$(Configuration)\ MIT Jean-Philippe Bruyère 7.3 - 1.1.0 + 1.2.0 $(CrowVersion)-beta