Skip to content

Commit

Permalink
Merge pull request #70 from Nighty3098/InDev
Browse files Browse the repository at this point in the history
In dev
  • Loading branch information
Nighty3098 authored May 26, 2024
2 parents d2c7b00 + b6ceeee commit 6e1af69
Show file tree
Hide file tree
Showing 17 changed files with 496 additions and 271 deletions.
10 changes: 8 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
{
Expand All @@ -102,7 +108,7 @@
}
],
"sqltools.useNodeRuntime": true,
"workbench.colorTheme": "Nightfox",
"workbench.colorTheme": "Vim Nightfly Theme",
"glassit.alpha": 220,
"animations.Command-Palette": "Slide",
}
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@

<details align="center">
<summary align="center">Screenshots:</summary>

![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)
<img src="imgs/1.png" />
<img src="imgs/2.png" />
<img src="imgs/3.png" />
<img src="imgs/4.png" />
<br>
<img src="imgs/5.png" />

</details>

Expand Down Expand Up @@ -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

</details>

Expand Down
Binary file modified imgs/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified imgs/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified imgs/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified imgs/4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgs/5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 26 additions & 12 deletions src/CodeKeeper/keeperFunc/functional.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,20 @@ void MainWindow::getSettingsData()
git_token = globalSettings->value("git_token").value<QString>();
isAutoSyncB = globalSettings->value("isAutoSync").value<bool>();

isCreated = globalSettings->value("isCreated").value<bool>();
isReleaseDate = globalSettings->value("isReleaseDate").value<bool>();
isLastCommit = globalSettings->value("isLastCommit").value<bool>();
isPullReq = globalSettings->value("isPullReq").value<bool>();
isLicense = globalSettings->value("isLicense").value<bool>();
isRelease = globalSettings->value("isRelease").value<bool>();
isIssue = globalSettings->value("isIssue").value<bool>();
isDownloads = globalSettings->value("isDownloads").value<bool>();
isCommit = globalSettings->value("isCommit").value<bool>();
isLang = globalSettings->value("isLang").value<bool>();
isStars = globalSettings->value("isStars").value<bool>();
isForks = globalSettings->value("isForks").value<bool>();
isRepoSize = globalSettings->value("isRepoSize").value<bool>();

qDebug() << "🔸 " << dir << selectedFont << font_size << theme << isCustomTitlebar
<< sortNotesRole << isAutoSyncing << isVisibleNotesList << isVisibleFolders
<< isVisiblePreview << isViewMode << git_repo << git_user << git_token << isAutoSyncB;
Expand All @@ -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("<p style='color: #dCD7BA;'>Connected</p>");
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("<p style='color: #dCD7BA;'>Disconnected</p>");
}

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("<p style='color: #dCD7BA;'>Auto sync on</p>");
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("<p style='color: #dCD7BA;'>Auto sync off</p>");
}
}
Expand Down
114 changes: 65 additions & 49 deletions src/CodeKeeper/keeperFunc/projectsFunc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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("<style>"
" .badge {"
" top: 5%;"
" position: relative;"
" height: 20px;"
" margin: 3px 3px;"
" border: 0px;"
" border-radius: 5px;"
" }"
"</style>"
"<html>"
" <div align='center' style='position: relative; height: 100%;'>"
" <img class='badge' src='https://img.shields.io/github/last-commit/"
+ repo
+ "?style=for-the-badge&color=7dc4e4&logoColor=D9E0EE&labelColor=171b22'/><br>"
" <img class='badge' src='https://img.shields.io/github/issues-pr/"
+ repo
+ "?style=for-the-badge&color=ef9f9c&logoColor=85e185&labelColor=1c1c29'/><br>"
" <img class='badge' src='https://img.shields.io/github/issues/"
+ repo
+ "?style=for-the-badge&color=dbb6ed&logoColor=D9E0EE&labelColor=171b22'/><br>"
" <img class='badge' src='https://img.shields.io/github/license/"
+ repo
+ "?style=for-the-badge&color=a6e0b8&logoColor=D9E0EE&labelColor=171b22'/><br>"
" <img class='badge' src='https://img.shields.io/github/release/"
+ repo
+ "?style=for-the-badge&color=7589d5&logoColor=D9E0EE&labelColor=171b22'/><br>"
" <img class='badge' src='https://img.shields.io/github/stars/"
+ repo
+ "?style=for-the-badge&color=eed49f&logoColor=D9E0EE&labelColor=171b22'/><br>"
" <img class='badge' src='https://img.shields.io/github/forks/"
+ repo
+ "?style=for-the-badge&color=9dc3ea&logoColor=D9E0EE&labelColor=171b22'/><br>"
" <img class='badge' src='https://img.shields.io/github/repo-size/"
+ repo
+ "?style=for-the-badge&color=ea9de7&logoColor=D9E0EE&labelColor=171b22'/><br>"
" <img class='badge' src='https://img.shields.io/github/downloads/"
+ repo
+ "/total?style=for-the-badge&color=ea9de7&logoColor=D9E0EE&labelColor=171b22'/>"
"</div>"
"</html>");
QString html = "<style>"
".badge {"
" height: 20px;"
" margin: 1% 1%;"
" border: 0px;"
" border-radius: 5px;"
"}"
"</style>"
"<html>"
" <body>"
" <div style='align-items: center; justify-content: center; display: flex; vertical-align: middle; flex-direction: column;'>";

if(isCreated) {
html += " <img class='badge' src='https://img.shields.io/github/created-at/" + repo + "?style=for-the-badge&color=7dc4e4&logoColor=D9E0EE&labelColor=1c1c29' />";
}
if(isReleaseDate) {
html += " <img class='badge' src='https://img.shields.io/github/release-date/" + repo + "?style=for-the-badge&color=e0ea9d&logoColor=D9E0EE&labelColor=171b22' />";
}
if(isLastCommit) {
html += " <img class='badge' src='https://img.shields.io/github/last-commit/" + repo + "?style=for-the-badge&color=7dc4e4&logoColor=D9E0EE&labelColor=1c1c29'/>";
}
if(isPullReq) {
html += " <img class='badge' src='https://img.shields.io/github/issues-pr/" + repo + "?style=for-the-badge&color=ef9f9c&logoColor=85e185&labelColor=1c1c29' />";
}
if(isLicense) {
html += " <img class='badge' src='https://img.shields.io/github/license/" + repo + "?style=for-the-badge&color=a6e0b8&logoColor=ffffff&labelColor=1c1c29' />";
}
if(isRelease) {
html += " <img class='badge' src='https://img.shields.io/github/release/" + repo + "?style=for-the-badge&color=7589d5&logoColor=ffffff&labelColor=1c1c29'/>";
}
if(isIssue) {
html += " <img class='badge' src='https://img.shields.io/github/issues/" + repo + "?style=for-the-badge&color=dbb6ed&logoColor=ffffff&labelColor=1c1c29' />";
}
if(isDownloads) {
html += " <img class='badge' src='https://img.shields.io/github/downloads/" + repo + "/total?style=for-the-badge&color=e0ea9d&logoColor=D9E0EE&labelColor=1c1c29' />";
}
if(isCommit) {
html += " <img class='badge' src='https://img.shields.io/github/commit-activity/t/" + repo + "?style=for-the-badge&color=a6e0b8&logoColor=D9E0EE&labelColor=1c1c29' />";
}
if(isLang) {
html += " <img class='badge' src='https://img.shields.io/github/languages/count/" + repo + "?style=for-the-badge&color=ea9de7&logoColor=D9E0EE&labelColor=1c1c29' />";
}
if(isStars) {
html += " <img class='badge' src='https://img.shields.io/github/stars/" + repo + "?style=for-the-badge&color=eed49f&logoColor=D9E0EE&labelColor=1c1c29' />";
}
if(isForks) {
html += " <img class='badge' src='https://img.shields.io/github/forks/" + repo + "?style=for-the-badge&color=9dc3ea&logoColor=D9E0EE&labelColor=1c1c29' />";
}
if(isRepoSize) {
html += " <img class='badge' src='https://img.shields.io/github/repo-size/" + repo + "?style=for-the-badge&color=ea9de7&logoColor=D9E0EE&labelColor=171b22'/>";
}

html += " </div>"
" </body>"
"</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);

Expand Down Expand Up @@ -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();
Expand All @@ -213,19 +229,19 @@ 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);

QPushButton *openButton = new QPushButton();
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);

Expand Down
2 changes: 1 addition & 1 deletion src/CodeKeeper/keeperFunc/tasksFunc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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: "
Expand Down
Loading

0 comments on commit 6e1af69

Please sign in to comment.