mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
uppsrc: Win7 chameleon fixes
git-svn-id: svn://ultimatepp.org/upp/trunk@2159 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
3eb5e133a4
commit
58e35e29e1
5 changed files with 37 additions and 141 deletions
|
|
@ -407,8 +407,8 @@ void ChHostSkin()
|
|||
{
|
||||
MultiButton::Style& s = MultiButton::StyleFrame().Write();
|
||||
for(int i = 0; i < 4; i++) {
|
||||
s.left[i] = Unglyph(XpImage(XP_COMBOBOX, 7, i + 1, Null, Size(20, 20)));
|
||||
s.right[i] = Unglyph(XpImage(XP_COMBOBOX, 6, i + 1, Null, Size(20, 20)));
|
||||
s.left[i] = Unglyph(XpImage(XP_COMBOBOX, 7, i + 1, Null, Size(40, 40)));
|
||||
s.right[i] = Unglyph(XpImage(XP_COMBOBOX, 6, i + 1, Null, Size(40, 40)));
|
||||
s.lmiddle[i] = s.rmiddle[i] = HorzBlend(s.right[i], s.left[i], 6, 14);
|
||||
Win32Look(s.look[i], XP_COMBOBOX, 4, i + 1);
|
||||
}
|
||||
|
|
@ -511,9 +511,8 @@ void ChHostSkin()
|
|||
Color c;
|
||||
double gf;
|
||||
m = Unglyph(m, c, gf);
|
||||
if(i == 0 && gf > 150)
|
||||
if(i == 0 && (gf > 150 || vista_aero))
|
||||
CtrlsImg::Set(CtrlsImg::I_DA, ClassicCtrlsImg::DA());
|
||||
|
||||
Button::StyleEdge().Write().look[i] = m;
|
||||
if(cbs)
|
||||
Button::StyleLeftEdge().Write().look[i] = m;
|
||||
|
|
@ -532,7 +531,7 @@ void ChHostSkin()
|
|||
if(!vista_aero) {
|
||||
MultiButton::Style& s = MultiButton::StyleDefault().Write();
|
||||
MultiButton::Style& fs = MultiButton::StyleFrame().Write();
|
||||
Image cm = Unglyph(XpImage(XP_COMBOBOX, CP_DROPDOWNBUTTON, i + 1, Null, Size(20, 20)));
|
||||
Image cm = Unglyph(XpImage(XP_COMBOBOX, CP_DROPDOWNBUTTON, i + 1, Null, Size(40, 40)));
|
||||
fs.right[i] = s.right[i] = cm;
|
||||
fs.left[i] = s.left[i] = MirrorHorz(s.right[i]);
|
||||
if(s.border == 0) {
|
||||
|
|
@ -547,13 +546,11 @@ void ChHostSkin()
|
|||
fs.lmiddle[i] = s.lmiddle[i] = MirrorHorz(mm);
|
||||
}
|
||||
|
||||
m = Unglyph(XpImage(XP_SCROLLBAR, SBP_ARROWBTN, i + ABS_UPNORMAL, paper));
|
||||
Size msz = m.GetSize();
|
||||
|
||||
m = Unglyph(XpImage(XP_SCROLLBAR, SBP_ARROWBTN, i + ABS_UPNORMAL, paper, Size(40, 40)));
|
||||
Button::StyleScroll().Write().look[i] =
|
||||
VertBlend(m, Unglyph(XpImage(XP_SCROLLBAR, SBP_ARROWBTN, i + ABS_DOWNNORMAL,
|
||||
paper)),
|
||||
msz.cy / 3, msz.cy * 2 / 3);
|
||||
paper, Size(40, 40))),
|
||||
14, 26);
|
||||
}
|
||||
|
||||
LabelBoxTextColor_Write(XpColor(XP_BUTTON, BP_GROUPBOX, GBS_NORMAL, 3803/*TMT_TEXTCOLOR*/));
|
||||
|
|
|
|||
|
|
@ -1506,6 +1506,10 @@ FileSel::FileSel() {
|
|||
SyncSplitter();
|
||||
|
||||
BackPaintHint();
|
||||
|
||||
#ifdef PLATFORM_WIN32
|
||||
list.IconWidth(GetFileIcon(GetHomeDirectory(), true, false, false).GetSize().cx);
|
||||
#endif
|
||||
}
|
||||
|
||||
FileSel::~FileSel() {}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#define _CtrlLib_icpp_init_stub
|
||||
#include "CtrlCore/init"
|
||||
#include "PdfDraw/init"
|
||||
#define BLITZ_INDEX__ F57F547EBE9C6FAAEA4B4F81F32910474
|
||||
#define BLITZ_INDEX__ F8CEBFB3B591328AB1E0EC796741AA480
|
||||
#include "CtrlLib.icpp"
|
||||
#undef BLITZ_INDEX__
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -7,152 +7,46 @@ int Diff(RGBA a, RGBA b)
|
|||
return max(abs(a.a - b.a), max(abs(a.r - b.r), max(abs(a.b - b.b), abs(a.g - b.g))));
|
||||
}
|
||||
|
||||
struct InterPoint {
|
||||
ImageBuffer &b;
|
||||
Rect rc;
|
||||
int sr, sg, sb;
|
||||
int sn, in;
|
||||
|
||||
InterPoint(ImageBuffer& b) : b(b) {
|
||||
sr = sg = sb = sn = in = 0;
|
||||
}
|
||||
void Add(int x, int y);
|
||||
};
|
||||
|
||||
void InterPoint::Add(int y, int x) {
|
||||
if(rc.Contains(x, y)) {
|
||||
RGBA ba = b[y][x];
|
||||
if(ba.a == 0)
|
||||
return;
|
||||
in++;
|
||||
sn++;
|
||||
sr += ba.r;
|
||||
sg += ba.g;
|
||||
sb += ba.b;
|
||||
}
|
||||
else
|
||||
in++;
|
||||
}
|
||||
|
||||
void Interpolate(ImageBuffer& b, Vector< Vector<bool> >& map, const Rect& rc)
|
||||
{
|
||||
Unmultiply(b);
|
||||
int todo;
|
||||
do {
|
||||
todo = 0;
|
||||
for(int x = rc.left; x < rc.right; x++)
|
||||
for(int y = rc.top; y < rc.bottom; y++) {
|
||||
RGBA& p = b[y][x];
|
||||
if(map[y][x]) {
|
||||
map[y][x] = 0;
|
||||
InterPoint ip(b);
|
||||
ip.rc = rc;
|
||||
ip.Add(y - 1, x - 1);
|
||||
ip.Add(y - 1, x);
|
||||
ip.Add(y - 1, x + 1);
|
||||
ip.Add(y, x - 1);
|
||||
ip.Add(y, x + 1);
|
||||
ip.Add(y + 1, x - 1);
|
||||
ip.Add(y + 1, x);
|
||||
ip.Add(y + 1, x + 1);
|
||||
if(ip.in >= 2) {
|
||||
if(ip.sn) {
|
||||
p.r = ip.sr / ip.sn;
|
||||
p.g = ip.sg / ip.sn;
|
||||
p.b = ip.sb / ip.sn;
|
||||
}
|
||||
else
|
||||
p = SColorFace();
|
||||
p.a = 255;
|
||||
}
|
||||
else
|
||||
todo++;
|
||||
}
|
||||
}
|
||||
}
|
||||
while(todo);
|
||||
Premultiply(b);
|
||||
}
|
||||
|
||||
struct ButtonDecomposer {
|
||||
Image src;
|
||||
Image dst;
|
||||
int aa[8];
|
||||
int aa;
|
||||
int maxdiff;
|
||||
RGBA color;
|
||||
int gdiff;
|
||||
int gcount;
|
||||
|
||||
RGBA GetC(int p) {
|
||||
Size sz = src.GetSize();
|
||||
int xx[3];
|
||||
int yy[3];
|
||||
yy[0] = xx[0] = aa[p];
|
||||
xx[1] = sz.cx - aa[p] - 1;
|
||||
xx[2] = sz.cx / 2;
|
||||
yy[1] = sz.cy - aa[p] - 1;
|
||||
yy[2] = sz.cy / 2;
|
||||
return src[xx[p / 3]][xx[p % 3]];
|
||||
}
|
||||
|
||||
void Do() {
|
||||
Size sz = src.GetSize();
|
||||
int qa = min(4, min(sz.cy / 4, sz.cx / 4));
|
||||
if(qa == 0) {
|
||||
dst = src;
|
||||
return;
|
||||
}
|
||||
int a = 0;
|
||||
for(int p = 0; p < 8; p++) {
|
||||
aa[p] = qa;
|
||||
Color c = GetC(p);
|
||||
while(aa[p] > 0) {
|
||||
Color c1 = GetC(p);
|
||||
if(Diff(c, c1) > 30)
|
||||
break;
|
||||
c = c1;
|
||||
aa[p]--;
|
||||
}
|
||||
if(aa[p] > a)
|
||||
a = aa[p];
|
||||
}
|
||||
if(a < min(sz.cx / 3, sz.cy / 3))
|
||||
a++;
|
||||
int a = min(5, min(sz.cx, sz.cy) / 5);
|
||||
maxdiff = gdiff = gcount = 0;
|
||||
color = SColorDisabled();
|
||||
dst = src;
|
||||
ImageBuffer b(dst);
|
||||
color = SColorText();
|
||||
maxdiff = gdiff = gcount = 0;
|
||||
Vector< Vector<bool> > map;
|
||||
for(int y = a; y < sz.cy - a; y++) {
|
||||
map.At(y).SetCount(sz.cx, false);
|
||||
RGBA *p = b[y];
|
||||
int x = a;
|
||||
Color c = p[x];
|
||||
while(x < sz.cx - a) {
|
||||
if(Diff(p[x], c) > 30)
|
||||
break;
|
||||
c = p[x++];
|
||||
}
|
||||
int xx = sz.cx - a;
|
||||
while(xx > x) {
|
||||
if(Diff(p[xx - 1], c) > 30)
|
||||
break;
|
||||
c = p[--xx];
|
||||
}
|
||||
for(int q = x; q < xx; q++) {
|
||||
int d = Diff(p[q], c);
|
||||
gcount++;
|
||||
gdiff += d;
|
||||
if(d >= maxdiff) {
|
||||
maxdiff = d;
|
||||
color = p[q];
|
||||
RGBA c1 = p[a - 1];
|
||||
RGBA c2 = p[sz.cx - a + 1];
|
||||
int n = sz.cx - 2 * a;
|
||||
p += a;
|
||||
for(int x = 0; x < n; x++) {
|
||||
RGBA c;
|
||||
c.r = ((n - x) * c1.r + x * c2.r) / n;
|
||||
c.g = ((n - x) * c1.g + x * c2.g) / n;
|
||||
c.b = ((n - x) * c1.b + x * c2.b) / n;
|
||||
c.a = ((n - x) * c1.a + x * c2.a) / n;
|
||||
int d = Diff(c, *p);
|
||||
if(d > 30) {
|
||||
gcount++;
|
||||
gdiff += d;
|
||||
if(d >= maxdiff) {
|
||||
maxdiff = d;
|
||||
color = *p;
|
||||
}
|
||||
}
|
||||
*p++ = c;
|
||||
}
|
||||
Fill(p + x, RGBAZero(), xx - x);
|
||||
map[y].Set(x, true, xx - x);
|
||||
}
|
||||
Interpolate(b, map, Rect(a, a, sz.cx - a, sz.cy - a));
|
||||
if(a < 2) a = 2;
|
||||
b.SetHotSpot(Point(a, a));
|
||||
dst = b;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,8 @@ enum { WITHBODY = 33 };
|
|||
|
||||
inline Font BrowserFont()
|
||||
#ifdef PLATFORM_WIN32
|
||||
{ return Arial(Ctrl::VertLayoutZoom(11)); }
|
||||
{ return StdFont(); }
|
||||
//{ return Arial(Ctrl::VertLayoutZoom(11)); }
|
||||
#else
|
||||
{ return Arial(Ctrl::VertLayoutZoom(9)); }
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue