Replies: 3 comments 8 replies
-
Sorry about that! #498 made a lot of changes to Themes and how colors are resolved from the I think we came to the conclusion that in #498 that most widget colors should be able to be configured through Currently It would be really helpful if you can point out which widgets, and what colors/states, need to have these override options added. For now, you should come most of the way using the |
Beta Was this translation helpful? Give feedback.
-
That's good to hear. Ideally, I want to be able to feed colors into each widget without touching the themes at all. I'm building my own theme system, so I don't really need or want to deal with the DVUI theme system. Even so, as long as there's a sane way of controlling all color and style assignments to a widget (no options left hard-coded and no options buried beyond hope of passing values), I can work with it. I mostly just want to be sure that DVUI is going in the direction of more control, not less control for more convenience. Let me give a brief example of what I've been doing. This is the struct I've been using to hold attribute values for the tabs:
I still feel that I haven't included everything and will find a couple more options I need to add. The goal is complete themeability. As a side note, the biggest reason I had to re-implement addTab was to give myself an option to turn off drawing the accent on focus. (Getting rid of ColorOrName was a good move, by the way. That extra consideration was a bother.) |
Beta Was this translation helpful? Give feedback.
-
I wrote this up last night after talking with you guys and reading more of #498. These are just ideas to be entertained. Don't shoot! If you're interested, I know of a way you can settle this theme stuff once and for all. Like I said, I'm building my own theme system and I planned out some parameters for how I wanted that to work. I don't know if any such suggestions would be welcome, but I'd like to lay them out anyway. These are just ideas based on how I've been setting up my project. Please feel free to dismiss these as the wild ramblings of some crazy man on the internet. No worries. My idea for my theme system is for nothing about the appearance to be hard-coded or otherwise assumed, leaving all judgement calls to the user (aside from the bare minimum for consistent display purposes), aiming for an exhaustive set of attributes fully user-controlled. If dvui were to do this, it would be even better. That would make DVUI a complete toolkit approaching the likes of GTK+ and Qt, and maybe superceding them in certain ways. If this thinking were applied to DVUI, I believe it would look something like this:
All widgets should accept raw values for all attributes. Theme attributes should be stored and accessed as sets of these raw values. All widgets should be written to receive one valid theme name and reference the attribute set of that theme which is loaded from files. If no theme name is given, widgets should rely exclusively on user-provided attributes. Every widget should assume sane defaults for every attribute left unset by the user or theme. Users should be able to load and unload themes from User Land by providing a file name. Built-in theme aliases can be provided as an afterthought. All attributes should be state-dependent. Attributes
States
That would be 63 total attirbutes for something like a box widget. (Believe it or not, I still consider this is be a compromise that leaves out control that would cost too much in code complexity for the value of the feature, like independent control of border color on all four sides. That just wouldn't be worth it.) Then all you'd need is a simple way of allowing color aliases (e.g. .red) to get automatically translated to hex codes and that should complete the base feature set. Complex widgets can be treated individually. I already have (almost) complete lists of attributes I care about for tabs, menus, and panes. I provided the Tabs struct above, so I'll stick the other two here just as examples of how I have been setting things up. I'm still working on building up TextEntry. (That one will have a cursor color, cursor width, and cursor height, hopefully switching to an underscore cursor in Insert mode and a block cursor or pipe cursor for normal mode, as is tradition.)
I think a setup like this would give all users as much or as little control as they want and nothing would be left dangling. Again, I'm just babbling about wouldn't-it-be-nice-if. I have no idea what it would take to bring dvui in line with this description and I wouldn't expect it to be well received. I would be interested to hear your thoughts about it, though. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there an easy way of passing around lots of specific color values that I just don't know about? I feel like I'm missing something. It seems that DVUI has lots of power under the hood, but, when it comes to widgets, it only gives me handful of crayons to use and a few of them just disappeared when I updated last night!
Currently, my project is up to 37 color settings (probably 20 of which are unique colors) and the total number of settings will probably be over 100 before I'm done (and it should be possible for ALL of those settings to be different colors). To make that possible, I've been using what you guys call "overrides" for color control and re-implementing helper functions as needed (so far just for menus and tabs, but I can see a need for more).
My project runs in a full system window with a system titlebar, run on a desktop PC. It will not be an app on a phone and it will not rely on any use of a web browser. The eventual feature set that I intend for my project requires state-dependent control of all visual attributes of every instance of every widget on the screen. (I don't expect you guys to do all of that. I just want you to make it possible for me to do that.)
The big trouble I'm facing is that there are so many functions that are hard-coded to use the built-in theme system that seems very much unsuited to my use case. To be clear, I'm not complaining about the theme system. There are other use cases in which it would be convenient. The problem is that I seem to be locked into it with no other options. I can suggest design parameters, but I'm not familiar enough with dvui yet to tailor them to your approach. I just got really nervous when I saw some of my color-handling disappear. The theme system as it stands right now just doesn't seem usable for me.
Am I missing something about how to use DVUI or is this a design thing?
Beta Was this translation helpful? Give feedback.
All reactions