Skip to content

Commit 14daa22

Browse files
committed
v2.5.2
1 parent 9a7936f commit 14daa22

20 files changed

+195
-58
lines changed

.vs/QuickLibrary/v16/.suo

-2.5 KB
Binary file not shown.
0 Bytes
Binary file not shown.
32 KB
Binary file not shown.
3.96 MB
Binary file not shown.

QuickLibrary/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("2.5.1")]
36-
[assembly: AssemblyFileVersion("2.5.1")]
35+
[assembly: AssemblyVersion("2.5.2")]
36+
[assembly: AssemblyFileVersion("2.5.2")]
3737
[assembly: NeutralResourcesLanguage("en")]

QuickLibrary/QlibContextMenu.cs

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
using System;
2+
using System.ComponentModel;
3+
using System.Drawing;
4+
using System.Windows.Forms;
5+
6+
namespace QuickLibrary
7+
{
8+
public class QlibContextMenuStrip : ContextMenuStrip
9+
{
10+
#region PRIVATE PROPS
11+
12+
private bool darkMode = false;
13+
14+
#endregion
15+
16+
#region HIDDEN PROPS
17+
18+
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
19+
public new Font Font { get { return base.Font; } set { } }
20+
21+
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
22+
public new Color ForeColor { get { return base.ForeColor; } set { } }
23+
24+
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
25+
public new Color BackColor { get { return base.BackColor; } set { } }
26+
27+
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
28+
public new Image BackgroundImage { get { return base.BackgroundImage; } set { } }
29+
30+
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
31+
public new ImageLayout BackgroundImageLayout { get { return base.BackgroundImageLayout; } set { } }
32+
33+
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
34+
public new RightToLeft RightToLeft { get { return base.RightToLeft; } set { } }
35+
36+
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
37+
public new string Text { get { return base.Text; } set { } }
38+
39+
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
40+
public new bool AllowDrop { get { return base.AllowDrop; } set { } }
41+
42+
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
43+
public new bool AutoSize { get { return base.AutoSize; } set { } }
44+
45+
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
46+
public new Padding Padding { get { return base.Padding; } set { } }
47+
48+
#endregion
49+
50+
#region PUBLIC PROPS
51+
52+
[Category("Qlib props"), Browsable(true), Description("Dark mode")]
53+
public bool DarkMode
54+
{
55+
get { return darkMode; }
56+
set { SetDarkMode(value); }
57+
}
58+
59+
#endregion
60+
61+
#region CONSTRUCTOR
62+
63+
public QlibContextMenuStrip(IContainer components) : base(components)
64+
{
65+
base.Font = ThemeMan.DefaultFont;
66+
base.ForeColor = Color.Black;
67+
base.BackColor = ThemeMan.LightSecondColor;
68+
base.BackgroundImage = null;
69+
base.BackgroundImageLayout = ImageLayout.Tile;
70+
base.RightToLeft = RightToLeft.No;
71+
base.Text = null;
72+
base.AllowDrop = false;
73+
base.AutoSize = true;
74+
base.Padding = new Padding(32, 2, 2, 2);
75+
}
76+
77+
#endregion
78+
79+
#region PRIVATE BODY
80+
81+
private void SetDarkMode(bool dark)
82+
{
83+
darkMode = dark;
84+
85+
if (dark)
86+
{
87+
base.BackColor = ThemeMan.DarkSecondColor;
88+
}
89+
else
90+
{
91+
base.BackColor = ThemeMan.LightSecondColor;
92+
}
93+
94+
foreach (var c in Items)
95+
{
96+
if (c.GetType() == typeof(ToolStripMenuItem))
97+
{
98+
if (dark)
99+
{
100+
(c as ToolStripMenuItem).BackColor = ThemeMan.DarkSecondColor;
101+
(c as ToolStripMenuItem).ForeColor = Color.White;
102+
(c as ToolStripMenuItem).DropDown.BackColor = ThemeMan.DarkSecondColor;
103+
(c as ToolStripMenuItem).DropDown.ForeColor = Color.White;
104+
}
105+
else
106+
{
107+
(c as ToolStripMenuItem).BackColor = ThemeMan.LightSecondColor;
108+
(c as ToolStripMenuItem).ForeColor = Color.Black;
109+
(c as ToolStripMenuItem).DropDown.BackColor = ThemeMan.LightSecondColor;
110+
(c as ToolStripMenuItem).DropDown.ForeColor = Color.Black;
111+
}
112+
}
113+
}
114+
115+
Renderer = new CustomToolStripSystemRenderer(dark);
116+
}
117+
118+
#endregion
119+
}
120+
}

QuickLibrary/QuickLibrary.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
<DesignTime>True</DesignTime>
7676
<DependentUpon>Resources.resx</DependentUpon>
7777
</Compile>
78-
<Compile Include="QlibContextMenu.cs">
78+
<Compile Include="QlibContextMenuStrip.cs">
7979
<SubType>Component</SubType>
8080
</Compile>
8181
<Compile Include="QlibListView.cs">

QuickLibrary/UpdateChecker.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ internal static void Init(string owner, string repo)
2626
CurrentVersion = version;
2727
}
2828

29-
internal static async Task<bool> CheckUpdate()
29+
internal static async Task<string> CheckUpdate()
3030
{
3131
var releases = await _releaseClient.GetAll(RepositoryOwner, RepostoryName);
3232
LatestRelease = releases[0];
@@ -45,25 +45,24 @@ internal static async Task<bool> CheckUpdate()
4545

4646
if (major > curMajor)
4747
{
48-
return true;
48+
return major + "." + minor + "." + patch;
4949
}
5050
else if (major == curMajor)
5151
{
5252
if (minor > curMinor)
5353
{
54-
return true;
54+
return major + "." + minor + "." + patch;
5555
}
5656
else if (minor == curMinor)
5757
{
5858
if (patch > curPatch)
5959
{
60-
return true;
60+
return major + "." + minor + "." + patch;
6161
}
6262
}
6363
}
6464
}
65-
66-
return false;
65+
return null;
6766
}
6867

6968
internal static async Task<string> RenderReleaseNotes()

QuickLibrary/UpdateForm.Designer.cs

Lines changed: 26 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)