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 UI Code] WIP: Inline UI Definition instead of xaml compilation #2465

Merged
merged 45 commits into from
Aug 26, 2024

Conversation

MyDrift-user
Copy link
Contributor

@MyDrift-user MyDrift-user commented Jul 27, 2024

Pull Request CONFLICTS WITH #2469

Warning

@ChrisTitusTech, og-mrk's PR linked on top will refractor themes.json, meaning his or my Changes will be undone. could
you please look at fixing it?

Warning

@ChrisTitusTech it has "conflicts" cause og-mrk's refractors themes.json, i am adding stuff to it which will be overwritten with his PR and crash/have wrong values
gets merged

inline ui build

Type of Change

  • Refactoring
  • UI/UX improvement

Description

Instead of compiling the jsons to xaml, we could take them and build the ui from a runspace with code.

  • automation will not have to wait on UI elements to load, because with a WIP PR it will be disabled on automation.

  • refractor ui generation that is already defined in json

  • general little UI improvements across winutil (positioning, margin, padding ..)

  • optimize search

  • fix ui of search

    • Before:
      image

      • search box has no space to tabs
      • text is to far to the bottom, meaning some characters are cut off
      • text goes behint the looking glass icon
    • After:
      image

      • text ends before icon
      • text is horizontally centered to make q,p,g .. look correctly
      • added a bit of margin to the left of the textbox
  • use proper theming everywhere

Impact:

  • creates possibility to easily add tweaks/preferences ... to the gui only if requirements are met (based on OS Version (Win10 / Win11 / < Buildnumber))
  • minimize winutil.ps1 filesize ~ -200kb
  • dynamic loading of content would support easily adding stuff later on, meaning we could
  • lowering compilation process time
  • unify differences in ui code (correct handling of theming in multiple places)

Plans for future:

  • if someone can make it or I somehow get how to do it put ui addition into runspace so multiple panels can load at the same time & ui can load faster.

Additional Information

This PR is a WIP, I made it very early in dev process to get feedback and let people know what i am up to because this will change a lot (logics of building the GUI)

Checklist

  • My code adheres to the coding and style guidelines of the project.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no errors/warnings/merge conflicts.

@MyDrift-user MyDrift-user mentioned this pull request Jul 28, 2024
6 tasks
- removed Get-TabXaml.ps1
- removed compilation part from compile.ps1
- removed existing changes from main.ps1
- added Invoke-WinUtilUIElements.ps1
- refractor existing changes into new function
- modified inputXML to call function
@MyDrift-user MyDrift-user changed the title WIP: Inline UI Definition instead of xaml compilation [Refactoring UI Code] WIP: Inline UI Definition instead of xaml compilation Aug 5, 2024
@MyDrift-user MyDrift-user mentioned this pull request Aug 6, 2024
6 tasks
Compile.ps1 Show resolved Hide resolved
- reworked function calling
- working on correct theming support
fix missing elements
fix var naming
@MyDrift-user MyDrift-user requested a review from og-mrk August 19, 2024 20:51
@MyDrift-user MyDrift-user marked this pull request as ready for review August 19, 2024 20:52
scripts/main.ps1 Outdated Show resolved Hide resolved
@MyDrift-user MyDrift-user marked this pull request as ready for review August 22, 2024 17:35
Copy link
Contributor

@og-mrk og-mrk left a comment

Choose a reason for hiding this comment

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

Well done @MyDrift-user , everything looks good now 👍

og-mrk and others added 4 commits August 24, 2024 14:01
* Remove the Special Character Escaping for Json Files as there's no need for it anymore

* Simplify 'application.json' Json Prefix Addition in 'Compile.ps1' Script

Thanks to  @fam007e for improving this section in his PR ChrisTitusTech#2587 changes

Co-authored-by: fam007e <faisalmoshiur@gmail.com>

---------

Co-authored-by: fam007e <faisalmoshiur@gmail.com>
@MyDrift-user MyDrift-user mentioned this pull request Aug 24, 2024
6 tasks
@MyDrift-user MyDrift-user requested a review from og-mrk August 24, 2024 19:37
@MyDrift-user MyDrift-user marked this pull request as draft August 26, 2024 18:24
@MyDrift-user MyDrift-user marked this pull request as ready for review August 26, 2024 19:08
@ChrisTitusTech ChrisTitusTech merged commit 5faeb8c into ChrisTitusTech:main Aug 26, 2024
1 check passed
ChrisTitusTech added a commit that referenced this pull request Aug 28, 2024
…lation (#2629)

* try1: apps panel

* refractor

- removed Get-TabXaml.ps1
- removed compilation part from compile.ps1
- removed existing changes from main.ps1
- added Invoke-WinUtilUIElements.ps1
- refractor existing changes into new function
- modified inputXML to call function

* removed unused replacementlogics

* fix toggle style

* move naming from winutil to wpf

* hotfixes

- reworked function calling
- working on correct theming support

* hotfix

* hotfix

fix missing elements
fix var naming

* some fixes

* hotfixes

* add image logic

* fix ? issue in search

* filter out unneeded categories

* cleanup

* fix border styling

* fixes

* preprocessing

* fix typo

* last fixes & add notes

* Update functions/public/Invoke-WPFUIElements.ps1

Co-authored-by: Mr.k <mineshtine28546271@gmail.com>

* fix margin

* fix tabcontent margin

* fix some other margin issues

* move fixed values outside of iterations

* little fix

* add Dispatcher.Invoke

* add error handling for styles

* Update functions/public/Invoke-WPFUIElements.ps1

Co-authored-by: Mr.k <mineshtine28546271@gmail.com>

* remove dispatcher

* fix search

* move run & undo tweaks to be fixed

* add error handling

* fix throw exception

* fixed accidental removal of findname grid call

* add padding & margin to make search look good

* remove grid to make it look correctly on small window

* fix rectangle

* Compiler Improvements for PR #2465 (#7)

* Remove the Special Character Escaping for Json Files as there's no need for it anymore

* Simplify 'application.json' Json Prefix Addition in 'Compile.ps1' Script

Thanks to  @fam007e for improving this section in his PR #2587 changes

Co-authored-by: fam007e <faisalmoshiur@gmail.com>

---------

Co-authored-by: fam007e <faisalmoshiur@gmail.com>

* fix margin of search clear

* fix cursor on clear search button

* undo fixed run & undo

* refractor themes.json

* undo themes.json

---------

Co-authored-by: Mr.k <mineshtine28546271@gmail.com>
Co-authored-by: fam007e <faisalmoshiur@gmail.com>
Co-authored-by: Chris Titus <contact@christitus.com>
@ChrisTitusTech ChrisTitusTech added the skip-changelog Skip Change Logs label Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-changelog Skip Change Logs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants