Skip to content

Commit 9ce8fe4

Browse files
nyjin노연진(Roh Yeonjin)(nyjin)
authored andcommitted
WPF - IME Transparent Text Background (#3143)
* The background color of ime text has been changed to transparent. * added static methods on imehandler for set background color or underline color through wpfimekeyboardhandler constructor. * changed codes for a pull request * removed unused a method * clean up codes Co-authored-by: 노연진(Roh Yeonjin)(nyjin) <[email protected]>
1 parent ac8d922 commit 9ce8fe4

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

CefSharp.Wpf.Example/Views/BrowserTabView.xaml.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ public BrowserTabView()
2929

3030
//browser.BrowserSettings.BackgroundColor = Cef.ColorSetARGB(0, 255, 255, 255);
3131

32+
//Please remove the comments below to use the Experimental WpfImeKeyboardHandler.
33+
//browser.WpfKeyboardHandler = new WpfImeKeyboardHandler(browser);
34+
35+
//Please remove the comments below to specify the color of the CompositionUnderline.
36+
//var transparent = Colors.Transparent;
37+
//var black = Colors.Black;
38+
//ImeHandler.ColorBKCOLOR = Cef.ColorSetARGB(transparent.A, transparent.R, transparent.G, transparent.B);
39+
//ImeHandler.ColorUNDERLINE = Cef.ColorSetARGB(black.A, black.R, black.G, black.B);
40+
3241
browser.RequestHandler = new ExampleRequestHandler();
3342

3443
var bindingOptions = new BindingOptions()

CefSharp.Wpf/Internals/IMEHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ namespace CefSharp.Wpf.Internals
1515
public static class ImeHandler
1616
{
1717
// Black SkColor value for underline.
18-
internal const uint ColorUNDERLINE = 0xFF000000;
18+
public static uint ColorUNDERLINE = 0xFF000000;
1919
// White SkColor value for background.
20-
internal const uint ColorBKCOLOR = 0xFFFFFFFF;
20+
public static uint ColorBKCOLOR = 0xFFFFFFFF;
2121

2222
public static bool GetResult(IntPtr hwnd, uint lParam, out string text)
2323
{

0 commit comments

Comments
 (0)