From ec2f73f0f66ce7ea31afdce6cacfe2225e765323 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Tue, 17 Nov 2009 16:45:46 +0100 Subject: Preserve normal/monospace internal viewer font --- UViewer.pas | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'UViewer.pas') diff --git a/UViewer.pas b/UViewer.pas index 1be2d6e..a80a434 100644 --- a/UViewer.pas +++ b/UViewer.pas @@ -42,6 +42,7 @@ type private // LineHeight, NumLines: integer; LineBuffer: TStringList; + procedure ApplyFont; protected AThread: TThread; public @@ -112,6 +113,7 @@ begin ScrolledWindow.AddControl(TextView); TextView.SetFocus; + ApplyFont; // ****************** @@ -253,11 +255,13 @@ begin end; // GDK_C, GDK_Capital_C, GDK_Insert: if (ssCtrl in Shift) then Accept := True; GDK_S, GDK_Capital_S: if (Shift = []) then begin - gtk_widget_modify_font(TextView.FWidget, pango_font_description_from_string('Monospace')); + ConfViewerMonospaceFont := True; + ApplyFont; Accept := False; end; GDK_A, GDK_Capital_A: if (Shift = []) then begin - gtk_widget_modify_font(TextView.FWidget, nil); + ConfViewerMonospaceFont := False; + ApplyFont; Accept := False; end; end; @@ -433,6 +437,13 @@ begin end; end; +procedure TFViewer.ApplyFont; +begin + if ConfViewerMonospaceFont + then gtk_widget_modify_font(TextView.FWidget, pango_font_description_from_string('Monospace')) + else gtk_widget_modify_font(TextView.FWidget, nil); +end; + (********************************************************************************************************************************) procedure TViewerThread.Execute; begin -- cgit v1.2.3