[LyX/master] Consider darkmode when inserting new branch

Juergen Spitzmueller spitz at lyx.org
Tue Jan 19 12:27:13 UTC 2021


commit 81c19502c1727a28a9505818ae70c6a32fef9a40
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Tue Jan 19 13:27:45 2021 +0100

    Consider darkmode when inserting new branch
---
 src/Buffer.cpp |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

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


More information about the lyx-cvs mailing list