Skip to content

Commit

Permalink
Fixed flabbet's requests
Browse files Browse the repository at this point in the history
  • Loading branch information
CPKreu committed May 5, 2023
1 parent 88efb07 commit 8b57dde
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 6 deletions.
3 changes: 3 additions & 0 deletions src/PixiEditor/Data/Localization/Languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,9 @@
"IMPORT_AS_REFERENCE_LAYER": "Import as reference layer",
"NAVIGATOR_PICK_ACTION_DISPLAY": "Right-click to pick color, Shift-right-click to copy color to clipboard",

"OPEN_FILE_FROM_CLIPBOARD": "Open from clipboard",
"OPEN_FILE_FROM_CLIPBOARD_DESCRIPTIVE": "Open from clipboard",

"OPEN_LOCALIZATION_DEBUG_WINDOW": "Open Localization Debug Window",
"FORCE_OTHER_FLOW_DIRECTION": "Force other flow direction",
"API_KEY": "API Key",
Expand Down
2 changes: 1 addition & 1 deletion src/PixiEditor/Styles/Titlebar.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid x:Name="LayoutRoot" Background="Transparent" Width="44" Height="35">
<TextBlock x:Name="txt" Text="{TemplateBinding Content}" FontFamily="{DynamicResource NativeIconFont}"
<TextBlock x:Name="txt" Text="{TemplateBinding Content}" FontFamily="Segoe MDL2 Assets"
Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"
RenderOptions.ClearTypeHint="Auto" TextOptions.TextRenderingMode="Aliased"
TextOptions.TextFormattingMode="Display" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ public Color PickColor(VecD pos, DocumentScope scope, bool includeReference, boo
return ColorHelpers.BlendColors(referenceColor, canvasColor);
}

byte referenceAlpha = canvasColor.A == 0 ? referenceColor.A : (byte)(referenceColor.A * 0.6f);
byte referenceAlpha = canvasColor.A == 0 ? referenceColor.A : (byte)(referenceColor.A * ReferenceLayerViewModel.TopMostOpacity);

referenceColor = new Color(referenceColor.R, referenceColor.G, referenceColor.B, referenceAlpha);
return ColorHelpers.BlendColors(canvasColor, referenceColor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ internal class ReferenceLayerViewModel : INotifyPropertyChanged
private readonly DocumentViewModel doc;
private readonly DocumentInternalParts internals;
public event PropertyChangedEventHandler PropertyChanged;

public const float TopMostOpacity = 0.6f;

public WriteableBitmap? ReferenceBitmap { get; private set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public void OpenFromOpenFileDialog()
OpenFromPath(dialog.FileName);
}

[Command.Basic("PixiEditor.File.OpenFileFromClipboard", "Open from clipboard", "Open from clipboard", CanExecute = "PixiEditor.Clipboard.HasImageInClipboard")]
[Command.Basic("PixiEditor.File.OpenFileFromClipboard", "OPEN_FILE_FROM_CLIPBOARD", "OPEN_FILE_FROM_CLIPBOARD_DESCRIPTIVE", CanExecute = "PixiEditor.Clipboard.HasImageInClipboard")]
public void OpenFromClipboard()
{
var images = ClipboardController.GetImagesFromClipboard();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ private void SelectedToolChanged(object sender, SelectedToolEventArgs e)
if (e.NewTool == this && PixelPerfectEnabled)
{
var toolbar = (BasicToolbar)Toolbar;
var setting = (SizeSetting)toolbar.Settings[0];
var setting = (SizeSetting)toolbar.Settings.First(x => x.Name == "ToolSize");
setting.Value = 1;
}

Expand Down
2 changes: 1 addition & 1 deletion src/PixiEditor/Views/Dialogs/HelloTherePopup.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@
<Button Command="{Binding DataContext.OpenInExplorerCommand, RelativeSource={RelativeSource AncestorType=uc:AlignableWrapPanel}}"
CommandParameter="{Binding FilePath}"
ToolTip="Open in File Explorer">
<TextBlock Text="&#xEC50;" FontFamily="{DynamicResource NativeIconFont}"
<TextBlock Text="&#xEC50;" FontFamily="Segoe MDL2 Assets"
TextAlignment="Center" FontSize="18"/>
</Button>
<Button Command="{cmds:Command Name=PixiEditor.File.RemoveRecent, UseProvided=True}"
Expand Down
3 changes: 2 additions & 1 deletion src/PixiEditor/Views/UserControls/Viewport.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
xmlns:cmds="clr-namespace:PixiEditor.Models.Commands.XAML"
xmlns:tools ="clr-namespace:PixiEditor.ViewModels.SubViewModels.Tools.Tools"
xmlns:views="clr-namespace:PixiEditor.Views"
xmlns:subviews="clr-namespace:PixiEditor.ViewModels.SubViewModels.Document"
mc:Ignorable="d"
x:Name="vpUc"
d:DesignHeight="450"
Expand Down Expand Up @@ -152,7 +153,7 @@
Visibility="{Binding Source={vm:ToolVM ColorPickerToolViewModel}, Path=PickFromReferenceLayer, Converter={converters:BoolToVisibilityConverter}}"
ZIndex="{Binding Document.ReferenceLayerViewModel.ShowHighest, Converter={converters:BoolToIntConverter}}"
IsHitTestVisible="{Binding Document.ReferenceLayerViewModel.IsTransforming}"
Opacity="{Binding Document.ReferenceLayerViewModel.ShowHighest, Converter={converters:BoolToValueConverter FalseValue=1.0, TrueValue=0.6}}">
Opacity="{Binding Document.ReferenceLayerViewModel.ShowHighest, Converter={converters:BoolToValueConverter FalseValue=1.0, TrueValue={x:Static subviews:ReferenceLayerViewModel.TopMostOpacity}}}">
<Image
Focusable="False"
Width="{Binding Document.ReferenceLayerViewModel.ReferenceBitmap.Width}"
Expand Down

0 comments on commit 8b57dde

Please sign in to comment.