diff --git a/uppsrc/CtrlCore/gtk3-todo.txt b/uppsrc/CtrlCore/gtk3-todo.txt index 2cf62602a..5ee2634b3 100644 --- a/uppsrc/CtrlCore/gtk3-todo.txt +++ b/uppsrc/CtrlCore/gtk3-todo.txt @@ -76,3 +76,5 @@ DONE: - WithDropChoice ch issue (again...) - Problem with multibutton is back again - Redmond scrollbars width +- Improve focus visuals + diff --git a/uppsrc/CtrlLib/Ch.cpp b/uppsrc/CtrlLib/Ch.cpp index 599f96a43..d3ddbe57c 100644 --- a/uppsrc/CtrlLib/Ch.cpp +++ b/uppsrc/CtrlLib/Ch.cpp @@ -458,6 +458,7 @@ void ChStdSkin() for(int pass = 0; pass < 2; pass++) { Button::Style& s = pass ? Button::StyleOk().Write() : Button::StyleNormal().Write(); int roundness = DPI(3); + s.focusmargin = DPI(4); for(int i = 0; i < 4; i++) { static int adj[] = { 10, 80, -5, -10 }; Color f = Adjust(SColorFace(), adj[i]); diff --git a/uppsrc/CtrlLib/ChGtk3.cpp b/uppsrc/CtrlLib/ChGtk3.cpp index 98bc34598..c3ea11b60 100644 --- a/uppsrc/CtrlLib/ChGtk3.cpp +++ b/uppsrc/CtrlLib/ChGtk3.cpp @@ -307,6 +307,7 @@ void ChHostSkin() Image button[4]; for(int pass = 0; pass < 2; pass++) { Button::Style& s = pass ? Button::StyleOk().Write() : Button::StyleNormal().Write(); + s.focusmargin = DPI(4); for(int i = 0; i < 4; i++) { Gtk_State(i); s.look[i] = Hot3(CairoImage()); diff --git a/uppsrc/CtrlLib/LabelBase.cpp b/uppsrc/CtrlLib/LabelBase.cpp index 52a1a6e9a..197ccee4d 100644 --- a/uppsrc/CtrlLib/LabelBase.cpp +++ b/uppsrc/CtrlLib/LabelBase.cpp @@ -395,11 +395,11 @@ void DrawFocus(Draw& w, int x, int y, int cx, int cy, Color c) { w.Clipoff(x, y, cx, cy); for(int a = 0; a < cx; a += CtrlImg::focus_h().GetWidth()) { w.DrawImage(a, 0, CtrlImg::focus_h(), c); - w.DrawImage(a, cy - 1, CtrlImg::focus_h(), c); + w.DrawImage(a, cy - DPI(1), CtrlImg::focus_h(), c); } for(int a = 0; a < cy; a += CtrlImg::focus_v().GetHeight()) { w.DrawImage(0, a, CtrlImg::focus_v(), c); - w.DrawImage(cx - 1, a, CtrlImg::focus_v(), c); + w.DrawImage(cx - DPI(1), a, CtrlImg::focus_v(), c); } w.End(); } diff --git a/uppsrc/CtrlLib/MultiButton.cpp b/uppsrc/CtrlLib/MultiButton.cpp index 5a60cd3a9..871ebefdd 100644 --- a/uppsrc/CtrlLib/MultiButton.cpp +++ b/uppsrc/CtrlLib/MultiButton.cpp @@ -373,6 +373,7 @@ Rect MultiButton::Paint0(Draw& w, bool getcr) if(HasFocus()) { fpaper = SColorHighlight(); text = SColorHighlightText(); + hotpressed = true; } else fpaper = IsEnabled() && IsEditable() ? SColorPaper() : SColorFace(); @@ -386,6 +387,8 @@ Rect MultiButton::Paint0(Draw& w, bool getcr) } ChPaint(w, sz, style->edge[style->activeedge ? mst : 0]); Color p = paper; + if(frm && style->activeedge && HasFocus()) + p = SColorHighlight(); if(hotpressed && (WhenPush || WhenClick)) p = Nvl(fpaper, paper); if(!IsNull(p) && !IsNull(style->coloredge))