Skip to content

Commit d467e93

Browse files
committed
SourceControl high dpi improvements and defaults updated...
1 parent 5b62b92 commit d467e93

File tree

7 files changed

+20
-12
lines changed

7 files changed

+20
-12
lines changed

External/Plugins/SourceControl/Actions/ProjectWatcher.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using System.Drawing;
1010
using System.Reflection;
1111
using PluginCore.Localization;
12+
using PluginCore.Helpers;
1213

1314
namespace SourceControl.Actions
1415
{
@@ -37,11 +38,11 @@ public static void Init()
3738
try
3839
{
3940
Assembly assembly = Assembly.GetExecutingAssembly();
40-
Skin = new Bitmap(assembly.GetManifestResourceStream("SourceControl.Resources.icons.png"));
41+
Skin = new Bitmap(assembly.GetManifestResourceStream(ScaleHelper.GetScale() > 1.5 ? "SourceControl.Resources.icons32.png" : "SourceControl.Resources.icons.png"));
4142
}
4243
catch
4344
{
44-
Skin = new Bitmap(160, 16);
45+
Skin = ScaleHelper.GetScale() > 1.5 ? new Bitmap(320, 32) : new Bitmap(160, 16);
4546
}
4647
}
4748

External/Plugins/SourceControl/Managers/OverlayManager.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
using System.Windows.Forms;
55
using ProjectManager.Controls.TreeView;
66
using SourceControl.Actions;
7+
using PluginCore.Helpers;
8+
using System;
79

810
namespace SourceControl.Managers
911
{
@@ -201,12 +203,14 @@ static public void SetOverlay(VCItemStatus status, TreeNode node, TreeView tree)
201203

202204
Image original = tree.ImageList.Images[node.ImageIndex];
203205
Bitmap composed = original.Clone() as Bitmap;
206+
Int32 curSize = ScaleHelper.GetScale() > 1.5 ? 32 : 16;
204207
using (Graphics destination = Graphics.FromImage(composed))
205208
{
206-
destination.DrawImage(iconSkin, new Rectangle(0, 0, 16, 16),
207-
new Rectangle((int)status * 16, 0, 16, 16), GraphicsUnit.Pixel);
209+
destination.DrawImage(iconSkin, new Rectangle(0, 0, composed.Width, composed.Height),
210+
new Rectangle((int)status * curSize, 0, curSize, curSize), GraphicsUnit.Pixel);
208211
}
209212
int index = tree.ImageList.Images.Count;
213+
composed = (Bitmap)PluginCore.PluginBase.MainForm.ImageSetAdjust((Image)composed);
210214
tree.ImageList.Images.Add(composed);
211215
map[node.ImageIndex] = index;
212216
node.SelectedImageIndex = node.ImageIndex = index;
-4.59 KB
Binary file not shown.
42.5 KB
Binary file not shown.
4.98 KB
Loading

External/Plugins/SourceControl/Settings.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,25 +61,25 @@ public Boolean EnableGIT
6161
set { this.enableGIT = value; }
6262
}
6363

64-
[DefaultValue("git")]
64+
[DefaultValue("git.exe")]
6565
[DisplayName("GIT Path")]
6666
[LocalizedCategory("SourceControl.Category.GIT")]
6767
[LocalizedDescription("SourceControl.Description.GITPath")]
6868
[Editor(typeof(FileNameEditor), typeof(UITypeEditor))]
6969
public String GITPath
7070
{
71-
get { return this.gitPath ?? "git"; }
71+
get { return this.gitPath ?? "git.exe"; }
7272
set { this.gitPath = value; }
7373
}
7474

75-
[DefaultValue("TortoiseProc.exe")]
75+
[DefaultValue("TortoiseGitProc.exe")]
7676
[DisplayName("TortoiseGIT Proc Path")]
7777
[LocalizedCategory("SourceControl.Category.GIT")]
7878
[LocalizedDescription("SourceControl.Description.TortoiseGITProcPath")]
7979
[Editor(typeof(FileNameEditor), typeof(UITypeEditor))]
8080
public String TortoiseGITProcPath
8181
{
82-
get { return this.tortoiseGitProcPath ?? "TortoiseProc.exe"; }
82+
get { return this.tortoiseGitProcPath ?? "TortoiseGitProc.exe"; }
8383
set { this.tortoiseGitProcPath = value; }
8484
}
8585

@@ -93,25 +93,25 @@ public Boolean EnableHG
9393
set { this.enableHG = value; }
9494
}
9595

96-
[DefaultValue("hg")]
96+
[DefaultValue("hg.exe")]
9797
[DisplayName("HG Path")]
9898
[LocalizedCategory("SourceControl.Category.HG")]
9999
[LocalizedDescription("SourceControl.Description.HGPath")]
100100
[Editor(typeof(FileNameEditor), typeof(UITypeEditor))]
101101
public String HGPath
102102
{
103-
get { return this.hgPath ?? "hg"; }
103+
get { return this.hgPath ?? "hg.exe"; }
104104
set { this.hgPath = value; }
105105
}
106106

107-
[DefaultValue("thgw")]
107+
[DefaultValue("thgw.exe")]
108108
[DisplayName("TortoiseHG Proc Path")]
109109
[LocalizedCategory("SourceControl.Category.HG")]
110110
[LocalizedDescription("SourceControl.Description.TortoiseHGProcPath")]
111111
[Editor(typeof(FileNameEditor), typeof(UITypeEditor))]
112112
public String TortoiseHGProcPath
113113
{
114-
get { return this.tortoiseHGProcPath ?? "thgw"; }
114+
get { return this.tortoiseHGProcPath ?? "thgw.exe"; }
115115
set { this.tortoiseHGProcPath = value; }
116116
}
117117

External/Plugins/SourceControl/SourceControl.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,4 +158,7 @@
158158
<Install>true</Install>
159159
</BootstrapperPackage>
160160
</ItemGroup>
161+
<ItemGroup>
162+
<EmbeddedResource Include="Resources\icons32.png" />
163+
</ItemGroup>
161164
</Project>

0 commit comments

Comments
 (0)