This commit is contained in:
Ani 2024-11-05 21:26:53 +01:00
Родитель f93b9e8766
Коммит 50153b0cce
7 изменённых файлов: 105 добавлений и 8 удалений

Просмотреть файл

@ -173,11 +173,23 @@
Width="16"
Height="16"
Margin="8,0,0,0">
<PathIcon
x:Name="AIGlyph"
AutomationProperties.AccessibilityView="Raw"
Data="M128 766q0-42 24-77t65-48l178-57q32-11 61-30t52-42q50-50 71-114l58-179q13-40 48-65t78-26q42 0 77 24t50 65l58 177q21 66 72 117 49 50 117 72l176 58q43 14 69 48t26 80q0 41-25 76t-64 49l-178 58q-66 21-117 72-32 32-51 73t-33 84-26 83-30 73-45 51-71 20q-42 0-77-24t-49-65l-58-178q-8-25-19-47t-28-43q-34-43-77-68t-89-41-89-27-78-29-55-45-21-75zm1149 7q-76-29-145-53t-129-60-104-88-73-138l-57-176-67 176q-18 48-42 89t-60 78q-34 34-76 61t-89 43l-177 57q75 29 144 53t127 60 103 89 73 137l57 176 67-176q37-97 103-168t168-103l177-57zm-125 759q0-31 20-57t49-36l99-32q34-11 53-34t30-51 20-59 20-54 33-41 58-16q32 0 59 19t38 50q6 20 11 40t13 40 17 38 25 34q16 17 39 26t48 18 49 16 44 20 31 32 12 50q0 33-18 60t-51 38q-19 6-39 11t-41 13-39 17-34 25q-24 25-35 62t-24 73-35 61-68 25q-32 0-59-19t-38-50q-6-18-11-39t-13-41-17-40-24-33q-18-17-41-27t-47-17-49-15-43-20-30-33-12-54zm583 4q-43-13-74-30t-55-41-40-55-32-74q-12 41-29 72t-42 55-55 42-71 31q81 23 128 71t71 129q15-43 31-74t40-54 53-40 75-32z"
Foreground="{ThemeResource TextFillColorSecondaryBrush}" />
<StackPanel
Margin="0"
Padding="0"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<Image
x:Name="AIGlyphImage"
AutomationProperties.AccessibilityView="Raw"
Source="/Assets/AdvancedPaste/SemanticKernel.svg"
Visibility="{Binding DataContext.IsAdvancedAIEnabled, Mode=OneWay, RelativeSource={RelativeSource Mode=TemplatedParent}, Converter={StaticResource BoolToVisibilityConverter}}" />
<PathIcon
x:Name="AIGlyph"
AutomationProperties.AccessibilityView="Raw"
Data="M128 766q0-42 24-77t65-48l178-57q32-11 61-30t52-42q50-50 71-114l58-179q13-40 48-65t78-26q42 0 77 24t50 65l58 177q21 66 72 117 49 50 117 72l176 58q43 14 69 48t26 80q0 41-25 76t-64 49l-178 58q-66 21-117 72-32 32-51 73t-33 84-26 83-30 73-45 51-71 20q-42 0-77-24t-49-65l-58-178q-8-25-19-47t-28-43q-34-43-77-68t-89-41-89-27-78-29-55-45-21-75zm1149 7q-76-29-145-53t-129-60-104-88-73-138l-57-176-67 176q-18 48-42 89t-60 78q-34 34-76 61t-89 43l-177 57q75 29 144 53t127 60 103 89 73 137l57 176 67-176q37-97 103-168t168-103l177-57zm-125 759q0-31 20-57t49-36l99-32q34-11 53-34t30-51 20-59 20-54 33-41 58-16q32 0 59 19t38 50q6 20 11 40t13 40 17 38 25 34q16 17 39 26t48 18 49 16 44 20 31 32 12 50q0 33-18 60t-51 38q-19 6-39 11t-41 13-39 17-34 25q-24 25-35 62t-24 73-35 61-68 25q-32 0-59-19t-38-50q-6-18-11-39t-13-41-17-40-24-33q-18-17-41-27t-47-17-49-15-43-20-30-33-12-54zm583 4q-43-13-74-30t-55-41-40-55-32-74q-12 41-29 72t-42 55-55 42-71 31q81 23 128 71t71 129q15-43 31-74t40-54 53-40 75-32z"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
Visibility="{Binding DataContext.IsAdvancedAIEnabled, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BoolToInvertedVisibilityConverter}}" />
</StackPanel>
</Viewbox>
<ScrollViewer
x:Name="ContentElement"
@ -251,6 +263,9 @@
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="AIGlyph" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlForegroundDisabled}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="AIGlyphImage" Storyboard.TargetProperty="Opacity">
<DiscreteObjectKeyFrame KeyTime="0" Value="0.4" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="PlaceholderTextContentPresenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{Binding PlaceholderForeground, RelativeSource={RelativeSource TemplatedParent}, TargetNullValue={ThemeResource TextControlPlaceholderForegroundDisabled}}" />
</ObjectAnimationUsingKeyFrames>
@ -346,6 +361,7 @@
x:Name="InputTxtBox"
HorizontalAlignment="Stretch"
x:FieldModifier="public"
DataContext="{x:Bind ViewModel}"
IsEnabled="{x:Bind ViewModel.ClipboardHasData, Mode=OneWay}"
KeyDown="InputTxtBox_KeyDown"
PlaceholderText="{x:Bind ViewModel.InputTxtBoxPlaceholderText, Mode=OneWay}"

Просмотреть файл

@ -0,0 +1,77 @@
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_367_9162)">
<mask id="mask0_367_9162" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="4" y="0" width="32" height="40">
<path d="M34.1422 5.85786C32.285 4.00069 30.0802 2.5275 27.6537 1.52241C25.2272 0.517314 22.6265 0 20 0C17.3736 0 14.7729 0.517317 12.3463 1.52241C9.91984 2.52751 7.71505 4.0007 5.85788 5.85787L5.86186 5.86184C3.41152 8.31218 4.90113 14.0036 9.12168 20C4.90114 25.9964 3.41152 31.6878 5.86186 34.1382L5.85789 34.1421C7.71506 35.9993 9.91984 37.4725 12.3464 38.4776C14.7729 39.4827 17.3736 40 20 40C22.6265 40 25.2272 39.4827 27.6537 38.4776C30.0802 37.4725 32.285 35.9993 34.1422 34.1421L34.1382 34.1382C36.5885 31.6878 35.0989 25.9964 30.8784 20C35.0989 14.0036 36.5885 8.31218 34.1382 5.86184L34.1422 5.85786Z" fill="white"/>
</mask>
<g mask="url(#mask0_367_9162)">
<path d="M14.1091 14.1089C6.30083 21.9172 2.60841 30.8845 5.86186 34.1379C9.11531 37.3914 18.0826 33.699 25.8909 25.8907L14.1091 14.1089Z" fill="url(#paint0_linear_367_9162)"/>
<path d="M34.1384 5.86192C30.885 2.60847 21.9177 6.30089 14.1094 14.1092L25.8912 25.891C33.6995 18.0827 37.3919 9.11538 34.1384 5.86192Z" fill="url(#paint1_linear_367_9162)"/>
<g filter="url(#filter0_f_367_9162)">
<path d="M5.85815 34.1419C7.71533 35.9991 9.92011 37.4723 12.3466 38.4774C14.7731 39.4825 17.3739 39.9998 20.0003 39.9998C22.6267 39.9998 25.2275 39.4825 27.654 38.4774C30.0805 37.4723 32.2853 35.9991 34.1424 34.1419L34.1384 34.1379C37.3919 30.8845 33.6995 21.9172 25.8912 14.1089L20.0003 19.9998L25.8912 25.8907C18.0829 33.699 9.1156 37.3914 5.86214 34.1379L5.85815 34.1419Z" fill="url(#paint2_radial_367_9162)"/>
</g>
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.85795 34.1421C7.71512 35.9993 9.9199 37.4725 12.3464 38.4776C14.7729 39.4827 17.3736 40 20.0001 40C22.6265 40 25.2272 39.4827 27.6538 38.4776C30.0803 37.4725 32.285 35.9993 34.1422 34.1421L34.1381 34.1381C37.3916 30.8846 33.6992 21.9173 25.8909 14.109L19.9999 20L25.8907 25.8908C18.0826 33.6989 9.11545 37.3914 5.86184 34.1382L5.85795 34.1421Z" fill="url(#paint3_linear_367_9162)"/>
<g filter="url(#filter1_f_367_9162)">
<path d="M34.1426 5.85786C32.2855 4.00069 30.0807 2.5275 27.6542 1.52241C25.2277 0.517314 22.6269 0 20.0005 0C17.3741 0 14.7733 0.517317 12.3468 1.52241C9.92032 2.52751 7.71554 4.0007 5.85837 5.85787L5.86235 5.86184C2.6089 9.1153 6.30132 18.0826 14.1096 25.8909L20.0005 20L14.1096 14.1091C21.9179 6.30081 30.8852 2.60839 34.1387 5.86184L34.1426 5.85786Z" fill="url(#paint4_radial_367_9162)"/>
</g>
<path fill-rule="evenodd" clip-rule="evenodd" d="M34.1421 5.85786C32.2849 4.00069 30.0801 2.5275 27.6536 1.52241C25.2271 0.517314 22.6264 0 19.9999 0C17.3735 0 14.7728 0.517317 12.3462 1.52241C9.91973 2.52751 7.71495 4.0007 5.85778 5.85787L5.86186 5.86194C2.60841 9.1154 6.30083 18.0827 14.1091 25.891L20.0001 20L14.1093 14.1092C21.9174 6.30106 30.8845 2.60863 34.1382 5.86176L34.1421 5.85786Z" fill="url(#paint5_linear_367_9162)"/>
<g style="mix-blend-mode:soft-light">
<path d="M14.1089 25.8907C21.9172 33.699 30.8845 37.3914 34.1379 34.1379C37.3914 30.8845 33.699 21.9172 25.8907 14.1089L14.1089 25.8907Z" fill="url(#paint6_linear_367_9162)"/>
</g>
<path d="M25.9006 25.9006C22.6418 29.1594 17.3582 29.1594 14.0994 25.9006C10.8406 22.6418 10.8406 17.3582 14.0994 14.0994C17.3582 10.8406 22.6418 10.8406 25.9006 14.0994C29.1594 17.3582 29.1594 22.6418 25.9006 25.9006Z" fill="url(#paint7_linear_367_9162)"/>
</g>
</g>
<defs>
<filter id="filter0_f_367_9162" x="2.52482" y="10.7756" width="36.1291" height="32.5575" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
<feGaussianBlur stdDeviation="1.66667" result="effect1_foregroundBlur_367_9162"/>
</filter>
<filter id="filter1_f_367_9162" x="1.34684" y="-3.33333" width="36.1291" height="32.5575" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/>
<feGaussianBlur stdDeviation="1.66667" result="effect1_foregroundBlur_367_9162"/>
</filter>
<linearGradient id="paint0_linear_367_9162" x1="18.8419" y1="30.7993" x2="3.60163" y2="21.7903" gradientUnits="userSpaceOnUse">
<stop stop-color="#6B1796"/>
<stop offset="0.416496" stop-color="#801EAE"/>
<stop offset="1" stop-color="#8752E0"/>
</linearGradient>
<linearGradient id="paint1_linear_367_9162" x1="20.6693" y1="10.9795" x2="32.9172" y2="18.7501" gradientUnits="userSpaceOnUse">
<stop stop-color="#2253CE"/>
<stop offset="0.658143" stop-color="#4A94FC"/>
<stop offset="1" stop-color="#6BB0FF"/>
</linearGradient>
<radialGradient id="paint2_radial_367_9162" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(21.9518 29.1054) rotate(-42.6722) scale(12.3846 14.093)">
<stop stop-color="#3D0D59"/>
<stop offset="1" stop-color="#3D0D59" stop-opacity="0"/>
</radialGradient>
<linearGradient id="paint3_linear_367_9162" x1="33.2725" y1="22.0379" x2="14.9821" y2="41.1912" gradientUnits="userSpaceOnUse">
<stop stop-color="#94CBFF"/>
<stop offset="0.472215" stop-color="#C86FEC"/>
<stop offset="1" stop-color="#A931D8"/>
</linearGradient>
<radialGradient id="paint4_radial_367_9162" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(17.9684 10.8231) rotate(133.859) scale(12.6284 14.3704)">
<stop stop-color="#122882"/>
<stop offset="1" stop-color="#1536A2" stop-opacity="0"/>
</radialGradient>
<linearGradient id="paint5_linear_367_9162" x1="9.4207" y1="21.4734" x2="31.7214" y2="3.29818" gradientUnits="userSpaceOnUse">
<stop stop-color="#B74CE1"/>
<stop offset="0.186314" stop-color="#7D7DF2"/>
<stop offset="0.337341" stop-color="#4A94FC"/>
<stop offset="0.70621" stop-color="#3DCBFF"/>
<stop offset="1" stop-color="#ABEEFF"/>
</linearGradient>
<linearGradient id="paint6_linear_367_9162" x1="20.8506" y1="31.8657" x2="33.6827" y2="28.1385" gradientUnits="userSpaceOnUse">
<stop stop-color="#F7ADFA"/>
<stop offset="1" stop-color="#F7ADFA" stop-opacity="0"/>
</linearGradient>
<linearGradient id="paint7_linear_367_9162" x1="21.0788" y1="11.6553" x2="17.1128" y2="29.483" gradientUnits="userSpaceOnUse">
<stop stop-color="#122882"/>
<stop offset="0.517831" stop-color="#491D9F"/>
<stop offset="1" stop-color="#801EAE"/>
</linearGradient>
<clipPath id="clip0_367_9162">
<rect width="40" height="40" fill="white"/>
</clipPath>
</defs>
</svg>

После

Ширина:  |  Высота:  |  Размер: 6.5 KiB

Просмотреть файл

@ -83,7 +83,7 @@ public enum PasteFormats
[PasteFormatMetadata(
IsCoreAction = false,
IconGlyph = "\uEC4A",
IconGlyph = "\uE945",
RequiresAIService = true,
CanPreview = true,
SupportedClipboardFormats = ClipboardFormat.Text | ClipboardFormat.Html | ClipboardFormat.Audio | ClipboardFormat.Image,

Просмотреть файл

@ -79,7 +79,7 @@ public sealed class CustomActionKernelQueryCacheService : IKernelQueryCacheServi
}
else
{
Logger.LogWarning($"Ignoring persisted kernel query cache; version mismatch - actual: {persistedCache.Version}, expected:{Version}");
Logger.LogWarning($"Ignoring persisted kernel query cache; version mismatch - actual: {persistedCache.Version}, expected: {Version}");
return [];
}
}

Просмотреть файл

@ -75,6 +75,8 @@ namespace AdvancedPaste.ViewModels
public bool IsCustomAIAvailable => IsCustomAIServiceEnabled && ClipboardHasDataForCustomAI;
public bool IsAdvancedAIEnabled => IsCustomAIServiceEnabled && _userSettings.IsAdvancedAIEnabled;
public bool ClipboardHasData => AvailableClipboardFormats != ClipboardFormat.None;
public bool ClipboardHasDataForCustomAI => (AvailableClipboardFormats & PasteFormat.MetadataDict[CustomAIFormat].SupportedClipboardFormats) != ClipboardFormat.None;
@ -141,6 +143,7 @@ namespace AdvancedPaste.ViewModels
{
OnPropertyChanged(nameof(ClipboardHasDataForCustomAI));
OnPropertyChanged(nameof(IsCustomAIAvailable));
OnPropertyChanged(nameof(IsAdvancedAIEnabled));
EnqueueRefreshPasteFormats();
}
@ -242,6 +245,7 @@ namespace AdvancedPaste.ViewModels
OnPropertyChanged(nameof(InputTxtBoxPlaceholderText));
OnPropertyChanged(nameof(CustomAIUnavailableErrorText));
OnPropertyChanged(nameof(IsCustomAIServiceEnabled));
OnPropertyChanged(nameof(IsAdvancedAIEnabled));
OnPropertyChanged(nameof(IsCustomAIAvailable));
});
}

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.2 KiB

Просмотреть файл

@ -83,7 +83,7 @@
</tkcontrols:SettingsCard>
<tkcontrols:SettingsCard
x:Uid="AdvancedPaste_EnableAdvancedAI"
HeaderIcon="{ui:FontIcon Glyph=&#xEC4A;}"
HeaderIcon="{ui:BitmapIcon Source=/Assets/Settings/Icons/SemanticKernel.png}"
IsEnabled="{x:Bind ViewModel.IsOpenAIEnabled, Mode=OneWay}">
<ToggleSwitch IsOn="{x:Bind ViewModel.IsAdvancedAIEnabled, Mode=TwoWay}" />
</tkcontrols:SettingsCard>