diff --git a/MainWindow.xaml b/MainWindow.xaml
index a323987..f1c7c67 100644
--- a/MainWindow.xaml
+++ b/MainWindow.xaml
@@ -233,6 +233,67 @@
+
+
@@ -280,33 +341,34 @@
HorizontalAlignment="Left"
Margin="14,14,0,0"
x:Name="Logo" />
-
-
+
+
-
+
+
+
+
+
diff --git a/UserControls/ComputerInformation.xaml b/UserControls/ComputerInformation.xaml
index a478bf0..f5278cb 100644
--- a/UserControls/ComputerInformation.xaml
+++ b/UserControls/ComputerInformation.xaml
@@ -47,6 +47,7 @@
+
+
+
+
+
+
+
+
+
-
-
@@ -83,20 +137,15 @@
-
-
-
-
-
diff --git a/UserControls/ComputerInformation.xaml.cs b/UserControls/ComputerInformation.xaml.cs
index c91dd9a..20db5ed 100644
--- a/UserControls/ComputerInformation.xaml.cs
+++ b/UserControls/ComputerInformation.xaml.cs
@@ -148,24 +148,50 @@ namespace C4IT_CustomerPanel.UserControls
RemoteHost = Environment.GetEnvironmentVariable("ClientName2");
#endif
TxtHostname.Text = RemoteHost;
- if (string.IsNullOrEmpty(RemoteHost))
- CanvasHostname.Visibility = Visibility.Collapsed;
+ CanvasHostname.Visibility = string.IsNullOrEmpty(RemoteHost)
+ ? Visibility.Collapsed
+ : Visibility.Visible;
TxtUsername.Text = Environment.UserDomainName + "\\" + Environment.UserName;
TxtIpaddress.Text = InformationHelper.GetIp4Address(MainWindow.MainInstance.ConfigSettings.ShowIpInfoOnlyInCorporateNetwork);
DriveInfo[] dInfo = InformationHelper.GetDrives();
TxtLastreboot.Text = InformationHelper.GetLastReboot().ToString(CultureInfo.CurrentUICulture);
+ StPaDrives.Children.Clear();
+ StPaDrives2.Children.Clear();
+
+ int fixedDriveCount = 0;
+ foreach (DriveInfo drive in dInfo)
+ {
+ if (drive.DriveType == DriveType.Fixed)
+ fixedDriveCount++;
+ }
+
+ int cardsPerRow = fixedDriveCount <= 1 ? 1 : 2;
+ double availableDriveWidth = StPaDrives.Width > 0 ? StPaDrives.Width : 334;
+ double driveCardWidth = Math.Max(120, (availableDriveWidth / cardsPerRow) - 4);
+
int k = 0;
foreach (DriveInfo drive in dInfo)
{
if ((drive.DriveType == DriveType.Fixed))
{
- Grid gri = new Grid { HorizontalAlignment = HorizontalAlignment.Center };
- Label lb = new Label { HorizontalAlignment = HorizontalAlignment.Center };
+ Grid gri = new Grid
+ {
+ HorizontalAlignment = HorizontalAlignment.Stretch,
+ Width = driveCardWidth
+ };
+ Label lb = new Label
+ {
+ HorizontalAlignment = HorizontalAlignment.Stretch,
+ HorizontalContentAlignment = HorizontalAlignment.Center,
+ FontSize = 11,
+ Padding = new Thickness(2, 0, 2, 0)
+ };
StackPanel sp = new StackPanel
{
- HorizontalAlignment = HorizontalAlignment.Center,
- Margin = new Thickness(10, 0, 0, 0)
+ HorizontalAlignment = HorizontalAlignment.Left,
+ Margin = new Thickness((k % cardsPerRow) == 0 ? 0 : 8, 0, 0, 0),
+ Width = driveCardWidth
};
var pbg = new CustomProgressBar
{
@@ -174,10 +200,8 @@ namespace C4IT_CustomerPanel.UserControls
lb.Content = drive.Name + " - " + InformationHelper.FormatBytes(drive.TotalSize - drive.TotalFreeSpace, false) + " / " + InformationHelper.FormatBytes(drive.TotalSize, true);
lb.ToolTip = lb.Content;
lb.ClipToBounds = true;
- sp.Width = StPaDrives.Width / dInfo.Length;
- pbg.Width = sp.Width;
+ pbg.Width = driveCardWidth;
pbg.Height = 20;
- sp.HorizontalAlignment = HorizontalAlignment.Center;
sp.Orientation = Orientation.Vertical;
gri.Children.Add(pbg);
pbg.ProgressValue = (int)((drive.TotalSize - drive.TotalFreeSpace) * 100 / drive.TotalSize);
@@ -194,11 +218,7 @@ namespace C4IT_CustomerPanel.UserControls
k++;
}
}
- if (k <= 1)
- {
- // StPaDrives2.Height = 0;
- // BtnRemoteSupport.Margin = new Thickness(0, -35, 0, 0);
- }
+ StPaDrives2.Visibility = k > 2 ? Visibility.Visible : Visibility.Collapsed;
}
catch (Exception)
{
diff --git a/UserControls/IncidentListItem.xaml b/UserControls/IncidentListItem.xaml
index fd75b06..71f6325 100644
--- a/UserControls/IncidentListItem.xaml
+++ b/UserControls/IncidentListItem.xaml
@@ -35,7 +35,24 @@
-
+
+
+
+
+