These are chat archives for AvaloniaUI/Avalonia

2nd
Jul 2016
Matthijs ter Woord
@mterwoord
Jul 02 2016 10:19
@ReedCopsey Cool! I always thought travis is just software...
Wiesław Šoltés
@wieslawsoltes
Jul 02 2016 10:53
Some Avalonia logo concept :smile:
2016-07-02_12-52-17.png
Steven Kirk
@grokys
Jul 02 2016 11:05
haha
nice
i have a friend who is a graphic designer who is going to help us design a logo actually
i need to speak to him again about it
Wiesław Šoltés
@wieslawsoltes
Jul 02 2016 12:08
This message was deleted
great
Darnell Williams
@Seeker1437
Jul 02 2016 16:32
Hey guys can I ask another question? I know it'sa bit off topic but because I plan to use it with Avalonia I wanted to pass it by you

I am working on a C# wrapper for the Sqaure Connect API, which I plan to leverage to as I start to work with AvaloniaUI more closely

Square supports setting a strict set of colors to item tiles.

if you were writing an API library would you build a const class for the supported colors?

idk if I thought it all out very well.

for example:

using System.Reflection;

namespace SquareConnect.V1.Enums
{
    /// <summary>
    /// Indicates the color of an item's label color in Square Register, in six-character hexadecimal format.
    /// </summary>
    /// <remarks>
    /// Colors other than those defined are not supported.
    /// </remarks>
    public static class ItemColor
    {
        /// <summary>
        /// A gray color.
        /// </summary>
        public const string Gray = "9da2a6";
        /// <summary>
        /// A lighter green color.
        /// </summary>
        public const string LightGreen = "4ab200";
        /// <summary>
        /// A darker green color.
        /// </summary>
        public const string DarkGreen = "0b8000";
        /// <summary>
        /// A lighter blue color.
        /// </summary>
        public const string LightBlue = "13b1bf";
        /// <summary>
        /// A darker blue color.
        /// </summary>
        public const string DarkBlue = "2952cc";
        /// <summary>
        /// A purple color.
        /// </summary>
        public const string Purple = "a82ee5";
        /// <summary>
        /// A lighter red color.
        /// </summary>
        public const string LightRed = "e5457a";
        /// <summary>
        /// A dark red color.
        /// </summary>
        public const string DarkRed = "b21212";
        /// <summary>
        /// A gold color.
        /// </summary>
        public const string Gold = "e5BF00";
        /// <summary>
        /// A brown color.
        /// </summary>
        public const string Brown = "593c00";

        /// <summary>
        /// Returns the name of the item color if it is defined
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public static string GetName(string value)
        {
            foreach (var field in typeof(ItemColor).GetFields(BindingFlags.Public | BindingFlags.Static))
            {
                if ((string)field.GetValue(null) == value)
                    return field.Name;
            }

            return "?";
        }
    }
}

the api will return the actual string values. I wrote this for when a user wanted to SET a color to one of the supported colors, does it make sense to have this?

How would I then convert the color string to a real brush in AvaloniaUI?

Wiesław Šoltés
@wieslawsoltes
Jul 02 2016 17:19
You can use Color.Parse in Avalonia and use resulting Color object to create brush.
Jeremy Koritzinsky
@jkoritzinsky
Jul 02 2016 17:51
@grokys whats the plan for our next official release?
Steven Kirk
@grokys
Jul 02 2016 18:42
I think the designer is in a decent state, no? If so, we should do a release of we've sorted out the remaining virtualization bugs
Once we've sorted out
Jeremy Koritzinsky
@jkoritzinsky
Jul 02 2016 18:43
Sounds good to me.
I've been planning to make an Avalonia backend for Oxyplot and they won't accept it into the main repo until I can pull a package from nuget. There were a lot of features added recently that the port would need, so I'm just waiting for our next offical release before I do the port.
Steven Kirk
@grokys
Jul 02 2016 19:17
I noticed you closed the icon PR, why is that? Was there something wrong with it?
I started reviewing it and trying to work out the problem today, but didn't have time to work it out
Jeremy Koritzinsky
@jkoritzinsky
Jul 02 2016 19:20
I was going to try to build it up from scratch again and see where it broke control catalog.
I didn't realize that you had started looking at it.
Steven Kirk
@grokys
Jul 02 2016 20:44
Ok well we'll see who works it out first - I probably won't have much time in the next few weeks
Jeremy Koritzinsky
@jkoritzinsky
Jul 02 2016 20:53
I've been working on it today and have made a lot of progress. I'll send a new PR once I complete it. If you have a chance to review my opacity mask pr though that would be great.
Jeremy Koritzinsky
@jkoritzinsky
Jul 02 2016 21:37
I can say that Icon support would be more efficient if it was bound exclusively to the windowing subsystem instead of having to route through the rendering subsystem first.
Nikita Tsukanov
@kekekeks
Jul 02 2016 21:38
The problem is that we need to support loading generated icons
BTW, why are you compressing icons to PNG first?
Oh, we don't have access to raw bitmap data in that api
Jeremy Koritzinsky
@jkoritzinsky
Jul 02 2016 21:39
Yep.
Nikita Tsukanov
@kekekeks
Jul 02 2016 21:39
There is another issue
Icons support mipmaps
at least in windows
Jeremy Koritzinsky
@jkoritzinsky
Jul 02 2016 21:40
And none of the native icon apis support using raw bytes. They require encoded images.
Nikita Tsukanov
@kekekeks
Jul 02 2016 21:40
Window frame uses 16x16 while taskbar can utilize up to 128x128
So we probably should have 2 methods of setting the icon
Jeremy Koritzinsky
@jkoritzinsky
Jul 02 2016 21:41
How many people actually use the generated icon feature of WPF?
Nikita Tsukanov
@kekekeks
Jul 02 2016 21:41
Well, let's say you develop a messenger and want to show unread message count
Jeremy Koritzinsky
@jkoritzinsky
Jul 02 2016 21:41
True
Good point.
Nikita Tsukanov
@kekekeks
Jul 02 2016 21:42
But loading icon directly from icon stream should also work fine
Jeremy Koritzinsky
@jkoritzinsky
Jul 02 2016 21:42
Is there an open source example that I can take a look at to figure out what APIs the other applications use?
Nikita Tsukanov
@kekekeks
Jul 02 2016 21:42
I think we need a different Icon class
With IIconImpl
Jeremy Koritzinsky
@jkoritzinsky
Jul 02 2016 21:42
That was my initial design. Do you want me to do that again?
Nikita Tsukanov
@kekekeks
Jul 02 2016 21:43
Which is provided by windowing subsystem
And accepts arbitrary binary data
Jeremy Koritzinsky
@jkoritzinsky
Jul 02 2016 21:43
I agree with that design. I can get it working in another branch.
Nikita Tsukanov
@kekekeks
Jul 02 2016 21:43
That will allow people to manually load their icons from rendertargetbitmap
Jeremy Koritzinsky
@jkoritzinsky
Jul 02 2016 21:44
I don't know if arbitrary binary data would work. GDI+ is very finicky about formats, and GDK pixbuf is similar.
Nikita Tsukanov
@kekekeks
Jul 02 2016 21:45
Both GDI+ and GTK are capable of loading png and ico
Jeremy Koritzinsky
@jkoritzinsky
Jul 02 2016 21:45
Yep.
Nikita Tsukanov
@kekekeks
Jul 02 2016 21:46
We could also add a way to construct IIconImpl from IBitmapImpl that will load bitmap data directly if that's supported by windowing subsystem
Or fallback to png serialization
BTW, did you manage to get opacity masks working?
with skia
Jeremy Koritzinsky
@jkoritzinsky
Jul 02 2016 21:46
Yeah.
Nikita Tsukanov
@kekekeks
Jul 02 2016 21:46
So what was needed to do the trick?
Jeremy Koritzinsky
@jkoritzinsky
Jul 02 2016 21:47
Ended up using SaveLayer with SkPaints to recombine the layers.
It's all in the opacity mask pr
Nikita Tsukanov
@kekekeks
Jul 02 2016 21:49
I'd rename CurrentCanvas back to _canvas
the name is misleading
Jeremy Koritzinsky
@jkoritzinsky
Jul 02 2016 21:50
must have missed that. will do.
I'm going to call it Canvas because it is a publicly exposed property
at least the getter is publically exposed.
Jeremy Koritzinsky
@jkoritzinsky
Jul 02 2016 23:37
@kekekeks I just finished an implementation of icons within the windowing platform that makes it easy to hook up a bitmap as the target. They use an internal method of transfer if possible (Cairo -> GTK) or otherwise persist out to png.