mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2026-08-10 01:51:18 +10:00
Fix search bar overflowing behind icon buttons at narrow window sizes (#4831)
* fix(search): make search bar stretch instead of overflowing at narrow window sizes * fix(ui): sync runtime MinWidth override with XAML value Add_Loaded was hardcoding $sync.Form.MinWidth back to 1000 after load, overriding the 1150 set in inputXML.xaml and letting the window shrink below the space the search bar/toolbar layout needs. * fix(ui): address responsive search review feedback * fix(ui): enforce usable toolbar width --------- Co-authored-by: Chris Titus <contact@christitus.com>
This commit is contained in:
+4
-1
@@ -285,6 +285,7 @@ $sync["Form"].Add_ContentRendered({
|
||||
# Extract screen width and height for the primary monitor
|
||||
$screenWidth = $primaryScreen.Bounds.Width
|
||||
$screenHeight = $primaryScreen.Bounds.Height
|
||||
$sync.Form.MinWidth = [Math]::Min([double]$sync.Form.MinWidth, [double]$screenWidth)
|
||||
|
||||
# Compare with the primary monitor size
|
||||
if ($sync.Form.ActualWidth -gt $screenWidth -or $sync.Form.ActualHeight -gt $screenHeight) {
|
||||
@@ -353,8 +354,10 @@ $searchBarTimer.add_Tick({
|
||||
$sync["SearchBar"].Add_TextChanged({
|
||||
if ($sync.SearchBar.Text -ne "") {
|
||||
$sync.SearchBarClearButton.Visibility = "Visible"
|
||||
$sync.SearchBarIcon.Visibility = "Collapsed"
|
||||
} else {
|
||||
$sync.SearchBarClearButton.Visibility = "Collapsed"
|
||||
$sync.SearchBarIcon.Visibility = "Visible"
|
||||
}
|
||||
if ($searchBarTimer.IsEnabled) {
|
||||
$searchBarTimer.Stop()
|
||||
@@ -365,7 +368,7 @@ $sync["SearchBar"].Add_TextChanged({
|
||||
$sync["Form"].Add_Loaded({
|
||||
param($e)
|
||||
$null = $e
|
||||
$sync.Form.MinWidth = "1000"
|
||||
$sync.Form.MinWidth = "1150"
|
||||
$sync["Form"].MaxWidth = [Double]::PositiveInfinity
|
||||
$sync["Form"].MaxHeight = [Double]::PositiveInfinity
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user