mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-12-23 02:00:26 +08:00
Set RichTextBox background to transparent
This commit is contained in:
@@ -23,6 +23,7 @@ using System.Linq;
|
|||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Media;
|
||||||
|
|
||||||
namespace QuickLook.Plugin.TextViewer;
|
namespace QuickLook.Plugin.TextViewer;
|
||||||
|
|
||||||
@@ -68,7 +69,8 @@ public class Plugin : IViewer
|
|||||||
if (path.EndsWith(".rtf", StringComparison.OrdinalIgnoreCase))
|
if (path.EndsWith(".rtf", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
var rtfBox = new RichTextBox();
|
var rtfBox = new RichTextBox();
|
||||||
FileStream fs = File.OpenRead(path);
|
using FileStream fs = File.OpenRead(path);
|
||||||
|
rtfBox.Background = new SolidColorBrush(Colors.Transparent);
|
||||||
rtfBox.Selection.Load(fs, DataFormats.Rtf);
|
rtfBox.Selection.Load(fs, DataFormats.Rtf);
|
||||||
rtfBox.IsReadOnly = true;
|
rtfBox.IsReadOnly = true;
|
||||||
rtfBox.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
|
rtfBox.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
|
||||||
|
|||||||
Reference in New Issue
Block a user