From 1a68a4602790973942dcd9334d3a9b7d39e5aa78 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Sun, 12 Feb 2012 20:39:22 +0100 Subject: [PATCH] Make Scintilla use Direct2D on Vista and later Signed-off-by: Sven Strickroth --- src/TortoiseGitBlame/TortoiseGitBlameView.cpp | 7 +++++++ src/TortoiseUDiff/MainWindow.cpp | 7 +++++++ src/TortoiseUDiff/TortoiseUDiff.vcproj | 8 ++++++++ src/Utils/MiscUI/SciEdit.cpp | 9 ++++++++- 4 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/TortoiseGitBlame/TortoiseGitBlameView.cpp b/src/TortoiseGitBlame/TortoiseGitBlameView.cpp index ecefdd1a3..7eaa828bd 100644 --- a/src/TortoiseGitBlame/TortoiseGitBlameView.cpp +++ b/src/TortoiseGitBlame/TortoiseGitBlameView.cpp @@ -35,6 +35,7 @@ #include "UniCodeUtils.h" #include "MenuEncode.h" #include "gitdll.h" +#include "SysInfo.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -730,6 +731,12 @@ void CTortoiseGitBlameView::InitialiseEditor() SendEditor(SCI_SETCARETFORE, ::GetSysColor(COLOR_WINDOWTEXT)); m_regOldLinesColor = CRegStdDWORD(_T("Software\\TortoiseGit\\BlameOldColor"), RGB(230, 230, 255)); m_regNewLinesColor = CRegStdDWORD(_T("Software\\TortoiseGit\\BlameNewColor"), RGB(255, 230, 230)); + if (SysInfo::Instance().IsWin7OrLater()) + { + SendEditor(SCI_SETTECHNOLOGY, SC_TECHNOLOGY_DIRECTWRITE); + SendEditor(SCI_SETBUFFEREDDRAW, 0); + } + SendEditor(SCI_SETFONTQUALITY, SC_EFF_QUALITY_LCD_OPTIMIZED); this->m_TextView.Call(SCI_SETWRAPMODE, SC_WRAP_NONE); diff --git a/src/TortoiseUDiff/MainWindow.cpp b/src/TortoiseUDiff/MainWindow.cpp index 9af7b35ff..65af4cd73 100644 --- a/src/TortoiseUDiff/MainWindow.cpp +++ b/src/TortoiseUDiff/MainWindow.cpp @@ -19,6 +19,7 @@ #include "StdAfx.h" #include "MainWindow.h" #include "UnicodeUtils.h" +#include "SysInfo.h" CMainWindow::CMainWindow(HINSTANCE hInst, const WNDCLASSEX* wcx /* = NULL*/) : CWindow(hInst, wcx) @@ -390,6 +391,12 @@ bool CMainWindow::Initialize() SendEditor(SCI_SETSELFORE, TRUE, ::GetSysColor(COLOR_HIGHLIGHTTEXT)); SendEditor(SCI_SETSELBACK, TRUE, ::GetSysColor(COLOR_HIGHLIGHT)); SendEditor(SCI_SETCARETFORE, ::GetSysColor(COLOR_WINDOWTEXT)); + if (SysInfo::Instance().IsWin7OrLater()) + { + SendEditor(SCI_SETTECHNOLOGY, SC_TECHNOLOGY_DIRECTWRITE); + SendEditor(SCI_SETBUFFEREDDRAW, 0); + } + SendEditor(SCI_SETFONTQUALITY, SC_EFF_QUALITY_LCD_OPTIMIZED); return true; } diff --git a/src/TortoiseUDiff/TortoiseUDiff.vcproj b/src/TortoiseUDiff/TortoiseUDiff.vcproj index bc6f4e383..8d79491f2 100644 --- a/src/TortoiseUDiff/TortoiseUDiff.vcproj +++ b/src/TortoiseUDiff/TortoiseUDiff.vcproj @@ -390,6 +390,10 @@ + + @@ -436,6 +440,10 @@ > + + diff --git a/src/Utils/MiscUI/SciEdit.cpp b/src/Utils/MiscUI/SciEdit.cpp index 3185e7480..449c1f88e 100644 --- a/src/Utils/MiscUI/SciEdit.cpp +++ b/src/Utils/MiscUI/SciEdit.cpp @@ -1,6 +1,6 @@ // TortoiseGit - a Windows shell extension for easy version control -// Copyright (C) 2003-2008 - TortoiseSVN +// Copyright (C) 2003-2008,2012 - TortoiseSVN // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -23,6 +23,7 @@ #include #include "..\registry.h" #include ".\sciedit.h" +#include "SysInfo.h" using namespace std; @@ -152,6 +153,12 @@ void CSciEdit::Init(LONG lLanguage, BOOL bLoadSpellCheck) Call(SCI_ASSIGNCMDKEY, SCK_END + (SCMOD_SHIFT << 16), SCI_LINEENDWRAPEXTEND); Call(SCI_ASSIGNCMDKEY, SCK_HOME, SCI_HOMEWRAP); Call(SCI_ASSIGNCMDKEY, SCK_HOME + (SCMOD_SHIFT << 16), SCI_HOMEWRAPEXTEND); + if (SysInfo::Instance().IsWin7OrLater()) + { + Call(SCI_SETTECHNOLOGY, SC_TECHNOLOGY_DIRECTWRITE); + Call(SCI_SETBUFFEREDDRAW, 0); + } + Call(SCI_SETFONTQUALITY, SC_EFF_QUALITY_LCD_OPTIMIZED); } -- 2.11.4.GIT