mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 19:33:23 +00:00
cleanup: remove isGnome3Session function
This is only used for archaic distros. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
3abb82bfd5
commit
86e3ceb0e9
5 changed files with 0 additions and 63 deletions
|
@ -127,15 +127,6 @@ QWidget *ComboBoxDelegate::createEditor(QWidget *parent, const QStyleOptionViewI
|
||||||
currCombo.model = const_cast<QAbstractItemModel *>(index.model());
|
currCombo.model = const_cast<QAbstractItemModel *>(index.model());
|
||||||
currCombo.activeText = currCombo.model->data(index).toString();
|
currCombo.activeText = currCombo.model->data(index).toString();
|
||||||
|
|
||||||
// Current display of things on Gnome3 looks like shit, so
|
|
||||||
// let's fix that.
|
|
||||||
if (isGnome3Session()) {
|
|
||||||
QPalette p;
|
|
||||||
p.setColor(QPalette::Window, QColor(Qt::white));
|
|
||||||
p.setColor(QPalette::Base, QColor(Qt::white));
|
|
||||||
comboDelegate->lineEdit()->setPalette(p);
|
|
||||||
comboDelegate->setPalette(p);
|
|
||||||
}
|
|
||||||
return comboDelegate;
|
return comboDelegate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -282,21 +282,6 @@ QString URLDialog::url() const
|
||||||
return ui.urlField->toPlainText();
|
return ui.urlField->toPlainText();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isGnome3Session()
|
|
||||||
{
|
|
||||||
#if defined(QT_OS_WIW) || defined(QT_OS_MAC)
|
|
||||||
return false;
|
|
||||||
#else
|
|
||||||
if (qApp->style()->objectName() != "gtk+")
|
|
||||||
return false;
|
|
||||||
QProcess p;
|
|
||||||
p.start("pidof", QStringList() << "gnome-shell");
|
|
||||||
p.waitForFinished(-1);
|
|
||||||
QString p_stdout = p.readAllStandardOutput();
|
|
||||||
return !p_stdout.isEmpty();
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#define COMPONENT_FROM_UI(_component) what->_component = ui._component->isChecked()
|
#define COMPONENT_FROM_UI(_component) what->_component = ui._component->isChecked()
|
||||||
#define UI_FROM_COMPONENT(_component) ui._component->setChecked(what->_component)
|
#define UI_FROM_COMPONENT(_component) ui._component->setChecked(what->_component)
|
||||||
|
|
||||||
|
|
|
@ -146,6 +146,4 @@ private:
|
||||||
Q_DISABLE_COPY(TextHyperlinkEventFilter)
|
Q_DISABLE_COPY(TextHyperlinkEventFilter)
|
||||||
};
|
};
|
||||||
|
|
||||||
bool isGnome3Session();
|
|
||||||
|
|
||||||
#endif // SIMPLEWIDGETS_H
|
#endif // SIMPLEWIDGETS_H
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0
|
// SPDX-License-Identifier: GPL-2.0
|
||||||
#include "TabDiveEquipment.h"
|
#include "TabDiveEquipment.h"
|
||||||
#include "maintab.h"
|
#include "maintab.h"
|
||||||
#include "desktop-widgets/simplewidgets.h" // For isGnome3Session()
|
|
||||||
#include "desktop-widgets/modeldelegates.h"
|
#include "desktop-widgets/modeldelegates.h"
|
||||||
#include "core/dive.h"
|
#include "core/dive.h"
|
||||||
#include "core/selection.h"
|
#include "core/selection.h"
|
||||||
|
@ -51,14 +50,6 @@ TabDiveEquipment::TabDiveEquipment(QWidget *parent) : TabBase(parent),
|
||||||
connect(cylindersModel, &CylindersModel::divesEdited, this, &TabDiveEquipment::divesEdited);
|
connect(cylindersModel, &CylindersModel::divesEdited, this, &TabDiveEquipment::divesEdited);
|
||||||
connect(weightModel, &WeightModel::divesEdited, this, &TabDiveEquipment::divesEdited);
|
connect(weightModel, &WeightModel::divesEdited, this, &TabDiveEquipment::divesEdited);
|
||||||
|
|
||||||
// Current display of things on Gnome3 looks like shit, so
|
|
||||||
// let's fix that.
|
|
||||||
if (isGnome3Session()) {
|
|
||||||
QPalette p;
|
|
||||||
p.setColor(QPalette::Window, QColor(Qt::white));
|
|
||||||
ui.scrollArea->viewport()->setPalette(p);
|
|
||||||
}
|
|
||||||
|
|
||||||
ui.cylinders->view()->setItemDelegateForColumn(CylindersModel::TYPE, new TankInfoDelegate(this));
|
ui.cylinders->view()->setItemDelegateForColumn(CylindersModel::TYPE, new TankInfoDelegate(this));
|
||||||
ui.cylinders->view()->setItemDelegateForColumn(CylindersModel::USE, new TankUseDelegate(this));
|
ui.cylinders->view()->setItemDelegateForColumn(CylindersModel::USE, new TankUseDelegate(this));
|
||||||
ui.cylinders->view()->setItemDelegateForColumn(CylindersModel::SENSORS, new SensorDelegate(this));
|
ui.cylinders->view()->setItemDelegateForColumn(CylindersModel::SENSORS, new SensorDelegate(this));
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
#include "TabDiveSite.h"
|
#include "TabDiveSite.h"
|
||||||
|
|
||||||
#include "core/selection.h"
|
#include "core/selection.h"
|
||||||
#include "desktop-widgets/simplewidgets.h" // for isGnome3Session()
|
|
||||||
#include "qt-models/diveplannermodel.h"
|
#include "qt-models/diveplannermodel.h"
|
||||||
|
|
||||||
#include <QShortcut>
|
#include <QShortcut>
|
||||||
|
@ -63,33 +62,6 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
|
||||||
else
|
else
|
||||||
setDocumentMode(false);
|
setDocumentMode(false);
|
||||||
|
|
||||||
// Current display of things on Gnome3 looks like shit, so
|
|
||||||
// let's fix that.
|
|
||||||
if (isGnome3Session()) {
|
|
||||||
// TODO: Either do this for all scroll areas or none
|
|
||||||
//QPalette p;
|
|
||||||
//p.setColor(QPalette::Window, QColor(Qt::white));
|
|
||||||
//ui.scrollArea->viewport()->setPalette(p);
|
|
||||||
|
|
||||||
// GroupBoxes in Gnome3 looks like I'v drawn them...
|
|
||||||
static const QString gnomeCss = QStringLiteral(
|
|
||||||
"QGroupBox {"
|
|
||||||
"background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,"
|
|
||||||
"stop: 0 #E0E0E0, stop: 1 #FFFFFF);"
|
|
||||||
"border: 2px solid gray;"
|
|
||||||
"border-radius: 5px;"
|
|
||||||
"margin-top: 1ex;"
|
|
||||||
"}"
|
|
||||||
"QGroupBox::title {"
|
|
||||||
"subcontrol-origin: margin;"
|
|
||||||
"subcontrol-position: top center;"
|
|
||||||
"padding: 0 3px;"
|
|
||||||
"background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,"
|
|
||||||
"stop: 0 #E0E0E0, stop: 1 #FFFFFF);"
|
|
||||||
"}");
|
|
||||||
for (QGroupBox *box: findChildren<QGroupBox *>())
|
|
||||||
box->setStyleSheet(gnomeCss);
|
|
||||||
}
|
|
||||||
// QLineEdit and QLabels should have minimal margin on the left and right but not waste vertical space
|
// QLineEdit and QLabels should have minimal margin on the left and right but not waste vertical space
|
||||||
QMargins margins(3, 2, 1, 0);
|
QMargins margins(3, 2, 1, 0);
|
||||||
for (QLabel *label: findChildren<QLabel *>())
|
for (QLabel *label: findChildren<QLabel *>())
|
||||||
|
|
Loading…
Add table
Reference in a new issue