mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
Gui: Add options for nightmode; switch window icons; switch wiki css
This commit is contained in:
@@ -54,7 +54,7 @@ public class ColorAdp_ implements ParseAble {
|
||||
else
|
||||
return null;
|
||||
}
|
||||
@gplx.Internal protected static ColorAdp parse_hex_(String raw) {
|
||||
public static ColorAdp parse_hex_(String raw) {
|
||||
try {
|
||||
int[] ary = new int[4]; // make ARGB ary
|
||||
int idx = 0;
|
||||
|
||||
@@ -62,7 +62,13 @@ public class Swt_btn_no_border implements GxwElem, Swt_control {
|
||||
private void Btn_img_(ImageAdp v) {
|
||||
if (box_btn == null || v == null) return;
|
||||
SizeAdp size = core.Size();
|
||||
v = v.Resize(size.Width(), size.Height());
|
||||
// HACK: nightmode
|
||||
// for day mode, resize needed b/c blurred images look better
|
||||
// for night mode, SWT introduces white pixels
|
||||
// so resize only if height is different knowing that (a) btns have height of 16px and (b) day=32px; night=16px
|
||||
// note can't use width, b/c search_exec_btn somehow goes from 16px to 20px
|
||||
if (v.Size().Height() != size.Height())
|
||||
v = v.Resize(size.Width(), size.Height());
|
||||
box_btn.setImage(Copy_w_transparency((Image)v.Under()));
|
||||
}
|
||||
private Image Copy_w_transparency(Image src) {
|
||||
|
||||
Reference in New Issue
Block a user