diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2013-09-26 20:35:30 -0300 |
---|---|---|
committer | Tomaz Canabrava <tcanabrava@kde.org> | 2013-09-26 20:35:30 -0300 |
commit | d6293217993a7601b6e1203cbab1062ba2b2523c (patch) | |
tree | 79f077746b53baa0e209186cb6387fe754097107 | |
parent | b036a318c695ed5950b5a7c74c8fc081b81b5dab (diff) | |
download | subsurface-d6293217993a7601b6e1203cbab1062ba2b2523c.tar.gz |
Fix the positioning of the `add` button when on Gtk style
Fix the positioning of the `add` button when on Gtk style,
in my XFCE install (and thus, may differ a bit from the
Gnome3 one ) the Plus button to add cylinders and weigths
got really strange placements, this seems to fix this,
I also tested on Oxygen and nothing broke there.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
-rw-r--r-- | qt-ui/tableview.cpp | 8 | ||||
-rw-r--r-- | qt-ui/tableview.ui | 17 |
2 files changed, 11 insertions, 14 deletions
diff --git a/qt-ui/tableview.cpp b/qt-ui/tableview.cpp index 6956d3941..88a9c3fb9 100644 --- a/qt-ui/tableview.cpp +++ b/qt-ui/tableview.cpp @@ -3,6 +3,7 @@ #include "models.h" #include <QPushButton> +#include <QLayout> #include <QFile> #include <QTextStream> #include <QSettings> @@ -14,11 +15,16 @@ TableView::TableView(QWidget *parent) : QWidget(parent), ui(new Ui::TableView){ QTextStream reader(&cssFile); QString css = reader.readAll(); ui->tableView->setStyleSheet(css); - + /* There`s mostly a need for a Mac fix here too. */ + if (qApp->style()->objectName() == "gtk+") + ui->groupBox->layout()->setContentsMargins(0, 9, 0, 0); + else + ui->groupBox->layout()->setContentsMargins(0, 0, 0, 0); QIcon plusIcon(":plus"); plusBtn = new QPushButton(plusIcon, QString(), ui->groupBox); plusBtn->setFlat(true); plusBtn->setToolTip(tr("Add Cylinder")); + plusBtn->setIconSize(QSize(16,16)); connect(plusBtn, SIGNAL(clicked(bool)), this, SIGNAL(addButtonClicked())); } diff --git a/qt-ui/tableview.ui b/qt-ui/tableview.ui index 10b5f79f9..4a6119f49 100644 --- a/qt-ui/tableview.ui +++ b/qt-ui/tableview.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>400</width> - <height>300</height> + <width>410</width> + <height>309</height> </rect> </property> <property name="windowTitle"> @@ -17,16 +17,7 @@ <property name="spacing"> <number>0</number> </property> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> + <property name="margin"> <number>0</number> </property> <item> @@ -42,7 +33,7 @@ <number>0</number> </property> <property name="topMargin"> - <number>0</number> + <number>10</number> </property> <property name="rightMargin"> <number>0</number> |