Dwarf-Therapist
Dwarf-Therapist copied to clipboard
UI improvements
- I had to change "buf" so that it wouldn't be an error on my Windows machine.
- It was annoying to not be able to change the skills of all the dwarfs at the same time, so I added a tab for the "Nothing" filter.
First time I do a pull request, am I doing it right...? What would an appropriate title be?
that's not how memory allocation in C or C++ works. like, at all. it's a VLA, use mingw or another GCC. regardless, there's a huge memory leak.
Oh wow, you're damn right, I feel like an idiot overlooking this important detail. This introduces a HUGE memory leak! I'll have to look at my compiler, I thought I was using GCC, though I could be wrong.
for the record, if you really want it to work with MSVC (although I don't really know why you would), the correct way to fix this would be to allocate a single buffer when the class is initialized; this way you avoid calling new[]
in a semi-hot path.
Yeah, don't worry about that, I know how to properly manage C++ memory. I must've just had some sort of brain fart I guess. :/ But what I do not know are the main/important differences between MSVC and GCC compilers. I'll look it up myself as well, but I was wondering if you had any quick links/references on hand about that comparison which you might share with me, pretty please :) and thanks for keeping me in check too :P
Ok well, I guess I screwed up the organization on this. The last few commits were supposed to be in a different pull request...
So currently, the style-sheet is not loaded automatically, since the only style-sheet there is is DarkTheme and I don't want to change the default look of DT. Instead, under the file
menu-tab, there is a reload style sheet
button that you can press to load the style-sheet, though unfortunately, it cannot "reload" the style-sheet after it has been initially loaded - as is deceiving name would suggest - for the time being.
The dark theme is getting there; still needs some tweaking though. Tooltips, tab headers and dock table/tree headers are difficult to read. The menu doesn't seem to be affected and there are still borders that haven't been changed:
It would also be nice to add a menu to choose from existing/detected themes.
The 'Nothing' group is probably a good idea. You could already assign labors by right clicking on the column headers; although the cells are arguably more intuitive and easier for quickly setting multiple labors on everyone.
Thanks.
I know the actual style-sheet is nowhere near completion (although I've made a lot of progress by going from 100 to 30 lines for achieving exactly the same effect; as I was trying to figure out how Qt uses style-sheets - I've a good amount of experience with websites, but not with Qt).
I was expecting to fix the style-sheet much faster, but I got caught-up by trying to get that reload style-sheet
button to work properly (as of now, you can only load it once after program start and not every time you press the button - as was intended) since that would greatly increase the productivity for making a decent style-sheet as I wouldn't have to reload DT every time I change the style-sheet.
When I do get a proper style-sheet going, then I'll add documentation for it as well, for now, I'm still experimenting.
Finally, where can I get one of those nifty icons for use of the style-sheet reload
button?
I realized that when you load a file into the resources through resources.qrc
, the Qt application (in this case DT) will load it once into memory, on program load, and not ever again. So finally figuring that out, I'm working with paths outside of the resources.qrc
file. I'll get a proper style-sheet reload
button up soon. And then a proper DarkTheme style-sheet and then the etc.