23 setFeatures(QDockWidget::DockWidgetClosable);
25 setWindowTitle(generateGlslIsfTitle());
27 scrollArea =
new QScrollArea(
this);
28 scrollArea->setWidgetResizable(
true);
29 setWidget(scrollArea);
31 label =
new QLabel(
this);
34 label->setWordWrap(
true);
35 label->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse);
36 label->setOpenExternalLinks(
true);
37 scrollArea->setWidget(label);
46 void VuoDocumentationSidebar::updateColor()
48 bool isDark =
static_cast<VuoEditor *
>(qApp)->isInterfaceDark();
51 QString titleTextColor = isDark ?
"#303030" :
"#808080";
52 QString titleBackgroundColor = isDark ?
"#919191" :
"#efefef";
53 QString contentBackgroundColor = isDark ?
"#282828" :
"#f9f9f9";
54 setStyleSheet(VUO_QSTRINGIFY(
56 titlebar-close-icon: url(:/Icons/dockwidget-close-%4.png);
67 border-left: 1px solid %2;
77 .arg(titleBackgroundColor)
78 .arg(contentBackgroundColor)
79 .arg(isDark ?
"dark" :
"light")
83 generateGlslIsfText();
84 label->setText(content);
90 QString VuoDocumentationSidebar::generateGlslIsfTitle()
92 return "GLSL/ISF Quick Reference";
98 QString VuoDocumentationSidebar::generateGlslIsfText()
100 QFile file(QApplication::applicationDirPath().append(
"/../Resources/GlslIsfQuickReference.md"));
101 file.open(QIODevice::ReadOnly);
102 QTextStream textStream(&file);
103 string markdown = textStream.readAll().toStdString();
105 return QString::fromStdString(html);
113 return label->selectedText();