mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-04-01 17:12:09 +00:00
* initial visual implementation - remove idiotic border logic from Invoke-WPFUIElements - add "application" type & style - add "radiobutton" type & style - remove prefer choco checkbox (did not modify logic outside of xaml, so i currently get errors due to that) * add image support via choco db - add image support via choco db - backup image should be taken from unigetui db - backup backup image is some random package one rn * add compatibility for every app * performance improvements - move get logo to runspace (not working rn) - readd choco checkbox to mute errors * add border name * fix scrollviewer & reimplement logo logic into ui elements * noimage fix * add notes * cleanup & remove nav from search effects * add button action * rename buttons * add sort by options * move scrollviewer & app buttons into uielements logic * format logic for app action buttons * fix app action button logic & move get & clear to sidepanel * change category of new buttons * add virtualisation & layouting fixes - commented out prefer choco logic - add virtualisation - layouting improvements * fix radiobuttons * LETS GOOO (#12) * Add Selected Apps Label, Reshuffel the nesting of the checkbox and the label to be able to reference the name from the actual checkbox * Add visual selection and allow click on the whole app section * Fix Theme definition to work with theme change * Fix Highlight on if label or icon is clicked * change applications.json to powershell object list and refactor UI Creation logic * Optimization and Add Collapsable Categories * Add Button functionality for install, uninstall, info, install selected, uninstall selected, clear and implement search * Rest application.json to Main * Reset Compile to main * Pretty much revamp_apps but without changes to applications.json * Small fixes * Add Get-Installed Loading Indicator + small fixes * Re-Add Choco Preference * Remove Logic from Invoke-WPFUIElements that is Moved to Invoke-WPFUIApps * Remove Alphabetical List, Sort Apps inside Category Alphabetically * Small fixes to the Get-Installed function and formatting stuff * Style for Hidden Checkbox but visible Content * Hotfix for Category Expansion during search * Replace Category Label with ToggleButton, Fix Search Bugs * First Try at implementing a Compact Mode for the App page * Fix Whitespace when using Search * Keep the search status when switching between compact and full view * Fix weird buggy behaviour in regards to switching the Display Mode and using Show-SelectedOnly * Improve Togglebutton - add initial implementation of togglebutton style - add togglebuttons to appnavigation.json - refractor UI element creation for Togglebutton - commit preprocessing changes * Togglebutton fixes - move dot to the right in style - cleanup code - fix arrangement of content * Add logic to the new ToggleButtons in the sidebar of the install tab and remove old buttons * reorder buttons & fix Togglebutton toggling if action not possible - reorder getinstalled and clearselection - set togglebutton back if no app is selected * Slight modificatoin to togglebutton style & fix sidebar width * Add hover effect for the app tiles * ToggleButtonStyle animation - add hover animation to white dot - remove IsPressed trigger - improve some comments * disable show selected filter on clear selection * Add a Popup Dropdown for Selected Apps with the ability to deselect them * Split up the functions to seperate files like the rest of the repo * Fix Bug where Scrollviewer dosnt work * disable autofallback checkbox * run preprocessing * remove installation scope - remove all 3 radiobuttons from appnavigation.json * remove scrollviewer from WPFUIElements * toggle showselected on GetInstalled * remove unused autofallback --------- Co-authored-by: Martin Wiethan <47688561+Marterich@users.noreply.github.com> Co-authored-by: Chris Titus <contact@christitus.com>
90 lines
3.9 KiB
PowerShell
90 lines
3.9 KiB
PowerShell
function Initialize-InstallHeader {
|
|
<#
|
|
.SYNOPSIS
|
|
Creates the Multi Selection Header Elements on the Install Tab
|
|
Used to as part of the Install Tab UI generation
|
|
.PARAMETER TargetElement
|
|
The Parent Element into which the Header should be placed
|
|
#>
|
|
param($TargetElement)
|
|
function New-WPFButton {
|
|
param (
|
|
[string]$Name,
|
|
[string]$Content
|
|
)
|
|
$button = New-Object Windows.Controls.Button
|
|
$button.Name = $Name
|
|
$button.Content = $Content
|
|
$button.Margin = New-Object Windows.Thickness(2)
|
|
$button.HorizontalAlignment = "Stretch"
|
|
return $button
|
|
}
|
|
|
|
$wrapPanelTop = New-Object Windows.Controls.WrapPanel
|
|
$wrapPanelTop.SetResourceReference([Windows.Controls.Control]::BackgroundProperty, "MainBackgroundColor")
|
|
$wrapPanelTop.HorizontalAlignment = "Left"
|
|
$wrapPanelTop.VerticalAlignment = "Top"
|
|
$wrapPanelTop.Orientation = "Horizontal"
|
|
$wrapPanelTop.SetResourceReference([Windows.Controls.Control]::MarginProperty, "TabContentMargin")
|
|
$buttonConfigs = @(
|
|
@{Name="WPFInstall"; Content="Install/Upgrade Selected"},
|
|
@{Name="WPFInstallUpgrade"; Content="Upgrade All"},
|
|
@{Name="WPFUninstall"; Content="Uninstall Selected"}
|
|
)
|
|
|
|
foreach ($config in $buttonConfigs) {
|
|
$button = New-WPFButton -Name $config.Name -Content $config.Content
|
|
$null = $wrapPanelTop.Children.Add($button)
|
|
$sync[$config.Name] = $button
|
|
}
|
|
|
|
$selectedAppsButton = New-Object Windows.Controls.Button
|
|
$selectedAppsButton.Name = "WPFselectedAppsButton"
|
|
$selectedAppsButton.Content = "Selected Apps: 0"
|
|
$selectedAppsButton.SetResourceReference([Windows.Controls.Control]::FontSizeProperty, "FontSizeHeading")
|
|
$selectedAppsButton.SetResourceReference([Windows.Controls.Control]::MarginProperty, "TabContentMargin")
|
|
$selectedAppsButton.SetResourceReference([Windows.Controls.Control]::ForegroundProperty, "MainForegroundColor")
|
|
$selectedAppsButton.HorizontalAlignment = "Center"
|
|
$selectedAppsButton.VerticalAlignment = "Center"
|
|
|
|
$selectedAppsPopup = New-Object Windows.Controls.Primitives.Popup
|
|
$selectedAppsPopup.IsOpen = $false
|
|
$selectedAppsPopup.PlacementTarget = $selectedAppsButton
|
|
$selectedAppsPopup.Placement = [System.Windows.Controls.Primitives.PlacementMode]::Bottom
|
|
$selectedAppsPopup.AllowsTransparency = $true
|
|
|
|
$selectedAppsBorder = New-Object Windows.Controls.Border
|
|
$selectedAppsBorder.SetResourceReference([Windows.Controls.Control]::BackgroundProperty, "MainBackgroundColor")
|
|
$selectedAppsBorder.SetResourceReference([Windows.Controls.Control]::BorderBrushProperty, "MainForegroundColor")
|
|
$selectedAppsBorder.SetResourceReference([Windows.Controls.Control]::BorderThicknessProperty, "ButtonBorderThickness")
|
|
$selectedAppsBorder.Width = 200
|
|
$selectedAppsBorder.Padding = 5
|
|
$selectedAppsPopup.Child = $selectedAppsBorder
|
|
$sync.selectedAppsPopup = $selectedAppsPopup
|
|
|
|
$sync.selectedAppsstackPanel = New-Object Windows.Controls.StackPanel
|
|
$selectedAppsBorder.Child = $sync.selectedAppsstackPanel
|
|
|
|
# Toggle selectedAppsPopup open/close with button
|
|
$selectedAppsButton.Add_Click({
|
|
$sync.selectedAppsPopup.IsOpen = -not $sync.selectedAppsPopup.IsOpen
|
|
})
|
|
# Close selectedAppsPopup when mouse leaves both button and selectedAppsPopup
|
|
$selectedAppsButton.Add_MouseLeave({
|
|
if (-not $sync.selectedAppsPopup.IsMouseOver) {
|
|
$sync.selectedAppsPopup.IsOpen = $false
|
|
}
|
|
})
|
|
$selectedAppsPopup.Add_MouseLeave({
|
|
if (-not $selectedAppsButton.IsMouseOver) {
|
|
$sync.selectedAppsPopup.IsOpen = $false
|
|
}
|
|
})
|
|
|
|
$null = $wrapPanelTop.Children.Add($selectedAppsButton)
|
|
$sync.$($selectedAppsButton.Name) = $selectedAppsButton
|
|
|
|
[Windows.Controls.DockPanel]::SetDock($wrapPanelTop, [Windows.Controls.Dock]::Top)
|
|
$null = $TargetElement.Children.Add($wrapPanelTop)
|
|
}
|