ide,CtrlCore: Large icons

git-svn-id: svn://ultimatepp.org/upp/trunk@6322 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2013-09-08 16:56:43 +00:00
parent bf28987faf
commit 9c921617d6
4 changed files with 19 additions and 16 deletions

View file

@ -248,7 +248,7 @@ int CodeEditor::InitUpp(const char **q)
void CodeEditor::InitKeywords() void CodeEditor::InitKeywords()
{ {
static const char *cpp[] = { static const char *cpp[] = {
"namespace", "__asm", "else", "struct", "namespace", "asm", "__asm", "else", "struct",
"enum", "switch", "auto", "__except", "template", "enum", "switch", "auto", "__except", "template",
"explicit", "this", "explicit", "this",
"bool", "extern", "mutable", "thread", "bool", "extern", "mutable", "thread",
@ -270,7 +270,9 @@ void CodeEditor::InitKeywords()
"double", "__leave", "static_cast", "double", "__leave", "static_cast",
"dynamic_cast", "long", "__stdcall", "while", "dynamic_cast", "long", "__stdcall", "while",
"force_inline", "force_inline",
// C++11 "and", "bitor", "or", "xor",
"compl", "bitand", "and_eq", "or_eq",
"xor_eq", "not", "not_eq",
"char16_t", "char32_t", "constexpr", "decltype", "char16_t", "char32_t", "constexpr", "decltype",
"noexcept", "nullptr", "static_assert", "noexcept", "nullptr", "static_assert",
"override", "final", "override", "final",

View file

@ -192,14 +192,14 @@ void TopWindow::SyncCaption()
Ctrl *owner = GetOwner(); Ctrl *owner = GetOwner();
wm_hints->window_group = owner ? owner->GetWindow() : w; wm_hints->window_group = owner ? owner->GetWindow() : w;
if(!icon.IsEmpty()) { if(!icon.IsEmpty()) {
Size isz = largeicon.IsEmpty() ? icon.GetSize() : largeicon.GetSize(); Size isz = icon.GetSize();
int len = 2 + isz.cx * isz.cy; int len = 2 + isz.cx * isz.cy;
Buffer<unsigned long> data(len); Buffer<unsigned long> data(len);
unsigned long *t = data; unsigned long *t = data;
*t++ = isz.cx; *t++ = isz.cx;
*t++ = isz.cy; *t++ = isz.cy;
for(int y = 0; y < isz.cy; y++) { for(int y = 0; y < isz.cy; y++) {
const RGBA *q = largeicon.IsEmpty() ? icon[y] : largeicon[y]; const RGBA *q = icon[y];
for(int x = isz.cx; x--;) { for(int x = isz.cx; x--;) {
*t++ = ((dword)q->a << 24) | *t++ = ((dword)q->a << 24) |
(dword)q->b | ((dword)q->g << 8) | ((dword)q->r << 16); (dword)q->b | ((dword)q->g << 8) | ((dword)q->r << 16);
@ -238,9 +238,8 @@ void TopWindow::CenterRect(Ctrl *owner)
else else
r = wr; r = wr;
Point p = r.CenterPos(sz); Point p = r.CenterPos(sz);
r = RectC(p.x, p.y, sz.cx, sz.cy);
if (p.x + sz.cx <= wr.Width() && p.y + sz.cy <= wr.Height()) { if (p.x <= wr.Width() && p.y <= wr.Height()) {
r = RectC(p.x, p.y, sz.cx, sz.cy);
wr.left += fm.left; wr.left += fm.left;
wr.right -= fm.right; wr.right -= fm.right;
wr.top += fm.top; wr.top += fm.top;
@ -253,8 +252,8 @@ void TopWindow::CenterRect(Ctrl *owner)
r.bottom = wr.bottom; r.bottom = wr.bottom;
minsize.cx = min(minsize.cx, r.GetWidth()); minsize.cx = min(minsize.cx, r.GetWidth());
minsize.cy = min(minsize.cy, r.GetHeight()); minsize.cy = min(minsize.cy, r.GetHeight());
SetRect(r);
} }
SetRect(r);
} }
} }

View file

@ -7,15 +7,17 @@ private:
XClassHint *class_hint; XClassHint *class_hint;
Size xminsize, xmaxsize; Size xminsize, xmaxsize;
bool topmost; bool topmost;
Buffer<unsigned long> PreperIcon(const Image& icon, int& len);
void CenterRect(Ctrl *owner);
void DefSyncTitle();
void EndIgnoreTakeFocus();
void CenterRect(Ctrl *owner); void SyncState();
void DefSyncTitle();
void EndIgnoreTakeFocus();
void SyncState(); Image invert;
WString title2;
Image invert; static Rect windowFrameMargin;
WString title2;
static Rect windowFrameMargin;
//$ }; //$ };

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Before After
Before After