kopia lustrzana https://gitlab.com/Teuniz/DSRemote
Work in progress.
rodzic
17e6d0c4d7
commit
dd24ea8321
2
global.h
2
global.h
|
@ -282,6 +282,8 @@ struct device_settings
|
||||||
|
|
||||||
int show_fps;
|
int show_fps;
|
||||||
|
|
||||||
|
int font_size;
|
||||||
|
|
||||||
// below here is use for the wave inspector
|
// below here is use for the wave inspector
|
||||||
int wave_mem_view_sample_start;
|
int wave_mem_view_sample_start;
|
||||||
int wave_mem_view_enabled;
|
int wave_mem_view_enabled;
|
||||||
|
|
|
@ -65,6 +65,8 @@
|
||||||
#include <QProgressDialog>
|
#include <QProgressDialog>
|
||||||
#include <QKeySequence>
|
#include <QKeySequence>
|
||||||
#include <QEventLoop>
|
#include <QEventLoop>
|
||||||
|
#include <QRect>
|
||||||
|
#include <QPixmap>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -122,8 +124,7 @@ public:
|
||||||
|
|
||||||
QLabel *statusLabel;
|
QLabel *statusLabel;
|
||||||
|
|
||||||
QFont *appfont,
|
QFont *appfont;
|
||||||
*monofont;
|
|
||||||
|
|
||||||
int adjDialFunc,
|
int adjDialFunc,
|
||||||
navDialFunc;
|
navDialFunc;
|
||||||
|
|
|
@ -32,23 +32,37 @@
|
||||||
|
|
||||||
UI_Mainwindow::UI_Mainwindow()
|
UI_Mainwindow::UI_Mainwindow()
|
||||||
{
|
{
|
||||||
int i;
|
int i, pxw;
|
||||||
|
|
||||||
char str[1024];
|
char str[1024];
|
||||||
|
|
||||||
|
QPixmap pxm(500, 100);
|
||||||
|
|
||||||
|
QPainter p_aint(&pxm);
|
||||||
|
|
||||||
setMinimumSize(1170, 630);
|
setMinimumSize(1170, 630);
|
||||||
setWindowTitle(PROGRAM_NAME " " PROGRAM_VERSION);
|
setWindowTitle(PROGRAM_NAME " " PROGRAM_VERSION);
|
||||||
setWindowIcon(QIcon(":/images/r_dsremote.png"));
|
setWindowIcon(QIcon(":/images/r_dsremote.png"));
|
||||||
|
|
||||||
appfont = new QFont;
|
appfont = new QFont;
|
||||||
|
|
||||||
monofont = new QFont;
|
appfont->setFamily("Noto Sans");
|
||||||
|
|
||||||
appfont->setFamily("Arial");
|
for(i=20; i>7; i--)
|
||||||
appfont->setPixelSize(12);
|
{
|
||||||
|
appfont->setPixelSize(i);
|
||||||
|
|
||||||
monofont->setFamily("andale mono");
|
p_aint.setFont(*appfont);
|
||||||
monofont->setPixelSize(12);
|
|
||||||
|
pxw = p_aint.boundingRect(0, 0, 500, 100, Qt::AlignLeft | Qt::TextSingleLine, "ABCDEFGHIJKLMNOPQRSTUVWXYZ").width();
|
||||||
|
|
||||||
|
// printf("i is: %i width is: %i\n", i, pxw);
|
||||||
|
|
||||||
|
if(pxw < 203) break;
|
||||||
|
}
|
||||||
|
pxw = i;
|
||||||
|
|
||||||
|
appfont->setPixelSize(pxw);
|
||||||
|
|
||||||
QApplication::setFont(*appfont);
|
QApplication::setFont(*appfont);
|
||||||
|
|
||||||
|
@ -62,6 +76,8 @@ UI_Mainwindow::UI_Mainwindow()
|
||||||
|
|
||||||
memset(&devparms, 0, sizeof(struct device_settings));
|
memset(&devparms, 0, sizeof(struct device_settings));
|
||||||
|
|
||||||
|
devparms.font_size = pxw;
|
||||||
|
|
||||||
devparms.screenshot_buf = (char *)malloc(WAVFRM_MAX_BUFSZ);
|
devparms.screenshot_buf = (char *)malloc(WAVFRM_MAX_BUFSZ);
|
||||||
|
|
||||||
for(i=0; i<MAX_CHNS; i++)
|
for(i=0; i<MAX_CHNS; i++)
|
||||||
|
@ -252,25 +268,25 @@ UI_Mainwindow::UI_Mainwindow()
|
||||||
recordButton->setStyleSheet("background-image: url(:/images/record.png);");
|
recordButton->setStyleSheet("background-image: url(:/images/record.png);");
|
||||||
|
|
||||||
menuGrpBox = new QGroupBox("Menu", DPRwidget);
|
menuGrpBox = new QGroupBox("Menu", DPRwidget);
|
||||||
menuGrpBox->setGeometry(180, 60, 125, 120);
|
menuGrpBox->setGeometry(180, 50, 125, 130);
|
||||||
|
|
||||||
acqButton = new QPushButton(menuGrpBox);
|
acqButton = new QPushButton(menuGrpBox);
|
||||||
acqButton->setGeometry(15, 20, 40, 18);
|
acqButton->setGeometry(15, 30, 40, 18);
|
||||||
acqButton->setText("acq");
|
acqButton->setText("acq");
|
||||||
cursButton = new QPushButton(menuGrpBox);
|
cursButton = new QPushButton(menuGrpBox);
|
||||||
cursButton->setGeometry(70, 20, 40, 18);
|
cursButton->setGeometry(70, 30, 40, 18);
|
||||||
cursButton->setText("curs");
|
cursButton->setText("curs");
|
||||||
saveButton = new QPushButton(menuGrpBox);
|
saveButton = new QPushButton(menuGrpBox);
|
||||||
saveButton->setGeometry(15, 55, 40, 18);
|
saveButton->setGeometry(15, 65, 40, 18);
|
||||||
saveButton->setText("save");
|
saveButton->setText("save");
|
||||||
dispButton = new QPushButton(menuGrpBox);
|
dispButton = new QPushButton(menuGrpBox);
|
||||||
dispButton->setGeometry(70, 55, 40, 18);
|
dispButton->setGeometry(70, 65, 40, 18);
|
||||||
dispButton->setText("disp");
|
dispButton->setText("disp");
|
||||||
utilButton = new QPushButton(menuGrpBox);
|
utilButton = new QPushButton(menuGrpBox);
|
||||||
utilButton->setGeometry(15, 90, 40, 18);
|
utilButton->setGeometry(15, 100, 40, 18);
|
||||||
utilButton->setText("util");
|
utilButton->setText("util");
|
||||||
helpButton = new QPushButton(menuGrpBox);
|
helpButton = new QPushButton(menuGrpBox);
|
||||||
helpButton->setGeometry(70, 90, 40, 18);
|
helpButton->setGeometry(70, 100, 40, 18);
|
||||||
helpButton->setText("help");
|
helpButton->setText("help");
|
||||||
|
|
||||||
horizontalGrpBox = new QGroupBox("Horizontal", DPRwidget);
|
horizontalGrpBox = new QGroupBox("Horizontal", DPRwidget);
|
||||||
|
@ -636,7 +652,6 @@ UI_Mainwindow::~UI_Mainwindow()
|
||||||
|
|
||||||
delete scrn_thread;
|
delete scrn_thread;
|
||||||
delete appfont;
|
delete appfont;
|
||||||
delete monofont;
|
|
||||||
pthread_mutex_destroy(&devparms.mutexx);
|
pthread_mutex_destroy(&devparms.mutexx);
|
||||||
|
|
||||||
free(devparms.screenshot_buf);
|
free(devparms.screenshot_buf);
|
||||||
|
|
|
@ -146,6 +146,10 @@ void SignalCurve::paintEvent(QPaintEvent *)
|
||||||
paint.setRenderHint(QPainter::Qt4CompatiblePainting, true);
|
paint.setRenderHint(QPainter::Qt4CompatiblePainting, true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
smallfont.setPixelSize(devparms->font_size);
|
||||||
|
|
||||||
|
paint.setFont(smallfont);
|
||||||
|
|
||||||
drawWidget(&paint, width(), height());
|
drawWidget(&paint, width(), height());
|
||||||
|
|
||||||
old_w = width();
|
old_w = width();
|
||||||
|
|
|
@ -97,6 +97,10 @@ void WaveCurve::paintEvent(QPaintEvent *)
|
||||||
|
|
||||||
QPainter *painter = &paint;
|
QPainter *painter = &paint;
|
||||||
|
|
||||||
|
smallfont.setPixelSize(devparms->font_size);
|
||||||
|
|
||||||
|
painter->setFont(smallfont);
|
||||||
|
|
||||||
curve_w = width();
|
curve_w = width();
|
||||||
|
|
||||||
curve_h = height();
|
curve_h = height();
|
||||||
|
|
Ładowanie…
Reference in New Issue