mirror of https://github.com/KLayout/klayout.git
Merge pull request #799 from KLayout/issue-778
Fixed #778 (monospace font selection generalized)
This commit is contained in:
commit
99f6beef54
|
|
@ -23,7 +23,16 @@
|
|||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<property name="margin">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="1">
|
||||
|
|
@ -93,11 +102,6 @@
|
|||
</item>
|
||||
<item>
|
||||
<widget class="QPlainTextEdit" name="text">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Monospace</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="lineWrapMode">
|
||||
<enum>QPlainTextEdit::NoWrap</enum>
|
||||
</property>
|
||||
|
|
|
|||
|
|
@ -1350,12 +1350,7 @@ p, li { white-space: pre-wrap; }
|
|||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="consoleTextFrame">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Monospace</family>
|
||||
</font>
|
||||
</property>
|
||||
<widget class="QFrame" name="console_text_frame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
|
|
@ -1366,11 +1361,6 @@ p, li { white-space: pre-wrap; }
|
|||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="input_field">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Monospace</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
|
|
|
|||
|
|
@ -1,48 +1,67 @@
|
|||
<ui version="4.0" >
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>RuntimeErrorForm</class>
|
||||
<widget class="QDialog" name="RuntimeErrorForm" >
|
||||
<property name="geometry" >
|
||||
<widget class="QDialog" name="RuntimeErrorForm">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>480</width>
|
||||
<width>496</width>
|
||||
<height>297</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle" >
|
||||
<property name="windowTitle">
|
||||
<string>Script Error</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<layout class="QVBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame_2" >
|
||||
<property name="frameShape" >
|
||||
<widget class="QFrame" name="frame_2">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow" >
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<property name="margin" >
|
||||
<layout class="QGridLayout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<item row="2" column="3" >
|
||||
<item row="2" column="3">
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType" >
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>411</width>
|
||||
<height>20</height>
|
||||
|
|
@ -50,15 +69,15 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="0" column="3" >
|
||||
<item row="0" column="3">
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType" >
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>411</width>
|
||||
<height>20</height>
|
||||
|
|
@ -66,22 +85,22 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="3" >
|
||||
<widget class="QLabel" name="msg_label" >
|
||||
<property name="text" >
|
||||
<item row="1" column="3">
|
||||
<widget class="QLabel" name="msg_label">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item rowspan="3" row="0" column="2" >
|
||||
<item row="0" column="2" rowspan="3">
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType" >
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>71</height>
|
||||
|
|
@ -89,36 +108,34 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item rowspan="3" row="0" column="1" >
|
||||
<widget class="QLabel" name="icon_label" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>0</hsizetype>
|
||||
<vsizetype>5</vsizetype>
|
||||
<item row="0" column="1" rowspan="3">
|
||||
<widget class="QLabel" name="icon_label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="frameShape" >
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="lineWidth" >
|
||||
<property name="lineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<property name="text">
|
||||
<string>X</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item rowspan="3" row="0" column="0" >
|
||||
<item row="0" column="0" rowspan="3">
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType" >
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>71</height>
|
||||
|
|
@ -130,35 +147,40 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="details_frame" >
|
||||
<property name="frameShape" >
|
||||
<widget class="QFrame" name="details_frame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow" >
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<layout class="QVBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QTextBrowser" name="details_text" >
|
||||
<property name="font" >
|
||||
<font>
|
||||
<family>Liberation Mono</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="lineWrapMode" >
|
||||
<widget class="QTextBrowser" name="details_text">
|
||||
<property name="lineWrapMode">
|
||||
<enum>QTextEdit::NoWrap</enum>
|
||||
</property>
|
||||
<property name="html" >
|
||||
<string><html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
<property name="html">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Liberation Mono'; font-size:11pt; font-weight:400; font-style:normal; text-decoration:none;">
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Liberation Sans';"></p></body></html></string>
|
||||
</style></head><body style=" font-family:'Ubuntu'; font-size:10pt; font-weight:400; font-style:normal;">
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Liberation Mono';"><br /></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
@ -166,44 +188,51 @@ p, li { white-space: pre-wrap; }
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame" >
|
||||
<property name="frameShape" >
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow" >
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" >
|
||||
<property name="margin" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing" >
|
||||
<layout class="QHBoxLayout">
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="details_pb" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy>
|
||||
<hsizetype>1</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<widget class="QPushButton" name="details_pb">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<string> Details >> </string>
|
||||
<property name="text">
|
||||
<string> Details >> </string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType" >
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>341</width>
|
||||
<height>16</height>
|
||||
|
|
@ -212,11 +241,11 @@ p, li { white-space: pre-wrap; }
|
|||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="ok_button" >
|
||||
<property name="text" >
|
||||
<widget class="QPushButton" name="ok_button">
|
||||
<property name="text">
|
||||
<string>OK</string>
|
||||
</property>
|
||||
<property name="default" >
|
||||
<property name="default">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
|
|
@ -226,7 +255,7 @@ p, li { white-space: pre-wrap; }
|
|||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11" />
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
|
|
@ -235,11 +264,11 @@ p, li { white-space: pre-wrap; }
|
|||
<receiver>RuntimeErrorForm</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel" >
|
||||
<hint type="sourcelabel">
|
||||
<x>457</x>
|
||||
<y>330</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel" >
|
||||
<hint type="destinationlabel">
|
||||
<x>271</x>
|
||||
<y>177</y>
|
||||
</hint>
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
|
||||
#include "layCrashMessage.h"
|
||||
#include "layQtTools.h"
|
||||
|
||||
#include <QPushButton>
|
||||
|
||||
|
|
@ -34,6 +35,7 @@ CrashMessage::CrashMessage (QWidget *parent, bool can_resume, const QString &t)
|
|||
setupUi (this);
|
||||
m_cancel_pressed = false;
|
||||
|
||||
text->setFont (monospace_font ());
|
||||
text->setPlainText (t);
|
||||
set_can_resume (can_resume);
|
||||
|
||||
|
|
|
|||
|
|
@ -270,6 +270,9 @@ MacroEditorDialog::MacroEditorDialog (lay::Dispatcher *pr, lym::MacroCollection
|
|||
|
||||
Ui::MacroEditorDialog::setupUi (this);
|
||||
|
||||
input_field->setFont (monospace_font ());
|
||||
console_text_frame->setFont (monospace_font ());
|
||||
|
||||
connect (mp_root, SIGNAL (macro_changed (lym::Macro *)), this, SLOT (macro_changed (lym::Macro *)));
|
||||
connect (mp_root, SIGNAL (macro_deleted (lym::Macro *)), this, SLOT (macro_deleted (lym::Macro *)));
|
||||
connect (mp_root, SIGNAL (macro_collection_deleted (lym::MacroCollection *)), this, SLOT (macro_collection_deleted (lym::MacroCollection *)));
|
||||
|
|
@ -332,16 +335,16 @@ MacroEditorDialog::MacroEditorDialog (lay::Dispatcher *pr, lym::MacroCollection
|
|||
|
||||
setObjectName (QString::fromUtf8 ("MacroEditorDialog"));
|
||||
|
||||
QHBoxLayout *layout = new QHBoxLayout(consoleTextFrame);
|
||||
QHBoxLayout *layout = new QHBoxLayout (console_text_frame);
|
||||
layout->setMargin (0);
|
||||
consoleTextFrame->setLayout(layout);
|
||||
mp_console_text = new TextEditWidget(consoleTextFrame);
|
||||
mp_console_text->setReadOnly(true);
|
||||
mp_console_text->setFont(consoleTextFrame->font());
|
||||
mp_console_text->setWordWrapMode(QTextOption::NoWrap);
|
||||
layout->addWidget(mp_console_text);
|
||||
console_text_frame->setLayout (layout);
|
||||
mp_console_text = new TextEditWidget (console_text_frame);
|
||||
mp_console_text->setReadOnly (true);
|
||||
mp_console_text->setFont (monospace_font ());
|
||||
mp_console_text->setWordWrapMode (QTextOption::NoWrap);
|
||||
layout->addWidget (mp_console_text);
|
||||
|
||||
m_stdout_format = mp_console_text->currentCharFormat();
|
||||
m_stdout_format = mp_console_text->currentCharFormat ();
|
||||
m_echo_format = m_stdout_format;
|
||||
m_echo_format.setForeground (QColor (0, 0, 255));
|
||||
m_stderr_format = m_stdout_format;
|
||||
|
|
|
|||
|
|
@ -929,7 +929,7 @@ void MacroEditorPage::set_font (const std::string &family, int size)
|
|||
if (! family.empty ()) {
|
||||
f.setFamily (tl::to_qstring (family));
|
||||
} else {
|
||||
f.setFamily (QString::fromUtf8 ("Monospace"));
|
||||
f.setFamily (lay::monospace_font ().family ());
|
||||
}
|
||||
f.setFixedPitch (true);
|
||||
if (size > 0) {
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
#include "layMacroEditorDialog.h"
|
||||
#include "layGenericSyntaxHighlighter.h"
|
||||
#include "layDispatcher.h"
|
||||
#include "layQtTools.h"
|
||||
|
||||
#include "lymMacro.h"
|
||||
|
||||
|
|
@ -218,7 +219,7 @@ MacroEditorSetupPage::setup (Dispatcher *root)
|
|||
|
||||
if (mp_data->font_size <= 0) {
|
||||
mp_data->font_size = font ().pointSize ();
|
||||
mp_data->font_family = "Monospace";
|
||||
mp_data->font_family = tl::to_string (monospace_font ().family ());
|
||||
}
|
||||
|
||||
QFont f;
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
|
||||
|
||||
#include "layRuntimeErrorForm.h"
|
||||
#include "layQtTools.h"
|
||||
#include "tlScriptError.h"
|
||||
|
||||
#include <QMessageBox>
|
||||
|
|
@ -40,6 +41,7 @@ RuntimeErrorForm::RuntimeErrorForm (QWidget *parent, const char *name, const tl:
|
|||
|
||||
msg_label->setText (tl::to_qstring (error->basic_msg ()));
|
||||
details_text->setText (tl::to_qstring (error->msg ()));
|
||||
details_text->setFont (lay::monospace_font ());
|
||||
details_frame->hide ();
|
||||
|
||||
// "borrow" the error pixmap from the message box
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
#include "layMacroEditorTree.h"
|
||||
#include "layMacroController.h"
|
||||
#include "layTechnologyController.h"
|
||||
#include "layQtTools.h"
|
||||
#include "lymMacro.h"
|
||||
#include "tlAssert.h"
|
||||
#include "tlStream.h"
|
||||
|
|
@ -408,7 +409,7 @@ TechMacrosPage::TechMacrosPage (QWidget *parent, const std::string &cat, const s
|
|||
|
||||
QFont f = mp_ui->macro_text->font ();
|
||||
f.setFixedPitch (true);
|
||||
f.setFamily (tl::to_qstring ("Monospace"));
|
||||
f.setFamily (monospace_font ().family ());
|
||||
mp_ui->macro_text->setFont (f);
|
||||
|
||||
connect (mp_ui->create_folder_button, SIGNAL (clicked ()), this, SLOT (create_folder_clicked ()));
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>2.5d Vertical Stack Information</string>
|
||||
<string><html>2.5d Vertical stack information (see <a href="int:/about/25d_view.xml">here</a> for details)</html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
@ -39,11 +39,6 @@
|
|||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QTextEdit" name="src_te">
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Monospace</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="lineWrapMode">
|
||||
<enum>QTextEdit::NoWrap</enum>
|
||||
</property>
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
#include "laybasicConfig.h"
|
||||
#include "dbD25TechnologyComponent.h"
|
||||
#include "layD25TechnologyComponent.h"
|
||||
#include "layQtTools.h"
|
||||
|
||||
#include <QResource>
|
||||
#include <QBuffer>
|
||||
|
|
@ -36,7 +37,9 @@ D25TechnologyComponentEditor::D25TechnologyComponentEditor (QWidget *parent)
|
|||
{
|
||||
setupUi (this);
|
||||
|
||||
// TODO: activate_help_links (mp_ui->help_label);
|
||||
src_te->setFont (monospace_font ());
|
||||
|
||||
activate_help_links (label);
|
||||
|
||||
QResource res (tl::to_qstring (":/syntax/d25_text.xml"));
|
||||
QByteArray data ((const char *) res.data (), int (res.size ()));
|
||||
|
|
|
|||
|
|
@ -1062,7 +1062,7 @@ UserPropertiesForm::UserPropertiesForm (QWidget *parent)
|
|||
mp_ui = new Ui::UserPropertiesForm ();
|
||||
mp_ui->setupUi (this);
|
||||
|
||||
mp_ui->text_edit->setFont (QFont ("Monospace"));
|
||||
mp_ui->text_edit->setFont (monospace_font ());
|
||||
mp_ui->text_edit->setAcceptRichText (false);
|
||||
|
||||
connect (mp_ui->add_pb, SIGNAL (clicked ()), this, SLOT (add ()));
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
#include <QWidget>
|
||||
#include <QLabel>
|
||||
#include <QPalette>
|
||||
#include <QFontDatabase>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
|
@ -189,6 +190,17 @@ indicate_error (QWidget *le, bool f)
|
|||
le->setPalette (pl);
|
||||
}
|
||||
|
||||
QFont monospace_font ()
|
||||
{
|
||||
#if QT_VERSION >= 0x050200
|
||||
return QFont (QFontDatabase::systemFont (QFontDatabase::FixedFont).family ());
|
||||
#else
|
||||
QFont f = QFont (QString::fromUtf8 ("Monospace"));
|
||||
f.setStyleHint (QFont::TypeWriter);
|
||||
return f;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if QT_VERSION < 0x050000
|
||||
|
||||
SignalBlocker::SignalBlocker (QWidget *w)
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
#include "laybasicCommon.h"
|
||||
|
||||
#include <string>
|
||||
#include <QFont>
|
||||
|
||||
class QLabel;
|
||||
class QWidget;
|
||||
|
|
@ -82,6 +83,12 @@ LAYBASIC_PUBLIC void indicate_error (QWidget *le, const tl::Exception *ex);
|
|||
*/
|
||||
LAYBASIC_PUBLIC void indicate_error (QWidget *le, bool error);
|
||||
|
||||
/**
|
||||
* @brief Gets the system monospace font
|
||||
*/
|
||||
LAYBASIC_PUBLIC QFont monospace_font ();
|
||||
|
||||
|
||||
#if QT_VERSION < 0x050000
|
||||
|
||||
// Provide missing QSignalBlocker for Qt4
|
||||
|
|
|
|||
Loading…
Reference in New Issue