]> git.lyx.org Git - features.git/commitdiff
GuiDocument.cpp: fix bug 10777
authorUwe Stöhr <uwestoehr@lyx.org>
Thu, 2 Nov 2017 21:25:26 +0000 (22:25 +0100)
committerUwe Stöhr <uwestoehr@lyx.org>
Thu, 2 Nov 2017 21:25:26 +0000 (22:25 +0100)
- 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

src/frontends/qt4/GuiDocument.cpp
src/frontends/qt4/ui/MathsUi.ui

index 385b3760ddc637671e7e2ec7c36dbd5c4af8c200..c015b86afc30ebfbb4b83dd4fcf043a62d3cb6ca 100644 (file)
@@ -1210,7 +1210,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<string, string> const & packages = BufferParams::auto_packages();
        mathsModule->packagesTW->setRowCount(packages.size());
        int i = 0;
@@ -1249,6 +1249,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()));
index 8ee7c4e7ce0fc226e3baa251fc23bcd1a6cd119e..380d76a3a5eb93284a04acb46be1369a1d20bdd8 100644 (file)
        <verstretch>0</verstretch>
       </sizepolicy>
      </property>
+     <property name="alternatingRowColors">
+      <bool>true</bool>
+     </property>
      <property name="columnCount">
       <number>4</number>
      </property>