From 3205fe13193361953c1d4e23d754d64aa4482b75 Mon Sep 17 00:00:00 2001 From: Meni Kadosh Date: Tue, 9 Jan 2024 23:00:16 +0200 Subject: [PATCH] - allowing ucList horizontal scroll bar - fitting usLict item and description to list width - allowing to see ucList Item extra info also if width is large - allowing more item in list by shorten the margin between list items - shorten summary execution page width and heigth --- .../AutomatePageLib/ExecutionSummaryPage.xaml | 2 +- .../AutomatePageLib/NewAutomatePage.xaml | 4 +- .../Skins/GingerDefaultSkinDictionary.xaml | 2 +- .../UCListView/UcListView.xaml | 2 +- .../UCListView/UcListViewItem.xaml | 74 ++++++++++++------- .../UCListView/UcListViewItem.xaml.cs | 27 ++++++- 6 files changed, 78 insertions(+), 33 deletions(-) diff --git a/Ginger/Ginger/AutomatePageLib/ExecutionSummaryPage.xaml b/Ginger/Ginger/AutomatePageLib/ExecutionSummaryPage.xaml index b11be015bf..2068c01431 100644 --- a/Ginger/Ginger/AutomatePageLib/ExecutionSummaryPage.xaml +++ b/Ginger/Ginger/AutomatePageLib/ExecutionSummaryPage.xaml @@ -3,7 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf" x:Class="Ginger.BusinessFlowWindows.ExecutionSummaryPage" - Height="800" Width="1000"> + Height="600" Width="600"> diff --git a/Ginger/Ginger/AutomatePageLib/NewAutomatePage.xaml b/Ginger/Ginger/AutomatePageLib/NewAutomatePage.xaml index d76a95b83b..462d9a4c96 100644 --- a/Ginger/Ginger/AutomatePageLib/NewAutomatePage.xaml +++ b/Ginger/Ginger/AutomatePageLib/NewAutomatePage.xaml @@ -318,7 +318,7 @@ - + @@ -327,7 +327,7 @@ - + diff --git a/Ginger/Ginger/Dictionaries/Skins/GingerDefaultSkinDictionary.xaml b/Ginger/Ginger/Dictionaries/Skins/GingerDefaultSkinDictionary.xaml index 1234e8e59a..f70b33082c 100644 --- a/Ginger/Ginger/Dictionaries/Skins/GingerDefaultSkinDictionary.xaml +++ b/Ginger/Ginger/Dictionaries/Skins/GingerDefaultSkinDictionary.xaml @@ -1574,7 +1574,7 @@ - - + + + + + + + + + + + + @@ -132,7 +156,7 @@ - + diff --git a/Ginger/Ginger/UserControlsLib/UCListView/UcListViewItem.xaml.cs b/Ginger/Ginger/UserControlsLib/UCListView/UcListViewItem.xaml.cs index 859003dea4..8f357adb44 100644 --- a/Ginger/Ginger/UserControlsLib/UCListView/UcListViewItem.xaml.cs +++ b/Ginger/Ginger/UserControlsLib/UCListView/UcListViewItem.xaml.cs @@ -697,7 +697,12 @@ private void SetItemFullName() { try { + AlignGridandTextWidth(); + xDetailsGrid.SizeChanged -= XDetailsGrid_SizeChanged; + xDetailsGrid.SizeChanged += XDetailsGrid_SizeChanged; xItemNameTxtBlock.Text = string.Empty; + xItemExtraInfoTxtBlock.Text = string.Empty; + xItemExtraInfoTxtBlock.Visibility = Visibility.Collapsed; string fullname = string.Empty; if (!string.IsNullOrEmpty(mItemNameField)) { @@ -709,7 +714,6 @@ private void SetItemFullName() FontSize = 15, Text = name.ToString() }); - fullname += name; } } @@ -718,7 +722,8 @@ private void SetItemFullName() bool isMandatory = (bool)Item.GetType().GetProperty(mItemMandatoryField).GetValue(Item); if (isMandatory) { - xItemNameTxtBlock.Inlines.Add(new System.Windows.Documents.Run + xItemExtraInfoTxtBlock.Visibility = Visibility.Visible; + xItemExtraInfoTxtBlock.Inlines.Add(new System.Windows.Documents.Run { FontSize = 18, Text = "*", @@ -733,7 +738,8 @@ private void SetItemFullName() Object extension = Item.GetType().GetProperty(mItemNameExtentionField).GetValue(Item); if (extension != null) { - xItemNameTxtBlock.Inlines.Add(new System.Windows.Documents.Run + xItemExtraInfoTxtBlock.Visibility = Visibility.Visible; + xItemExtraInfoTxtBlock.Inlines.Add(new System.Windows.Documents.Run { FontSize = 11, Text = string.Format(" [{0}]", extension.ToString()) @@ -744,6 +750,7 @@ private void SetItemFullName() } xItemNameTxtBlock.ToolTip = fullname; + xItemExtraInfoTxtBlock.ToolTip = fullname; } catch (Exception ex) { @@ -753,6 +760,20 @@ private void SetItemFullName() }); } + private void AlignGridandTextWidth() + { + if (xItemNameColumn.ActualWidth > 200) + { + xItemNameTxtBlock.MaxWidth = xItemNameColumn.ActualWidth - 100; + xItemDescriptionTxtBlock.MaxWidth = xItemNameTxtBlock.MaxWidth; + } + } + + private void XDetailsGrid_SizeChanged(object sender, SizeChangedEventArgs e) + { + AlignGridandTextWidth(); + } + private void SetItemDescription() { this.Dispatcher.Invoke(() =>