Improve UI
This commit is contained in:
parent
961805272d
commit
e5209fb459
|
@ -58,11 +58,24 @@ namespace Filtration.ViewModels
|
|||
get
|
||||
{
|
||||
string[] commentLines = ItemFilterCommentBlock.Comment.Split(new[] { Environment.NewLine }, StringSplitOptions.None);
|
||||
if (commentLines[0].StartsWith(@"============") || commentLines[0].StartsWith(@"------------"))
|
||||
var titleOffset = 1;
|
||||
if (commentLines.Length > 1 && (commentLines[0].StartsWith(@"============") || commentLines[0].StartsWith(@"------------")))
|
||||
{
|
||||
titleOffset = 3;
|
||||
commentLines[0] = commentLines[1];
|
||||
}
|
||||
return commentLines[0].TrimStart(' ');
|
||||
|
||||
commentLines[0] = commentLines[0].TrimStart(' ');
|
||||
if (commentLines[0].Length > 80)
|
||||
{
|
||||
commentLines[0] = commentLines[0].Substring(0, 80) + " (...)";
|
||||
}
|
||||
else if (commentLines.Length > titleOffset)
|
||||
{
|
||||
commentLines[0] = commentLines[0] + " (...)";
|
||||
}
|
||||
|
||||
return commentLines[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -28,6 +28,9 @@ namespace Filtration.ViewModels.ToolPanes
|
|||
icon.UriSource = new Uri("pack://application:,,,/Filtration;component/Resources/Icons/block_group_browser_icon.png");
|
||||
icon.EndInit();
|
||||
IconSource = icon;
|
||||
|
||||
IsVisible = false;
|
||||
|
||||
Messenger.Default.Register<NotificationMessage<bool>>(this, message =>
|
||||
{
|
||||
switch (message.Notification)
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
</ListBox.Resources>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate DataType="viewModels:ItemFilterCommentBlockViewModel">
|
||||
<TextBlock Text="{Binding Comment, Converter={StaticResource HashSignRemovalConverter}}" ToolTip="{Binding Comment}" />
|
||||
<TextBlock Text="{Binding Header, Converter={StaticResource HashSignRemovalConverter}}" ToolTip="{Binding Comment}" />
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
|
Loading…
Reference in New Issue