diff --git a/.vscode/settings.json b/.vscode/settings.json index 8f836309..119f22fc 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -90,7 +90,13 @@ "__memory": "cpp", "limits": "cpp", "ratio": "cpp", - "tuple": "cpp" + "tuple": "cpp", + "random": "cpp", + "cstdlib": "cpp", + "charconv": "cpp", + "functional": "cpp", + "type_traits": "cpp", + "utility": "cpp" }, "sqltools.connections": [ { @@ -102,7 +108,7 @@ } ], "sqltools.useNodeRuntime": true, - "workbench.colorTheme": "Nightfox", + "workbench.colorTheme": "Vim Nightfly Theme", "glassit.alpha": 220, "animations.Command-Palette": "Slide", } \ No newline at end of file diff --git a/README.md b/README.md index 26800566..e6f150fc 100644 --- a/README.md +++ b/README.md @@ -35,11 +35,12 @@
Screenshots: - - ![1](https://github.com/Nighty3098/CodeKeeper/assets/154594695/f12d4183-814c-4c43-a11d-73820b634025) - ![2](https://github.com/Nighty3098/CodeKeeper/assets/154594695/4a3e291f-fbe2-4ad4-a5be-7616fde2f98d) - ![3](https://github.com/Nighty3098/CodeKeeper/assets/154594695/34d023cc-2202-4418-a663-408e75e2c081) - ![4](https://github.com/Nighty3098/CodeKeeper/assets/154594695/cea8770d-acf5-4df6-af7f-fc5fa5ae7eaa) + + + + +
+
@@ -142,10 +143,13 @@ - [ ] - Using marked js - [X] - Markdown to HTML converter - [X] - Markdown to PDF converter - +****** - [ ] - Multilang - [ ] - Migrate to CMake - [X] - Update shortcuts +****** + - [ ] - Git Api + - [ ] - Git Sync diff --git a/imgs/1.png b/imgs/1.png index c1c6ab9f..ea7c34b9 100644 Binary files a/imgs/1.png and b/imgs/1.png differ diff --git a/imgs/2.png b/imgs/2.png index d8c5bba7..6cb85a34 100644 Binary files a/imgs/2.png and b/imgs/2.png differ diff --git a/imgs/3.png b/imgs/3.png index 625f1191..0a4833fa 100644 Binary files a/imgs/3.png and b/imgs/3.png differ diff --git a/imgs/4.png b/imgs/4.png index 8b815719..06392e87 100644 Binary files a/imgs/4.png and b/imgs/4.png differ diff --git a/imgs/5.png b/imgs/5.png new file mode 100644 index 00000000..bd9308b9 Binary files /dev/null and b/imgs/5.png differ diff --git a/src/CodeKeeper/keeperFunc/functional.cpp b/src/CodeKeeper/keeperFunc/functional.cpp index 47dfda24..2f88918a 100644 --- a/src/CodeKeeper/keeperFunc/functional.cpp +++ b/src/CodeKeeper/keeperFunc/functional.cpp @@ -52,6 +52,20 @@ void MainWindow::getSettingsData() git_token = globalSettings->value("git_token").value(); isAutoSyncB = globalSettings->value("isAutoSync").value(); + isCreated = globalSettings->value("isCreated").value(); + isReleaseDate = globalSettings->value("isReleaseDate").value(); + isLastCommit = globalSettings->value("isLastCommit").value(); + isPullReq = globalSettings->value("isPullReq").value(); + isLicense = globalSettings->value("isLicense").value(); + isRelease = globalSettings->value("isRelease").value(); + isIssue = globalSettings->value("isIssue").value(); + isDownloads = globalSettings->value("isDownloads").value(); + isCommit = globalSettings->value("isCommit").value(); + isLang = globalSettings->value("isLang").value(); + isStars = globalSettings->value("isStars").value(); + isForks = globalSettings->value("isForks").value(); + isRepoSize = globalSettings->value("isRepoSize").value(); + qDebug() << "🔸 " << dir << selectedFont << font_size << theme << isCustomTitlebar << sortNotesRole << isAutoSyncing << isVisibleNotesList << isVisibleFolders << isVisiblePreview << isViewMode << git_repo << git_user << git_token << isAutoSyncB; @@ -60,28 +74,28 @@ void MainWindow::getSettingsData() void MainWindow::setConnectionStatus() { if (checkConnection()) { - isConnected->setIcon( - QPixmap(":/connected.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation)); + isConnected->setIcon(QPixmap(":/connected.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation)); isConnected->setToolTip("

Connected

"); sizeGrip2->setStyleSheet("background-color: #37d442; border-radius: 5px;"); } else { - isConnected->setIcon( - QPixmap(":/disconnected.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation)); + isConnected->setIcon(QPixmap(":/disconnected.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation)); isConnected->setToolTip("

Disconnected

"); } if (isAutoSyncing) { - isAutoSync->setIcon( - QPixmap(":/auto_sync_on.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation)); + isAutoSync->setIcon(QPixmap(":/auto_sync_on.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation)); isAutoSync->setToolTip("

Auto sync on

"); sizeGrip2->setStyleSheet("background-color: #37d442; border-radius: 5px;"); } else { - isAutoSync->setIcon( - QPixmap(":/auto_sync_off.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation)); + isAutoSync->setIcon(QPixmap(":/auto_sync_off.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation)); isAutoSync->setToolTip("

Auto sync off

"); } } diff --git a/src/CodeKeeper/keeperFunc/projectsFunc.cpp b/src/CodeKeeper/keeperFunc/projectsFunc.cpp index afdc98d1..6e90ae85 100644 --- a/src/CodeKeeper/keeperFunc/projectsFunc.cpp +++ b/src/CodeKeeper/keeperFunc/projectsFunc.cpp @@ -107,54 +107,70 @@ void MainWindow::createGitBadges(QString git_url, QWebEngineView *page) QString prefix = "https://github.com/"; QString repo = git_url.replace(prefix, ""); - page->setHtml("" - "" - "
" - "
" - "
" - "
" - "
" - "
" - "
" - "
" - "
" - " " - "
" - ""); + QString html = "" + "" + " " + "
"; + + if(isCreated) { + html += " "; + } + if(isReleaseDate) { + html += " "; + } + if(isLastCommit) { + html += " "; + } + if(isPullReq) { + html += " "; + } + if(isLicense) { + html += " "; + } + if(isRelease) { + html += " "; + } + if(isIssue) { + html += " "; + } + if(isDownloads) { + html += " "; + } + if(isCommit) { + html += " "; + } + if(isLang) { + html += " "; + } + if(isStars) { + html += " "; + } + if(isForks) { + html += " "; + } + if(isRepoSize) { + html += " "; + } + + html += "
" + " " + ""; + + page->setHtml(html); } void MainWindow::openProject(QListWidget *listWidget, QListWidgetItem *item) { if (item) { QDialog dialog(this); - dialog.setFixedSize(300, 450); + dialog.setFixedSize(400, 550); dialog.setWindowTitle(tr("Edit project")); dialog.setWindowFlags(windowFlags() | Qt::FramelessWindowHint); @@ -187,7 +203,7 @@ void MainWindow::openProject(QListWidget *listWidget, QListWidgetItem *item) linkToGit->setFont(selectedFont); QComboBox *documentation = new QComboBox(); - documentation->setFixedSize(140, 25); + documentation->setFixedSize(190, 25); documentation->setFont(selectedFont); QLabel *lastMod = new QLabel(); @@ -213,9 +229,9 @@ void MainWindow::openProject(QListWidget *listWidget, QListWidgetItem *item) cancelBtn->setText("Cancel"); cancelBtn->setStyleSheet("font-size: " + font_size + "pt;"); cancelBtn->setFixedHeight(25); - cancelBtn->setIcon( - QPixmap(":/quit.png") - .scaled(font_size.toInt() + 3, font_size.toInt() + 3, Qt::KeepAspectRatio, Qt::SmoothTransformation)); + cancelBtn->setIcon(QPixmap(":/quit.png") + .scaled(font_size.toInt() + 3, font_size.toInt() + 3, + Qt::KeepAspectRatio, Qt::SmoothTransformation)); cancelBtn->setIconSize(QSize(10, 10)); cancelBtn->setFont(selectedFont); @@ -223,9 +239,9 @@ void MainWindow::openProject(QListWidget *listWidget, QListWidgetItem *item) openButton->setText("Open"); openButton->setStyleSheet("font-size: " + font_size + "pt;"); openButton->setFixedHeight(25); - openButton->setIcon( - QPixmap(":/read.png") - .scaled(font_size.toInt() + 3, font_size.toInt() + 3, Qt::KeepAspectRatio, Qt::SmoothTransformation)); + openButton->setIcon(QPixmap(":/read.png") + .scaled(font_size.toInt() + 3, font_size.toInt() + 3, + Qt::KeepAspectRatio, Qt::SmoothTransformation)); openButton->setIconSize(QSize(10, 10)); openButton->setFont(selectedFont); diff --git a/src/CodeKeeper/keeperFunc/tasksFunc.cpp b/src/CodeKeeper/keeperFunc/tasksFunc.cpp index 63a5d9c3..eca52afa 100644 --- a/src/CodeKeeper/keeperFunc/tasksFunc.cpp +++ b/src/CodeKeeper/keeperFunc/tasksFunc.cpp @@ -117,7 +117,7 @@ void MainWindow::renameItemOnDoubleClick(QListWidget *listWidget, QListWidgetIte lineEdit.setText(oldData[0]); - QPushButton okButton(tr("OK"), &dialog); + QPushButton okButton(tr("Save"), &dialog); okButton.setFont(selectedFont); okButton.setFixedSize(200, 25); okButton.setStyleSheet("background-color: #2D4F67; border-color: #2D4F67; font-size: " diff --git a/src/CodeKeeper/mainwindow.cpp b/src/CodeKeeper/mainwindow.cpp index 8c3347b7..27e401f0 100644 --- a/src/CodeKeeper/mainwindow.cpp +++ b/src/CodeKeeper/mainwindow.cpp @@ -78,20 +78,22 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) appIcon = new QLabel(); appIcon->setAlignment(Qt::AlignCenter); - appIcon->setPixmap(QPixmap(":/icon.png").scaled(200, 200, Qt::KeepAspectRatio, Qt::SmoothTransformation)); + appIcon->setPixmap( + QPixmap(":/icon.png").scaled(200, 200, Qt::KeepAspectRatio, Qt::SmoothTransformation)); // settings btn - openSettingsBtn = new QPushButton( - QPixmap(":/settings.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation), - " Settings"); + openSettingsBtn = + new QPushButton(QPixmap(":/settings.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + " Settings"); openSettingsBtn->setFixedSize(100, 25); // sync btn - syncDataBtn = new QPushButton( - QPixmap(":/retry.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation), - " Sync data"); + syncDataBtn = new QPushButton(QPixmap(":/retry.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + " Sync data"); syncDataBtn->setFixedSize(100, 25); // ======================================================== @@ -158,9 +160,9 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) connect(noteEdit, &QMarkdownTextEdit::textChanged, this, &MainWindow::setHeader); menuButton = new QToolButton; - menuButton->setIcon( - QPixmap(":/main.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation)); + menuButton->setIcon(QPixmap(":/main.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation)); menuButton->setIconSize(QSize(10, 10)); menuButton->setPopupMode(QToolButton::InstantPopup); menuButton->setStyleSheet( @@ -169,32 +171,34 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) menu = new QMenu(menuButton); QMenu *viewMenu = new QMenu("View", menu); - viewMenu->setIcon( - QPixmap(":/view.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation)); - - newNote = menu->addAction( - QPixmap(":/new.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation), - "New Note", this, SLOT(createNote()), Qt::CTRL + Qt::Key_N); - rmNote = menu->addAction( - QPixmap(":/delete.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation), - "Remove", this, SLOT(removeNote()), Qt::CTRL + Qt::Key_Delete); - newFolder = menu->addAction( - QPixmap(":/new_folder.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation), - "New folder", this, SLOT(createFolder()), Qt::CTRL + Qt::SHIFT + Qt::Key_N); - renameItemA = menu->addAction( - QPixmap(":/rename.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation), - "Rename", this, SLOT(renameItem()), Qt::Key_F2); + viewMenu->setIcon(QPixmap(":/view.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation)); + + newNote = menu->addAction(QPixmap(":/new.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + "New Note", this, SLOT(createNote()), Qt::CTRL + Qt::Key_N); + rmNote = menu->addAction(QPixmap(":/delete.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + "Remove", this, SLOT(removeNote()), Qt::CTRL + Qt::Key_Delete); + newFolder = menu->addAction(QPixmap(":/new_folder.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + "New folder", this, SLOT(createFolder()), + Qt::CTRL + Qt::SHIFT + Qt::Key_N); + renameItemA = menu->addAction(QPixmap(":/rename.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + "Rename", this, SLOT(renameItem()), Qt::Key_F2); menu->addSeparator(); expandAllA = menu->addAction( QPixmap(":/expand.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation), + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, + Qt::SmoothTransformation), "Expand on one stage", [this]() { notesList->expandAll(); }, Qt::CTRL + Qt::Key_E); menu->addSeparator(); @@ -207,79 +211,81 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) showRender->setCheckable(true); showRender->setChecked(isVisiblePreview); viewMenu->addSeparator(); - viewMode = viewMenu->addAction( - QPixmap(":/view.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation), - "Reading mode", this, SLOT(toViewMode()), Qt::CTRL + Qt::SHIFT + Qt::Key_V); + viewMode = viewMenu->addAction(QPixmap(":/view.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + "Reading mode", this, SLOT(toViewMode()), + Qt::CTRL + Qt::SHIFT + Qt::Key_V); viewMode->setCheckable(true); viewMode->setChecked(isViewMode); QMenu *editMenu = new QMenu("Edit", menu); - editMenu->setIcon( - QPixmap(":/edit.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation)); - setH1A = editMenu->addAction( - QPixmap(":/h1.png") - .scaled(font_size.toInt() + 3, font_size.toInt() + 3, Qt::KeepAspectRatio, Qt::SmoothTransformation), - "Set H1", this, SLOT(setH1())); - setH2A = editMenu->addAction( - QPixmap(":/h2.png") - .scaled(font_size.toInt() + 3, font_size.toInt() + 3, Qt::KeepAspectRatio, Qt::SmoothTransformation), - "Set H2", this, SLOT(setH2())); - setH3A = editMenu->addAction( - QPixmap(":/h3.png") - .scaled(font_size.toInt() + 3, font_size.toInt() + 3, Qt::KeepAspectRatio, Qt::SmoothTransformation), - "Set H3", this, SLOT(setH3())); + editMenu->setIcon(QPixmap(":/edit.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation)); + setH1A = editMenu->addAction(QPixmap(":/h1.png") + .scaled(font_size.toInt() + 3, font_size.toInt() + 3, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + "Set H1", this, SLOT(setH1())); + setH2A = editMenu->addAction(QPixmap(":/h2.png") + .scaled(font_size.toInt() + 3, font_size.toInt() + 3, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + "Set H2", this, SLOT(setH2())); + setH3A = editMenu->addAction(QPixmap(":/h3.png") + .scaled(font_size.toInt() + 3, font_size.toInt() + 3, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + "Set H3", this, SLOT(setH3())); editMenu->addSeparator(); - setQuoteA = editMenu->addAction( - QPixmap(":/quote.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation), - "Add quote", this, SLOT(setQuote())); - setListA = editMenu->addAction( - QPixmap(":/list.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation), - "Add list item", this, SLOT(setList())); - setNumListA = editMenu->addAction( - QPixmap(":/numList.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation), - "Add numbered list", this, SLOT(setNumList())); - setLinkA = editMenu->addAction( - QPixmap(":/link.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation), - "Add link", this, SLOT(setLink())); - setTaskA = editMenu->addAction( - QPixmap(":/checkbox.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation), - "Add task", this, SLOT(setTask())); + setQuoteA = editMenu->addAction(QPixmap(":/quote.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + "Add quote", this, SLOT(setQuote())); + setListA = editMenu->addAction(QPixmap(":/list.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + "Add list item", this, SLOT(setList())); + setNumListA = + editMenu->addAction(QPixmap(":/numList.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + "Add numbered list", this, SLOT(setNumList())); + setLinkA = editMenu->addAction(QPixmap(":/link.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + "Add link", this, SLOT(setLink())); + setTaskA = editMenu->addAction(QPixmap(":/checkbox.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + "Add task", this, SLOT(setTask())); editMenu->addSeparator(); - setBoldA = editMenu->addAction( - QPixmap(":/bold.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation), - "Set bold", this, SLOT(setBold())); - setItalicA = editMenu->addAction( - QPixmap(":/italic.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation), - "Set italic", this, SLOT(setItalic())); - setStrikeA = editMenu->addAction( - QPixmap(":/strikethrough.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation), - "Set strikethrough", this, SLOT(setStrike())); - setTableA = editMenu->addAction( - QPixmap(":/table.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation), - "Add table", this, SLOT(setTable())); + setBoldA = editMenu->addAction(QPixmap(":/bold.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + "Set bold", this, SLOT(setBold())); + setItalicA = editMenu->addAction(QPixmap(":/italic.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + "Set italic", this, SLOT(setItalic())); + setStrikeA = editMenu->addAction(QPixmap(":/strikethrough.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + "Set strikethrough", this, SLOT(setStrike())); + setTableA = editMenu->addAction(QPixmap(":/table.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + "Add table", this, SLOT(setTable())); QMenu *sortMenu = new QMenu("Sort by", menu); - sortMenu->setIcon( - QPixmap(":/sorting.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation)); + sortMenu->setIcon(QPixmap(":/sorting.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation)); nameAction = sortMenu->addAction("Name", this, SLOT(setSortByName())); dateAction = sortMenu->addAction("Date", this, SLOT(setSortByTime())); QMenu *exportMenu = new QMenu("Export as", menu); - exportMenu->setIcon( - QPixmap(":/export.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation)); + exportMenu->setIcon(QPixmap(":/export.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation)); exportToHtml = exportMenu->addAction("HTML", this, SLOT(exportNoteToHtml())); exportToPdf = exportMenu->addAction("Pdf", this, SLOT(exportNoteToPdf())); @@ -289,54 +295,54 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) menu->addMenu(exportMenu); menuButton->setMenu(menu); - setH1B = new QPushButton( - QPixmap(":/h1.png") - .scaled(font_size.toInt() + 3, font_size.toInt() + 3, Qt::KeepAspectRatio, Qt::SmoothTransformation), - ""); - setH2B = new QPushButton( - QPixmap(":/h2.png") - .scaled(font_size.toInt() + 3, font_size.toInt() + 3, Qt::KeepAspectRatio, Qt::SmoothTransformation), - ""); - setH3B = new QPushButton( - QPixmap(":/h3.png") - .scaled(font_size.toInt() + 3, font_size.toInt() + 3, Qt::KeepAspectRatio, Qt::SmoothTransformation), - ""); - setListB = new QPushButton( - QPixmap(":/list.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation), - ""); - setLinkB = new QPushButton( - QPixmap(":/link.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation), - ""); - setBoldB = new QPushButton( - QPixmap(":/bold.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation), - ""); - setItalicB = new QPushButton( - QPixmap(":/italic.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation), - ""); - setStrikeB = new QPushButton( - QPixmap(":/strikethrough.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation), - ""); - setTaskB = new QPushButton( - QPixmap(":/checkbox.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation), - ""); - setNumListB = new QPushButton( - QPixmap(":/numList.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation), - ""); - setTableB = new QPushButton( - QPixmap(":/table.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation), - ""); - setQuoteB = new QPushButton( - QPixmap(":/quote.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation), - ""); + setH1B = new QPushButton(QPixmap(":/h1.png") + .scaled(font_size.toInt() + 3, font_size.toInt() + 3, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + ""); + setH2B = new QPushButton(QPixmap(":/h2.png") + .scaled(font_size.toInt() + 3, font_size.toInt() + 3, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + ""); + setH3B = new QPushButton(QPixmap(":/h3.png") + .scaled(font_size.toInt() + 3, font_size.toInt() + 3, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + ""); + setListB = new QPushButton(QPixmap(":/list.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + ""); + setLinkB = new QPushButton(QPixmap(":/link.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + ""); + setBoldB = new QPushButton(QPixmap(":/bold.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + ""); + setItalicB = new QPushButton(QPixmap(":/italic.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + ""); + setStrikeB = new QPushButton(QPixmap(":/strikethrough.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + ""); + setTaskB = new QPushButton(QPixmap(":/checkbox.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + ""); + setNumListB = new QPushButton(QPixmap(":/numList.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + ""); + setTableB = new QPushButton(QPixmap(":/table.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + ""); + setQuoteB = new QPushButton(QPixmap(":/quote.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + ""); setH1B->setStyleSheet("background-color: #0D1117; border-color: #0D1117; margin-left: 4px;"); setH2B->setStyleSheet("background-color: #0D1117; border-color: #0D1117; margin-left: 4px;"); @@ -415,9 +421,9 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) QSpacerItem *spacer2 = new QSpacerItem(100, 0, QSizePolicy::Expanding, QSizePolicy::Minimum); tasksMenuBtn = new QToolButton; - tasksMenuBtn->setIcon( - QPixmap(":/main.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation)); + tasksMenuBtn->setIcon(QPixmap(":/main.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation)); tasksMenuBtn->setIconSize(QSize(50, 50)); tasksMenuBtn->setFixedSize(30, 30); tasksMenuBtn->setPopupMode(QToolButton::InstantPopup); @@ -426,14 +432,14 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) tasksMenu = new QMenu(tasksMenuBtn); - addTask = tasksMenu->addAction( - QPixmap(":/new.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation), - "Add task", this, SLOT(addNewTask()), Qt::Key_Return); - rmTask = tasksMenu->addAction( - QPixmap(":/delete.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation), - "Delete task", this, SLOT(removeTask()), Qt::Key_Delete); + addTask = tasksMenu->addAction(QPixmap(":/new.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + "Add task", this, SLOT(addNewTask()), Qt::Key_Return); + rmTask = tasksMenu->addAction(QPixmap(":/delete.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + "Delete task", this, SLOT(removeTask()), Qt::Key_Delete); tasksMenuBtn->setMenu(tasksMenu); @@ -514,9 +520,9 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) // menu projectsMenuButton = new QToolButton(); - projectsMenuButton->setIcon( - QPixmap(":/main.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation)); + projectsMenuButton->setIcon(QPixmap(":/main.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation)); projectsMenuButton->setPopupMode(QToolButton::InstantPopup); projectsMenuButton->setFixedSize(30, 25); projectsMenuButton->setIconSize(QSize(40, 40)); @@ -526,14 +532,16 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) projectsMenu = new QMenu(projectsMenuButton); // actions for menu - newProject = projectsMenu->addAction( - QPixmap(":/new.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation), - "New", this, SLOT(createProject()), Qt::CTRL + Qt::Key_N); - rmProject = projectsMenu->addAction( - QPixmap(":/delete.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation), - "Remove", this, SLOT(removeProject()), Qt::Key_Delete); + newProject = + projectsMenu->addAction(QPixmap(":/new.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + "New", this, SLOT(createProject()), Qt::CTRL + Qt::Key_N); + rmProject = + projectsMenu->addAction(QPixmap(":/delete.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + "Remove", this, SLOT(removeProject()), Qt::Key_Delete); projectsMenuButton->setMenu(projectsMenu); diff --git a/src/CodeKeeper/mainwindow.h b/src/CodeKeeper/mainwindow.h index 4cc23b30..55cc4d16 100644 --- a/src/CodeKeeper/mainwindow.h +++ b/src/CodeKeeper/mainwindow.h @@ -131,6 +131,20 @@ class MainWindow : public QMainWindow MainWindow(QWidget *parent = nullptr); ~MainWindow(); + bool isCreated; + bool isReleaseDate; + bool isLastCommit; + bool isPullReq; + bool isLicense; + bool isRelease; + bool isIssue; + bool isDownloads; + bool isCommit; + bool isLang; + bool isStars; + bool isForks; + bool isRepoSize; + private slots: void openSettingsWindow(); void openSyncWindow(); diff --git a/src/CodeKeeper/settingsFunc/functional.cpp b/src/CodeKeeper/settingsFunc/functional.cpp index e4664062..47dde854 100644 --- a/src/CodeKeeper/settingsFunc/functional.cpp +++ b/src/CodeKeeper/settingsFunc/functional.cpp @@ -17,8 +17,9 @@ void SettingsWindow::closeEvent(QCloseEvent *event) void SettingsWindow::checkUpdates() { } -void SettingsWindow::checkRepo(QString repo) +void SettingsWindow::checkRepo() { + QString repo = "https://github.com/" + gitUser->text() + "/" + gitRepo->text(); QNetworkAccessManager nam; QNetworkReply *reply = nam.get(QNetworkRequest(QUrl(repo))); @@ -27,8 +28,8 @@ void SettingsWindow::checkRepo(QString repo) loop.exec(); if (reply->error() == QNetworkReply::NoError) { - qDebug() << repo; - qDebug() << "🟢 Repository is available"; + // qDebug() << repo; + // qDebug() << "🟢 Repository is available"; repoAvailability->setText("Repository is available"); } else { qDebug() << repo; @@ -82,6 +83,33 @@ void SettingsWindow::saveData() isCustomTitlebar = customTitleBar->isChecked(); globalSettings->setValue("isCustomTitlebar", isCustomTitlebar); + isCreated = CisCreated->isChecked(); + globalSettings->setValue("isCreated", isCreated); + isReleaseDate = CisReleaseDate->isChecked(); + globalSettings->setValue("isReleaseDate", isReleaseDate); + isLastCommit = CisLastCommit->isChecked(); + globalSettings->setValue("isLastCommit", isLastCommit); + isPullReq = CisPullReq->isChecked(); + globalSettings->setValue("isPullReq", isPullReq); + isLicense = CisLicense->isChecked(); + globalSettings->setValue("isLicense", isLicense); + isRelease = CisRelease->isChecked(); + globalSettings->setValue("isRelease", isRelease); + isIssue = CisIssue->isChecked(); + globalSettings->setValue("isIssue", isIssue); + isDownloads = CisDownloads->isChecked(); + globalSettings->setValue("isDownloads", isDownloads); + isCommit = CisCommit->isChecked(); + globalSettings->setValue("isCommit", isCommit); + isLang = CisLang->isChecked(); + globalSettings->setValue("isLang", isLang); + isStars = CisStars->isChecked(); + globalSettings->setValue("isStars", isStars); + isForks = CisForks->isChecked(); + globalSettings->setValue("isForks", isForks); + isRepoSize = CisRepoSize->isChecked(); + globalSettings->setValue("isRepoSize", isRepoSize); + messageBox->setIcon(QMessageBox::Information); messageBox->setWindowTitle("CodeKeeper - Settings"); messageBox->setText("To apply the settings, restart the application."); @@ -211,6 +239,34 @@ void SettingsWindow::setFontPr2(QFont *selectedFont, int *font_size_int) repoAvailability->setFont(*selectedFont); repoAvailability->setStyleSheet("font-size: " + font_size + "pt;"); + projectsContentLabel->setFont(*selectedFont); + + CisCreated->setFont(*selectedFont); + CisReleaseDate->setFont(*selectedFont); + CisLastCommit->setFont(*selectedFont); + CisPullReq->setFont(*selectedFont); + CisLicense->setFont(*selectedFont); + CisRelease->setFont(*selectedFont); + CisIssue->setFont(*selectedFont); + CisDownloads->setFont(*selectedFont); + CisCommit->setFont(*selectedFont); + CisLang->setFont(*selectedFont); + CisStars->setFont(*selectedFont); + CisForks->setFont(*selectedFont); + + CisCreated->setStyleSheet("font-size: " + font_size + "pt;"); + CisReleaseDate->setStyleSheet("font-size: " + font_size + "pt;"); + CisLastCommit->setStyleSheet("font-size: " + font_size + "pt;"); + CisPullReq->setStyleSheet("font-size: " + font_size + "pt;"); + CisLicense->setStyleSheet("font-size: " + font_size + "pt;"); + CisRelease->setStyleSheet("font-size: " + font_size + "pt;"); + CisIssue->setStyleSheet("font-size: " + font_size + "pt;"); + CisDownloads->setStyleSheet("font-size: " + font_size + "pt;"); + CisCommit->setStyleSheet("font-size: " + font_size + "pt;"); + CisLang->setStyleSheet("font-size: " + font_size + "pt;"); + CisStars->setStyleSheet("font-size: " + font_size + "pt;"); + CisForks->setStyleSheet("font-size: " + font_size + "pt;"); + // set Data fontSelector->setCurrentFont(*selectedFont); fontSize->setValue(font_size.toInt()); diff --git a/src/CodeKeeper/settingswindow.cpp b/src/CodeKeeper/settingswindow.cpp index 211e05d9..a17bf076 100644 --- a/src/CodeKeeper/settingswindow.cpp +++ b/src/CodeKeeper/settingswindow.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "mainwindow.cpp" #include "mainwindow.h" @@ -31,6 +32,21 @@ SettingsWindow::SettingsWindow(QWidget *parent) : QMainWindow{ parent } isCustomTitlebar = globalSettings->value("isCustomTitlebar").value(); + isCreated = globalSettings->value("isCreated").value(); + isReleaseDate = globalSettings->value("isReleaseDate").value(); + isLastCommit = globalSettings->value("isLastCommit").value(); + isPullReq = globalSettings->value("isPullReq").value(); + isLicense = globalSettings->value("isLicense").value(); + isRelease = globalSettings->value("isRelease").value(); + isIssue = globalSettings->value("isIssue").value(); + isDownloads = globalSettings->value("isDownloads").value(); + isCommit = globalSettings->value("isCommit").value(); + isLang = globalSettings->value("isLang").value(); + isStars = globalSettings->value("isStars").value(); + isForks = globalSettings->value("isForks").value(); + isRepoSize = globalSettings->value("isRepoSize").value(); + + this->setStyleSheet(file.readAll()); setWindowFlags(windowFlags() | Qt::FramelessWindowHint); @@ -38,7 +54,7 @@ SettingsWindow::SettingsWindow(QWidget *parent) : QMainWindow{ parent } setCentralWidget(centralWidget); mainLayout = new QVBoxLayout(centralWidget); - setFixedSize(450, 600); + setFixedSize(600, 600); // tabs tabs = new QTabWidget(); @@ -46,16 +62,16 @@ SettingsWindow::SettingsWindow(QWidget *parent) : QMainWindow{ parent } QHBoxLayout *BtnsL = new QHBoxLayout(); - saveBtn = new QPushButton( - QPixmap(":/save.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation), - " Apply"); + saveBtn = new QPushButton(QPixmap(":/save.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + " Apply"); saveBtn->setFixedSize(100, 25); - quitBtn = new QPushButton( - QPixmap(":/quit.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation), - " Quit"); + quitBtn = new QPushButton(QPixmap(":/quit.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + " Quit"); quitBtn->setFixedSize(100, 25); BtnsL->addWidget(saveBtn); @@ -85,10 +101,11 @@ SettingsWindow::SettingsWindow(QWidget *parent) : QMainWindow{ parent } versionInfo->setText("Version: 0.1.5"); versionInfo->setAlignment(Qt::AlignCenter); - checkUpdatesBtn = new QPushButton( - QPixmap(":/retry.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation), - " Chech for updates"); + checkUpdatesBtn = + new QPushButton(QPixmap(":/retry.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + " Chech for updates"); checkUpdatesBtn->setFixedSize(200, 25); checkUpdatesBtnL->addWidget(checkUpdatesBtn); @@ -140,8 +157,6 @@ SettingsWindow::SettingsWindow(QWidget *parent) : QMainWindow{ parent } repoAvailability = new QLabel("Repo"); repoAvailability->setAlignment(Qt::AlignHCenter); - QString repo = "https://github.com/" + gitUser->text() + "/" + gitRepo->text(); - checkRepo(repo); mainSyncLayout->setSpacing(10); mainSyncLayout->addWidget(gitLabel, 0, 2, 1, 1); @@ -207,17 +222,68 @@ SettingsWindow::SettingsWindow(QWidget *parent) : QMainWindow{ parent } pathToFolder->setMaximumHeight(25); pathToFolder->setText(path); - openFolder = new QPushButton( - QPixmap(":/open.png") - .scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation), - " Browse"); + openFolder = new QPushButton(QPixmap(":/open.png") + .scaled(font_size.toInt() + 1, font_size.toInt() + 1, + Qt::KeepAspectRatio, Qt::SmoothTransformation), + " Browse"); openFolder->setMaximumHeight(25); - storageL->setSpacing(10); + storageL->setSpacing(25); storageL->addWidget(storageLabel, 0, 1, 0, 4); storageL->addWidget(pathToFolder, 1, 3); storageL->addWidget(openFolder, 2, 3); + // projects content tab + QGridLayout *projectsContentL = new QGridLayout; + projectsContentL->setSpacing(10); + projectsContentL->setAlignment(Qt::AlignCenter); + + projectsContentLabel = new QLabel("Projects content"); + projectsContentLabel->setStyleSheet("font-size: 32px;"); + projectsContentLabel->setAlignment(Qt::AlignCenter); + + CisCreated = new QCheckBox("Created time"); + CisCreated->setChecked(isCreated); + CisReleaseDate = new QCheckBox("Last release time"); + CisReleaseDate->setChecked(isReleaseDate); + CisLastCommit = new QCheckBox("Last commit time"); + CisLastCommit->setChecked(isLastCommit); + CisPullReq = new QCheckBox("Total pull requests"); + CisPullReq->setChecked(isPullReq); + CisLicense = new QCheckBox("License"); + CisLicense->setChecked(isLicense); + CisRelease = new QCheckBox("Release"); + CisRelease->setChecked(isRelease); + CisIssue = new QCheckBox("Issues"); + CisIssue->setChecked(isIssue); + CisDownloads = new QCheckBox("downloads"); + CisDownloads->setChecked(isDownloads); + CisCommit = new QCheckBox("Commits"); + CisCommit->setChecked(isCommit); + CisLang = new QCheckBox("Langs"); + CisLang->setChecked(isLang); + CisStars = new QCheckBox("Stars"); + CisStars->setChecked(isStars); + CisForks = new QCheckBox("Forks"); + CisForks->setChecked(isForks); + CisRepoSize = new QCheckBox("Repo size"); + CisRepoSize->setChecked(isRepoSize); + + projectsContentL->addWidget(projectsContentLabel, 0, 0, 1, 1, Qt::AlignCenter); + projectsContentL->addWidget(CisCreated, 1, 0, 1, 1, Qt::AlignCenter); + projectsContentL->addWidget(CisReleaseDate, 2, 0, 1, 1, Qt::AlignCenter); + projectsContentL->addWidget(CisLastCommit, 3, 0, 1, 1, Qt::AlignCenter); + projectsContentL->addWidget(CisPullReq, 4, 0, 1, 1, Qt::AlignCenter); + projectsContentL->addWidget(CisLicense, 5, 0, 1, 1, Qt::AlignCenter); + projectsContentL->addWidget(CisRelease, 6, 0, 1, 1, Qt::AlignCenter); + projectsContentL->addWidget(CisIssue, 7, 0, 1, 1, Qt::AlignCenter); + projectsContentL->addWidget(CisDownloads, 8, 0, 1, 1, Qt::AlignCenter); + projectsContentL->addWidget(CisCommit, 9, 0, 1, 1, Qt::AlignCenter); + projectsContentL->addWidget(CisLang, 10, 0, 1, 1, Qt::AlignCenter); + projectsContentL->addWidget(CisStars, 11, 0, 1, 1, Qt::AlignCenter); + projectsContentL->addWidget(CisForks, 12, 0, 1, 1, Qt::AlignCenter); + projectsContentL->addWidget(CisRepoSize, 13, 0, 1, 1, Qt::AlignCenter); + // info tab QWidget *aboutTab = new QWidget(); QVBoxLayout *aboutTabLayout = new QVBoxLayout(aboutTab); @@ -250,20 +316,28 @@ SettingsWindow::SettingsWindow(QWidget *parent) : QMainWindow{ parent } tabs->addTab(appereanceTab, "Appereance"); + // projects content + QWidget *projectsContentTab = new QWidget(); + projectsContentTab->setLayout(projectsContentL); + tabs->addTab(projectsContentTab, "Projects"); + QIcon aboutIco; QIcon syncIco; QIcon storageIco; QIcon paletteIco; + QIcon projectsIco; aboutIco.addFile(":/about.png"); syncIco.addFile(":/refresh.png"); storageIco.addFile(":/storage.png"); paletteIco.addFile(":/palette.png"); + projectsIco.addFile(":/project.png"); tabs->setTabIcon(tabs->indexOf(aboutTab), aboutIco); tabs->setTabIcon(tabs->indexOf(syncTab), syncIco); tabs->setTabIcon(tabs->indexOf(storageTab), storageIco); tabs->setTabIcon(tabs->indexOf(appereanceTab), paletteIco); + tabs->setTabIcon(tabs->indexOf(projectsContentTab), projectsIco); tabs->setIconSize(QSize(font_size.toInt(), font_size.toInt())); tabs->setTabBarAutoHide(true); @@ -277,10 +351,11 @@ SettingsWindow::SettingsWindow(QWidget *parent) : QMainWindow{ parent } connect(checkUpdatesBtnL, SIGNAL(clicked()), this, SLOT(checkUpdates())); connect(openFolder, SIGNAL(clicked()), this, SLOT(fopenFolder())); - QObject::connect(gitRepo, &QLineEdit::textChanged, [&]() { - QString repo = "https://github.com/" + gitUser->text() + "/" + gitRepo->text(); - checkRepo(repo); - }); + QTimer *repoTimer = new QTimer(this); + qDebug() << "checking"; + + connect(repoTimer, &QTimer::timeout, [=]() { checkRepo(); }); + repoTimer->start(100); int font_size_int = font_size.toInt(); setFontPr2(&selectedFont, &font_size_int); diff --git a/src/CodeKeeper/settingswindow.h b/src/CodeKeeper/settingswindow.h index c0019a63..d0770189 100644 --- a/src/CodeKeeper/settingswindow.h +++ b/src/CodeKeeper/settingswindow.h @@ -27,6 +27,20 @@ class SettingsWindow : public QMainWindow bool isAutoSyncB; bool isCustomTitlebar; + bool isCreated; + bool isReleaseDate; + bool isLastCommit; + bool isPullReq; + bool isLicense; + bool isRelease; + bool isIssue; + bool isDownloads; + bool isCommit; + bool isLang; + bool isStars; + bool isForks; + bool isRepoSize; + private slots: void closeEvent(QCloseEvent *event); void QuitW(); @@ -35,7 +49,7 @@ private slots: void fopenFolder(); void setFontPr2(QFont *selectedFont, int *font_size_int); - void checkRepo(QString repo); + void checkRepo(); private: QWidget *centralWidget; @@ -85,6 +99,24 @@ private slots: QLabel *storageLabel; QLineEdit *pathToFolder; QPushButton *openFolder; + + // projects content + QLabel *projectsContentLabel; + + QCheckBox *CisCreated; + QCheckBox *CisReleaseDate; + QCheckBox *CisLastCommit; + QCheckBox *CisPullReq; + QCheckBox *CisLicense; + QCheckBox *CisRelease; + QCheckBox *CisIssue; + QCheckBox *CisDownloads; + QCheckBox *CisCommit; + QCheckBox *CisLang; + QCheckBox *CisStars; + QCheckBox *CisForks; + QCheckBox *CisRepoSize; + }; #endif // SETTINGSWINDOW_H diff --git a/src/stylesheet/stylesheet.qss b/src/stylesheet/stylesheet.qss index 280b8238..7261f1c3 100644 --- a/src/stylesheet/stylesheet.qss +++ b/src/stylesheet/stylesheet.qss @@ -23,16 +23,16 @@ QCheckBox::indicator { } QCheckBox::indicator:unchecked { border-radius: 7px; - background-color: #3e4a6b; + background-color: #171b22; } QCheckBox::indicator:unchecked:hover { border-radius: 7px; - background-color: #3e4a6b; + background-color: #171b22; } QCheckBox::indicator:unchecked:pressed { border-radius: 7px; - background-color: #3e4a6b; + background-color: #171b22; } QCheckBox::indicator:checked { @@ -208,16 +208,16 @@ QMenu::indicator { } QMenu::indicator:unchecked { border-radius: 4px; - background-color: #0d1117; + background-color: #171b22; } QMenu::indicator:unchecked:hover { border-radius: 4px; - background-color: #0d1117; + background-color: #171b22; } QMenu::indicator:unchecked:pressed { border-radius: 4px; - background-color: #0d1117; + background-color: #171b22; } QMenu::indicator:checked { border-radius: 4px; diff --git a/src/stylesheet/stylesheet_setting_window.qss b/src/stylesheet/stylesheet_setting_window.qss index d0e81479..61b0238c 100644 --- a/src/stylesheet/stylesheet_setting_window.qss +++ b/src/stylesheet/stylesheet_setting_window.qss @@ -44,16 +44,16 @@ QCheckBox::indicator { } QCheckBox::indicator:unchecked { border-radius: 4px; - background-color: #171b22; + background-color: #0d1117; } QCheckBox::indicator:unchecked:hover { border-radius: 4px; - background-color: #171b22; + background-color: #0d1117; } QCheckBox::indicator:unchecked:pressed { border-radius: 4px; - background-color: #171b22; + background-color: #0d1117; } QCheckBox::indicator:checked {