mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-27 06:38:44 -05:00
Implement a user option to set font sizes.
Updates to User's Guide. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3501 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
cbed84e0c7
commit
88c73582a0
Binary file not shown.
16
main.cpp
16
main.cpp
@ -17,14 +17,16 @@ int main(int argc, char *argv[])
|
||||
QApplication a(argc, argv);
|
||||
|
||||
QFile f("fonts.txt");
|
||||
qint32 fontSize,fontWeight,fontSize2,fontWeight2; // Defaults 8 50 10 50
|
||||
fontSize2=10;
|
||||
fontWeight2=50;
|
||||
if(f.open(QIODevice::ReadOnly)) {
|
||||
QTextStream in(&f); //Example:
|
||||
QString fontFamily; // helvetica
|
||||
qint32 fontSize,fontWeight; // 8,50
|
||||
in >> fontFamily >> fontSize >> fontWeight;
|
||||
QTextStream in(&f);
|
||||
in >> fontSize >> fontWeight >> fontSize2 >> fontWeight2;
|
||||
f.close();
|
||||
QFont font;
|
||||
font=QFont(fontFamily,fontSize,fontWeight);
|
||||
QFont font=a.font();
|
||||
if(fontSize!=8) font.setPointSize(fontSize);
|
||||
font.setWeight(fontWeight); //Set the GUI fonts
|
||||
a.setFont(font);
|
||||
}
|
||||
|
||||
@ -54,7 +56,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Multiple instances: Call MainWindow() with the UUID key
|
||||
MainWindow w(&mem_jt9, &my_key);
|
||||
MainWindow w(&mem_jt9, &my_key, fontSize2, fontWeight2);
|
||||
w.show();
|
||||
return a.exec();
|
||||
}
|
||||
|
@ -40,7 +40,9 @@ QString Program_Title_Version=" WSJT-X v1.1, r" + rev.mid(6,4) +
|
||||
|
||||
//-------------------------------------------------- MainWindow constructor
|
||||
// Multiple instances: new arg *thekey
|
||||
MainWindow::MainWindow(QSharedMemory *shdmem, QString *thekey, QWidget *parent) :
|
||||
MainWindow::MainWindow(QSharedMemory *shdmem, QString *thekey, \
|
||||
qint32 fontSize2, qint32 fontWeight2, \
|
||||
QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::MainWindow)
|
||||
{
|
||||
@ -114,6 +116,12 @@ MainWindow::MainWindow(QSharedMemory *shdmem, QString *thekey, QWidget *parent)
|
||||
connect(ui->freeTextMsg, SIGNAL(customContextMenuRequested(const QPoint&)),
|
||||
this, SLOT(showMacros(const QPoint&)));
|
||||
|
||||
QFont font=ui->decodedTextBrowser->font();
|
||||
font.setPointSize(fontSize2);
|
||||
font.setWeight(fontWeight2);
|
||||
ui->decodedTextBrowser->setFont(font);
|
||||
ui->decodedTextBrowser2->setFont(font);
|
||||
|
||||
QTimer *guiTimer = new QTimer(this);
|
||||
connect(guiTimer, SIGNAL(timeout()), this, SLOT(guiUpdate()));
|
||||
guiTimer->start(100); //Don't change the 100 ms!
|
||||
@ -320,8 +328,8 @@ MainWindow::MainWindow(QSharedMemory *shdmem, QString *thekey, QWidget *parent)
|
||||
if(ui->actionAFMHot->isChecked()) on_actionAFMHot_triggered();
|
||||
if(ui->actionBlue->isChecked()) on_actionBlue_triggered();
|
||||
|
||||
ui->decodedTextLabel->setFont(ui->decodedTextBrowser2->font());
|
||||
ui->decodedTextLabel2->setFont(ui->decodedTextBrowser->font());
|
||||
ui->decodedTextLabel->setFont(ui->decodedTextBrowser->font());
|
||||
ui->decodedTextLabel2->setFont(ui->decodedTextBrowser2->font());
|
||||
t="UTC dB DT Freq Message";
|
||||
ui->decodedTextLabel->setText(t);
|
||||
ui->decodedTextLabel2->setText(t);
|
||||
|
@ -29,7 +29,9 @@ class MainWindow : public QMainWindow
|
||||
|
||||
// Multiple instances: call MainWindow() with *thekey
|
||||
public:
|
||||
explicit MainWindow(QSharedMemory *shdmem, QString *thekey, QWidget *parent = 0);
|
||||
explicit MainWindow(QSharedMemory *shdmem, QString *thekey, \
|
||||
qint32 fontSize2, qint32 fontWeight2, \
|
||||
QWidget *parent = 0);
|
||||
~MainWindow();
|
||||
|
||||
public slots:
|
||||
|
@ -1314,7 +1314,7 @@ p, li { white-space: pre-wrap; }
|
||||
<string/>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">buttonGroup</string>
|
||||
<string>buttonGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
@ -1348,7 +1348,7 @@ p, li { white-space: pre-wrap; }
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">buttonGroup</string>
|
||||
<string>buttonGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
@ -1379,7 +1379,7 @@ p, li { white-space: pre-wrap; }
|
||||
<string/>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">buttonGroup</string>
|
||||
<string>buttonGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
@ -1403,13 +1403,6 @@ p, li { white-space: pre-wrap; }
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Droid Sans</family>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
@ -1547,7 +1540,7 @@ p, li { white-space: pre-wrap; }
|
||||
<string/>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">buttonGroup</string>
|
||||
<string>buttonGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
@ -1695,7 +1688,7 @@ p, li { white-space: pre-wrap; }
|
||||
<string/>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">buttonGroup</string>
|
||||
<string>buttonGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
@ -1726,7 +1719,7 @@ p, li { white-space: pre-wrap; }
|
||||
<string/>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">buttonGroup</string>
|
||||
<string>buttonGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
@ -2209,7 +2202,7 @@ p, li { white-space: pre-wrap; }
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>760</width>
|
||||
<height>22</height>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuFile">
|
||||
|
Loading…
Reference in New Issue
Block a user