1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-06-25 05:29:31 +00:00

Minor UI tweaks

- Show the full path in the tooltip for the two "recent project"
  buttons shown on the launch panel.
- Reset the app title bar and status bar contents when the project
  is closed.
This commit is contained in:
Andy McFadden 2019-12-07 13:55:11 -08:00
parent b8e092cede
commit 13f7ae4b70
3 changed files with 52 additions and 12 deletions

View File

@ -1350,6 +1350,8 @@ namespace SourceGen {
mGenerationLog = null;
UpdateTitle();
// Not necessary, but it lets us check the memory monitor to see if we got
// rid of everything.
GC.Collect();

View File

@ -585,21 +585,23 @@ limitations under the License.
Command="{StaticResource NewProjectCmd}"/>
<Button Content="Open existing project" Width="240" Height="50" Margin="10"
Command="{StaticResource OpenCmd}"/>
<Button Name="recentProjectButton1" Width="240" Height="50" Margin="10"
<Button Width="240" Height="50" Margin="10" Visibility="{Binding RecentProjectVisibility1}"
ToolTip="{Binding RecentProjectPath1}" ToolTipService.InitialShowDelay="1000"
Command="{DynamicResource RecentProjectCmd}" CommandParameter="0">
<Button.Content>
<StackPanel>
<TextBlock HorizontalAlignment="Center">Recent project #1</TextBlock>
<TextBlock Name="recentProjectName1" HorizontalAlignment="Center">???</TextBlock>
<TextBlock Text="{Binding RecentProjectName1, FallbackValue=RECENT 1}" HorizontalAlignment="Center"/>
</StackPanel>
</Button.Content>
</Button>
<Button Name="recentProjectButton2" Width="240" Height="50" Margin="10"
<Button Width="240" Height="50" Margin="10" Visibility="{Binding RecentProjectVisibility2}"
ToolTip="{Binding RecentProjectPath2}" ToolTipService.InitialShowDelay="1000"
Command="{DynamicResource RecentProjectCmd}" CommandParameter="1">
<Button.Content>
<StackPanel>
<TextBlock HorizontalAlignment="Center">Recent project #2</TextBlock>
<TextBlock Name="recentProjectName2" HorizontalAlignment="Center">???</TextBlock>
<TextBlock Text="{Binding RecentProjectName2, FallbackValue=RECENT 1}" HorizontalAlignment="Center"/>
</StackPanel>
</Button.Content>
</Button>

View File

@ -1436,22 +1436,58 @@ namespace SourceGen.WpfGui {
}
}
public Visibility RecentProjectVisibility1 {
get { return mRecentProjectVisibility1; }
set { mRecentProjectVisibility1 = value; OnPropertyChanged(); }
}
private Visibility mRecentProjectVisibility1;
public string RecentProjectName1 {
get { return mRecentProjectName1; }
set { mRecentProjectName1 = value; OnPropertyChanged(); }
}
private string mRecentProjectName1;
public string RecentProjectPath1 {
get { return mRecentProjectPath1; }
set { mRecentProjectPath1 = value; OnPropertyChanged(); }
}
private string mRecentProjectPath1;
public Visibility RecentProjectVisibility2 {
get { return mRecentProjectVisibility2; }
set { mRecentProjectVisibility2 = value; OnPropertyChanged(); }
}
private Visibility mRecentProjectVisibility2;
public string RecentProjectName2 {
get { return mRecentProjectName2; }
set { mRecentProjectName2 = value; OnPropertyChanged(); }
}
private string mRecentProjectName2;
public string RecentProjectPath2 {
get { return mRecentProjectPath2; }
set { mRecentProjectPath2 = value; OnPropertyChanged(); }
}
private string mRecentProjectPath2;
public void UpdateRecentLinks() {
List<string> pathList = mMainCtrl.RecentProjectPaths;
if (pathList.Count >= 1) {
recentProjectName1.Text = Path.GetFileName(pathList[0]);
recentProjectButton1.Visibility = Visibility.Visible;
RecentProjectPath1 = pathList[0];
RecentProjectName1 = Path.GetFileName(pathList[0]);
RecentProjectVisibility1 = Visibility.Visible;
} else {
recentProjectName1.Text = string.Empty;
recentProjectButton1.Visibility = Visibility.Collapsed;
RecentProjectVisibility1 = Visibility.Collapsed;
}
if (pathList.Count >= 2) {
recentProjectName2.Text = Path.GetFileName(pathList[1]);
recentProjectButton2.Visibility = Visibility.Visible;
RecentProjectPath2 = pathList[1];
RecentProjectName2 = Path.GetFileName(pathList[1]);
RecentProjectVisibility2 = Visibility.Visible;
} else {
recentProjectName2.Text = string.Empty;
recentProjectButton2.Visibility = Visibility.Collapsed;
RecentProjectVisibility2 = Visibility.Collapsed;
}
}