Consider darkmode when inserting new branch

This commit is contained in:
Juergen Spitzmueller 2021-01-19 13:27:45 +01:00
parent 4062cbd278
commit 81c19502c1

View File

@ -2943,8 +2943,10 @@ void Buffer::dispatch(FuncRequest const & func, DispatchResult & dr)
string const bcolor = branch->color(); string const bcolor = branch->color();
if (bcolor.size() == 7 && bcolor[0] == '#') if (bcolor.size() == 7 && bcolor[0] == '#')
x11hexname = bcolor; x11hexname = bcolor;
else else {
x11hexname = lcolor.getX11HexName(lcolor.getFromLyXName(bcolor)); bool const darkmode = theApp() ? theApp()->isInDarkMode() : false;
x11hexname = lcolor.getX11HexName(lcolor.getFromLyXName(bcolor), darkmode);
}
docstring const str = branch_name + ' ' + from_ascii(x11hexname); docstring const str = branch_name + ' ' + from_ascii(x11hexname);
lyx::dispatch(FuncRequest(LFUN_SET_COLOR, str)); lyx::dispatch(FuncRequest(LFUN_SET_COLOR, str));
dr.setError(false); dr.setError(false);