Skip to content
This repository has been archived by the owner on Jun 2, 2023. It is now read-only.

Commit

Permalink
53X Again 44!
Browse files Browse the repository at this point in the history
  • Loading branch information
Taiizor authored and Taiizor committed Apr 16, 2021
1 parent 345e0e8 commit 7ca11d9
Show file tree
Hide file tree
Showing 17 changed files with 214 additions and 64 deletions.
Binary file modified .screenshots/Witcher_WF_CR.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/Witcher.WF/Notify/Standard/WF.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 31 additions & 23 deletions src/Witcher.WF/Notify/Standard/WF.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public partial class WitcherStandardWF : Form
private StateType Stage = StateType.Show;

private bool Exit = true;
private double Value = 0;
private double Value;

public WitcherStandardWF(Structs.Data Data)
{
Expand All @@ -42,6 +42,11 @@ public WitcherStandardWF(Structs.Data Data)
TEXT.Text = Local.Text;
TEXT.Font = Local.Font;

Width = Local.Size.Width;
Height = Local.Size.Height;

PANEL.Visible = Local.Close;

if (Local.Theme == ThemeType.Dark || Local.Theme == ThemeType.Light)
{
if (Local.Theme == ThemeType.Dark)
Expand Down Expand Up @@ -203,34 +208,37 @@ private void General_Tick(object sender, EventArgs e)
case StateType.Close:
if (Text == NotifyName + "0")
{
if (Local.Location == EdgeLocationType.BotRight || Local.Location == EdgeLocationType.TopRight || Local.Location == EdgeLocationType.RightCenter || Local.Location == EdgeLocationType.FullCenter)
if (Local.Close)
{
Value += PANEL.Width / (Local.Time / General.Interval);

if (PANEL.Width > Convert.ToInt32(Value))
{
BAR.Location = new(PANEL.Width - Convert.ToInt32(Value), 0);
BAR.Width = Convert.ToInt32(Value);
}
else
if (Local.Location == EdgeLocationType.BotRight || Local.Location == EdgeLocationType.TopRight || Local.Location == EdgeLocationType.RightCenter || Local.Location == EdgeLocationType.FullCenter)
{
BAR.Location = new(0, 0);
BAR.Width = PANEL.Width;
CLOSE_Click(sender, e);
}
}
else
{
Value += PANEL.Width / (Local.Time / General.Interval);
Value += PANEL.Width / (Local.Time / General.Interval);

if (PANEL.Width > Convert.ToInt32(Value))
{
BAR.Width = Convert.ToInt32(Value);
if (PANEL.Width > Convert.ToInt32(Value))
{
BAR.Location = new(PANEL.Width - Convert.ToInt32(Value), 0);
BAR.Width = Convert.ToInt32(Value);
}
else
{
BAR.Location = new(0, 0);
BAR.Width = PANEL.Width;
CLOSE_Click(sender, e);
}
}
else
{
BAR.Width = PANEL.Width;
CLOSE_Click(sender, e);
Value += PANEL.Width / (Local.Time / General.Interval);

if (PANEL.Width > Convert.ToInt32(Value))
{
BAR.Width = Convert.ToInt32(Value);
}
else
{
BAR.Width = PANEL.Width;
CLOSE_Click(sender, e);
}
}
}
}
Expand Down
30 changes: 14 additions & 16 deletions src/Witcher.WF/Notify/Standard/WF.resx
Original file line number Diff line number Diff line change
Expand Up @@ -117,27 +117,25 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="LEFT.Locked" type="System.Boolean, mscorlib">
<metadata name="LEFT.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="CLOSE.Locked" type="System.Boolean, mscorlib">
</metadata>
<metadata name="CLOSE.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="TEXT.Locked" type="System.Boolean, mscorlib">
</metadata>
<metadata name="TEXT.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="BAR.Locked" type="System.Boolean, mscorlib">
</metadata>
<metadata name="BAR.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="General.TrayLocation" type="System.Drawing.Point, System.Drawing">
</metadata>
<metadata name="General.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</data>
<data name="PANEL.Locked" type="System.Boolean, mscorlib">
</metadata>
<metadata name="PANEL.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.Locked" type="System.Boolean, mscorlib">
</metadata>
<metadata name="$this.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
</metadata>
</root>
12 changes: 12 additions & 0 deletions src/Witcher.WF/Struct/Structs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,23 @@ public struct Data
public string Title;
public string Text;
public Font Font;
public Size Size;
public bool Pause;
public bool Close;
public bool Top;
public int Time;
}

/// <summary>
///
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct Size
{
public int Width;
public int Height;
}

/// <summary>
///
/// </summary>
Expand Down
3 changes: 3 additions & 0 deletions src/Witcher.WF/Witcher.WF.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ public static void Show(Structs.Data Data)
case Enums.NotifyType.Standard:
Show(new WitcherStandardWF(Data));
break;
case Enums.NotifyType.Beautiful:
//Show(new WitcherBeautifulWF(Data));
break;
}
}
else
Expand Down
4 changes: 4 additions & 0 deletions src/Witcher.WF/Witcher.WF.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,8 @@ Changes are detailed at https://github.com/Soferity/Witcher/releases
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<Folder Include="Notify\Beautiful\" />
</ItemGroup>

</Project>
3 changes: 2 additions & 1 deletion src/Witcher.WPF/Notify/Standard/WPF.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Height="60" Width="400"
MinHeight="40" MinWidth="200"
Title="Witcher Standard WPF"
WindowStartupLocation="Manual"
ResizeMode="NoResize" WindowStyle="None"
Expand All @@ -17,7 +18,7 @@
<StackPanel Name="LEFT" Background="Crimson" Orientation="Horizontal" DockPanel.Dock="Left">
<Image x:Name="CLOSE" Width="26" Height="16" Source="/Witcher.WPF;component/Resources/Notify/Standard/Multiply.png" RenderOptions.BitmapScalingMode="Fant" Stretch="Uniform" Cursor="Hand" MouseEnter="CLOSE_MouseEnter" MouseLeave="CLOSE_MouseLeave" MouseLeftButtonUp="CLOSE_MouseLeftButtonUp"/>
</StackPanel>
<DockPanel HorizontalAlignment="Stretch">
<DockPanel HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Border Name="TOP" DockPanel.Dock="Top" Height="58">
<AccessText Name="TEXT" Foreground="Gainsboro" VerticalAlignment="Center" HorizontalAlignment="Center" FontFamily="Raleway SemiBold" FontSize="12" Text="My Name Is Soferity Witcher WPF Sweetheart!" TextTrimming="CharacterEllipsis" TextWrapping="WrapWithOverflow" LineStackingStrategy="BlockLineHeight"/>
</Border>
Expand Down
32 changes: 22 additions & 10 deletions src/Witcher.WPF/Notify/Standard/WPF.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public partial class WitcherStandardWPF : Window

private bool Exit = true;
private bool Enabled = true;
private double Value = 0;
private double Value;
private int Time = 50;

public WitcherStandardWPF(Structs.Data Data)
Expand All @@ -56,6 +56,15 @@ public WitcherStandardWPF(Structs.Data Data)
TEXT.FontStyle = Local.Font.Style;
TEXT.FontWeight = Local.Font.Weight;

Width = Local.Size.Width;
Height = Local.Size.Height;

if (!Local.Close)
{
TOP.Height += 2;
PANEL.Visibility = Visibility.Hidden;
}

if (Local.Theme == ThemeType.Dark || Local.Theme == ThemeType.Light)
{
if (Local.Theme == ThemeType.Dark)
Expand Down Expand Up @@ -250,16 +259,19 @@ private Task General_Tick()
case StateType.Close:
if (Title == NotifyName + "0")
{
Value += PANEL.ActualWidth / (Local.Time / Time);

if (PANEL.ActualWidth > Value)
if (Local.Close)
{
BAR.Width = Value;
}
else
{
BAR.Width = PANEL.Width;
CLOSE_MouseLeftButtonUp(null, null);
Value += PANEL.ActualWidth / (Local.Time / Time);

if (PANEL.ActualWidth > Value)
{
BAR.Width = Value;
}
else
{
BAR.Width = PANEL.Width;
CLOSE_MouseLeftButtonUp(null, null);
}
}
}
break;
Expand Down
12 changes: 12 additions & 0 deletions src/Witcher.WPF/Struct/Structs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,23 @@ public struct Data
public string Title;
public string Text;
public Font Font;
public Size Size;
public bool Pause;
public bool Close;
public bool Top;
public int Time;
}

/// <summary>
///
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct Size
{
public double Width;
public double Height;
}

/// <summary>
///
/// </summary>
Expand Down
4 changes: 4 additions & 0 deletions src/Witcher.WPF/Witcher.WPF.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,8 @@ Changes are detailed at https://github.com/Soferity/Witcher/releases
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<Folder Include="Notify\Beautiful\" />
</ItemGroup>

</Project>
12 changes: 10 additions & 2 deletions src/Witcher.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WPF", "WPF", "{188D1AD9-1AA
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Witcher_WPF_CR", "Witcher_WPF_CR\Witcher_WPF_CR.csproj", "{06647B67-C720-4DB1-92E9-DE559F4AD0A9}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Catcher", "Catcher", "{E0268EBA-276A-410F-8923-4EDB7FADF1F0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WF", "WF", "{0883B4DC-C35D-43D4-95F1-DAA5E1B31D96}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WPF", "WPF", "{19191630-9A04-4EE4-BE48-D155AAEC3AB1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -51,10 +57,12 @@ Global
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{29781EE5-4D9A-47BE-8C4A-3D79F69B0948} = {1EAD3DCD-AA7E-4645-B949-8D26184F2BA1}
{CE3B27D5-4416-4E0D-82D8-5E5C316AE974} = {F19BB245-AE13-48FE-9A76-A8B11AECCDA1}
{CE3B27D5-4416-4E0D-82D8-5E5C316AE974} = {0883B4DC-C35D-43D4-95F1-DAA5E1B31D96}
{2079D7B4-A998-4C78-8674-10E4330A027A} = {188D1AD9-1AAE-43CE-886F-E366C61FBEDE}
{A844967C-9F1A-4659-8D39-CCF79310FD09} = {F19BB245-AE13-48FE-9A76-A8B11AECCDA1}
{06647B67-C720-4DB1-92E9-DE559F4AD0A9} = {188D1AD9-1AAE-43CE-886F-E366C61FBEDE}
{06647B67-C720-4DB1-92E9-DE559F4AD0A9} = {19191630-9A04-4EE4-BE48-D155AAEC3AB1}
{0883B4DC-C35D-43D4-95F1-DAA5E1B31D96} = {E0268EBA-276A-410F-8923-4EDB7FADF1F0}
{19191630-9A04-4EE4-BE48-D155AAEC3AB1} = {E0268EBA-276A-410F-8923-4EDB7FADF1F0}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FE10105D-CE85-4315-A7F7-0BF056EFC5B7}
Expand Down
Loading

0 comments on commit 7ca11d9

Please sign in to comment.