Commit e56957ac authored by Sylvain Thery's avatar Sylvain Thery

bug mac colorSelection

parent e74095de
......@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>240</width>
<width>276</width>
<height>600</height>
</rect>
</property>
......@@ -115,7 +115,7 @@
<item>
<widget class="QPushButton" name="scolorButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
......@@ -214,7 +214,7 @@
<item>
<widget class="QPushButton" name="dcolorButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
......@@ -390,6 +390,18 @@
</item>
<item>
<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">
<string>Back Color</string>
</property>
......@@ -424,6 +436,18 @@
</item>
<item>
<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">
<string>Front n Back</string>
</property>
......
......@@ -54,7 +54,7 @@ private slots:
void vertexColorClicked();
void backColorClicked();
void bothColorClicked();
void colorSelected(const QColor& col);
void colorSelected();
private:
void addPositionVBO(QString name);
......
......@@ -36,7 +36,8 @@ Surface_Render_DockTab::Surface_Render_DockTab(SCHNApps* s, Surface_Render_Plugi
connect(vcolorButton,SIGNAL(clicked()),this,SLOT(vertexColorClicked()));
connect(bfcolorButton, SIGNAL(clicked()), this, SLOT(backColorClicked()));
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()
}
void Surface_Render_DockTab::colorSelected(const QColor& col)
void Surface_Render_DockTab::colorSelected()
{
QColor col = m_colorDial->currentColor();
if (m_currentColorDial == 1)
{
m_diffuseColor = col;
......
......@@ -975,7 +975,6 @@ void SCHNApps::showHidePythonDock()
void SCHNApps::execPythonCmd(const QString& cmd)
{
#ifdef WIN32
QString line = cmd;
if (line.size() >= 2)
{
......@@ -986,10 +985,6 @@ void SCHNApps::execPythonCmd(const QString& cmd)
m_pythonConsole.consoleMessage(spaces + line);
m_pythonConsole.executeLine(false);
}
#else
m_pythonConsole.consoleMessage(cmd);
m_pythonConsole.executeLine(false);
#endif
}
void SCHNApps::loadPythonScriptFromFile(const QString& fileName)
......@@ -1189,7 +1184,7 @@ void SCHNApps::setPythonShortcut(const QString& keys, const QString& command)
if (keys.length() == 1)
{
k = keys[0].unicode();
k = keys[0].toUpper().unicode();
}
else
{
......@@ -1205,7 +1200,7 @@ void SCHNApps::setPythonShortcut(const QString& keys, const QString& command)
k |= Qt::KeypadModifier;
k <<= 32;
QChar c = keys[keys.length() - 1];
QChar c = keys[keys.length() - 1].toUpper();
k |= c.unicode();
}
......
......@@ -508,34 +508,12 @@ void View::keyPressEvent(QKeyEvent* event)
k <<= 32;
k |= event->key();
// exec python shortcuts if exist
m_schnapps->execPythonShortcut(k);
// exec python shortcuts if exist and stop propagation of event !
if (m_schnapps->execPythonShortcut(k))
return;
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:
{
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