summaryrefslogtreecommitdiff
path: root/UViewer.pas
diff options
context:
space:
mode:
Diffstat (limited to 'UViewer.pas')
-rw-r--r--UViewer.pas15
1 files changed, 13 insertions, 2 deletions
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