# HG changeset patch # User Torsten # Date 1451465165 -3600 # Node ID d9f4e4961e09909955c939f7d09298d0faf64b10 # Parent 9b21039bf63b32373e653f20432d9a2763132c8c improved margin and marker colors in the editor * file-editor-tab.cc (update_lexer): caclulate color from background and foreground color of the lexer, borders of markers set to foreground color diff -r 9b21039bf63b -r d9f4e4961e09 libgui/src/m-editor/file-editor-tab.cc --- a/libgui/src/m-editor/file-editor-tab.cc Wed Dec 30 08:28:37 2015 +0100 +++ b/libgui/src/m-editor/file-editor-tab.cc Wed Dec 30 09:46:05 2015 +0100 @@ -586,17 +586,23 @@ _edit_area->setCaretForegroundColor (lexer->color (0)); _edit_area->setIndentationGuidesForegroundColor (lexer->color (0)); - // set margin colors depending on selected background color of the lexer - QColor bg = lexer->paper (0), fg; - int h, s, v, factor=-1; - bg.getHsv (&h,&s,&v); + // set some colors depending on selected background color of the lexer + QColor bg = lexer->paper (0); + QColor fg = lexer->color (0); + + int bh, bs, bv, fh, fs, fv, h, s, v; + bg.getHsv (&bh,&bs,&bv); + fg.getHsv (&fh,&fs,&fv); - if (v < 96) - factor = 2; + // margin colors + h = bh; + s = bs/2; + v = bv + (fv - bv)/8; + bg.setHsv (h,s,v); + v = bv + (fv - bv)/4; + fg.setHsv (h,s,v); - bg.setHsv (h,s/2,v + factor*40); - fg.setHsv (h,s/2,v + (factor+1)*40); - + _edit_area->setMarkerForegroundColor (lexer->color (0)); _edit_area->setMarginsForegroundColor (lexer->color (0)); _edit_area->setMarginsBackgroundColor (bg); _edit_area->setFoldMarginColors (bg,fg);