summaryrefslogtreecommitdiff
path: root/Preferences.cc
diff options
context:
space:
mode:
authorkintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c>2010-01-21 19:18:21 (GMT)
committerkintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c>2010-01-21 19:18:21 (GMT)
commit0a3a7b15794053299dbe16cf6fd5e42c27853945 (patch)
treec97266987e195dc3c849168c958ae96a649ca1d6 /Preferences.cc
parent9ce0a168d05901bd251e65af8bf652b49486639e (diff)
Added first mockup of a color scheme chooser
git-svn-id: http://svn.clifford.at/openscad/trunk@332 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'Preferences.cc')
-rw-r--r--Preferences.cc59
1 files changed, 49 insertions, 10 deletions
diff --git a/Preferences.cc b/Preferences.cc
index f098ab4..1c7f988 100644
--- a/Preferences.cc
+++ b/Preferences.cc
@@ -26,16 +26,39 @@ Preferences::Preferences(QWidget *parent) : QMainWindow(parent)
{
setupUi(this);
- this->colormap[BACKGROUND_COLOR] = QColor(0xff, 0xff, 0xe5);
- this->colormap[OPENCSG_FACE_FRONT_COLOR] = QColor(0xf9, 0xd7, 0x2c);
- this->colormap[OPENCSG_FACE_BACK_COLOR] = QColor(0x9d, 0xcb, 0x51);
- this->colormap[CGAL_FACE_FRONT_COLOR] = QColor(0xf9, 0xd7, 0x2c);
- this->colormap[CGAL_FACE_BACK_COLOR] = QColor(0x9d, 0xcb, 0x51);
- this->colormap[CGAL_FACE_2D_COLOR] = QColor(0x00, 0xbf, 0x99);
- this->colormap[CGAL_EDGE_FRONT_COLOR] = QColor(0xff, 0x00, 0x00);
- this->colormap[CGAL_EDGE_BACK_COLOR] = QColor(0xff, 0x00, 0x00);
- this->colormap[CGAL_EDGE_2D_COLOR] = QColor(0xff, 0x00, 0x00);
- this->colormap[CROSSHAIR_COLOR] = QColor(0x80, 0x00, 0x00);
+ this->colorscheme = this->colorSchemeChooser->item(0)->text();
+ this->colorschemes["Cornfield"][BACKGROUND_COLOR] = QColor(0xff, 0xff, 0xe5);
+ this->colorschemes["Cornfield"][OPENCSG_FACE_FRONT_COLOR] = QColor(0xf9, 0xd7, 0x2c);
+ this->colorschemes["Cornfield"][OPENCSG_FACE_BACK_COLOR] = QColor(0x9d, 0xcb, 0x51);
+ this->colorschemes["Cornfield"][CGAL_FACE_FRONT_COLOR] = QColor(0xf9, 0xd7, 0x2c);
+ this->colorschemes["Cornfield"][CGAL_FACE_BACK_COLOR] = QColor(0x9d, 0xcb, 0x51);
+ this->colorschemes["Cornfield"][CGAL_FACE_2D_COLOR] = QColor(0x00, 0xbf, 0x99);
+ this->colorschemes["Cornfield"][CGAL_EDGE_FRONT_COLOR] = QColor(0xff, 0x00, 0x00);
+ this->colorschemes["Cornfield"][CGAL_EDGE_BACK_COLOR] = QColor(0xff, 0x00, 0x00);
+ this->colorschemes["Cornfield"][CGAL_EDGE_2D_COLOR] = QColor(0xff, 0x00, 0x00);
+ this->colorschemes["Cornfield"][CROSSHAIR_COLOR] = QColor(0x80, 0x00, 0x00);
+
+ this->colorschemes["Metallic"][BACKGROUND_COLOR] = QColor(0xaa, 0xaa, 0xff);
+ this->colorschemes["Metallic"][OPENCSG_FACE_FRONT_COLOR] = QColor(0xdd, 0xdd, 0xff);
+ this->colorschemes["Metallic"][OPENCSG_FACE_BACK_COLOR] = QColor(0xdd, 0x22, 0xdd);
+ this->colorschemes["Metallic"][CGAL_FACE_FRONT_COLOR] = QColor(0xdd, 0xdd, 0xff);
+ this->colorschemes["Metallic"][CGAL_FACE_BACK_COLOR] = QColor(0xdd, 0x22, 0xdd);
+ this->colorschemes["Metallic"][CGAL_FACE_2D_COLOR] = QColor(0x00, 0xbf, 0x99);
+ this->colorschemes["Metallic"][CGAL_EDGE_FRONT_COLOR] = QColor(0xff, 0x00, 0x00);
+ this->colorschemes["Metallic"][CGAL_EDGE_BACK_COLOR] = QColor(0xff, 0x00, 0x00);
+ this->colorschemes["Metallic"][CGAL_EDGE_2D_COLOR] = QColor(0xff, 0x00, 0x00);
+ this->colorschemes["Metallic"][CROSSHAIR_COLOR] = QColor(0x80, 0x00, 0x00);
+
+ this->colorschemes["Sunset"][BACKGROUND_COLOR] = QColor(0xaa, 0x44, 0x44);
+ this->colorschemes["Sunset"][OPENCSG_FACE_FRONT_COLOR] = QColor(0xff, 0xaa, 0xaa);
+ this->colorschemes["Sunset"][OPENCSG_FACE_BACK_COLOR] = QColor(0x88, 0x22, 0x33);
+ this->colorschemes["Sunset"][CGAL_FACE_FRONT_COLOR] = QColor(0xff, 0xaa, 0xaa);
+ this->colorschemes["Sunset"][CGAL_FACE_BACK_COLOR] = QColor(0x88, 0x22, 0x33);
+ this->colorschemes["Sunset"][CGAL_FACE_2D_COLOR] = QColor(0x00, 0xbf, 0x99);
+ this->colorschemes["Sunset"][CGAL_EDGE_FRONT_COLOR] = QColor(0xff, 0x00, 0x00);
+ this->colorschemes["Sunset"][CGAL_EDGE_BACK_COLOR] = QColor(0xff, 0x00, 0x00);
+ this->colorschemes["Sunset"][CGAL_EDGE_2D_COLOR] = QColor(0xff, 0x00, 0x00);
+ this->colorschemes["Sunset"][CROSSHAIR_COLOR] = QColor(0x80, 0x00, 0x00);
QActionGroup *group = new QActionGroup(this);
group->addAction(prefsAction3DView);
@@ -44,6 +67,10 @@ Preferences::Preferences(QWidget *parent) : QMainWindow(parent)
prefsAction3DView->setChecked(true);
this->actionTriggered(this->prefsAction3DView);
+
+ connect(this->colorSchemeChooser, SIGNAL(itemSelectionChanged()),
+ this, SLOT(colorSchemeChanged()));
+
}
Preferences::~Preferences()
@@ -60,3 +87,15 @@ Preferences::actionTriggered(QAction *action)
this->stackedWidget->setCurrentWidget(this->pageAdvanced);
}
}
+
+void Preferences::colorSchemeChanged()
+{
+ this->colorscheme = this->colorSchemeChooser->currentItem()->text();
+ emit requestRedraw();
+}
+
+const QColor &Preferences::color(RenderColor idx)
+{
+ return this->colorschemes[this->colorscheme][idx];
+}
+
contact: Jan Huwald // Impressum