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 #2629

Merged
merged 48 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
4402c5c
try1: apps panel
MyDrift-user Jul 27, 2024
dfe7dc4
refractor
MyDrift-user Jul 31, 2024
eaa19eb
Merge branch 'ChrisTitusTech:main' into compact
MyDrift-user Jul 31, 2024
ec4cb1d
removed unused replacementlogics
MyDrift-user Aug 6, 2024
bb39be7
fix toggle style
MyDrift-user Aug 7, 2024
1132d53
move naming from winutil to wpf
MyDrift-user Aug 9, 2024
47e8001
hotfixes
MyDrift-user Aug 9, 2024
b15f31f
hotfix
MyDrift-user Aug 9, 2024
3be1999
hotfix
MyDrift-user Aug 10, 2024
506c015
some fixes
MyDrift-user Aug 11, 2024
e6e449a
hotfixes
MyDrift-user Aug 11, 2024
cdf3685
add image logic
MyDrift-user Aug 11, 2024
3f48c8a
fix ? issue in search
MyDrift-user Aug 15, 2024
4c6990b
filter out unneeded categories
MyDrift-user Aug 15, 2024
a22d6b0
cleanup
MyDrift-user Aug 15, 2024
80ca474
fix border styling
MyDrift-user Aug 16, 2024
c241293
fixes
MyDrift-user Aug 16, 2024
f0b4660
Merge branch 'main' into compact
MyDrift-user Aug 19, 2024
210f321
preprocessing
MyDrift-user Aug 19, 2024
6175c08
fix typo
MyDrift-user Aug 19, 2024
c056bbc
last fixes & add notes
MyDrift-user Aug 19, 2024
a17080f
Merge branch 'ChrisTitusTech:main' into compact
MyDrift-user Aug 19, 2024
18466bc
Update functions/public/Invoke-WPFUIElements.ps1
MyDrift-user Aug 20, 2024
2f7ff31
fix margin
MyDrift-user Aug 20, 2024
0743699
fix tabcontent margin
MyDrift-user Aug 20, 2024
60f3615
fix some other margin issues
MyDrift-user Aug 20, 2024
c914a7b
move fixed values outside of iterations
MyDrift-user Aug 20, 2024
210d288
little fix
MyDrift-user Aug 20, 2024
cbb5691
add Dispatcher.Invoke
MyDrift-user Aug 20, 2024
1c2b301
add error handling for styles
MyDrift-user Aug 20, 2024
ac63c2a
Update functions/public/Invoke-WPFUIElements.ps1
MyDrift-user Aug 21, 2024
23f11d3
remove dispatcher
MyDrift-user Aug 22, 2024
7b42f7b
fix search
MyDrift-user Aug 22, 2024
20dc45b
move run & undo tweaks to be fixed
MyDrift-user Aug 22, 2024
7e3d124
add error handling
MyDrift-user Aug 22, 2024
f284173
fix throw exception
MyDrift-user Aug 22, 2024
cb2576e
fixed accidental removal of findname grid call
MyDrift-user Aug 22, 2024
1f6e5b8
add padding & margin to make search look good
MyDrift-user Aug 22, 2024
f7e100d
remove grid to make it look correctly on small window
MyDrift-user Aug 22, 2024
71db68a
fix rectangle
MyDrift-user Aug 22, 2024
57b903b
Compiler Improvements for PR #2465 (#7)
og-mrk Aug 24, 2024
ac11f88
Merge branch 'ChrisTitusTech:main' into compact
MyDrift-user Aug 24, 2024
00870ae
fix margin of search clear
MyDrift-user Aug 24, 2024
5084b39
fix cursor on clear search button
MyDrift-user Aug 24, 2024
c5c7b6c
undo fixed run & undo
MyDrift-user Aug 25, 2024
b85f8c8
refractor themes.json
MyDrift-user Aug 26, 2024
3f3628b
undo themes.json
MyDrift-user Aug 26, 2024
d3aecee
Merge branch 'main' into compact
ChrisTitusTech Aug 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 2 additions & 39 deletions Compile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -64,38 +64,14 @@ Get-ChildItem "$workingdir\functions" -Recurse -File | ForEach-Object {
}
Update-Progress "Adding: Config *.json" 40
Get-ChildItem "$workingdir\config" | Where-Object {$psitem.extension -eq ".json"} | ForEach-Object {

$json = (Get-Content $psitem.FullName).replace("'","''")

# Replace every XML Special Character so it'll render correctly in final build
# Only do so if json files has content to be displayed (for example the applications, tweaks, features json files)
# Make an Array List containing every name at first level of Json File
$jsonAsObject = $json | convertfrom-json
$firstLevelJsonList = [System.Collections.ArrayList]::new()
$jsonAsObject.PSObject.Properties.Name | ForEach-Object {$null = $firstLevelJsonList.Add($_)}
# Note:
# Avoid using HTML Entity Codes, for example '”' (stands for "Right Double Quotation Mark"),
# Use **HTML decimal/hex codes instead**, as using HTML Entity Codes will result in XML parse Error when running the compiled script.
for ($i = 0; $i -lt $firstLevelJsonList.Count; $i += 1) {
$firstLevelName = $firstLevelJsonList[$i]
if ($jsonAsObject.$firstLevelName.content -ne $null) {
$jsonAsObject.$firstLevelName.content = $jsonAsObject.$firstLevelName.content.replace('&','&#38;').replace('“','&#8220;').replace('”','&#8221;').replace("'",'&#39;').replace('<','&#60;').replace('>','&#62;').replace('—','&#8212;')
$jsonAsObject.$firstLevelName.content = $jsonAsObject.$firstLevelName.content.replace('&#39;&#39;',"&#39;") # resolves the Double Apostrophe caused by the first replace function in the main loop
}
if ($jsonAsObject.$firstLevelName.description -ne $null) {
$jsonAsObject.$firstLevelName.description = $jsonAsObject.$firstLevelName.description.replace('&','&#38;').replace('“','&#8220;').replace('”','&#8221;').replace("'",'&#39;').replace('<','&#60;').replace('>','&#62;').replace('—','&#8212;')
$jsonAsObject.$firstLevelName.description = $jsonAsObject.$firstLevelName.description.replace('&#39;&#39;',"&#39;") # resolves the Double Apostrophe caused by the first replace function in the main loop
}
}
$jsonAsObject = $json | convertfrom-json

# Add 'WPFInstall' as a prefix to every entry-name in 'applications.json' file
if ($psitem.Name -eq "applications.json") {
for ($i = 0; $i -lt $firstLevelJsonList.Count; $i += 1) {
$appEntryName = $firstLevelJsonList[$i]
foreach ($appEntryName in $jsonAsObject.PSObject.Properties.Name) {
$appEntryContent = $jsonAsObject.$appEntryName
# Remove the entire app entry, so we could add it later with a different name
$jsonAsObject.PSObject.Properties.Remove($appEntryName)
# Add the app entry, but with a different name (WPFInstall + The App Entry Name)
$jsonAsObject | Add-Member -MemberType NoteProperty -Name "WPFInstall$appEntryName" -Value $appEntryContent
}
}
Expand All @@ -110,20 +86,7 @@ Get-ChildItem "$workingdir\config" | Where-Object {$psitem.extension -eq ".json"

$xaml = (Get-Content "$workingdir\xaml\inputXML.xaml").replace("'","''")

# Dot-source the Get-TabXaml function
. "$workingdir\functions\private\Get-TabXaml.ps1"

Update-Progress "Building: Xaml " 75
$appXamlContent = Get-TabXaml "applications" 5
$tweaksXamlContent = Get-TabXaml "tweaks"
$featuresXamlContent = Get-TabXaml "feature"


Update-Progress "Adding: Xaml " 90
# Replace the placeholder in $inputXML with the content of inputApp.xaml
$xaml = $xaml -replace "{{InstallPanel_applications}}", $appXamlContent
$xaml = $xaml -replace "{{InstallPanel_tweaks}}", $tweaksXamlContent
$xaml = $xaml -replace "{{InstallPanel_features}}", $featuresXamlContent

$script_content.Add($(Write-output "`$inputXML = '$xaml'"))

Expand Down
221 changes: 0 additions & 221 deletions functions/private/Get-TabXaml.ps1

This file was deleted.

Loading
Loading