Skip to content

Commit

Permalink
Fixed bug in custom files form, fixed 2 russian localizations, releas…
Browse files Browse the repository at this point in the history
…e 4.2
  • Loading branch information
zdimension committed Jan 23, 2016
1 parent 8f26cc6 commit a40c17c
Show file tree
Hide file tree
Showing 25 changed files with 1,065 additions and 526 deletions.
4 changes: 2 additions & 2 deletions SharpBoot.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
Microsoft Visual Studio Solution File, Format Version 14.00
# Visual Studio 2015
VisualStudioVersion = 12.0.30501.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpBoot", "SharpBoot\SharpBoot.csproj", "{7EA17673-BEC5-4E2D-B51E-98FAA9C9B178}"
Expand Down
43 changes: 30 additions & 13 deletions SharpBoot/Bootloaders.cs
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,13 @@ public void SetImage(Image image, Size sz)
public long TotalSize { get; set; } = 280911;
}

public interface IBootloaderTheme
{
Size Resolution { get; set; }

string GetCode();
}

public class SyslinuxTheme
{
public int Margin { get; set; } = 4;
Expand Down Expand Up @@ -451,30 +458,40 @@ public string GetCode()
(Program.UseCyrillicFont ? "FONT /boot/syslinux/cyrillic_cp866.psf\n" : "");
}

public List<ThemeEntry> Entries = new List<ThemeEntry>
public List<SLTEntry> Entries = new List<SLTEntry>
{
new ThemeEntry("border", "#ffffffff", "#ee000000", ShadowType.std),
new ThemeEntry("title", "#ffffffff", "#ee000000", ShadowType.std),
new ThemeEntry("sel", "#ffffffff", "#85000000", ShadowType.std),
new ThemeEntry("unsel", "#ffffffff", "#ee000000", ShadowType.std),
new ThemeEntry("pwdheader", "#ff000000", "#99ffffff", ShadowType.rev),
new ThemeEntry("pwdborder", "#ff000000", "#99ffffff", ShadowType.rev),
new ThemeEntry("pwdentry", "#ff000000", "#99ffffff", ShadowType.rev),
new ThemeEntry("hotkey", "#ff00ff00", "#ee000000", ShadowType.std),
new ThemeEntry("hotsel", "#ffffffff", "#85000000", ShadowType.std)
new SLTEntry("screen", "#80ffffff", "#00000000", ShadowType.std),
new SLTEntry("border", "#ffffffff", "#ee000000", ShadowType.std),
new SLTEntry("title", "#ffffffff", "#ee000000", ShadowType.std),
new SLTEntry("unsel", "#ffffffff", "#ee000000", ShadowType.std),
new SLTEntry("hotkey", "#ff00ff00", "#ee000000", ShadowType.std),
new SLTEntry("sel", "#ffffffff", "#85000000", ShadowType.std),
new SLTEntry("hotsel", "#ffffffff", "#85000000", ShadowType.std),
new SLTEntry("disabled", "#60cccccc", "#00000000", ShadowType.std),
new SLTEntry("scrollbar", "#40000000", "#00000000", ShadowType.std),
new SLTEntry("tabmsg", "#90ffff00", "#00000000", ShadowType.std),
new SLTEntry("cmdmark", "#c000ffff", "#00000000", ShadowType.std),
new SLTEntry("cmdline", "#c0ffffff", "#00000000", ShadowType.std),
new SLTEntry("pwdborder", "#80ffffff", "#20ffffff", ShadowType.rev),
new SLTEntry("pwdheader", "##80ff8080", "#20ffffff", ShadowType.rev),
new SLTEntry("pwdentry", "#80ffffff", "#20ffffff", ShadowType.rev),
new SLTEntry("timeout_msg", "#80ffffff", "#00000000", ShadowType.std),
new SLTEntry("timeout", "#c0ffffff", "#00000000", ShadowType.std),
new SLTEntry("help", "#c0ffffff", "#00000000", ShadowType.std)
};

public class ThemeEntry
// SLTEntry = SysLinux Theme Entry
public class SLTEntry
{
public ThemeEntry(string name, Color foreground, Color background, ShadowType shadowType = ShadowType.none)
public SLTEntry(string name, Color foreground, Color background, ShadowType shadowType = ShadowType.none)
{
Name = name;
Foreground = foreground;
Background = background;
ShadowType = shadowType;
}

public ThemeEntry(string name, string foreground, string background, ShadowType shadowType = ShadowType.none)
public SLTEntry(string name, string foreground, string background, ShadowType shadowType = ShadowType.none)
: this(name, ColorTranslator.FromHtml(foreground), ColorTranslator.FromHtml(background), shadowType)
{
}
Expand Down
7 changes: 4 additions & 3 deletions SharpBoot/CustomFileFrm.Designer.cs

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

15 changes: 14 additions & 1 deletion SharpBoot/CustomFileFrm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private void lvFiles_DragDrop(object sender, DragEventArgs e)

private void lvFiles_CellValidated(object sender, DataGridViewCellEventArgs e)
{
var cell = lvFiles.Rows[e.RowIndex].Cells[e.ColumnIndex];
var cell = lvFiles.Rows[e.RowIndex].Cells[1];
var cv = cell.Value?.ToString() ?? "";
if (string.IsNullOrWhiteSpace(cv) || cv.EndsWith("/"))
{
Expand All @@ -120,5 +120,18 @@ private void lvFiles_CellValidated(object sender, DataGridViewCellEventArgs e)
}
}
}

private void lvFiles_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex == 0)
{
ofpFile.Multiselect = false;
if (ofpFile.ShowDialog() == DialogResult.OK)
{
lvFiles.Rows[e.RowIndex].Cells[0].Value = ofpFile.FileName;
}
ofpFile.Multiselect = true;
}
}
}
}
Loading

0 comments on commit a40c17c

Please sign in to comment.