diff --git a/src/Gui/DlgSettingsViewColor.cpp b/src/Gui/DlgSettingsViewColor.cpp index bf8f3e216c..28fcee4394 100644 --- a/src/Gui/DlgSettingsViewColor.cpp +++ b/src/Gui/DlgSettingsViewColor.cpp @@ -66,15 +66,6 @@ void DlgSettingsViewColor::saveSettings() checkBoxSelection->onSave(); HighlightColor->onSave(); SelectionColor->onSave(); - CursorTextColor->onSave(); - EditedEdgeColor->onSave(); - EditedVertexColor->onSave(); - ConstructionColor->onSave(); - FullyConstrainedColor->onSave(); - BoundingBoxColor->onSave(); - DefaultShapeColor->onSave(); - DefaultShapeLineColor->onSave(); - DefaultShapeLineWidth->onSave(); } void DlgSettingsViewColor::loadSettings() @@ -90,15 +81,6 @@ void DlgSettingsViewColor::loadSettings() checkBoxSelection->onRestore(); HighlightColor->onRestore(); SelectionColor->onRestore(); - CursorTextColor->onRestore(); - EditedEdgeColor->onRestore(); - EditedVertexColor->onRestore(); - ConstructionColor->onRestore(); - FullyConstrainedColor->onRestore(); - BoundingBoxColor->onRestore(); - DefaultShapeColor->onRestore(); - DefaultShapeLineColor->onRestore(); - DefaultShapeLineWidth->onRestore(); } /** diff --git a/src/Gui/DlgSettingsViewColor.ui b/src/Gui/DlgSettingsViewColor.ui index 8a7d92e6fe..9b2f5301ed 100644 --- a/src/Gui/DlgSettingsViewColor.ui +++ b/src/Gui/DlgSettingsViewColor.ui @@ -148,7 +148,7 @@ - + Background color @@ -342,7 +342,7 @@ - + Qt::Vertical @@ -355,296 +355,6 @@ - - - - Default colors - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - 0 - - - 6 - - - - - - 240 - 0 - - - - Edited edge color - - - - - - - Edited vertex color - - - - - - - Construction geometry - - - - - - - Fully constrained geometry - - - - - - - The color of construction geometry in edit mode - - - - 0 - 0 - 220 - - - - ConstructionColor - - - View - - - - - - - The color of fully constrained geometry in edit mode - - - - 0 - 255 - 0 - - - - FullyConstrainedColor - - - View - - - - - - - The color of vertices being edited - - - - 255 - 38 - 0 - - - - EditedVertexColor - - - View - - - - - - - The color of edges being edited - - - - 255 - 255 - 255 - - - - EditedEdgeColor - - - View - - - - - - - Cursor text color - - - - - - - - 0 - 0 - 255 - - - - CursorTextColor - - - View - - - - - - - Bounding box color - - - - - - - The color of bounding boxes in the 3D view - - - - 255 - 255 - 255 - - - - BoundingBoxColor - - - View - - - - - - - - - - - - 240 - 0 - - - - Default shape color - - - - - - - The default color for new shapes - - - - 204 - 204 - 204 - - - - DefaultShapeColor - - - View - - - - - - - - - - - - 182 - 0 - - - - Default line width and color - - - - - - - The default line color for new shapes - - - - 25 - 25 - 25 - - - - DefaultShapeLineColor - - - View - - - - - - - The default line thickness for new shapes - - - px - - - 2 - - - DefaultShapeLineWidth - - - View - - - - - - - - @@ -653,11 +363,6 @@ QPushButton
Gui/Widgets.h
- - Gui::PrefSpinBox - QSpinBox -
Gui/PrefWidgets.h
-
Gui::PrefColorButton Gui::ColorButton @@ -679,15 +384,6 @@ checkBoxSelection HighlightColor SelectionColor - DefaultShapeColor - DefaultShapeLineWidth - DefaultShapeLineColor - CursorTextColor - EditedEdgeColor - EditedVertexColor - ConstructionColor - FullyConstrainedColor - BoundingBoxColor radioButtonSimple SelectionColor_Background radioButtonGradient diff --git a/src/Mod/Part/Gui/AppPartGui.cpp b/src/Mod/Part/Gui/AppPartGui.cpp index 8a368bf641..8cef483084 100644 --- a/src/Mod/Part/Gui/AppPartGui.cpp +++ b/src/Mod/Part/Gui/AppPartGui.cpp @@ -50,6 +50,7 @@ #include "ViewProviderRuledSurface.h" #include "DlgSettingsGeneral.h" +#include "DlgSettingsObjectColor.h" #include "DlgSettings3DViewPartImp.h" #include "Workbench.h" @@ -146,6 +147,7 @@ void PartGuiExport initPartGui() // register preferences pages (void)new Gui::PrefPageProducer ( QT_TRANSLATE_NOOP("QObject","Part design") ); (void)new Gui::PrefPageProducer ( QT_TRANSLATE_NOOP("QObject","Part design") ); + (void)new Gui::PrefPageProducer ( QT_TRANSLATE_NOOP("QObject","Display") ); Gui::ViewProviderBuilder::add( Part::PropertyPartShape::getClassTypeId(), PartGui::ViewProviderPart::getClassTypeId()); diff --git a/src/Mod/Part/Gui/CMakeLists.txt b/src/Mod/Part/Gui/CMakeLists.txt index c2d457ba20..5da5d56f70 100644 --- a/src/Mod/Part/Gui/CMakeLists.txt +++ b/src/Mod/Part/Gui/CMakeLists.txt @@ -38,6 +38,7 @@ set(PartGui_MOC_HDRS DlgRevolution.h DlgSettings3DViewPartImp.h DlgSettingsGeneral.h + DlgSettingsObjectColor.h TaskFaceColors.h TaskShapeBuilder.h TaskLoft.h @@ -66,6 +67,7 @@ set(PartGui_UIC_SRCS DlgRevolution.ui DlgSettings3DViewPart.ui DlgSettingsGeneral.ui + DlgSettingsObjectColor.ui TaskFaceColors.ui TaskShapeBuilder.ui TaskLoft.ui @@ -121,6 +123,9 @@ SET(PartGui_SRCS DlgSettingsGeneral.cpp DlgSettingsGeneral.h DlgSettingsGeneral.ui + DlgSettingsObjectColor.cpp + DlgSettingsObjectColor.h + DlgSettingsObjectColor.ui Resources/Part.qrc PreCompiled.cpp PreCompiled.h diff --git a/src/Mod/Part/Gui/DlgSettingsObjectColor.cpp b/src/Mod/Part/Gui/DlgSettingsObjectColor.cpp new file mode 100644 index 0000000000..1ce9eb5554 --- /dev/null +++ b/src/Mod/Part/Gui/DlgSettingsObjectColor.cpp @@ -0,0 +1,94 @@ +/*************************************************************************** + * Copyright (c) 2013 Werner Mayer * + * * + * 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" + +#ifndef _PreComp_ +#endif + +#include "DlgSettingsObjectColor.h" +#include + +using namespace PartGui; + +/* TRANSLATOR PartGui::DlgSettingsObjectColor */ + +/** + * Constructs a DlgSettingsObjectColor which is a child of 'parent', with the + * name 'name' and widget flags set to 'f' + */ +DlgSettingsObjectColor::DlgSettingsObjectColor(QWidget* parent) + : PreferencePage(parent) +{ + this->setupUi(this); +} + +/** + * Destroys the object and frees any allocated resources + */ +DlgSettingsObjectColor::~DlgSettingsObjectColor() +{ + // no need to delete child widgets, Qt does it all for us +} + +void DlgSettingsObjectColor::saveSettings() +{ + CursorTextColor->onSave(); + EditedEdgeColor->onSave(); + EditedVertexColor->onSave(); + ConstructionColor->onSave(); + FullyConstrainedColor->onSave(); + BoundingBoxColor->onSave(); + DefaultShapeColor->onSave(); + DefaultShapeLineColor->onSave(); + DefaultShapeLineWidth->onSave(); +} + +void DlgSettingsObjectColor::loadSettings() +{ + CursorTextColor->onRestore(); + EditedEdgeColor->onRestore(); + EditedVertexColor->onRestore(); + ConstructionColor->onRestore(); + FullyConstrainedColor->onRestore(); + BoundingBoxColor->onRestore(); + DefaultShapeColor->onRestore(); + DefaultShapeLineColor->onRestore(); + DefaultShapeLineWidth->onRestore(); +} + +/** + * Sets the strings of the subwidgets using the current language. + */ +void DlgSettingsObjectColor::changeEvent(QEvent *e) +{ + if (e->type() == QEvent::LanguageChange) { + retranslateUi(this); + } + else { + QWidget::changeEvent(e); + } +} + +#include "moc_DlgSettingsObjectColor.cpp" + diff --git a/src/Mod/Part/Gui/DlgSettingsObjectColor.h b/src/Mod/Part/Gui/DlgSettingsObjectColor.h new file mode 100644 index 0000000000..5d327eb7fa --- /dev/null +++ b/src/Mod/Part/Gui/DlgSettingsObjectColor.h @@ -0,0 +1,54 @@ +/*************************************************************************** + * Copyright (c) 2013 Werner Mayer * + * * + * 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 PARTGUI_DIALOG_DLGSETTINGSOBJECTCOLOR_H +#define PARTGUI_DIALOG_DLGSETTINGSOBJECTCOLOR_H + +#include "ui_DlgSettingsObjectColor.h" +#include + +namespace PartGui { + +/** + * The DlgSettingsObjectColor class implements a preference page to change color settings + * for data objects. + * @author Werner Mayer + */ +class DlgSettingsObjectColor : public Gui::Dialog::PreferencePage, public Ui_DlgSettingsObjectColor +{ + Q_OBJECT + +public: + DlgSettingsObjectColor(QWidget* parent = 0); + ~DlgSettingsObjectColor(); + + void saveSettings(); + void loadSettings(); + +protected: + void changeEvent(QEvent *e); +}; + +} // namespace Gui + +#endif // PARTGUI_DIALOG_DLGSETTINGSOBJECTCOLOR_H diff --git a/src/Mod/Part/Gui/DlgSettingsObjectColor.ui b/src/Mod/Part/Gui/DlgSettingsObjectColor.ui new file mode 100644 index 0000000000..7913af9949 --- /dev/null +++ b/src/Mod/Part/Gui/DlgSettingsObjectColor.ui @@ -0,0 +1,358 @@ + + + PartGui::DlgSettingsObjectColor + + + + 0 + 0 + 601 + 598 + + + + Object Colors + + + + 9 + + + 6 + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Default colors + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + 0 + + + 6 + + + + + + 240 + 0 + + + + Edited edge color + + + + + + + Edited vertex color + + + + + + + Construction geometry + + + + + + + Fully constrained geometry + + + + + + + The color of construction geometry in edit mode + + + + 0 + 0 + 220 + + + + ConstructionColor + + + View + + + + + + + The color of fully constrained geometry in edit mode + + + + 0 + 255 + 0 + + + + FullyConstrainedColor + + + View + + + + + + + The color of vertices being edited + + + + 255 + 38 + 0 + + + + EditedVertexColor + + + View + + + + + + + The color of edges being edited + + + + 255 + 255 + 255 + + + + EditedEdgeColor + + + View + + + + + + + Cursor text color + + + + + + + + 0 + 0 + 255 + + + + CursorTextColor + + + View + + + + + + + Bounding box color + + + + + + + The color of bounding boxes in the 3D view + + + + 255 + 255 + 255 + + + + BoundingBoxColor + + + View + + + + + + + + + + + + 240 + 0 + + + + Default shape color + + + + + + + The default color for new shapes + + + + 204 + 204 + 204 + + + + DefaultShapeColor + + + View + + + + + + + + + + + + 182 + 0 + + + + Default line width and color + + + + + + + The default line color for new shapes + + + + 25 + 25 + 25 + + + + DefaultShapeLineColor + + + View + + + + + + + The default line thickness for new shapes + + + px + + + 2 + + + DefaultShapeLineWidth + + + View + + + + + + + + + + + + + Gui::ColorButton + QPushButton +
Gui/Widgets.h
+
+ + Gui::PrefSpinBox + QSpinBox +
Gui/PrefWidgets.h
+
+ + Gui::PrefColorButton + Gui::ColorButton +
Gui/PrefWidgets.h
+
+
+ + DefaultShapeColor + DefaultShapeLineWidth + DefaultShapeLineColor + CursorTextColor + EditedEdgeColor + EditedVertexColor + ConstructionColor + FullyConstrainedColor + BoundingBoxColor + + + +