Skip to content

Commit

Permalink
theme: Small tweeks and readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathanwoodburn committed Jun 5, 2023
1 parent 5326091 commit e29cb24
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion BidderGUI/Form1.Designer.cs

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

12 changes: 6 additions & 6 deletions BidderGUI/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,7 @@ private void UpdateTheme()
batchsizenumericud.BackColor = ColorTranslator.FromHtml(theme["background-alt"]);
intervalnumericUpDown.BackColor = ColorTranslator.FromHtml(theme["background-alt"]);
regtestbutton.BackColor = ColorTranslator.FromHtml(theme["background-alt"]);
mainnetbutton.BackColor = ColorTranslator.FromHtml(theme["background-alt"]);
mainnetbutton.BackColor = ColorTranslator.FromHtml(theme["background-alt"]);
button1.BackColor = ColorTranslator.FromHtml(theme["background-alt"]);
button2.BackColor = ColorTranslator.FromHtml(theme["background-alt"]);
button3.BackColor = ColorTranslator.FromHtml(theme["background-alt"]);
Expand Down Expand Up @@ -1148,7 +1148,7 @@ private void UpdateTheme()

// Transparancy
applyTransparency(theme);


}

Expand All @@ -1160,19 +1160,15 @@ private void applyTransparency(Dictionary<string, string> theme)
{
case "mica":
var accent = new AccentPolicy { AccentState = AccentState.ACCENT_ENABLE_BLURBEHIND };

var accentStructSize = Marshal.SizeOf(accent);

var accentPtr = Marshal.AllocHGlobal(accentStructSize);
Marshal.StructureToPtr(accent, accentPtr, false);

var data = new WindowCompositionAttributeData
{
Attribute = WindowCompositionAttribute.WCA_ACCENT_POLICY,
SizeOfData = accentStructSize,
Data = accentPtr
};

User32.SetWindowCompositionAttribute(Handle, ref data);
Marshal.FreeHGlobal(accentPtr);
break;
Expand Down Expand Up @@ -1202,6 +1198,10 @@ private void applyTransparency(Dictionary<string, string> theme)
{
Opacity = Convert.ToDouble(theme["transparency-percent"]) / 100;
}
else
{
addlog("No transparency-percent found in theme file");
}
break;
}
}
Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Example `node bin/hsd-ledger sendraw --http-host 127.0.0.1 --api-key=1234 -w col


## Theme
You can change the theme by editing the `theme.txt` file in %appdata%/HSDBidderGUI.
You can change the theme by editing the `theme.txt` file in `%appdata%/HSDBidderGUI`.
Here is a list of options:

### background:
Expand All @@ -91,16 +91,14 @@ Options are:
2. mica (styled like some newer windows apps)
3. key (transparent with a key color)
This will also make the transparent colour clickthroughable.
This requires transparency-key to be set
4. percent (transparent with a percentage)
This will affect all parts of the form.
Requires transparency-percent to be set

### transparency-key:
Sets the key color for the form. Only used if transparent-mode is set to key.
Can also be set to `main` or `alt` to use the main or alt background colors.
Sets the key color for the form. Required if transparent-mode is set to key.
Can also be set to `main` or `alt` to use the main or alt background colors.
! Warning if you set this to be black the menu options (Minimize, Close) will be a bit buggy.

### transparency-percent:
Sets the transparency percentage for the form. Only used if transparent-mode is set to percent.
Sets the transparency percentage for the form. Required if transparent-mode is set to percent.
0 is fully transparent and 100 is fully opaque.

0 comments on commit e29cb24

Please sign in to comment.