Skip to content

Commit

Permalink
Added splitter for tasks window
Browse files Browse the repository at this point in the history
  • Loading branch information
Nighty3098 committed Aug 19, 2024
1 parent 05fb6ac commit 3313207
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 35 deletions.
33 changes: 17 additions & 16 deletions src/CodeKeeper/CodeKeeper_ru_RU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
<context>
<name>AccountWindow</name>
<message>
<location filename="accountFunc/functional.cpp" line="382"/>
<location filename="accountFunc/functional.cpp" line="375"/>
<source>
Public repos: </source>
<translation>
Публичные репозитории: </translation>
</message>
<message>
<location filename="accountFunc/functional.cpp" line="383"/>
<location filename="accountFunc/functional.cpp" line="376"/>
<source>

Following: </source>
Expand All @@ -20,7 +20,7 @@ Following: </source>
Подписки: </translation>
</message>
<message>
<location filename="accountFunc/functional.cpp" line="384"/>
<location filename="accountFunc/functional.cpp" line="377"/>
<source>

Followers: </source>
Expand All @@ -29,7 +29,7 @@ Followers: </source>
Подписчики: </translation>
</message>
<message>
<location filename="accountFunc/functional.cpp" line="385"/>
<location filename="accountFunc/functional.cpp" line="378"/>
<source>

Stars: </source>
Expand All @@ -38,22 +38,22 @@ Stars: </source>
Звёзды: </translation>
</message>
<message>
<location filename="accountFunc/functional.cpp" line="410"/>
<location filename="accountFunc/functional.cpp" line="403"/>
<source>No tasks found</source>
<translation>Задачи не найдены</translation>
</message>
<message>
<location filename="accountFunc/functional.cpp" line="424"/>
<location filename="accountFunc/functional.cpp" line="417"/>
<source>Completed</source>
<translation>Выполнено</translation>
</message>
<message>
<location filename="accountFunc/functional.cpp" line="424"/>
<location filename="accountFunc/functional.cpp" line="417"/>
<source>Started</source>
<translation>Начато</translation>
</message>
<message>
<location filename="accountFunc/functional.cpp" line="424"/>
<location filename="accountFunc/functional.cpp" line="417"/>
<source>Not Started</source>
<translation>Не начато</translation>
</message>
Expand All @@ -66,12 +66,12 @@ No languages found</source>
Статистика языков не найдена</translation>
</message>
<message>
<location filename="accountFunc/functional.cpp" line="523"/>
<location filename="accountFunc/functional.cpp" line="517"/>
<source>None</source>
<translation>Отсутствуют</translation>
</message>
<message>
<location filename="accountFunc/functional.cpp" line="527"/>
<location filename="accountFunc/functional.cpp" line="521"/>
<source>Other</source>
<translation>Другие</translation>
</message>
Expand All @@ -92,22 +92,22 @@ No languages found</source>
<translation type="vanished">Закончено: </translation>
</message>
<message>
<location filename="accountFunc/functional.cpp" line="477"/>
<location filename="accountFunc/functional.cpp" line="470"/>
<source>Not started</source>
<translation>Не начато</translation>
</message>
<message>
<location filename="accountFunc/functional.cpp" line="477"/>
<location filename="accountFunc/functional.cpp" line="470"/>
<source>In Dev</source>
<translation>В разработке</translation>
</message>
<message>
<location filename="accountFunc/functional.cpp" line="477"/>
<location filename="accountFunc/functional.cpp" line="470"/>
<source>On Review</source>
<translation>На ревью</translation>
</message>
<message>
<location filename="accountFunc/functional.cpp" line="477"/>
<location filename="accountFunc/functional.cpp" line="470"/>
<source>Finished</source>
<translation>Закончено</translation>
</message>
Expand Down Expand Up @@ -143,7 +143,7 @@ Projects</oldsource>
<translation>Из данных CodeKeeper</translation>
</message>
<message>
<location filename="accountFunc/functional.cpp" line="518"/>
<location filename="accountFunc/functional.cpp" line="512"/>
<source>

Languages</source>
Expand Down Expand Up @@ -877,7 +877,8 @@ You have completed all of your tasks for the day. Good job!</source>
</message>
<message>
<location filename="settingswindow.cpp" line="107"/>
<source> Checkfor updates</source>
<source> Check for updates</source>
<oldsource> Checkfor updates</oldsource>
<translation> Проверить обновления</translation>
</message>
<message>
Expand Down
10 changes: 2 additions & 8 deletions src/CodeKeeper/accountFunc/functional.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,11 @@ QStringList AccountWindow::getAllGitReposUrls(const QString &username)
{
QStringList repoUrls;

// Создаем менеджер сети
QNetworkAccessManager manager;

// URL для получения репозиториев пользователя
QString reposUrl = QString("https://api.github.com/users/%1/repos").arg(username);

// URL для получения событий пользователя
QString eventsUrl = QString("https://api.github.com/users/%1/events").arg(username);

// Функция для отправки запроса и обработки ответа
auto fetchUrls = [&](const QString &url) {
QNetworkRequest request;
request.setUrl(QUrl(url));
Expand Down Expand Up @@ -78,10 +73,8 @@ QStringList AccountWindow::getAllGitReposUrls(const QString &username)
reply->deleteLater();
};

// Получаем репозитории пользователя
fetchUrls(reposUrl);

// Получаем события пользователя
fetchUrls(eventsUrl);

qDebug() << "User repos: " << repoUrls;
Expand Down Expand Up @@ -484,7 +477,8 @@ void AccountWindow::setProjectsStats()
}
}

void AccountWindow::setLangsStats(const QString langsData, CircleChart *langsChart, ColorValueDisplay *langsValuesDisplay)
void AccountWindow::setLangsStats(const QString langsData, CircleChart *langsChart,
ColorValueDisplay *langsValuesDisplay)
{
QStringList langsColors;
langsColors << "#c75d5e"
Expand Down
12 changes: 9 additions & 3 deletions src/CodeKeeper/keeperFunc/functional.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,17 @@ void MainWindow::setConnectionStatus()

void MainWindow::createCustomTitlebar()
{
closeBtn->setFixedSize(16, 20);
minimizeBtn->setFixedSize(16, 20);
maximizeBtn->setFixedSize(16, 20);
closeBtn->setFixedSize(16, 16);
minimizeBtn->setFixedSize(16, 16);
maximizeBtn->setFixedSize(16, 16);

closeBtn->setStyleSheet("QPushButton {"
" border-radius: 0px;"
" border-color: rgba(0, 0, 0, 0);"
" background-color: rgba(0, 0, 0, 0);"
" background-image: url(':/red.png');"
" background-repeat: no-repeat;"
" background-attachment: fixed;"
"}"

"QPushButton:hover {"
Expand All @@ -152,6 +153,7 @@ void MainWindow::createCustomTitlebar()
" background-image: url(':/redHovered.png');"
" background-repeat: no-repeat;"
" background-color: rgba(0, 0, 0, 0);"
" background-attachment: fixed;"
"}");

minimizeBtn->setStyleSheet("QPushButton {"
Expand All @@ -160,6 +162,7 @@ void MainWindow::createCustomTitlebar()
" background-color: rgba(0, 0, 0, 0);"
" background-image: url(':/yellow.png');"
" background-repeat: no-repeat;"
" background-attachment: fixed;"
"}"

"QPushButton:hover {"
Expand All @@ -168,6 +171,7 @@ void MainWindow::createCustomTitlebar()
" background-image: url(':/yellowHovered.png');"
" background-repeat: no-repeat;"
" background-color: rgba(0, 0, 0, 0);"
" background-attachment: fixed;"
"}");

maximizeBtn->setStyleSheet("QPushButton {"
Expand All @@ -176,6 +180,7 @@ void MainWindow::createCustomTitlebar()
" background-color: rgba(0, 0, 0, 0);"
" background-image: url(':/green.png');"
" background-repeat: no-repeat;"
" background-attachment: fixed;"
"}"

"QPushButton:hover {"
Expand All @@ -184,6 +189,7 @@ void MainWindow::createCustomTitlebar()
" background-image: url(':/greenHovered.png');"
" background-color: rgba(0, 0, 0, 0);"
" background-repeat: no-repeat;"
" background-attachment: fixed;"
"}");

if (isCustomTitlebar)
Expand Down
22 changes: 15 additions & 7 deletions src/CodeKeeper/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,15 +451,23 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)

tasksGLayout->addLayout(tasksStatsL, 0, 0, 1, 3);

tasksGLayout->addWidget(label_1, 1, 0);
tasksGLayout->addWidget(label_2, 1, 1);
tasksGLayout->addWidget(label_3, 1, 2);
QSplitter *tasksSplitter = new QSplitter(Qt::Horizontal);

tasksGLayout->addWidget(incompleteTasks, 2, 0);
tasksGLayout->addWidget(inprocessTasks, 2, 1);
tasksGLayout->addWidget(completeTasks, 2, 2);
tasksSplitter->addWidget(incompleteTasks);
tasksSplitter->addWidget(inprocessTasks);
tasksSplitter->addWidget(completeTasks);

tasksGLayout->addWidget(taskText, 3, 1);
tasksSplitter->setStretchFactor(0, 1);
tasksSplitter->setStretchFactor(1, 1);
tasksSplitter->setStretchFactor(2, 1);

tasksGLayout->addWidget(label_1, 1, 0, Qt::AlignHCenter);
tasksGLayout->addWidget(label_2, 1, 1, Qt::AlignHCenter);
tasksGLayout->addWidget(label_3, 1, 2, Qt::AlignHCenter);

tasksGLayout->addWidget(tasksSplitter, 2, 0, 1, 3);

tasksGLayout->addWidget(taskText, 4, 1);

// ========================================================

Expand Down
2 changes: 1 addition & 1 deletion src/CodeKeeper/settingswindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ SettingsWindow::SettingsWindow(QWidget *parent) : QMainWindow{parent}
checkUpdatesBtn = new QPushButton(
QPixmap(":/retry.png")
.scaled(font_size.toInt() + 1, font_size.toInt() + 1, Qt::KeepAspectRatio, Qt::SmoothTransformation),
tr(" Checkfor updates"));
tr(" Check for updates"));
checkUpdatesBtn->setFixedSize(200, 30);
checkUpdatesBtnL->addWidget(checkUpdatesBtn);

Expand Down

0 comments on commit 3313207

Please sign in to comment.