Skip to content

Commit

Permalink
Ironsides - Tooltips for the bar items (#3107)
Browse files Browse the repository at this point in the history
* Tooltips for the bar items

* PR updates
  • Loading branch information
timkur authored Jun 5, 2024
1 parent 0c4fb00 commit f7fbe96
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 15 deletions.
6 changes: 3 additions & 3 deletions tools/PI/DevHome.PI/BarWindowHorizontal.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<ColumnDefinition x:Name="RightPaddingColumn" Width="0"/>
</Grid.ColumnDefinitions>

<TextBlock x:Name="TitleTextBlock" Text="DevHome PI" FontSize="10" Margin="10,0,0,0" HorizontalAlignment="Left" Grid.Column="1" VerticalAlignment="Center"/>
<TextBlock x:Uid="Title" FontSize="10" Margin="10,0,0,0" HorizontalAlignment="Left" Grid.Column="1" VerticalAlignment="Center"/>
<StackPanel x:Name="ChromeButtonPanel" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0, 0, 10, 0" Background="Transparent" Grid.Column="1">
<Button
x:Uid="SnapButton"
Expand Down Expand Up @@ -65,15 +65,15 @@
</controls:ProcessSelectionButton>

<!-- Per App controls -->
<Image x:Name="AppIcon" HorizontalAlignment="Center" Source="{x:Bind _viewModel.ApplicationIcon, Mode=OneWay}" Margin="5" Height="20" Width="20" Visibility="{x:Bind _viewModel.AppBarVisibility, Mode=OneWay}"/>
<Image x:Name="AppIcon" HorizontalAlignment="Center" Source="{x:Bind _viewModel.ApplicationIcon, Mode=OneWay}" ToolTipService.ToolTip="{x:Bind _viewModel.ApplicationName, Mode=OneWay}" Margin="5" Height="20" Width="20" Visibility="{x:Bind _viewModel.AppBarVisibility, Mode=OneWay}"/>
<TextBlock x:Uid="AppPID" Text="{x:Bind _viewModel.ApplicationPid, Mode=OneWay}" FontFamily="Segoe UI" FontSize="10" Margin="5" VerticalAlignment="Center" Visibility="{x:Bind _viewModel.AppBarVisibility, Mode=OneWay}"/>
<TextBlock x:Uid="AppCPUUsage" Text="{x:Bind _viewModel.AppCpuUsage, Mode=OneWay}" FontFamily="Segoe UI" FontSize="10" Margin="5" VerticalAlignment="Center" Visibility="{x:Bind _viewModel.AppBarVisibility, Mode=OneWay}"/>

<!-- Per System controls -->
<Button x:Uid="SwitchLayoutButton" x:Name="SwitchLayoutButton" HorizontalAlignment="Center" Click="{x:Bind _viewModel.SwitchLayoutCommand}">
<TextBlock Text="&#xe8b4;"/>
</Button>
<Button x:Name="LargeContentButton" Click="{x:Bind _viewModel.ShowBigWindowCommand}" HorizontalAlignment="Center">
<Button x:Uid="SwitchToLargeLayoutButton" Click="{x:Bind _viewModel.ShowBigWindowCommand}" HorizontalAlignment="Center">
<TextBlock Text="&#xe8a1;"/>
</Button>

Expand Down
8 changes: 5 additions & 3 deletions tools/PI/DevHome.PI/BarWindowVertical.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,16 @@
<StackPanel x:Name="ChromeButtonPanelVertical" Orientation="Vertical" HorizontalAlignment="Center" Margin="0, 10" Grid.Row="0">
<TextBlock x:Name="GripTextBlock" Text="&#xe76f;&#xe76f;" FontSize="10" Margin="0" HorizontalAlignment="Center" FontFamily="Segoe Fluent Icons" PointerPressed="Window_PointerPressed" PointerMoved="Window_PointerMoved" PointerReleased="Window_PointerReleased"/>
<Button
x:Uid="SnapButton"
Margin="0,20, 0, 0"
Style="{StaticResource ChromeButton}"
HorizontalAlignment="Center"
IsEnabled="{x:Bind _viewModel.IsSnappingEnabled, Mode=OneWay}"
Click="{x:Bind _viewModel.PerformSnapCommand}" >
<TextBlock Text="{x:Bind _viewModel.CurrentSnapButtonText, Mode=OneWay}"/>
<TextBlock Text="{x:Bind _viewModel.CurrentSnapButtonText, Mode=OneWay}"/>
</Button>
<Button
x:Uid="VerticalCloseButton"
Style="{StaticResource ChromeButton}"
Click="CloseButton_Click"
HorizontalAlignment="Center"
Expand Down Expand Up @@ -68,15 +70,15 @@
</controls:ProcessSelectionButton>

<!-- Per App controls -->
<Image x:Name="AppIcon" HorizontalAlignment="Center" Source="{x:Bind _viewModel.ApplicationIcon, Mode=OneWay}" Margin="5" Height="20" Width="20" Visibility="{x:Bind _viewModel.AppBarVisibility, Mode=OneWay}"/>
<Image x:Name="AppIcon" HorizontalAlignment="Center" Source="{x:Bind _viewModel.ApplicationIcon, Mode=OneWay}" ToolTipService.ToolTip="{x:Bind _viewModel.ApplicationName, Mode=OneWay}" Margin="5" Height="20" Width="20" Visibility="{x:Bind _viewModel.AppBarVisibility, Mode=OneWay}"/>
<TextBlock x:Uid="AppPID" Text="{x:Bind _viewModel.ApplicationPid, Mode=OneWay}" FontFamily="Segoe UI" FontSize="10" Margin="5" HorizontalAlignment="Center" Visibility="{x:Bind _viewModel.AppBarVisibility, Mode=OneWay}"/>
<TextBlock x:Uid="AppCPUUsage" Text="{x:Bind _viewModel.AppCpuUsage, Mode=OneWay}" FontFamily="Segoe UI" FontSize="10" Margin="5" HorizontalAlignment="Center" Visibility="{x:Bind _viewModel.AppBarVisibility, Mode=OneWay}"/>

<!-- Per System controls -->
<Button x:Uid="SwitchLayoutButton" x:Name="SwitchLayoutButton" Click="{x:Bind _viewModel.SwitchLayoutCommand}" HorizontalAlignment="Center">
<TextBlock Text="&#xe8b4;"/>
</Button>
<Button x:Name="LargeContentButton" Click="{x:Bind _viewModel.ShowBigWindowCommand}" HorizontalAlignment="Center">
<Button x:Uid="SwitchToLargeLayoutButton" Click="{x:Bind _viewModel.ShowBigWindowCommand}" HorizontalAlignment="Center">
<TextBlock Text="&#xe8a1;"/>
</Button>

Expand Down
26 changes: 17 additions & 9 deletions tools/PI/DevHome.PI/Strings/en-us/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,6 @@
<value>Restore</value>
<comment>Tooltip for the restore button in the BarWindow</comment>
</data>
<data name="CloseAllMenuItem.Text" xml:space="preserve">
<value>End PI service</value>
<comment>The label for the close all menu item flyout. This will cause the program to terminate.</comment>
</data>
<data name="CloseAllMenuItem.ToolTipService.ToolTip" xml:space="preserve">
<value>Close the PI window and the service</value>
<comment>The tooltip for the close all menu item flyout. This will cause the program to terminate.</comment>
</data>
<data name="PinMenuItemText" xml:space="preserve">
<value>Pin</value>
<comment>A label for the menuitem to pin a tool on the bar.</comment>
Expand All @@ -153,7 +145,7 @@
<value>Dissociate so that PI is not tracking any app</value>
<comment>The tooltip for a button which causes PI to no longer track any app</comment>
</data>
<data name="LargeContentButton.ToolTipService.ToolTip" xml:space="preserve">
<data name="SwitchToLargeLayoutButton.ToolTipService.ToolTip" xml:space="preserve">
<value>Expand or collapse the large content panel</value>
<comment>The tooltip for a button which expands or collapses the large content panel.</comment>
</data>
Expand Down Expand Up @@ -905,4 +897,20 @@
<value>Invalid tool path or name</value>
<comment>Text for the message to show to the user when the supplied path or name is not valid.</comment>
</data>
<data name="ProcessChooserButton.ToolTipService.ToolTip" xml:space="preserve">
<value>Select a process to investigate</value>
<comment>Describes using a button in PI's UX to investigate another process running on the system</comment>
</data>
<data name="SnapButton.ToolTipService.ToolTip" xml:space="preserve">
<value>Attach the diagnostic bar to the target application</value>
<comment>Describes using a button in PI's UX</comment>
</data>
<data name="Title.Text" xml:space="preserve">
<value>Dev Home PI</value>
<comment>The product name</comment>
</data>
<data name="VerticalCloseButton.ToolTipService.ToolTip" xml:space="preserve">
<value>Close</value>
<comment>Describes a button that will close PI's window</comment>
</data>
</root>
5 changes: 5 additions & 0 deletions tools/PI/DevHome.PI/ViewModels/BarWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ public partial class BarWindowViewModel : ObservableObject
[ObservableProperty]
private Visibility _appBarVisibility = Visibility.Visible;

[ObservableProperty]
private string _applicationName = string.Empty;

[ObservableProperty]
private int _applicationPid;

Expand Down Expand Up @@ -85,6 +88,7 @@ public BarWindowViewModel()

if (process != null)
{
ApplicationName = process.ProcessName;
ApplicationPid = process.Id;
ApplicationIcon = TargetAppData.Instance.Icon;
}
Expand Down Expand Up @@ -186,6 +190,7 @@ private void TargetApp_PropertyChanged(object? sender, PropertyChangedEventArgs
if (process is not null)
{
ApplicationPid = process.Id;
ApplicationName = process.ProcessName;
}
});
}
Expand Down

0 comments on commit f7fbe96

Please sign in to comment.