#569 Added custom font for labels in 3D scene and added font size to preferences

This commit is contained in:
Magne Sjaastad
2016-08-09 13:09:08 +02:00
parent 17d37c70d3
commit 58047a6509
11 changed files with 274 additions and 40 deletions

View File

@@ -57,6 +57,7 @@
#include "RiuMultiCaseImportDialog.h"
#include "RiuProcessMonitor.h"
#include "RiuProjectPropertyView.h"
#include "RiuPropertyViewTabWidget.h"
#include "RiuResultInfoPanel.h"
#include "RiuResultQwtPlot.h"
#include "RiuToolTipMenu.h"
@@ -1429,7 +1430,9 @@ void RiuMainWindow::slotShowPerformanceInfo(bool enable)
void RiuMainWindow::slotEditPreferences()
{
RiaApplication* app = RiaApplication::instance();
caf::PdmUiPropertyViewDialog propertyDialog(this, app->preferences(), "Preferences", "");
QStringList tabNames = app->preferences()->tabNames();
RiuPropertyViewTabWidget propertyDialog(this, app->preferences(), "Preferences", tabNames);
if (propertyDialog.exec() == QDialog::Accepted)
{
// Write preferences using QSettings and apply them to the application

View File

@@ -0,0 +1,81 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016 Statoil ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RiuPropertyViewTabWidget.h"
#include "cafPdmObject.h"
#include "cafPdmUiPropertyView.h"
#include <QBoxLayout>
#include <QDialogButtonBox>
#include <QStringList>
#include <QTabWidget>
#include <QWidget>
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiuPropertyViewTabWidget::RiuPropertyViewTabWidget(QWidget* parent, caf::PdmObject* object, const QString& windowTitle, const QStringList& uiConfigNameForTabs)
: QDialog(parent)
{
setWindowTitle(windowTitle);
QTabWidget* tabWidget = new QTabWidget;
for (int i = 0; i < uiConfigNameForTabs.size(); i++)
{
// Use a container widget to get some UI space around a PdmUiPropertyView
QWidget* containerWidget = new QWidget;
QHBoxLayout* widgetLayout = new QHBoxLayout;
containerWidget->setLayout(widgetLayout);
caf::PdmUiPropertyView* pdmUiPropertyView = new caf::PdmUiPropertyView();
pdmUiPropertyView->setUiConfigurationName(uiConfigNameForTabs[i]);
widgetLayout->addWidget(pdmUiPropertyView);
tabWidget->addTab(containerWidget, uiConfigNameForTabs[i]);
pdmUiPropertyView->showProperties(object);
m_pageWidgets.push_back(pdmUiPropertyView);
}
QVBoxLayout* dialogLayout = new QVBoxLayout;
setLayout(dialogLayout);
dialogLayout->addWidget(tabWidget);
// Buttons
QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
dialogLayout->addWidget(buttonBox);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RiuPropertyViewTabWidget::~RiuPropertyViewTabWidget()
{
for (auto w : m_pageWidgets)
{
w->showProperties(NULL);
}
}

View File

@@ -0,0 +1,40 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2016 Statoil ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include <QDialog>
namespace caf {
class PdmObject;
}
class QWidget;
class QString;
class QStringList;
class RiuPropertyViewTabWidget : public QDialog
{
public:
RiuPropertyViewTabWidget(QWidget* parent, caf::PdmObject* object, const QString& windowTitle, const QStringList& uiConfigNameForTabs);
~RiuPropertyViewTabWidget();
private:
std::vector<caf::PdmUiPropertyView*> m_pageWidgets;
};