changeset 26871:9590067f59dd

display history list in fixed-width font (bug #55872) * history-dock-widget.cc (notice_settings): add this individual handler for changes in the users preferences and set the font following the console widget font and size in it * history-dock-widget.h: new slot notice_settings
author Torsten Lilge <ttl-octave@mailbox.org>
date Sun, 10 Mar 2019 09:58:58 +0100
parents d05863145670
children 07d0ab1f1ec3
files libgui/src/history-dock-widget.cc libgui/src/history-dock-widget.h
diffstat 2 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/history-dock-widget.cc	Sat Mar 09 21:17:21 2019 -0800
+++ b/libgui/src/history-dock-widget.cc	Sun Mar 10 09:58:58 2019 +0100
@@ -34,6 +34,7 @@
 
 #include "error.h"
 #include "resource-manager.h"
+#include "gui-preferences.h"
 
 #include "cmd-hist.h"
 
@@ -340,4 +341,18 @@
 
     m_history_list_view->setTextElideMode (Qt::ElideRight);
   }
+
+  void history_dock_widget::notice_settings (const QSettings *settings)
+  {
+    QFont font = QFont ();
+
+    font.setStyleHint (QFont::TypeWriter);
+    QString default_font = settings->value (global_mono_font.key, global_mono_font.def).toString ();
+
+    font.setFamily (settings->value (cs_font.key, default_font).toString ());
+    font.setPointSize (settings->value ("terminal/fontSize", 10).toInt ());
+
+    m_history_list_view->setFont (font);
+  }
+
 }
--- a/libgui/src/history-dock-widget.h	Sat Mar 09 21:17:21 2019 -0800
+++ b/libgui/src/history-dock-widget.h	Sun Mar 10 09:58:58 2019 +0100
@@ -50,6 +50,7 @@
     void append_history (const QString& hist_entry);
     void clear_history (void);
     void save_settings (void);
+    void notice_settings (const QSettings *);
 
   signals: