Skip to content

Commit

Permalink
mainwindow: show tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
hariimurti committed Jan 18, 2021
1 parent 327f034 commit 766b3f3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
6 changes: 4 additions & 2 deletions ApkManager/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,12 @@
<ColumnDefinition Width="10" />
<ColumnDefinition Width="30"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text=". . . ." Name="txtAbi" VerticalAlignment="Center" Margin="0,0,10,0" />
<TextBlock Grid.Column="0" Text=". . . ." Name="txtAbi" TextTrimming="CharacterEllipsis"
VerticalAlignment="Center" Margin="0,0,10,0" />
<TextBlock Grid.Column="1" Text="SDK" VerticalAlignment="Center"/>
<TextBlock Grid.Column="2" Text=":" VerticalAlignment="Center"/>
<TextBlock Grid.Column="3" Text=". . . ." Name="txtSdk" VerticalAlignment="Center"/>
<TextBlock Grid.Column="3" Text=". . . ." Name="txtSdk" TextTrimming="CharacterEllipsis"
VerticalAlignment="Center"/>
</Grid>
</Grid>
</DockPanel>
Expand Down
23 changes: 14 additions & 9 deletions ApkManager/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,11 @@ private async void TxtPath_TextChanged(object sender, TextChangedEventArgs e)
if(!(sender is TextBox tb)) return;

txtLabel.Text = ". . . .";
txtLabel.ToolTip = null;
txtPackage.Text = ". . . .";
txtPackage.ToolTip = null;
txtVersion.Text = ". . . .";
txtVersion.ToolTip = null;
txtAbi.Text = ". . . .";
txtAbi.ToolTip = null;
txtSdk.Text = ". . . .";
Expand All @@ -130,27 +133,29 @@ private async void TxtPath_TextChanged(object sender, TextChangedEventArgs e)
if (aapt.Success)
{
loadedApk = aapt.Apk;

txtLabel.Text = loadedApk.Label;
txtLabel.ToolTip = txtLabel.Text;

txtPackage.Text = loadedApk.PackageName;
txtPackage.ToolTip = txtPackage.Text;

txtVersion.Text = string.Format("{0} ( {1} )", loadedApk.VersionName, loadedApk.VersionCode);
txtVersion.ToolTip = txtVersion.Text;

var foundOne = !loadedApk.AbiList.Contains(",");
txtAbi.Text = foundOne ? loadedApk.AbiList : "see list";
txtAbi.ToolTip = foundOne ? null : loadedApk.AbiList;
txtAbi.FontStyle = foundOne ? FontStyles.Normal : FontStyles.Italic;
txtAbi.Foreground = foundOne ? txtSdk.Foreground : Brushes.Blue;
txtAbi.Text = loadedApk.AbiList;
txtAbi.ToolTip = txtAbi.Text;

txtSdk.Text = loadedApk.SdkVersion.ToString();

imgIcon.Source = loadedApk.Icon;
gbAction.IsEnabled = true;
}
// file corrupt or error
else
{
txtLabel.Text = "file corrupt?";
txtPackage.Text = "not an apk file?";
txtVersion.Text = "???";
txtAbi.Text = "???";
txtSdk.Text = "???";
txtPackage.Text = "not an apk file? unusual file path?";
}

ShowLoading(false);
Expand Down

0 comments on commit 766b3f3

Please sign in to comment.