[Registry Preview] Removing Read Only (#25152)

* Removing Read Only

Based off the comments and how the app is being see in the early reports, this check box will just add confusion, so I've pulled it from the UX and screenshots.

* Update MainWindow.xaml

Fixing tab order
This commit is contained in:
Randy
2023-04-03 04:50:41 -07:00
committed by GitHub
parent 1fdf8cc9f8
commit bfe99a06f1
5 changed files with 3 additions and 62 deletions

View File

@@ -56,7 +56,6 @@ namespace RegistryPreview
}
// Save app settings
jsonSettings.SetNamedValue("checkBoxTextBox.Checked", JsonValue.CreateBooleanValue(checkBoxTextBox.IsChecked.Value));
SaveSettingsFile(settingsFolder, settingsFile);
}
@@ -68,12 +67,6 @@ namespace RegistryPreview
// static flag to track whether the Visual Tree is ready - if the main Grid has been loaded, the tree is ready.
visualTreeReady = true;
// Load and restore app settings
if (jsonSettings.ContainsKey("checkBoxTextBox.Checked"))
{
checkBoxTextBox.IsChecked = jsonSettings.GetNamedBoolean("checkBoxTextBox.Checked");
}
// Check to see if the REG file was opened and parsed successfully
if (OpenRegistryFile(App.AppFilename) == false)
{
@@ -354,33 +347,5 @@ namespace RegistryPreview
RefreshRegistryFile();
saveButton.IsEnabled = true;
}
/// <summary>
/// Readonly checkbox is checked, set textBox to read only; also update the font color so it has a hint of being "disabled" (also the hover state!)
/// </summary>
private void CheckBoxTextBox_Checked(object sender, RoutedEventArgs e)
{
textBox.IsReadOnly = true;
SolidColorBrush brush = new SolidColorBrush(Windows.UI.Color.FromArgb(255, 120, 120, 120)); // (SolidColorBrush)Application.Current.Resources["TextBoxDisabledForegroundThemeBrush"];
if (brush != null)
{
textBox.Foreground = brush;
textBox.Resources["TextControlForegroundPointerOver"] = brush;
}
}
/// <summary>
/// Readonly checkbox is unchecked, set textBox to be editable; also update the font color back to a theme friendly foreground (also the hover state!)
/// </summary>
private void CheckBoxTextBox_Unchecked(object sender, RoutedEventArgs e)
{
textBox.IsReadOnly = false;
SolidColorBrush brush = (SolidColorBrush)Application.Current.Resources["TextControlForeground"];
if (brush != null)
{
textBox.Foreground = brush;
textBox.Resources["TextControlForegroundPointerOver"] = brush;
}
}
}
}

View File

@@ -41,7 +41,6 @@
<RowDefinition Height="*" />
<RowDefinition Height="6" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid
@@ -147,7 +146,7 @@
Grid.Row="1"
Grid.RowSpan="3"
Grid.Column="0"
Margin="8,0,0,0"
Margin="8,0,0,8"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
AcceptsReturn="True"
@@ -164,26 +163,6 @@
TabIndex="0"
TextWrapping="NoWrap" />
<StackPanel
x:Name="stackPanelTextBox"
Grid.Row="4"
Grid.Column="0"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
IsTabStop="False">
<CheckBox
x:Name="checkBoxTextBox"
x:Uid="checkBoxTextBox"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Checked="CheckBoxTextBox_Checked"
Content="{Binding Content}"
IsChecked="True"
IsTabStop="True"
TabIndex="1"
Unchecked="CheckBoxTextBox_Unchecked" />
</StackPanel>
<Grid
Grid.Row="1"
Grid.Column="2"
@@ -206,7 +185,7 @@
ScrollViewer.HorizontalScrollMode="Enabled"
ScrollViewer.VerticalScrollBarVisibility="Visible"
ScrollViewer.VerticalScrollMode="Auto"
TabIndex="2">
TabIndex="1">
<TreeView.ItemTemplate>
<DataTemplate>
<StackPanel
@@ -245,7 +224,7 @@
ItemsSource="{x:Bind listRegistryValues}"
RowDetailsVisibilityMode="Collapsed"
SelectionMode="Single"
TabIndex="3">
TabIndex="2">
<controls:DataGrid.Columns>
<controls:DataGridTemplateColumn
x:Uid="NameColumn"

View File

@@ -117,9 +117,6 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="checkBoxTextBox.Content" xml:space="preserve">
<value>Read only</value>
</data>
<data name="EditButton.Label" xml:space="preserve">
<value>Edit file...</value>
</data>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 425 KiB

After

Width:  |  Height:  |  Size: 999 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 84 KiB