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

(minor) fixes #31

Merged
merged 1 commit into from
Feb 13, 2024
Merged

(minor) fixes #31

merged 1 commit into from
Feb 13, 2024

Conversation

veger
Copy link
Collaborator

@veger veger commented Feb 12, 2024

It is a collection of changes I made for ShadowTheAge#145 to fix various things.
In order to make this (big) PR adding the summary view smaller, I moved this (and some other changed) to their own PR, before submitting the PR to add the summary view.

List of improvements/fixes:

  • Don't use 'weird' output of EncapsulateRect() as 'lastRect', but the actual rect of the (old) state
    EncapsulateRect() changes the returned rectangle while processing it, causing rendering issues (I forgot the details, it is ages ago)
  • Improve ScrollArea class names to reflect horizontal scrolling as well, including a constructor parameter to enable horizontal scrolling
    The ScrollArea is capable of having both vertical and horizontal scrollbars. The horizontal scrollbar is never used, and was not exposed. But the summary view needs it for larger factories or the user needs an ultra, mega, super wide screen 😛
  • Renamed some variables
    For clarification
  • Typos and some formatting

* Don't use 'weird' output of EncapsulateRect as 'lastRect', but the
  actual rect of the (old) state
* Improve ScrollArea class names to reflect horizontal scrolling as
  well, including a constructor parameter to enable horizontal scrolling
* Renamed some variables
* Typos and some formatting
@shpaass
Copy link
Owner

shpaass commented Feb 12, 2024

@SWeini, please take a look if you have time.

Copy link
Collaborator

@SWeini SWeini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all changes are just minor and look OK to me on first sight

@shpaass shpaass merged commit d7573ff into shpaass:master Feb 13, 2024
@veger veger deleted the minor-fixes branch February 13, 2024 08:20
shpaass added a commit that referenced this pull request Feb 14, 2024
#34)

#31 was missing an additional fix for the scroll area and their
scrollbars.
With this I did not see any glitches anymore, and the ScrollArea size is
set correctly now (showing scrollbars if needed).(hard to see/test, as
it was visible for the Summary tab which will be my next PR)

Adding a lastContentRect which contains the (correct/out-of-window)
size, fixes the contentSize calculation in BuildGui().
shpaass added a commit that referenced this pull request Feb 29, 2024
I tried to reuse the existing UI of YAFC, so I based the whole thing on
a `ProjectPageContents` and a `ProjectPageView`, so it would be
recognized and fit into the `MainScreen` (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:
* calculating `DatGrid` width when header is not used (I found the
header useless here)

The original idea is from
ShadowTheAge#123
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