Skip to content
This repository was archived by the owner on Aug 25, 2024. It is now read-only.

Commit 8960a02

Browse files
committed
preview layout, build with cake
1 parent 05801c3 commit 8960a02

File tree

12 files changed

+146
-52
lines changed

12 files changed

+146
-52
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.idea/
2+
.dist/
3+
.vscode/
24

35
## Ignore Visual Studio temporary files, build results, and
46
## files generated by popular Visual Studio add-ons.

src/Flow.Launcher.Plugin.ClipboardR.sln renamed to Flow.Launcher.Plugin.ClipboardR.sln

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 17
44
VisualStudioVersion = 17.5.33516.290
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClipboardR.Core", "ClipboardR.Core\ClipboardR.Core.csproj", "{EF6857EB-C12A-4361-920E-C739B17E88FC}"
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClipboardR.Core", "src\ClipboardR.Core\ClipboardR.Core.csproj", "{EF6857EB-C12A-4361-920E-C739B17E88FC}"
77
EndProject
8-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClipboardR", "ClipboardR\ClipboardR.csproj", "{9F9450B0-3E7A-4633-9B99-45CFF5C509F1}"
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClipboardR", "src\ClipboardR\ClipboardR.csproj", "{9F9450B0-3E7A-4633-9B99-45CFF5C509F1}"
99
EndProject
10-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClipboardR.Panels", "ClipboardR.Panels\ClipboardR.Panels.csproj", "{DB894ED7-0905-4CAF-A529-CCF27B3C9410}"
10+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClipboardR.Panels", "src\ClipboardR.Panels\ClipboardR.Panels.csproj", "{DB894ED7-0905-4CAF-A529-CCF27B3C9410}"
1111
EndProject
12-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClipboardR.Core.Test", "ClipboardR.Core.Test\ClipboardR.Core.Test.csproj", "{1D2F05B7-1520-4D05-9B2A-0628B29C13AE}"
12+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClipboardR.Core.Test", "src\ClipboardR.Core.Test\ClipboardR.Core.Test.csproj", "{1D2F05B7-1520-4D05-9B2A-0628B29C13AE}"
13+
EndProject
14+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Build", "build\Build.csproj", "{8AE1016A-11A6-4A6C-B5F4-97149923841C}"
1315
EndProject
1416
Global
1517
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -33,6 +35,10 @@ Global
3335
{1D2F05B7-1520-4D05-9B2A-0628B29C13AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
3436
{1D2F05B7-1520-4D05-9B2A-0628B29C13AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
3537
{1D2F05B7-1520-4D05-9B2A-0628B29C13AE}.Release|Any CPU.Build.0 = Release|Any CPU
38+
{8AE1016A-11A6-4A6C-B5F4-97149923841C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
39+
{8AE1016A-11A6-4A6C-B5F4-97149923841C}.Debug|Any CPU.Build.0 = Debug|Any CPU
40+
{8AE1016A-11A6-4A6C-B5F4-97149923841C}.Release|Any CPU.ActiveCfg = Release|Any CPU
41+
{8AE1016A-11A6-4A6C-B5F4-97149923841C}.Release|Any CPU.Build.0 = Release|Any CPU
3642
EndGlobalSection
3743
GlobalSection(SolutionProperties) = preSolution
3844
HideSolutionNode = FALSE

build.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dotnet run --project build/Build.csproj -- $args
2+
exit $LASTEXITCODE;

build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dotnet run --project ./build/Build.csproj -- "$@"

cake.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
; The configuration file for Cake.
2+
[NuGet]
3+
LoadDependencies=true
4+
5+
[Settings]
6+
ShowProcessCommandLine=true

src/ClipboardR.Core/Struct.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public struct ClipboardData : IEquatable<ClipboardData>
1414
public string PreviewImagePath;
1515
public SharpClipboard.ContentTypes Type;
1616
public int Score;
17+
public DateTime Time;
1718

1819
public bool Equals(ClipboardData b)
1920
{
@@ -22,8 +23,8 @@ public bool Equals(ClipboardData b)
2223

2324
public override int GetHashCode()
2425
{
25-
var hashcode = (Text?.GetHashCode() ?? 0) ^ (DisplayTitle?.GetHashCode() ?? 0) ^ (Data?.GetHashCode() ?? 0) ^
26-
(SenderApp?.GetHashCode() ?? 0) ^ Type.GetHashCode();
26+
var hashcode = (Text?.GetHashCode() ?? 0) ^ (DisplayTitle?.GetHashCode() ?? 0) ^
27+
(Data?.GetHashCode() ?? 0) ^ (SenderApp?.GetHashCode() ?? 0) ^ Type.GetHashCode();
2728
return hashcode;
2829
}
2930
}

src/ClipboardR.Panels/PreviewPanel.xaml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@
44
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
55
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
66
xmlns:local="clr-namespace:ClipboardR.Panels"
7-
mc:Ignorable="d"
8-
d:DesignHeight="400" d:DesignWidth="250">
9-
<Grid HorizontalAlignment="Center" VerticalAlignment="Center" MinWidth="250" MinHeight="200" MaxWidth="250"
10-
MaxHeight="400">
7+
mc:Ignorable="d">
8+
<Grid HorizontalAlignment="Center" VerticalAlignment="Center"
9+
MinWidth="250" MinHeight="200" MaxWidth="400" MaxHeight="600">
1110
<Grid.RowDefinitions>
1211
<RowDefinition Height="90*" />
1312
<RowDefinition Height="10*" />
@@ -16,23 +15,24 @@
1615
<ColumnDefinition Width="50*" />
1716
<ColumnDefinition Width="50*" />
1817
</Grid.ColumnDefinitions>
19-
<Image x:Name="PreImage" HorizontalAlignment="Center" Margin="5,5,5,5" VerticalAlignment="Center"
20-
Grid.ColumnSpan="2" Visibility="Hidden" Width="290" Height="260" MinWidth="200" MinHeight="200"
21-
MaxWidth="250" MaxHeight="280" />
18+
<Image x:Name="PreImage"
19+
HorizontalAlignment="Center" Margin="5,5,5,5" VerticalAlignment="Center"
20+
Grid.ColumnSpan="2" Visibility="Hidden" MinWidth="200" MinHeight="200"
21+
MaxWidth="400" MaxHeight="500" />
2222
<TextBox Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Grid.RowSpan="2"
2323
x:Name="TxtBoxPre" HorizontalAlignment="Center" TextWrapping="Wrap" VerticalAlignment="Top"
24-
Panel.ZIndex="1" FontSize="14" TextAlignment="Justify"
25-
Padding="5,5,5,5" MinWidth="200" MinHeight="200" MaxWidth="250" MaxHeight="264"
26-
ScrollViewer.HorizontalScrollBarVisibility="Auto" Focusable="True" VerticalScrollBarVisibility="Auto"
27-
Text="" GotFocus="TxtBoxPre_GotFocus"
28-
Margin="5,5,5,5" HorizontalContentAlignment="Stretch" TextChanged="TxtBoxPre_TextChanged" />
24+
Panel.ZIndex="1" FontSize="14" TextAlignment="Justify" Padding="5,5,5,5"
25+
MinWidth="200" MinHeight="200" MaxWidth="400" MaxHeight="500"
26+
ScrollViewer.HorizontalScrollBarVisibility="Auto" Focusable="True"
27+
VerticalScrollBarVisibility="Auto" Text="" GotFocus="TxtBoxPre_GotFocus"
28+
Margin="5,5,5,5" HorizontalContentAlignment="Stretch"
29+
TextChanged="TxtBoxPre_TextChanged" IsReadOnly="True" />
2930
<Button Grid.Column="0" Grid.Row="1"
3031
x:Name="BtnCopy" Content="Copy" HorizontalAlignment="Center" VerticalAlignment="Center"
31-
Width="NaN" Height="NaN" MinWidth="50" MinHeight="20" Margin="0,5,0,5" Click="BtnCopy_Click" />
32+
MinWidth="50" MinHeight="20" Margin="0,5,0,5" Click="BtnCopy_Click" />
3233
<Button Grid.Column="1" Grid.Row="1"
3334
x:Name="BtnDelete" Content="Delete" HorizontalAlignment="Center"
34-
VerticalAlignment="Center" Width="NaN" Height="NaN" MinWidth="50" MinHeight="20"
35+
VerticalAlignment="Center" MinWidth="50" MinHeight="20"
3536
Margin="0,5,0,5" Click="BtnDelete_Click" />
36-
3737
</Grid>
3838
</UserControl>

src/ClipboardR.Panels/PreviewPanel.xaml.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ private void BtnDelete_Click(object sender, System.Windows.RoutedEventArgs e)
7979

8080
private void TxtBoxPre_GotFocus(object sender, System.Windows.RoutedEventArgs e)
8181
{
82-
TxtBoxPre.SelectAll();
82+
TextBox tb = (TextBox)sender;
83+
tb.Dispatcher.BeginInvoke(new Action(() => tb.SelectAll()));
8384
}
8485

8586
private void TxtBoxPre_TextChanged(object sender, TextChangedEventArgs e)

src/ClipboardR/ClipboardR.csproj

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
32
<PropertyGroup>
43
<PackageId>ClipboardR</PackageId>
54
<Authors>Rainyl</Authors>
@@ -11,14 +10,17 @@
1110
<LangVersion>11</LangVersion>
1211
<Nullable>enable</Nullable>
1312
<TargetFramework>net7.0-windows</TargetFramework>
14-
<Version>0.1.1</Version>
13+
<Version>0.1.3</Version>
14+
<ReleaseOutputPath>./bin/Release</ReleaseOutputPath>
1515
</PropertyGroup>
1616

1717
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
1818
<DocumentationFile>bin\Release\Flow.Launcher.Plugin.ClipboardR.xml</DocumentationFile>
1919
<DebugType>none</DebugType>
2020
<DebugSymbols>False</DebugSymbols>
2121
<GenerateDocumentationFile>false</GenerateDocumentationFile>
22+
<PlatformTarget>x64</PlatformTarget>
23+
<OutputPath>$(ReleaseOutputPath)</OutputPath>
2224
</PropertyGroup>
2325

2426
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -29,17 +31,17 @@
2931
<Content Include="plugin.json">
3032
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
3133
</Content>
32-
</ItemGroup>
33-
34-
<ItemGroup>
3534
<Content Include="Images/clipboard.png">
3635
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
3736
</Content>
3837
</ItemGroup>
3938

4039
<ItemGroup>
41-
<PackageReference Include="Flow.Launcher.Plugin" Version="4.0.0" />
42-
<PackageReference Include="H.InputSimulator" Version="1.3.0" />
40+
<PackageReference Include="Flow.Launcher.Plugin" Version="4.0.0">
41+
<PrivateAssets>all</PrivateAssets>
42+
</PackageReference>
43+
<PackageReference Include="H.InputSimulator" Version="1.3.0">
44+
</PackageReference>
4345
<PackageReference Include="SharpClipboard" Version="3.5.2" />
4446
</ItemGroup>
4547

@@ -48,4 +50,13 @@
4850
<ProjectReference Include="..\ClipboardR.Panels\ClipboardR.Panels.csproj" />
4951
</ItemGroup>
5052

53+
<!-- <Target Name="CreateReleaseZip" AfterTargets="Publish">-->
54+
<!-- <PropertyGroup>-->
55+
<!-- <ZipOutputPath>$(ReleaseOutputPath)/../ZipFiles</ZipOutputPath>-->
56+
<!-- <PublishDir>$(ReleaseOutputPath)/net7.0-windows/publish/</PublishDir>-->
57+
<!-- </PropertyGroup>-->
58+
<!-- <MakeDir Directories="$(ZipOutputPath)" />-->
59+
<!-- <ZipDirectory DestinationFile="$(ZipOutputPath)\$(PackageId)-v$(Version).zip" SourceDirectory="$(PublishDir)" Overwrite="true" />-->
60+
<!-- </Target>-->
61+
5162
</Project>

src/ClipboardR/FodyWeavers.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
2+
<PropertyChanged />
3+
</Weavers>

0 commit comments

Comments
 (0)