MCPcopy Create free account
hub / github.com/dail8859/NotepadNext / applyStyleSheet

Method applyStyleSheet

src/dialogs/MainWindow.cpp:1796–1821  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1794}
1795
1796void MainWindow::applyStyleSheet()
1797{
1798 qInfo(Q_FUNC_INFO);
1799
1800 QString sheet;
1801 QFile f(":/stylesheets/npp.css");
1802 qInfo() << "Loading stylesheet:" << f.fileName();
1803
1804 f.open(QFile::ReadOnly);
1805 sheet = f.readAll();
1806 f.close();
1807
1808 // If there is a "custom.css" file where the ini is located, load it as a style sheet addition
1809 QString directoryPath = QFileInfo(app->getSettings()->fileName()).absolutePath();
1810 QString fullPath = QDir(directoryPath).filePath("custom.css");
1811 if (QFile::exists(fullPath)) {
1812 QFile custom(fullPath);
1813 qInfo() << "Loading stylesheet:" << custom.fileName();
1814
1815 custom.open(QFile::ReadOnly);
1816 sheet += custom.readAll();
1817 custom.close();
1818 }
1819
1820 setStyleSheet(sheet);
1821}
1822
1823void MainWindow::setLanguage(ScintillaNext *editor, const QString &languageName)
1824{

Callers

nothing calls this directly

Calls 2

closeMethod · 0.80
getSettingsMethod · 0.80

Tested by

no test coverage detected