This commits splits the "General" dialog to "General" and "Colors".

This commit is contained in:
donovaly
2020-04-14 00:11:47 +02:00
committed by WandererFan
parent 363031fc73
commit f4e937d3e0
8 changed files with 753 additions and 560 deletions

View File

@@ -39,10 +39,11 @@
#include "Workbench.h"
#include "MDIViewPage.h"
#include "DlgPrefsTechDraw1Imp.h"
#include "DlgPrefsTechDrawGeneralImp.h"
#include "DlgPrefsTechDraw2Imp.h"
#include "DlgPrefsTechDrawAnnotationImp.h"
#include "DlgPrefsTechDrawDimensionsImp.h"
#include "DlgPrefsTechDrawColorsImp.h"
#include "DlgPrefsTechDraw4Imp.h"
#include "DlgPrefsTechDraw5Imp.h"
#include "ViewProviderPage.h"
@@ -150,10 +151,11 @@ PyMOD_INIT_FUNC(TechDrawGui)
TechDrawGui::ViewProviderCosmeticExtension::init();
// register preferences pages
new Gui::PrefPageProducer<TechDrawGui::DlgPrefsTechDraw1Imp> ("TechDraw"); //General
new Gui::PrefPageProducer<TechDrawGui::DlgPrefsTechDrawGeneralImp> ("TechDraw"); //General
new Gui::PrefPageProducer<TechDrawGui::DlgPrefsTechDraw2Imp> ("TechDraw"); //Scale
new Gui::PrefPageProducer<TechDrawGui::DlgPrefsTechDrawAnnotationImp> ("TechDraw"); //Annotation
new Gui::PrefPageProducer<TechDrawGui::DlgPrefsTechDrawDimensionsImp>("TechDraw"); //Dimensions
new Gui::PrefPageProducer<TechDrawGui::DlgPrefsTechDrawAnnotationImp> ("TechDraw"); //Annotation
new Gui::PrefPageProducer<TechDrawGui::DlgPrefsTechDrawColorsImp>("TechDraw"); //Colors
new Gui::PrefPageProducer<TechDrawGui::DlgPrefsTechDraw5Imp> ("TechDraw"); //HLR
new Gui::PrefPageProducer<TechDrawGui::DlgPrefsTechDraw4Imp> ("TechDraw"); //Advanced

View File

@@ -44,10 +44,11 @@ set(TechDrawGui_MOC_HDRS
QGIViewDimension.h
QGIViewBalloon.h
TaskProjGroup.h
DlgPrefsTechDraw1Imp.h
DlgPrefsTechDrawGeneralImp.h
DlgPrefsTechDraw2Imp.h
DlgPrefsTechDrawAnnotationImp.h
DlgPrefsTechDrawDimensionsImp.h
DlgPrefsTechDrawColorsImp.h
DlgPrefsTechDraw4Imp.h
DlgPrefsTechDraw5Imp.h
TaskLinkDim.h
@@ -85,10 +86,11 @@ else()
endif()
set(TechDrawGui_UIC_SRCS
DlgPrefsTechDraw1.ui
DlgPrefsTechDrawGeneral.ui
DlgPrefsTechDraw2.ui
DlgPrefsTechDrawAnnotation.ui
DlgPrefsTechDrawDimensions.ui
DlgPrefsTechDrawColors.ui
DlgPrefsTechDraw4.ui
DlgPrefsTechDraw5.ui
TaskProjGroup.ui
@@ -147,9 +149,9 @@ SET(TechDrawGui_SRCS
TaskProjGroup.ui
TaskProjGroup.cpp
TaskProjGroup.h
DlgPrefsTechDraw1.ui
DlgPrefsTechDraw1Imp.cpp
DlgPrefsTechDraw1Imp.h
DlgPrefsTechDrawGeneral.ui
DlgPrefsTechDrawGeneralImp.cpp
DlgPrefsTechDrawGeneralImp.h
DlgPrefsTechDraw2.ui
DlgPrefsTechDraw2Imp.cpp
DlgPrefsTechDraw2Imp.h
@@ -159,6 +161,9 @@ SET(TechDrawGui_SRCS
DlgPrefsTechDrawDimensions.ui
DlgPrefsTechDrawDimensionsImp.cpp
DlgPrefsTechDrawDimensionsImp.h
DlgPrefsTechDrawColors.ui
DlgPrefsTechDrawColorsImp.cpp
DlgPrefsTechDrawColorsImp.h
DlgPrefsTechDraw4.ui
DlgPrefsTechDraw4Imp.cpp
DlgPrefsTechDraw4Imp.h

View File

@@ -0,0 +1,573 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>TechDrawGui::DlgPrefsTechDrawColorsImp</class>
<widget class="QWidget" name="TechDrawGui::DlgPrefsTechDrawColorsImp">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>460</width>
<height>369</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>Colors</string>
</property>
<property name="toolTip">
<string/>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QGroupBox" name="gb_Colors">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>225</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>200</height>
</size>
</property>
<property name="title">
<string>Colors</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="lbl_Normal">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Normal</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="Gui::PrefColorButton" name="pcb_Normal">
<property name="toolTip">
<string>Normal line color</string>
</property>
<property name="color">
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>NormalColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/Colors</cstring>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="3">
<widget class="QLabel" name="lbl_Hidden">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Hidden Line</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="Gui::PrefColorButton" name="pcb_Hidden">
<property name="toolTip">
<string>Hidden line color</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>HiddenColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/Colors</cstring>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lbl_PreSelect">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Preselected</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="Gui::PrefColorButton" name="pcb_PreSelect">
<property name="toolTip">
<string>Preselection color</string>
</property>
<property name="color">
<color>
<red>255</red>
<green>255</green>
<blue>20</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>PreSelectColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/Colors</cstring>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Section Face</string>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="Gui::PrefColorButton" name="pcb_Surface">
<property name="toolTip">
<string>Section face color</string>
</property>
<property name="color">
<color>
<red>225</red>
<green>225</green>
<blue>225</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>CutSurfaceColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/Colors</cstring>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="lbl_Select">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Selected</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="Gui::PrefColorButton" name="pcb_Select">
<property name="toolTip">
<string>Selected item color</string>
</property>
<property name="color">
<color>
<red>28</red>
<green>173</green>
<blue>28</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>SelectColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/Colors</cstring>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QLabel" name="label_14">
<property name="text">
<string>Section Line</string>
</property>
</widget>
</item>
<item row="2" column="4">
<widget class="Gui::PrefColorButton" name="pcbSectionLine">
<property name="toolTip">
<string>Section line color</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>SectionColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/Decorations</cstring>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Background</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="Gui::PrefColorButton" name="pcb_Background">
<property name="toolTip">
<string>Background color around pages</string>
</property>
<property name="color">
<color>
<red>80</red>
<green>80</green>
<blue>80</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>Background</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/Colors</cstring>
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QLabel" name="label_5">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Hatch</string>
</property>
</widget>
</item>
<item row="3" column="4">
<widget class="Gui::PrefColorButton" name="pcb_Hatch">
<property name="toolTip">
<string>Hatch image color</string>
</property>
<property name="color">
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>Hatch</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/Colors</cstring>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_13">
<property name="text">
<string>Dimension</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="Gui::PrefColorButton" name="pcbDimColor">
<property name="toolTip">
<string>Color of dimension lines and text.</string>
</property>
<property name="color">
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>Color</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/Dimensions</cstring>
</property>
</widget>
</item>
<item row="4" column="3">
<widget class="QLabel" name="label_7">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Geometric Hatch</string>
</property>
</widget>
</item>
<item row="4" column="4">
<widget class="Gui::PrefColorButton" name="pcb_GeomHatch">
<property name="toolTip">
<string>Geometric hatch pattern color</string>
</property>
<property name="color">
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>GeomHatch</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/Colors</cstring>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_15">
<property name="text">
<string>Centerline</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="Gui::PrefColorButton" name="pcbCenterColor">
<property name="toolTip">
<string>Centerline color</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>CenterColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/Decorations</cstring>
</property>
</widget>
</item>
<item row="5" column="3">
<widget class="QLabel" name="label_16">
<property name="text">
<string>Vertex</string>
</property>
</widget>
</item>
<item row="5" column="4">
<widget class="Gui::PrefColorButton" name="pcbVertexColor">
<property name="toolTip">
<string>Color of vertices in views</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>VertexColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/Decorations</cstring>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="Gui::PrefCheckBox" name="pcb_PaintFaces">
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="toolTip">
<string>Object faces will be transparent</string>
</property>
<property name="text">
<string>Transparent Faces</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>ClearFace</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/Colors</cstring>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="Gui::PrefColorButton" name="pcb_Face">
<property name="toolTip">
<string>Face color (if not transparent)</string>
</property>
<property name="color">
<color>
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>FaceColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/Colors</cstring>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_18">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Detail Highlight</string>
</property>
</widget>
</item>
<item row="6" column="3">
<widget class="QLabel" name="label_17">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Leaderline</string>
</property>
</widget>
</item>
<item row="6" column="4">
<widget class="Gui::PrefColorButton" name="pcbMarkup">
<property name="toolTip">
<string>Default color for leader lines </string>
</property>
<property name="color">
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>Color</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/Markups</cstring>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="Gui::PrefColorButton" name="pcbHighlight">
<property name="color">
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>HighlightColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/Decorations</cstring>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QLabel" name="label_12">
<property name="font">
<font>
<pointsize>12</pointsize>
<italic>true</italic>
</font>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="text">
<string>Items in italics are default values for new objects. They have no effect on existing objects.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>19</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>Gui::ColorButton</class>
<extends>QPushButton</extends>
<header>Gui/Widgets.h</header>
</customwidget>
<customwidget>
<class>Gui::PrefColorButton</class>
<extends>Gui::ColorButton</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
<customwidget>
<class>Gui::PrefCheckBox</class>
<extends>QCheckBox</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@@ -0,0 +1,99 @@
/***************************************************************************
* Copyright (c) 2020 FreeCAD Developers *
* Author: Uwe Stöhr <uwestoehr@lyx.org> *
* Based on src/Mod/FEM/Gui/DlgSettingsFEMImp.cpp *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library 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 Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#include "PreCompiled.h"
#include "DlgPrefsTechDrawColorsImp.h"
#include <Gui/PrefWidgets.h>
using namespace TechDrawGui;
DlgPrefsTechDrawColorsImp::DlgPrefsTechDrawColorsImp( QWidget* parent )
: PreferencePage( parent )
{
this->setupUi(this);
}
DlgPrefsTechDrawColorsImp::~DlgPrefsTechDrawColorsImp()
{
// no need to delete child widgets, Qt does it all for us
}
void DlgPrefsTechDrawColorsImp::saveSettings()
{
pcbDimColor->onSave();
pcb_Hatch->onSave();
pcb_Background->onSave();
pcb_PreSelect->onSave();
pcb_Hidden->onSave();
pcb_Select->onSave();
pcb_Normal->onSave();
pcb_Surface->onSave();
pcb_GeomHatch->onSave();
pcb_Face->onSave();
pcb_PaintFaces->onSave();
pcbSectionLine->onSave();
pcbCenterColor->onSave();
pcbVertexColor->onSave();
pcbMarkup->onSave();
pcbHighlight->onSave();
}
void DlgPrefsTechDrawColorsImp::loadSettings()
{
pcbDimColor->onRestore();
pcb_Hatch->onRestore();
pcb_Background->onRestore();
pcb_PreSelect->onRestore();
pcb_Hidden->onRestore();
pcb_Select->onRestore();
pcb_Normal->onRestore();
pcb_Surface->onRestore();
pcb_GeomHatch->onRestore();
pcb_Face->onRestore();
pcb_PaintFaces->onRestore();
pcbSectionLine->onRestore();
pcbCenterColor->onRestore();
pcbVertexColor->onRestore();
pcbMarkup->onRestore();
pcbHighlight->onRestore();
}
/**
* Sets the strings of the subwidgets using the current language.
*/
void DlgPrefsTechDrawColorsImp::changeEvent(QEvent *e)
{
if (e->type() == QEvent::LanguageChange) {
saveSettings();
retranslateUi(this);
loadSettings();
}
else {
QWidget::changeEvent(e);
}
}
#include <Mod/TechDraw/Gui/moc_DlgPrefsTechDrawColorsImp.cpp>

View File

@@ -0,0 +1,49 @@
/**************************************************************************
* Copyright (c) 2020 FreeCAD Developers *
* Author: Uwe Stöhr <uwestoehr@lyx.org> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library 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 Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#ifndef DRAWINGGUI_DLGPREFSTECHDRAWIMPCOLORS_H
#define DRAWINGGUI_DLGPREFSTECHDRAWIMPCOLORS_H
#include <Mod/TechDraw/Gui/ui_DlgPrefsTechDrawColors.h>
#include <Gui/PropertyPage.h>
namespace TechDrawGui {
class DlgPrefsTechDrawColorsImp : public Gui::Dialog::PreferencePage, public Ui_DlgPrefsTechDrawColorsImp
{
Q_OBJECT
public:
DlgPrefsTechDrawColorsImp( QWidget* parent = 0 );
~DlgPrefsTechDrawColorsImp();
protected:
void saveSettings();
void loadSettings();
void changeEvent(QEvent *e);
};
} // namespace TechDrawGui
#endif // DRAWINGGUI_DLGPREFSTECHDRAWIMPCOLORS_H

View File

@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>TechDrawGui::DlgPrefsTechDraw1Imp</class>
<widget class="QWidget" name="TechDrawGui::DlgPrefsTechDraw1Imp">
<class>TechDrawGui::DlgPrefsTechDrawGeneralImp</class>
<widget class="QWidget" name="TechDrawGui::DlgPrefsTechDrawGeneralImp">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>460</width>
<height>760</height>
<height>510</height>
</rect>
</property>
<property name="sizePolicy">
@@ -185,494 +185,6 @@ for ProjectionGroups</string>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="gb_Colors">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>225</height>
</size>
</property>
<property name="baseSize">
<size>
<width>0</width>
<height>200</height>
</size>
</property>
<property name="title">
<string>Colors</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="lbl_Normal">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Normal</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="Gui::PrefColorButton" name="pcb_Normal">
<property name="toolTip">
<string>Normal line color</string>
</property>
<property name="color">
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>NormalColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/Colors</cstring>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="3">
<widget class="QLabel" name="lbl_Hidden">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Hidden Line</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="Gui::PrefColorButton" name="pcb_Hidden">
<property name="toolTip">
<string>Hidden line color</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>HiddenColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/Colors</cstring>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="lbl_PreSelect">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Preselected</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="Gui::PrefColorButton" name="pcb_PreSelect">
<property name="toolTip">
<string>Preselection color</string>
</property>
<property name="color">
<color>
<red>255</red>
<green>255</green>
<blue>20</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>PreSelectColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/Colors</cstring>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Section Face</string>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="Gui::PrefColorButton" name="pcb_Surface">
<property name="toolTip">
<string>Section face color</string>
</property>
<property name="color">
<color>
<red>225</red>
<green>225</green>
<blue>225</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>CutSurfaceColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/Colors</cstring>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="lbl_Select">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Selected</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="Gui::PrefColorButton" name="pcb_Select">
<property name="toolTip">
<string>Selected item color</string>
</property>
<property name="color">
<color>
<red>28</red>
<green>173</green>
<blue>28</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>SelectColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/Colors</cstring>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QLabel" name="label_14">
<property name="text">
<string>Section Line</string>
</property>
</widget>
</item>
<item row="2" column="4">
<widget class="Gui::PrefColorButton" name="pcbSectionLine">
<property name="toolTip">
<string>Section line color</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>SectionColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/Decorations</cstring>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Background</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="Gui::PrefColorButton" name="pcb_Background">
<property name="toolTip">
<string>Background color around pages</string>
</property>
<property name="color">
<color>
<red>80</red>
<green>80</green>
<blue>80</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>Background</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/Colors</cstring>
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QLabel" name="label_5">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Hatch</string>
</property>
</widget>
</item>
<item row="3" column="4">
<widget class="Gui::PrefColorButton" name="pcb_Hatch">
<property name="toolTip">
<string>Hatch image color</string>
</property>
<property name="color">
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>Hatch</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/Colors</cstring>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_13">
<property name="text">
<string>Dimension</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="Gui::PrefColorButton" name="pcbDimColor">
<property name="toolTip">
<string>Color of dimension lines and text.</string>
</property>
<property name="color">
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>Color</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/Dimensions</cstring>
</property>
</widget>
</item>
<item row="4" column="3">
<widget class="QLabel" name="label_7">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Geometric Hatch</string>
</property>
</widget>
</item>
<item row="4" column="4">
<widget class="Gui::PrefColorButton" name="pcb_GeomHatch">
<property name="toolTip">
<string>Geometric hatch pattern color</string>
</property>
<property name="color">
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>GeomHatch</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/Colors</cstring>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_15">
<property name="text">
<string>Centerline</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="Gui::PrefColorButton" name="pcbCenterColor">
<property name="toolTip">
<string>Centerline color</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>CenterColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/Decorations</cstring>
</property>
</widget>
</item>
<item row="5" column="3">
<widget class="QLabel" name="label_16">
<property name="text">
<string>Vertex</string>
</property>
</widget>
</item>
<item row="5" column="4">
<widget class="Gui::PrefColorButton" name="pcbVertexColor">
<property name="toolTip">
<string>Color of vertices in views</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>VertexColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/Decorations</cstring>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="Gui::PrefCheckBox" name="pcb_PaintFaces">
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="toolTip">
<string>Object faces will be transparent</string>
</property>
<property name="text">
<string>Transparent Faces</string>
</property>
<property name="prefEntry" stdset="0">
<cstring>ClearFace</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/Colors</cstring>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="Gui::PrefColorButton" name="pcb_Face">
<property name="toolTip">
<string>Face color (if not transparent)</string>
</property>
<property name="color">
<color>
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>FaceColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/Colors</cstring>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_18">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Detail Highlight</string>
</property>
</widget>
</item>
<item row="6" column="3">
<widget class="QLabel" name="label_17">
<property name="font">
<font>
<italic>true</italic>
</font>
</property>
<property name="text">
<string>Leaderline</string>
</property>
</widget>
</item>
<item row="6" column="4">
<widget class="Gui::PrefColorButton" name="pcbMarkup">
<property name="toolTip">
<string>Default color for leader lines </string>
</property>
<property name="color">
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>Color</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>Mod/TechDraw/Markups</cstring>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="Gui::PrefColorButton" name="pcbHighlight">
<property name="color">
<color>
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</property>
<property name="prefEntry" stdset="0">
<cstring>HighlightColor</cstring>
</property>
<property name="prefPath" stdset="0">
<cstring>/Mod/TechDraw/Decorations</cstring>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="gb_Font">
<property name="sizePolicy">
@@ -1162,21 +674,11 @@ for ProjectionGroups</string>
<extends>QWidget</extends>
<header>Gui/QuantitySpinBox.h</header>
</customwidget>
<customwidget>
<class>Gui::ColorButton</class>
<extends>QPushButton</extends>
<header>Gui/Widgets.h</header>
</customwidget>
<customwidget>
<class>Gui::PrefFileChooser</class>
<extends>Gui::FileChooser</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
<customwidget>
<class>Gui::PrefColorButton</class>
<extends>Gui::ColorButton</extends>
<header>Gui/PrefWidgets.h</header>
</customwidget>
<customwidget>
<class>Gui::PrefCheckBox</class>
<extends>QCheckBox</extends>

View File

@@ -25,12 +25,12 @@
#include "PreCompiled.h"
#include "DlgPrefsTechDraw1Imp.h"
#include "DlgPrefsTechDrawGeneralImp.h"
#include <Gui/PrefWidgets.h>
using namespace TechDrawGui;
DlgPrefsTechDraw1Imp::DlgPrefsTechDraw1Imp( QWidget* parent )
DlgPrefsTechDrawGeneralImp::DlgPrefsTechDrawGeneralImp( QWidget* parent )
: PreferencePage( parent )
{
this->setupUi(this);
@@ -38,12 +38,12 @@ DlgPrefsTechDraw1Imp::DlgPrefsTechDraw1Imp( QWidget* parent )
plsb_LabelSize->setMinimum(0);
}
DlgPrefsTechDraw1Imp::~DlgPrefsTechDraw1Imp()
DlgPrefsTechDrawGeneralImp::~DlgPrefsTechDrawGeneralImp()
{
// no need to delete child widgets, Qt does it all for us
}
void DlgPrefsTechDraw1Imp::saveSettings()
void DlgPrefsTechDrawGeneralImp::saveSettings()
{
pfc_DefTemp->onSave();
pfc_DefDir->onSave();
@@ -60,27 +60,9 @@ void DlgPrefsTechDraw1Imp::saveSettings()
cb_Override->onSave();
cb_PageUpdate->onSave();
cb_AutoDist->onSave();
pcbDimColor->onSave();
pcb_Hatch->onSave();
pcb_Background->onSave();
pcb_PreSelect->onSave();
pcb_Hidden->onSave();
pcb_Select->onSave();
pcb_Normal->onSave();
pcb_Surface->onSave();
pcb_GeomHatch->onSave();
pcb_Face->onSave();
pcb_PaintFaces->onSave();
pcbSectionLine->onSave();
pcbCenterColor->onSave();
pcbVertexColor->onSave();
pcbMarkup->onSave();
pcbHighlight->onSave();
}
void DlgPrefsTechDraw1Imp::loadSettings()
void DlgPrefsTechDrawGeneralImp::loadSettings()
{
double labelDefault = 8.0;
plsb_LabelSize->setValue(labelDefault);
@@ -100,30 +82,12 @@ void DlgPrefsTechDraw1Imp::loadSettings()
cb_Override->onRestore();
cb_PageUpdate->onRestore();
cb_AutoDist->onRestore();
pcbDimColor->onRestore();
pcb_Hatch->onRestore();
pcb_Background->onRestore();
pcb_PreSelect->onRestore();
pcb_Hidden->onRestore();
pcb_Select->onRestore();
pcb_Normal->onRestore();
pcb_Surface->onRestore();
pcb_GeomHatch->onRestore();
pcb_Face->onRestore();
pcb_PaintFaces->onRestore();
pcbSectionLine->onRestore();
pcbCenterColor->onRestore();
pcbVertexColor->onRestore();
pcbMarkup->onRestore();
pcbHighlight->onRestore();
}
/**
* Sets the strings of the subwidgets using the current language.
*/
void DlgPrefsTechDraw1Imp::changeEvent(QEvent *e)
void DlgPrefsTechDrawGeneralImp::changeEvent(QEvent *e)
{
if (e->type() == QEvent::LanguageChange) {
saveSettings();
@@ -135,4 +99,4 @@ void DlgPrefsTechDraw1Imp::changeEvent(QEvent *e)
}
}
#include <Mod/TechDraw/Gui/moc_DlgPrefsTechDraw1Imp.cpp>
#include <Mod/TechDraw/Gui/moc_DlgPrefsTechDrawGeneralImp.cpp>

View File

@@ -1,7 +1,6 @@
/**************************************************************************
* Copyright (c) 2015 FreeCAD Developers *
* Author: WandererFan <wandererfan@gmail.com> *
* Based on src/Mod/FEM/Gui/DlgPrefsTechDraw1Imp.cpp *
* *
* This file is part of the FreeCAD CAx development system. *
* *
@@ -23,21 +22,21 @@
***************************************************************************/
#ifndef DRAWINGGUI_DLGPREFSTECHDRAWIMP1_H
#define DRAWINGGUI_DLGPREFSTECHDRAWIMP1_H
#ifndef DRAWINGGUI_DLGPREFSTECHDRAWIMPGENERAL_H
#define DRAWINGGUI_DLGPREFSTECHDRAWIMPGENERAL_H
#include <Mod/TechDraw/Gui/ui_DlgPrefsTechDraw1.h>
#include <Mod/TechDraw/Gui/ui_DlgPrefsTechDrawGeneral.h>
#include <Gui/PropertyPage.h>
namespace TechDrawGui {
class DlgPrefsTechDraw1Imp : public Gui::Dialog::PreferencePage, public Ui_DlgPrefsTechDraw1Imp
class DlgPrefsTechDrawGeneralImp : public Gui::Dialog::PreferencePage, public Ui_DlgPrefsTechDrawGeneralImp
{
Q_OBJECT
public:
DlgPrefsTechDraw1Imp( QWidget* parent = 0 );
~DlgPrefsTechDraw1Imp();
DlgPrefsTechDrawGeneralImp( QWidget* parent = 0 );
~DlgPrefsTechDrawGeneralImp();
protected:
void saveSettings();
@@ -47,4 +46,4 @@ protected:
} // namespace TechDrawGui
#endif // DRAWINGGUI_DLGPREFSTECHDRAWIMP1_H
#endif // DRAWINGGUI_DLGPREFSTECHDRAWIMPGENERAL_H