Commit e56957ac authored by Sylvain Thery's avatar Sylvain Thery

bug mac colorSelection

parent e74095de
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>240</width> <width>276</width>
<height>600</height> <height>600</height>
</rect> </rect>
</property> </property>
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
<item> <item>
<widget class="QPushButton" name="scolorButton"> <widget class="QPushButton" name="scolorButton">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
...@@ -214,7 +214,7 @@ ...@@ -214,7 +214,7 @@
<item> <item>
<widget class="QPushButton" name="dcolorButton"> <widget class="QPushButton" name="dcolorButton">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
...@@ -390,6 +390,18 @@ ...@@ -390,6 +390,18 @@
</item> </item>
<item> <item>
<widget class="QPushButton" name="bfcolorButton"> <widget class="QPushButton" name="bfcolorButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>32</height>
</size>
</property>
<property name="text"> <property name="text">
<string>Back Color</string> <string>Back Color</string>
</property> </property>
...@@ -424,6 +436,18 @@ ...@@ -424,6 +436,18 @@
</item> </item>
<item> <item>
<widget class="QPushButton" name="bothcolorButton"> <widget class="QPushButton" name="bothcolorButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>32</height>
</size>
</property>
<property name="text"> <property name="text">
<string>Front n Back</string> <string>Front n Back</string>
</property> </property>
......
...@@ -54,7 +54,7 @@ private slots: ...@@ -54,7 +54,7 @@ private slots:
void vertexColorClicked(); void vertexColorClicked();
void backColorClicked(); void backColorClicked();
void bothColorClicked(); void bothColorClicked();
void colorSelected(const QColor& col); void colorSelected();
private: private:
void addPositionVBO(QString name); void addPositionVBO(QString name);
......
...@@ -36,7 +36,8 @@ Surface_Render_DockTab::Surface_Render_DockTab(SCHNApps* s, Surface_Render_Plugi ...@@ -36,7 +36,8 @@ Surface_Render_DockTab::Surface_Render_DockTab(SCHNApps* s, Surface_Render_Plugi
connect(vcolorButton,SIGNAL(clicked()),this,SLOT(vertexColorClicked())); connect(vcolorButton,SIGNAL(clicked()),this,SLOT(vertexColorClicked()));
connect(bfcolorButton, SIGNAL(clicked()), this, SLOT(backColorClicked())); connect(bfcolorButton, SIGNAL(clicked()), this, SLOT(backColorClicked()));
connect(bothcolorButton, SIGNAL(clicked()), this, SLOT(bothColorClicked())); connect(bothcolorButton, SIGNAL(clicked()), this, SLOT(bothColorClicked()));
connect(m_colorDial,SIGNAL(colorSelected(const QColor&)),this,SLOT(colorSelected(const QColor&))); connect(m_colorDial,SIGNAL(accepted()),this,SLOT(colorSelected()));
} }
...@@ -235,8 +236,9 @@ void Surface_Render_DockTab::bothColorClicked() ...@@ -235,8 +236,9 @@ void Surface_Render_DockTab::bothColorClicked()
} }
void Surface_Render_DockTab::colorSelected(const QColor& col) void Surface_Render_DockTab::colorSelected()
{ {
QColor col = m_colorDial->currentColor();
if (m_currentColorDial == 1) if (m_currentColorDial == 1)
{ {
m_diffuseColor = col; m_diffuseColor = col;
......
...@@ -975,7 +975,6 @@ void SCHNApps::showHidePythonDock() ...@@ -975,7 +975,6 @@ void SCHNApps::showHidePythonDock()
void SCHNApps::execPythonCmd(const QString& cmd) void SCHNApps::execPythonCmd(const QString& cmd)
{ {
#ifdef WIN32
QString line = cmd; QString line = cmd;
if (line.size() >= 2) if (line.size() >= 2)
{ {
...@@ -986,10 +985,6 @@ void SCHNApps::execPythonCmd(const QString& cmd) ...@@ -986,10 +985,6 @@ void SCHNApps::execPythonCmd(const QString& cmd)
m_pythonConsole.consoleMessage(spaces + line); m_pythonConsole.consoleMessage(spaces + line);
m_pythonConsole.executeLine(false); m_pythonConsole.executeLine(false);
} }
#else
m_pythonConsole.consoleMessage(cmd);
m_pythonConsole.executeLine(false);
#endif
} }
void SCHNApps::loadPythonScriptFromFile(const QString& fileName) void SCHNApps::loadPythonScriptFromFile(const QString& fileName)
...@@ -1189,7 +1184,7 @@ void SCHNApps::setPythonShortcut(const QString& keys, const QString& command) ...@@ -1189,7 +1184,7 @@ void SCHNApps::setPythonShortcut(const QString& keys, const QString& command)
if (keys.length() == 1) if (keys.length() == 1)
{ {
k = keys[0].unicode(); k = keys[0].toUpper().unicode();
} }
else else
{ {
...@@ -1205,7 +1200,7 @@ void SCHNApps::setPythonShortcut(const QString& keys, const QString& command) ...@@ -1205,7 +1200,7 @@ void SCHNApps::setPythonShortcut(const QString& keys, const QString& command)
k |= Qt::KeypadModifier; k |= Qt::KeypadModifier;
k <<= 32; k <<= 32;
QChar c = keys[keys.length() - 1]; QChar c = keys[keys.length() - 1].toUpper();
k |= c.unicode(); k |= c.unicode();
} }
......
...@@ -508,34 +508,12 @@ void View::keyPressEvent(QKeyEvent* event) ...@@ -508,34 +508,12 @@ void View::keyPressEvent(QKeyEvent* event)
k <<= 32; k <<= 32;
k |= event->key(); k |= event->key();
// exec python shortcuts if exist // exec python shortcuts if exist and stop propagation of event !
m_schnapps->execPythonShortcut(k); if (m_schnapps->execPythonShortcut(k))
return;
switch (event->key()) switch (event->key())
{ {
case Qt::Key_Z:
{
/* const glm::mat4& msv = getCurrentCamera()->getTransfoMatrix();
float sx = msv[0][0];
float sy = msv[1][1];
float sz = msv[2][2];
Utils::QT::inputValues(
Utils::QT::VarFloat(0.1f, 10.0f, sx, "Scale X",
Utils::QT::VarFloat(0.1f, 10.0f, sy, "Scale Y",
Utils::QT::VarFloat(0.1f, 10.0f, sz, "Scale Z"))), "Scaling view");
getCurrentCamera()->setScaling(sx, sy, sz);
QString msg = QString("Sx=") + QString::number(msv[0][0]) + QString(" / Sy=") + QString::number(msv[1][1]) + QString(" / Sz=") + QString::number(msv[2][2]);
m_schnapps->statusBar()->showMessage(msg, 2000);
QTextStream* rec = m_schnapps->pythonStreamRecorder();
if (rec)
*rec << this->getName() << " getCurrentCamera().setScaling(" << sx << ", " << sy << ", " << sz << ");" << endl;*/
}
break;
case Qt::Key_S: case Qt::Key_S:
{ {
b_saveSnapshots = !b_saveSnapshots; b_saveSnapshots = !b_saveSnapshots;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment