From f9a4b05c2c77727e47e455b10017c62c2141c72a Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Thu, 10 Mar 2011 18:27:39 +0100 Subject: [PATCH] GUI: restable: add. small adjustement of row height and vertical text pos. in cells --- src/qtgui/restable.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/qtgui/restable.cpp b/src/qtgui/restable.cpp index 6e805e49..0ede5d5c 100644 --- a/src/qtgui/restable.cpp +++ b/src/qtgui/restable.cpp @@ -42,6 +42,11 @@ #include "rclconfig.h" #include "plaintorich.h" +// Compensate for the default and somewhat bizarre vertical placement +// of text in cells +static const int ROWHEIGHTPAD = 2; +static const int TEXTINCELLVTRANS = -4; + ////////////////////////////////// // Restable "pager". We use it to display a single doc details in the // detail area @@ -378,7 +383,9 @@ public: #endif } painter->setClipRect(option.rect); - painter->translate(option.rect.topLeft()); + QPoint where = option.rect.topLeft(); + where.ry() += TEXTINCELLVTRANS; + painter->translate(where); document.setHtml(text); document.drawContents(painter); painter->restore(); @@ -418,7 +425,8 @@ void ResTable::init() header = tableView->verticalHeader(); if (header) { - header->setDefaultSectionSize(QApplication::fontMetrics().height()+5); + header->setDefaultSectionSize(QApplication::fontMetrics().height() + + ROWHEIGHTPAD); } QKeySequence seq("Esc");