Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI improvements #308

Open
wants to merge 14 commits into
base: DF2016
Choose a base branch
from
Open

UI improvements #308

wants to merge 14 commits into from

Conversation

maksym-gryb
Copy link

  • 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?

…an be changed for all dwarves with the 'Nothing' filter option selected
@Hello71
Copy link
Contributor

Hello71 commented Jun 18, 2016

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.

@maksym-gryb
Copy link
Author

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.

@Hello71
Copy link
Contributor

Hello71 commented Jun 18, 2016

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.

@maksym-gryb
Copy link
Author

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

@maksym-gryb
Copy link
Author

Ok well, I guess I screwed up the organization on this. The last few commits were supposed to be in a different pull request...

@maksym-gryb maksym-gryb changed the title Filter for "Nothing" UI improvement UI improvements Jun 20, 2016
@maksym-gryb
Copy link
Author

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.

@splintermind
Copy link
Owner

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.

@maksym-gryb
Copy link
Author

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?

@maksym-gryb
Copy link
Author

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.

@maksym-gryb maksym-gryb mentioned this pull request Aug 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants