-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add a tab showing the production summary #38
Conversation
When comparing your Summary that can be opened from the top-left menu and the Production Summary that can be opened from the "+" sign, what is the difference between their purposes? |
Oh... when you make the Window too small for the tab bar? I never tried/did this as I have short tab names to prevent making the bar too long/large 😄
This is something that @ShadowTheAge started, but never finished: I do not know the extact intention, but I do not it was (slightly) different compared to this one. @ShadowTheAge also had the idea that this PR should be a plugin, but the plugin system was/is not available: ShadowTheAge#145 (comment). Unfortunately, it is not in a feature branch, so finding all commits related to this is quite a bit of work. |
I haven't understood what exactly you meant by "making it too small", but I didn't make it small on purpose. The app window was around 1500x900 at the time of making a screenshot. I attached the full-screen version below.
I think the tab names that have the length of something like "Military Science" should be handled without overlapping because that's a common name length. |
Oh now I see, it is the name on the left side of the Summary view, I thought it was on the tab bar that was wrapping. IIRC, the width could not be made dynamic (or I was not able to do so, but I'll verify when I have some time) |
Also, I got a NullReferenceException when trying to delete the Summary page
|
I never tried this 🤣 The Summary view is a singleton, as it is a special production page. So it should not be fully deleted (hence the error). |
I checked and it is possible to set a min/max width for the column. But it does not work when I make the I have a plan to move the first column outside of the DataGrid, but I got some headaches as it still would need to scroll vertically! (we'd need to two/nested ScrollAreas for that...) Either way, I do feel there is a bug in the DataGrid and calculating dynamic widths. Most stuff in YAFC is using static widths, so I guess this bug is not triggered until now when I tried to set the min/max allowed width. |
I think this feature will take quite some time to polish and then replace the current Summary with. So I think about releasing YAFC with the current features, and moving this one to the next release. @veger what do you think? |
It is fine by me, we can focus for the release after this include this overview/summary tab. There is already a lot of new and exiting stuff to release. |
Alright! Then I'll playtest the current version for a bit and then release. |
ff81c74
to
87425cf
Compare
…not enough production
Note that the horizontal scrollbar is not clickable (ctrl+scroll and keyboard scrolling is working)
It is a bit hackish but it seems to work (after updating the UI to trigger some 'recalculation') Fixes: #2
As this is a singleton (with a fixed GUID), it sohuld not be fully deleted. Instead we hide it as if the clsoe button on the tab was clicked.
87425cf
to
212f938
Compare
I rebased and reformatted (for the new editorconfig) this PR. Known issues (summary):
Fixed
The data grid does not support dynamic widths (although the code looks like it should). Nonetheless, I guess we should open an issue for this (bug), and discuss the wished outcome/support of the data grid? For this PR I could increase the width, but it won't help too much...
<CRTL>+<scroll wheel> or arrow keys do work. Clicking the scrollbar does not work. Back then I tried to figure out what is causing this, but was not able to. Let's open a ticket for this as well? Is there anything else known that needs solving? |
Well... there are a lot of improvements imaginable, but I would propose to add new features for the Summary Tab in future PRs 😉 |
What do you think about calculating the max length of the name column before generating the page, and setting it to that number? Is that a dynamic width you meant, or can it be arranged? |
Discussion is a good idea. Right know, I'm not sure how that could be solved or in what way the data grid should change.
Good idea, too. It is more than irritating that there are scrollbars but only one of them works. |
It could be done like this (yes, it makes the width dynamic) but that is moving UI related stuff to the model/analyzer code. Ideally, the DataGrid UI should do this automatically without the non-UI part (or at least the non-low level UI part) of YAFC to know about this calculations.
Me neither, I feel there is a bug, or unfinished code in the DataGrid.
I'll make a ticket, so other know how to use it. And for us to remember to figure this out and fix it |
Then I would suggest to make the length of the first column so that it can fit at least 20 characters. |
Sure, I'll use a As the |
The DataGrid component does not (properly) support automatic width calculation, so a sensible hard-coded width is applied
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you take into account that these measurements are some logical measurements and are converted to real pixels at a late step during UI drawing?
Thats something I fell for, at first.
I used the low-tech approach: fill in some value and see whether it was wide enough. After 5 ( 😞 ) iterations I could fit 20 |
With this PR the fixed width (introduced by #38) will be no more and the column width is dynamically calculated depending on the names of the production sheets. --- This change is part of a larger set of changes that I am planning to commit, but those changes need some additional love... (It works, but I broke some things that should not be broken). This change is ready and works separately and adds value to YAFC already. I had to apply one small hack to make this a stand-alone PR, which is making `firstColumnWidth` static. In the upcoming PR it will be a regular field of its class.
It took some preparation and bug fix PRs, but this is (finally) the PR adding the 'Summary Tab'
I tried to reuse the existing UI of YAFC, so I based the whole thing on a
ProjectPageContents
and aProjectPageView
, so it would be recognized and fit into theMainScreen
(tabs) and serialization.The UI of the new 'Summary' tab is ugly, I tried making it nicer, but I found it hard to understand the
ImGui
and its features and how to use them... So I propose this could be further improved om in separate PRs to get the basic functionality/feature into YAFC already and make it available for everyone (I used it a lot and cannot live without this anymore).I also fixed some issues I found while implementing the Summary tab, moved to #31 and #34, except for:
DatGrid
width when header is not used (I found the header useless here)The original idea is from ShadowTheAge#123