compatibility with high-DPI displays
parent
5aac89e1ef
commit
6d7d66175c
|
@ -7,7 +7,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>570</width>
|
||||
<height>319</height>
|
||||
<height>340</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
@ -77,12 +77,12 @@
|
|||
<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-size:10pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">About Mitsuba</span></p>
|
||||
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Version MTS_VERSION<br />Configuration flags: <span style=" font-family:'Courier New,courier';">CONFIG_FLAGS</span></p>
|
||||
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Mitsuba is an extensible rendering framework written in portable C++. It implements unbiased as well as biased techniques and contains heavy optimizations targeted towards current CPU architectures.</p>
|
||||
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Copyright © MTS_YEAR Wenzel Jakob &lt;<a href="mailto:wenzel@cs.cornell.edu"><span style=" text-decoration: underline; color:#0000ff;">wenzel@cs.cornell.edu</span></a>&gt;</p>
|
||||
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Licensed under the <a href="http://www.gnu.org/licenses/gpl-3.0.html"><span style=" text-decoration: underline; color:#0000ff;">GNU GPL, Version 3</span></a>.</p></body></html></string>
|
||||
</style></head><body style=" font-family:'.SF NS Text'; font-size:13pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt; font-weight:600;">About Mitsuba</span></p>
|
||||
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Version MTS_VERSION<br />Configuration flags: </span><span style=" font-family:'Courier New,courier'; font-size:10pt;">CONFIG_FLAGS</span></p>
|
||||
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Mitsuba is an extensible rendering framework written in portable C++. It implements unbiased as well as biased techniques and contains heavy optimizations targeted towards current CPU architectures.</span></p>
|
||||
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Copyright © MTS_YEAR Wenzel Jakob &lt;</span><a href="mailto:wenzel.jakob@epfl.ch"><span style=" font-size:10pt; text-decoration: underline; color:#0000ff;">wenzel.jakob@epfl.ch</span></a><span style=" font-size:10pt;">&gt;</span></p>
|
||||
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Licensed under the </span><a href="http://www.gnu.org/licenses/gpl-3.0.html"><span style=" font-size:10pt; text-decoration: underline; color:#0000ff;">GNU GPL, Version 3</span></a><span style=" font-size:10pt;">.</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::RichText</enum>
|
||||
|
|
|
@ -374,10 +374,11 @@ void GLWidget::downloadFramebuffer() {
|
|||
}
|
||||
|
||||
QSize GLWidget::sizeHint() const {
|
||||
float ratio = windowHandle()->devicePixelRatio();
|
||||
QSize minimumSize(440, 170);
|
||||
if (m_context) {
|
||||
return QSize(std::max(minimumSize.width(), m_context->framebuffer->getWidth()),
|
||||
std::max(minimumSize.height(), m_context->framebuffer->getHeight()));
|
||||
return QSize(std::max(minimumSize.width(), int(m_context->framebuffer->getWidth()/ratio)),
|
||||
std::max(minimumSize.height(), int(m_context->framebuffer->getHeight()/ratio)));
|
||||
} else {
|
||||
return minimumSize;
|
||||
}
|
||||
|
@ -609,13 +610,12 @@ void GLWidget::keyReleaseEvent(QKeyEvent *event) {
|
|||
}
|
||||
|
||||
void GLWidget::mouseMoveEvent(QMouseEvent *event) {
|
||||
QPoint rel = event->pos() - m_mousePos;
|
||||
float ratio = windowHandle()->devicePixelRatio();
|
||||
QPoint rel = event->pos() - m_mousePos / ratio;
|
||||
if (!m_context || !m_context->scene
|
||||
|| !m_mouseDrag || rel == QPoint(0,0) || m_animation)
|
||||
return;
|
||||
|
||||
m_mousePos = event->pos();
|
||||
|
||||
// if (m_ignoreMouseEvent == rel) {
|
||||
if (m_ignoreMouseEvent != QPoint(0, 0)) {
|
||||
m_ignoreMouseEvent = QPoint(0, 0);
|
||||
|
@ -766,8 +766,10 @@ void GLWidget::mousePressEvent(QMouseEvent *event) {
|
|||
if (m_context == NULL || m_context->scene == NULL)
|
||||
return;
|
||||
|
||||
m_mousePos = event->pos();
|
||||
m_initialMousePos = mapToGlobal(m_mousePos);
|
||||
float ratio = windowHandle()->devicePixelRatio();
|
||||
m_mousePos = event->pos()*ratio;
|
||||
|
||||
m_initialMousePos = mapToGlobal(event->pos());
|
||||
m_mouseDrag = true;
|
||||
|
||||
if (m_cropping) {
|
||||
|
@ -977,7 +979,8 @@ void GLWidget::paintGL() {
|
|||
Point2i lowerRight = upperLeft +
|
||||
m_context->framebuffer->getSize();
|
||||
|
||||
if (width() > size.x || height() > size.y) {
|
||||
float ratio = windowHandle()->devicePixelRatio();
|
||||
if (width() * ratio > size.x || height() * ratio > size.y) {
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||
/* Draw a border to highlight the region occupied by the image */
|
||||
glColor4f(0.4f, 0.4f, 0.4f, 1.0f);
|
||||
|
@ -1369,10 +1372,11 @@ void GLWidget::updateScrollBars() {
|
|||
return;
|
||||
}
|
||||
|
||||
float ratio = windowHandle()->devicePixelRatio();
|
||||
int reqWidth = m_context->framebuffer->getWidth(),
|
||||
reqHeight = m_context->framebuffer->getHeight(),
|
||||
width = size().width(),
|
||||
height = size().height();
|
||||
width = size().width()*ratio,
|
||||
height = size().height()*ratio;
|
||||
|
||||
if (m_hScroll->isVisible())
|
||||
height += m_hScroll->size().height();
|
||||
|
|
|
@ -23,7 +23,9 @@ LogWidget::LogWidget(QWidget *parent)
|
|||
: QMainWindow(parent) {
|
||||
m_contents = new QTextEdit(this);
|
||||
QFont font = QFontDatabase::systemFont(QFontDatabase::FixedFont);
|
||||
#if defined(__OSX__)
|
||||
font.setPointSize(14);
|
||||
#endif
|
||||
m_contents->setFont(font);
|
||||
m_contents->setReadOnly(true);
|
||||
QPalette palette;
|
||||
|
|
|
@ -134,8 +134,10 @@ ServerWidget::ServerWidget(QWidget *parent,
|
|||
const QString &nodeName, int listenPort)
|
||||
: QMainWindow(parent) {
|
||||
m_contents = new QTextEdit(this);
|
||||
QFont font("Monospace");
|
||||
font.setStyleHint(QFont::TypeWriter);
|
||||
QFont font = QFontDatabase::systemFont(QFontDatabase::FixedFont);
|
||||
#if defined(__OSX__)
|
||||
font.setPointSize(14);
|
||||
#endif
|
||||
m_contents->setFont(font);
|
||||
m_contents->setReadOnly(true);
|
||||
QPalette palette;
|
||||
|
|
Loading…
Reference in New Issue