44 if (type == VuoShaderFile::GLSLImageFilter
45 || type == VuoShaderFile::GLSLImageGenerator
46 || type == VuoShaderFile::GLSLImageTransition
47 || type == VuoShaderFile::GLSLObjectRenderer)
96 vertex->document()->setModified(
false);
98 geometry->document()->setModified(
false);
100 fragment->document()->setModified(
false);
142 void VuoCodeEditorStages::keyPressEvent(QKeyEvent *event)
144 int key =
event->key();
145 Qt::KeyboardModifiers modifiers =
event->modifiers();
147 if ( (key == Qt::Key_BracketRight && modifiers & Qt::ControlModifier && modifiers & Qt::ShiftModifier)
148 || (key == Qt::Key_Right && modifiers & Qt::ControlModifier && modifiers & Qt::AltModifier ))
149 setCurrentIndex(currentIndex() + 1);
150 else if ( (key == Qt::Key_BracketLeft && modifiers & Qt::ControlModifier && modifiers & Qt::ShiftModifier)
151 || (key == Qt::Key_Left && modifiers & Qt::ControlModifier && modifiers & Qt::AltModifier ))
152 setCurrentIndex(currentIndex() - 1);
154 QTabWidget::keyPressEvent(event);
157 void VuoCodeEditorStages::updateColor(
bool isDark)
171 QColor tabBackground = e->
gutterColor.lighter(isDark ? 90 : 105);
172 QColor tabBorder = e->
gutterColor.lighter(isDark ? 110 : 97);
175 int gutterWidth = codeEditor->
gutter->width();
177 setStyleSheet(VUO_QSTRINGIFY(
182 QTabWidget::tab-bar {
187 padding: 2px 12px 2px 12px;
188 border: 1px solid %7;
192 QTabBar::tab:selected {
195 border-top: 2px solid %2;
196 border-bottom: 1px solid %3;
197 border-top-left-radius: 4px;
198 border-top-right-radius: 4px;
205 QTabBar::tab:!selected {
213 border-bottom: 1px solid %1;
218 .arg(e->palette().text().color().name())
220 .arg(tabBackground.name())
221 .arg(tabBorder.name())
222 .arg(gutterWidth - 1)
249 if (currentWidget() ==
vertex)
250 return VuoShaderFile::Vertex;
251 else if (currentWidget() ==
geometry)
252 return VuoShaderFile::Geometry;
254 return VuoShaderFile::Fragment;
262 if (stage == VuoShaderFile::Vertex)
264 else if (stage == VuoShaderFile::Geometry)
266 else if (stage == VuoShaderFile::Fragment)