mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 04:37:30 +02:00
This reverts commit 1b6b446915.
<!-- Enter a brief description/summary of your PR here. What does it
fix/what does it change/how was it tested (even manually, if necessary)?
-->
## Summary of the Pull Request
Reverting this PR because WinUI 3 doesn’t support drag operations when
running as admin.
<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
- [ ] Closes: #xxx
<!-- - [ ] Closes: #yyy (add separate lines for additional resolved
issues) -->
- [ ] **Communication:** I've discussed this with core contributors
already. If the work hasn't been agreed, this work might be rejected
- [ ] **Tests:** Added/updated and all pass
- [ ] **Localization:** All end-user-facing strings can be localized
- [ ] **Dev docs:** Added/updated
- [ ] **New binaries:** Added on the required places
- [ ] [JSON for
signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json)
for new binaries
- [ ] [WXS for
installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs)
for new binaries and localization folder
- [ ] [YML for CI
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml)
for new test projects
- [ ] [YML for signed
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml)
- [ ] **Documentation updated:** If checked, please file a pull request
on [our docs
repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys)
and link it here: #xxx
<!-- Provide a more detailed description of the PR, other things fixed,
or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments
<!-- Describe how you validated the behavior. Add automated tests
wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
This commit is contained in:
@@ -466,39 +466,27 @@
|
|||||||
TextChanged="EditVariableDialogValueTxtBox_TextChanged"
|
TextChanged="EditVariableDialogValueTxtBox_TextChanged"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
<MenuFlyoutSeparator Visibility="{Binding ShowAsList, Converter={StaticResource BoolToVisibilityConverter}}" />
|
<MenuFlyoutSeparator Visibility="{Binding ShowAsList, Converter={StaticResource BoolToVisibilityConverter}}" />
|
||||||
<ListView
|
<ItemsControl
|
||||||
x:Name="EditVariableValuesList"
|
x:Name="EditVariableValuesList"
|
||||||
Margin="0,-8,0,12"
|
Margin="0,-8,0,12"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
AllowDrop="True"
|
|
||||||
CanDragItems="True"
|
|
||||||
CanReorderItems="True"
|
|
||||||
DragItemsCompleted="EditVariableValuesList_DragItemsCompleted"
|
|
||||||
ItemsSource="{Binding ValuesList, Mode=TwoWay}"
|
ItemsSource="{Binding ValuesList, Mode=TwoWay}"
|
||||||
Visibility="{Binding ShowAsList, Converter={StaticResource BoolToVisibilityConverter}}">
|
Visibility="{Binding ShowAsList, Converter={StaticResource BoolToVisibilityConverter}}">
|
||||||
<ListView.ItemTemplate>
|
<ItemsControl.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="32" />
|
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
<ColumnDefinition Width="40" />
|
<ColumnDefinition Width="40" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<FontIcon
|
|
||||||
Grid.Column="0"
|
|
||||||
Margin="0,0,8,0"
|
|
||||||
FontSize="16"
|
|
||||||
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
|
||||||
Glyph="" />
|
|
||||||
<TextBox
|
<TextBox
|
||||||
Grid.Column="1"
|
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
BorderBrush="Transparent"
|
BorderBrush="Transparent"
|
||||||
LostFocus="EditVariableValuesListTextBox_LostFocus"
|
LostFocus="EditVariableValuesListTextBox_LostFocus"
|
||||||
Text="{Binding Text}" />
|
Text="{Binding Text}" />
|
||||||
<Button
|
<Button
|
||||||
x:Uid="More_Options_Button"
|
x:Uid="More_Options_Button"
|
||||||
Grid.Column="2"
|
Grid.Column="1"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Content=""
|
Content=""
|
||||||
FontFamily="{ThemeResource SymbolThemeFontFamily}"
|
FontFamily="{ThemeResource SymbolThemeFontFamily}"
|
||||||
@@ -535,8 +523,8 @@
|
|||||||
</Button>
|
</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ListView.ItemTemplate>
|
</ItemsControl.ItemTemplate>
|
||||||
</ListView>
|
</ItemsControl>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</ContentDialog>
|
</ContentDialog>
|
||||||
|
|||||||
@@ -16,8 +16,6 @@ namespace EnvironmentVariablesUILib
|
|||||||
{
|
{
|
||||||
public sealed partial class EnvironmentVariablesMainPage : Page
|
public sealed partial class EnvironmentVariablesMainPage : Page
|
||||||
{
|
{
|
||||||
private const string ValueListSeparator = ";";
|
|
||||||
|
|
||||||
private sealed class RelayCommandParameter
|
private sealed class RelayCommandParameter
|
||||||
{
|
{
|
||||||
public RelayCommandParameter(Variable variable, VariablesSet set)
|
public RelayCommandParameter(Variable variable, VariablesSet set)
|
||||||
@@ -442,7 +440,7 @@ namespace EnvironmentVariablesUILib
|
|||||||
variable.ValuesList.Move(index, index - 1);
|
variable.ValuesList.Move(index, index - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
var newValues = string.Join(ValueListSeparator, variable.ValuesList?.Select(x => x.Text).ToArray());
|
var newValues = string.Join(";", variable.ValuesList?.Select(x => x.Text).ToArray());
|
||||||
EditVariableDialogValueTxtBox.Text = newValues;
|
EditVariableDialogValueTxtBox.Text = newValues;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -463,7 +461,7 @@ namespace EnvironmentVariablesUILib
|
|||||||
variable.ValuesList.Move(index, index + 1);
|
variable.ValuesList.Move(index, index + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
var newValues = string.Join(ValueListSeparator, variable.ValuesList?.Select(x => x.Text).ToArray());
|
var newValues = string.Join(";", variable.ValuesList?.Select(x => x.Text).ToArray());
|
||||||
EditVariableDialogValueTxtBox.Text = newValues;
|
EditVariableDialogValueTxtBox.Text = newValues;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -478,7 +476,7 @@ namespace EnvironmentVariablesUILib
|
|||||||
var variable = EditVariableDialog.DataContext as Variable;
|
var variable = EditVariableDialog.DataContext as Variable;
|
||||||
variable.ValuesList.Remove(listItem);
|
variable.ValuesList.Remove(listItem);
|
||||||
|
|
||||||
var newValues = string.Join(ValueListSeparator, variable.ValuesList?.Select(x => x.Text).ToArray());
|
var newValues = string.Join(";", variable.ValuesList?.Select(x => x.Text).ToArray());
|
||||||
EditVariableDialogValueTxtBox.Text = newValues;
|
EditVariableDialogValueTxtBox.Text = newValues;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -494,7 +492,7 @@ namespace EnvironmentVariablesUILib
|
|||||||
var index = variable.ValuesList.IndexOf(listItem);
|
var index = variable.ValuesList.IndexOf(listItem);
|
||||||
variable.ValuesList.Insert(index, new Variable.ValuesListItem { Text = string.Empty });
|
variable.ValuesList.Insert(index, new Variable.ValuesListItem { Text = string.Empty });
|
||||||
|
|
||||||
var newValues = string.Join(ValueListSeparator, variable.ValuesList?.Select(x => x.Text).ToArray());
|
var newValues = string.Join(";", variable.ValuesList?.Select(x => x.Text).ToArray());
|
||||||
EditVariableDialogValueTxtBox.TextChanged -= EditVariableDialogValueTxtBox_TextChanged;
|
EditVariableDialogValueTxtBox.TextChanged -= EditVariableDialogValueTxtBox_TextChanged;
|
||||||
EditVariableDialogValueTxtBox.Text = newValues;
|
EditVariableDialogValueTxtBox.Text = newValues;
|
||||||
EditVariableDialogValueTxtBox.TextChanged += EditVariableDialogValueTxtBox_TextChanged;
|
EditVariableDialogValueTxtBox.TextChanged += EditVariableDialogValueTxtBox_TextChanged;
|
||||||
@@ -512,7 +510,7 @@ namespace EnvironmentVariablesUILib
|
|||||||
var index = variable.ValuesList.IndexOf(listItem);
|
var index = variable.ValuesList.IndexOf(listItem);
|
||||||
variable.ValuesList.Insert(index + 1, new Variable.ValuesListItem { Text = string.Empty });
|
variable.ValuesList.Insert(index + 1, new Variable.ValuesListItem { Text = string.Empty });
|
||||||
|
|
||||||
var newValues = string.Join(ValueListSeparator, variable.ValuesList?.Select(x => x.Text).ToArray());
|
var newValues = string.Join(";", variable.ValuesList?.Select(x => x.Text).ToArray());
|
||||||
EditVariableDialogValueTxtBox.TextChanged -= EditVariableDialogValueTxtBox_TextChanged;
|
EditVariableDialogValueTxtBox.TextChanged -= EditVariableDialogValueTxtBox_TextChanged;
|
||||||
EditVariableDialogValueTxtBox.Text = newValues;
|
EditVariableDialogValueTxtBox.Text = newValues;
|
||||||
EditVariableDialogValueTxtBox.TextChanged += EditVariableDialogValueTxtBox_TextChanged;
|
EditVariableDialogValueTxtBox.TextChanged += EditVariableDialogValueTxtBox_TextChanged;
|
||||||
@@ -534,7 +532,7 @@ namespace EnvironmentVariablesUILib
|
|||||||
listItem.Text = (sender as TextBox)?.Text;
|
listItem.Text = (sender as TextBox)?.Text;
|
||||||
var variable = EditVariableDialog.DataContext as Variable;
|
var variable = EditVariableDialog.DataContext as Variable;
|
||||||
|
|
||||||
var newValues = string.Join(ValueListSeparator, variable.ValuesList?.Select(x => x.Text).ToArray());
|
var newValues = string.Join(";", variable.ValuesList?.Select(x => x.Text).ToArray());
|
||||||
EditVariableDialogValueTxtBox.TextChanged -= EditVariableDialogValueTxtBox_TextChanged;
|
EditVariableDialogValueTxtBox.TextChanged -= EditVariableDialogValueTxtBox_TextChanged;
|
||||||
EditVariableDialogValueTxtBox.Text = newValues;
|
EditVariableDialogValueTxtBox.Text = newValues;
|
||||||
EditVariableDialogValueTxtBox.TextChanged += EditVariableDialogValueTxtBox_TextChanged;
|
EditVariableDialogValueTxtBox.TextChanged += EditVariableDialogValueTxtBox_TextChanged;
|
||||||
@@ -550,16 +548,5 @@ namespace EnvironmentVariablesUILib
|
|||||||
CancelAddVariable();
|
CancelAddVariable();
|
||||||
ConfirmAddVariableBtn.IsEnabled = false;
|
ConfirmAddVariableBtn.IsEnabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void EditVariableValuesList_DragItemsCompleted(ListViewBase sender, DragItemsCompletedEventArgs args)
|
|
||||||
{
|
|
||||||
if (EditVariableDialog.DataContext is Variable variable && variable.ValuesList != null)
|
|
||||||
{
|
|
||||||
var newValues = string.Join(ValueListSeparator, variable.ValuesList.Select(x => x.Text));
|
|
||||||
EditVariableDialogValueTxtBox.TextChanged -= EditVariableDialogValueTxtBox_TextChanged;
|
|
||||||
EditVariableDialogValueTxtBox.Text = newValues;
|
|
||||||
EditVariableDialogValueTxtBox.TextChanged += EditVariableDialogValueTxtBox_TextChanged;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user