ide: Navigator cosmetics

This commit is contained in:
Mirek Fidler 2023-04-11 23:52:49 +02:00
parent 3d304dbc09
commit ee64df7fc4

View file

@ -253,9 +253,8 @@ void Navigator::NavigatorDisplay::PaintBackground(Draw& w, const Rect& r, const
return;
const NavItem& m = *item[ii];
bool focuscursor = (style & (FOCUS|CURSOR)) == (FOCUS|CURSOR) || (style & SELECT);
if(findarg(m.kind, KIND_NEST) >= 0)
w.DrawRect(r, focuscursor ? paper : m.pretty.Find('\xff') >= 0 ? SColorFace()
: Blend(SColorMark, SColorPaper, 220));
if(m.kind == KIND_NEST && !focuscursor)
w.DrawRect(r, Blend(SColorMark, SColorPaper, 220));
else
w.DrawRect(r, paper);
}
@ -272,11 +271,10 @@ int Navigator::NavigatorDisplay::DoPaint(Draw& w, const Rect& r, const Value& q,
int x = r.left;
int y = r.top + (r.GetHeight() - Draw::GetStdFontCy()) / 2;
PaintBackground(w, r, q, ink, paper, style);
if(m.kind == KIND_NEST) {
bool fn = m.pretty.Find('\xff') >= 0;
w.DrawRect(r, focuscursor ? paper : fn ? SColorFace()
: Blend(SColorMark(), SColorPaper(), 220));
if(fn)
if(m.pretty.Find('\xff') >= 0)
return PaintFileName(w, r, m.pretty, ink);
w.DrawText(x, y, m.pretty, StdFont().Bold(), ink);
return GetTextSize(m.pretty, StdFont().Bold()).cx;
@ -318,7 +316,7 @@ int Navigator::ScopeDisplay::DoPaint(Draw& w, const Rect& r, const Value& q, Col
return x;
}
String h = q;
if(*h == '\xff')
if(h.Find('\xff') >= 0)
return PaintFileName(w, r, h, ink);
else
h = FormatNest(h);
@ -451,6 +449,7 @@ void Navigator::Search()
(nest_pass == 2 ? ToUpper(s).Find(usearch_nest) >= 0 :
nest_pass == 1 ? s.Find(search_nest) >= 0 :
s == search_nest)) {
DDUMPHEX(s);
scope.Add(s);
set.Add(s);
}