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

Refactoring codebase #120

Merged
merged 7 commits into from
Apr 6, 2024
Merged

Refactoring codebase #120

merged 7 commits into from
Apr 6, 2024

Conversation

R-Abbasi
Copy link
Collaborator

@R-Abbasi R-Abbasi commented Mar 29, 2024

Took the branch feature-generate-training-data which is right before the branch 88-enhancement-organisation-and-style containing the current style.

  • added handler.hpp, style.hpp, handler.cpp and style.cpp files
  • modified main.cpp mostly

The codebase has been simplified and is at a good readability and maintainability level without any source file inclusion, redundant .cpp/.hpp files or complicated code. main.cpp has now less than half of code lines compared to its initial version (from 671 to 341).
I think this version can be considered as an appropriate base to continue from and add recent features to.

  • Changes in the commit step-2-changes:

    • used specific ImGui::BeginChilds for spacific parts of the program
    • removed much redundant code
    • added a lot of simplifications
    • fixed the program startup crash bug
  • Changes in the commit step-3-changes

    • made lots of simplifications and improvements in handler.hpp, handler.cpp , style.hpp, and style.cpp files
    • arranged ImGui::BeginChilds and removed redundant ones
    • added imagesHeader.hpp containing the logo in hex data
    • added stb_image.h and loaded the logo image using proper code
    • added a border for the plot region part - and more ...
  • Changes in the commit step-4-changes

    • coded loading images with modifiable text
    • modified imagesHeader.hpp to contain all images yet with less code lines (11,857 to 9844)
    • modified style.cpp
  • Changes in the commit step-5-changes

    • updated all files to meet the current version's features
    • added a few global variables to header.hpp leading to considerable progress in simplicity and readability especially for functions
    • added a feature to close the tool buttons as soon as one is selected on the tree-node
    • removed functions not used anymore
    • added tool buttons Reset and Version
    • minor simplifications throughout the whole codebase
    • extended the languages maps and more

Copy link
Collaborator

@AKMaily AKMaily left a comment

Choose a reason for hiding this comment

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

Tested the Userflow in the software and all features are working as before. The structure is good and makes the code much more readable. The Design is not yet implemented as it was before. I would like to apply the Style and see if it looks the same before we merge this branch into the master.

};

ImGuiInstance window{1280, 760,
ImGuiInstance window{1920, 1080,
Copy link
Collaborator

Choose a reason for hiding this comment

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

The reason this was set to 1280, 760 is because then it will not be to big for little screens. Otherwise the resizing does not work right.

Copy link
Collaborator

@AKMaily AKMaily left a comment

Choose a reason for hiding this comment

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

The Style can be set the same way as before and the software still works.

@AKMaily AKMaily merged commit 30cfc7d into master Apr 6, 2024
2 checks passed
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.

None yet

2 participants