-
Notifications
You must be signed in to change notification settings - Fork 337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ironsides - Tooltips for the bar items #3107
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,14 +29,16 @@ | |
<StackPanel x:Name="ChromeButtonPanelVertical" Orientation="Vertical" HorizontalAlignment="Center" Margin="0, 10" Grid.Row="0"> | ||
<TextBlock x:Name="GripTextBlock" Text="" 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" | ||
|
@@ -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}"/> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please put each property on their own line. #WontFix There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just my 2cents... obvious consistency is important, but my vote would be to have all the properties on one line. When I'm trying to see how all of my controls fit into a layout on the page, having a line per control is more readable (to me) than having a single control take up a quarter of the page. I think this borders on personal preference though... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to add another two cents🙂... generally, we put everything on one line when it's short enough to fit and split when it's not. Personally, I find that easier to read in an IDE, but I also think splitting long lines makes it easier to review on GitHub. I'm fine with the wontfix, just wanted to add a little context. |
||
<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=""/> | ||
</Button> | ||
<Button x:Name="LargeContentButton" Click="{x:Bind _viewModel.ShowBigWindowCommand}" HorizontalAlignment="Center"> | ||
<Button x:Name="LargeContentButton" x:Uid="LargeContentButton" Click="{x:Bind _viewModel.ShowBigWindowCommand}" HorizontalAlignment="Center"> | ||
<TextBlock Text=""/> | ||
</Button> | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,9 @@ public partial class BarWindowViewModel : ObservableObject | |
[ObservableProperty] | ||
private Visibility _appBarVisibility = Visibility.Visible; | ||
|
||
[ObservableProperty] | ||
private string? _applicationName; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NIT: remove There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok. Seems to fit the pattern better for the rest of the file. I'm guessing a tooltip of null is different than a tooltip of "", but in theory the user won't have access to the tooltip of an app if we're not attached to an app. |
||
|
||
[ObservableProperty] | ||
private int _applicationPid; | ||
|
||
|
@@ -85,6 +88,7 @@ public BarWindowViewModel() | |
|
||
if (process != null) | ||
{ | ||
ApplicationName = process.ProcessName; | ||
ApplicationPid = process.Id; | ||
ApplicationIcon = TargetAppData.Instance.Icon; | ||
} | ||
|
@@ -186,6 +190,7 @@ private void TargetApp_PropertyChanged(object? sender, PropertyChangedEventArgs | |
if (process is not null) | ||
{ | ||
ApplicationPid = process.Id; | ||
ApplicationName = process.ProcessName; | ||
} | ||
}); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: a more descriptive Id. "LargeContentButton" is ambiguous. #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point.