mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 23:43:24 +00:00
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>
This commit is contained in:
parent
b036a318c6
commit
d629321799
2 changed files with 11 additions and 14 deletions
|
@ -3,6 +3,7 @@
|
||||||
#include "models.h"
|
#include "models.h"
|
||||||
|
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
#include <QLayout>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
@ -14,11 +15,16 @@ TableView::TableView(QWidget *parent) : QWidget(parent), ui(new Ui::TableView){
|
||||||
QTextStream reader(&cssFile);
|
QTextStream reader(&cssFile);
|
||||||
QString css = reader.readAll();
|
QString css = reader.readAll();
|
||||||
ui->tableView->setStyleSheet(css);
|
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");
|
QIcon plusIcon(":plus");
|
||||||
plusBtn = new QPushButton(plusIcon, QString(), ui->groupBox);
|
plusBtn = new QPushButton(plusIcon, QString(), ui->groupBox);
|
||||||
plusBtn->setFlat(true);
|
plusBtn->setFlat(true);
|
||||||
plusBtn->setToolTip(tr("Add Cylinder"));
|
plusBtn->setToolTip(tr("Add Cylinder"));
|
||||||
|
plusBtn->setIconSize(QSize(16,16));
|
||||||
connect(plusBtn, SIGNAL(clicked(bool)), this, SIGNAL(addButtonClicked()));
|
connect(plusBtn, SIGNAL(clicked(bool)), this, SIGNAL(addButtonClicked()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>400</width>
|
<width>410</width>
|
||||||
<height>300</height>
|
<height>309</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@ -17,16 +17,7 @@
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="leftMargin">
|
<property name="margin">
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
|
@ -42,7 +33,7 @@
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="topMargin">
|
<property name="topMargin">
|
||||||
<number>0</number>
|
<number>10</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="rightMargin">
|
<property name="rightMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
|
|
Loading…
Add table
Reference in a new issue