From eb172be29b3c9154abd8af376c0acdfa37211d71 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Uwe=20St=C3=B6hr?= Date: Thu, 2 Nov 2017 22:25:26 +0100 Subject: [PATCH] GuiDocument.cpp: fix bug 10777 - the column width must be as wide as the column header text - also center the radiobuttons in the table - also use alternating colors for the table rows (cherry picked from commit a69f1a9e161c87cc58e1a2dcec1e174136190b89) --- src/frontends/qt4/GuiDocument.cpp | 7 ++++++- src/frontends/qt4/ui/MathsUi.ui | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/frontends/qt4/GuiDocument.cpp b/src/frontends/qt4/GuiDocument.cpp index 560883ec6a..e063545d9d 100644 --- a/src/frontends/qt4/GuiDocument.cpp +++ b/src/frontends/qt4/GuiDocument.cpp @@ -1213,7 +1213,7 @@ GuiDocument::GuiDocument(GuiView & lv) headers << qt_("Package") << qt_("Load automatically") << qt_("Load always") << qt_("Do not load"); mathsModule->packagesTW->setHorizontalHeaderLabels(headers); - setSectionResizeMode(mathsModule->packagesTW->horizontalHeader(), QHeaderView::Stretch); + setSectionResizeMode(mathsModule->packagesTW->horizontalHeader(), QHeaderView::ResizeToContents); map const & packages = BufferParams::auto_packages(); mathsModule->packagesTW->setRowCount(packages.size()); int i = 0; @@ -1252,6 +1252,11 @@ GuiDocument::GuiDocument(GuiView & lv) mathsModule->packagesTW->setCellWidget(i, 1, autoRB); mathsModule->packagesTW->setCellWidget(i, 2, alwaysRB); mathsModule->packagesTW->setCellWidget(i, 3, neverRB); + //center the table contents + pack->setTextAlignment(Qt::AlignHCenter); + autoRB->setStyleSheet("margin-left:50%; margin-right:50%;"); + alwaysRB->setStyleSheet("margin-left:50%; margin-right:50%;"); + neverRB->setStyleSheet("margin-left:50%; margin-right:50%;"); connect(autoRB, SIGNAL(clicked()), this, SLOT(change_adaptor())); diff --git a/src/frontends/qt4/ui/MathsUi.ui b/src/frontends/qt4/ui/MathsUi.ui index 8ee7c4e7ce..380d76a3a5 100644 --- a/src/frontends/qt4/ui/MathsUi.ui +++ b/src/frontends/qt4/ui/MathsUi.ui @@ -179,6 +179,9 @@ 0 + + true + 4 -- 2.39.5