From f7a00a4a2e52579bf8e48d111569de3ffa9bd240 Mon Sep 17 00:00:00 2001 From: cxl Date: Sat, 18 Jan 2020 17:15:43 +0000 Subject: [PATCH] CtrlLib: Chameleon fixes git-svn-id: svn://ultimatepp.org/upp/trunk@13916 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/CtrlCore/gtk3-todo.txt | 3 +-- uppsrc/CtrlLib/Ch.cpp | 4 +++- uppsrc/CtrlLib/MultiButton.cpp | 13 ++++++++++--- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/uppsrc/CtrlCore/gtk3-todo.txt b/uppsrc/CtrlCore/gtk3-todo.txt index f34039580..df50dc812 100644 --- a/uppsrc/CtrlCore/gtk3-todo.txt +++ b/uppsrc/CtrlCore/gtk3-todo.txt @@ -2,8 +2,6 @@ - GUILock docs CH: -- WithDropChoice ch issue (again...) - - Redmond scrollbars width DONE: @@ -81,3 +79,4 @@ DONE: - Ide split buttons look unexpected - Issue with editfield text clipping in the right - Possible issue with Capture (e.g. ide about box) +- WithDropChoice ch issue (again...) diff --git a/uppsrc/CtrlLib/Ch.cpp b/uppsrc/CtrlLib/Ch.cpp index 0f3080088..7068eada1 100644 --- a/uppsrc/CtrlLib/Ch.cpp +++ b/uppsrc/CtrlLib/Ch.cpp @@ -382,13 +382,15 @@ void ChSynthetic(Image button100x100[4], Color text[4]) } if(i == CTRL_DISABLED) { ProgressIndicator::Style& s = ProgressIndicator::StyleDefault().Write(); - s.hlook = MakeButton(roundness, m, DPI(1), ink); ImageBuffer ib(1, 8); + ImageBuffer ibb(1, 8); for(int i = 0; i < 8; i++) { int a[] = { 20, 40, 10, 0, -10, -20, -30, -40 }; ib[i][0] = AdjustColor(SColorHighlight(), a[i]); + ibb[i][0] = Blend(SColorFace(), SColorPaper(), i * 255 / 7); } s.hchunk = MakeButton(roundness, Magnify(ib, 10, 1), DPI(1), ink); + s.hlook = MakeButton(roundness, Magnify(ibb, 10, 1), DPI(1), ink); s.bound = true; s.nomargins = true; } diff --git a/uppsrc/CtrlLib/MultiButton.cpp b/uppsrc/CtrlLib/MultiButton.cpp index 946e1d7ec..9f3818245 100644 --- a/uppsrc/CtrlLib/MultiButton.cpp +++ b/uppsrc/CtrlLib/MultiButton.cpp @@ -358,12 +358,17 @@ Rect MultiButton::Paint0(Draw& w, bool getcr) Color fpaper = Null; Color text = SColorLabel; + bool hotpressed = false; if(!nobg && !ComplexFrame() && frm) { - if(mst == CTRL_HOT && !IsTrivial()) + if(mst == CTRL_HOT && !IsTrivial()) { fpaper = Blend(SColorHighlight, SColorPaper, 235); + hotpressed = true; + } else - if(mst == CTRL_PRESSED && !IsTrivial()) + if(mst == CTRL_PRESSED && !IsTrivial()) { fpaper = Blend(SColorHighlight, SColorFace, 235); + hotpressed = true; + } else if(HasFocus()) { fpaper = SColorHighlight(); @@ -380,7 +385,9 @@ Rect MultiButton::Paint0(Draw& w, bool getcr) w.Clip(l, 0, r - l, sz.cy); } ChPaint(w, sz, style->edge[style->activeedge ? mst : 0]); - Color p = Nvl(fpaper, paper); + Color p = paper; + if(hotpressed) + p = Nvl(fpaper, paper); if(!IsNull(p) && !IsNull(style->coloredge)) ChPaint(w, sz, style->coloredge, p); if(style->clipedge)