| 1794 | } |
| 1795 | |
| 1796 | void 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 | |
| 1823 | void MainWindow::setLanguage(ScintillaNext *editor, const QString &languageName) |
| 1824 | { |
nothing calls this directly
no test coverage detected