nomad-software / tkd

GUI toolkit for the D programming language based on Tcl/Tk
MIT License
117 stars 16 forks source link

added color options for entry, text, spinbox, combobox, label, window and font options for text #50

Closed AndrewGrim closed 5 years ago

AndrewGrim commented 5 years ago

new mixin template that allows you to set the foreground and background color for some of the widgets, changed example.d to reflect this

AndrewGrim commented 5 years ago

A few things:

The FontSize enum is kinda useless I only have it there to keep the default arguments consistent.

I added the FontStyle enum but I also added other ones so you could be more explicit. I definitely went overboard with the options because I couldn't decide on just one. I like True and False for underline and overstrike but its not consistent with the style because true and false are keywords. I don't like FontOverstrike.overstrike because its pretty redundant. So it might be better to keep just FontWeight and FontStyle in effort to keep it simple.

There aren't a lot of font options but the ones that are there I have tested and confirmed working, we could always add more in the future.

nomad-software commented 5 years ago

Thanks for the work but the work has grown far beyond a simple change and needs to be broken up.

If you could re-submit a different PR for just the color changes then let's get that into master. Once this is in then we can take a look at the fonts.

The current font options are way too much. We only need weight and style as enums and they should be very small. Looking at this link: https://www.tcl.tk/man/tcl8.4/TkCmd/font.htm there are only a few options. As I showed above it would be a FontWeight and FontStyle enum, that's all.

Each enum should have its own file and there should not be more than one enum value per option. Even if Tcl/Tk supports this, Tkd should not. Let's make it simple for users. One enum for weight and one for style, that's it.

Fonts and sizes should not be placed in an enum, simply because there are far too many and these should be user-defined.

Please take a small amount of time to understand how Tkd is trying to simplify using Tcl/Tk by presenting a simple API. Simpler the better but it has to be consistent, intuitive and easy to use. Currently, the font handling in this PR has gone a little beyond this.

AndrewGrim commented 5 years ago

Thanks for taking the time to look this over. I realize I was a bit hot headed creating the pull request and I should have put more thought into writing the code before submitting it. I will rethink this and create the new pull requests in the near future.

nomad-software commented 5 years ago

No problem at all, thanks for the interest. I just want to make sure things are simple and nice to use. :)