From 4114823b3e8d00087eb67631fb98465944059581 Mon Sep 17 00:00:00 2001
From: Ilya Panov <89508801+mirotvoretts@users.noreply.github.com>
Date: Sat, 5 Apr 2025 13:24:42 +0300
Subject: [PATCH 01/17] docs: update installation guide and add screenshot
---
README.md | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/README.md b/README.md
index d2242e4..5e9cacd 100644
--- a/README.md
+++ b/README.md
@@ -39,15 +39,7 @@ GRANT ALL PRIVILEGES ON DATABASE efficio TO efficio;
\q
```
-4. Enter under **efficio** profile
-
-```bash
-psql -U efficio -d efficio -h localhost
-```
-
-> After that run the server on address **localhost** and **port** 5432 in your pgAdmin4
-
-5. Build and start app
+4. Build and start app
```bash
mkdir -p build && cd build
@@ -56,6 +48,11 @@ make
./EfficioTaskTracker -platform xcb
```
+## Current result
+
+
+
+
## Technologies Used
- Qt 6.8.2
- PostgreSQL 17.4
@@ -64,4 +61,4 @@ make
## License
-This project is licensed under the **MIT License**. See the [LICENSE](https://github.com/toximu/efficio-task-tracker/blob/main/LICENSE) file for details.
\ No newline at end of file
+This project is licensed under the **MIT License**. See the [LICENSE](https://github.com/toximu/efficio-task-tracker/blob/main/LICENSE) file for details.
From 3d06e251d23bc5fd07b0ea0282be86775dcf170c Mon Sep 17 00:00:00 2001
From: Ilya Panov <89508801+mirotvoretts@users.noreply.github.com>
Date: Thu, 10 Apr 2025 23:11:37 +0300
Subject: [PATCH 02/17] docs: update building app guide
---
README.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/README.md b/README.md
index 5e9cacd..cbfcd75 100644
--- a/README.md
+++ b/README.md
@@ -30,6 +30,8 @@ git clone git@github.com:toximu/efficio-task-tracker.git
sudo service postgresql start && sudo -u postgres psql
```
+> If you use fish shell, replace `service` with `systemctl`
+
3. Create **efficio** user
```SQL
From 69edfb7591027829178d832cc7ac63817b2ceee2 Mon Sep 17 00:00:00 2001
From: tima bytsan <86739929+toximu@users.noreply.github.com>
Date: Thu, 10 Apr 2025 23:17:00 +0300
Subject: [PATCH 03/17] return main.cpp
---
main.cpp | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
create mode 100644 main.cpp
diff --git a/main.cpp b/main.cpp
new file mode 100644
index 0000000..91bce06
--- /dev/null
+++ b/main.cpp
@@ -0,0 +1,34 @@
+#include
+#include
+#include
+#include
+#include
+#include "applicationwindow.h"
+#include "login_window.h"
+#include "mainwindow.h"
+
+int main(int argc, char *argv[]) {
+ QApplication application(argc, argv);
+
+ QTranslator translator;
+ const QStringList ui_languages = QLocale::system().uiLanguages();
+ for (const QString &locale : ui_languages) {
+ const QString base_name = "MainWindow_" + QLocale(locale).name();
+ if (translator.load(":/i18n/" + base_name)) {
+ QApplication::installTranslator(&translator);
+ break;
+ }
+ }
+
+ auto *app_window = new Ui::ApplicationWindow("EFFICIO");
+ auto *login_window = new LoginWindow(app_window);
+
+ app_window->setCentralWidget(login_window);
+ const QRect screen_geometry = QApplication::primaryScreen()->availableGeometry();
+ const int x = (screen_geometry.width() - login_window->width()) / 2;
+ const int y = (screen_geometry.height() - login_window->height()) / 2;
+ app_window->move(x, y);
+ app_window->show();
+
+ return QApplication::exec();
+}
From 34b3b8d594dd7991546e01286fe10b5d5d1e1ced Mon Sep 17 00:00:00 2001
From: MuravAna
Date: Fri, 11 Apr 2025 15:39:03 +0300
Subject: [PATCH 04/17] Changes in login_window style: add 4 new themes, but
have bug because of gradient
---
.../include/login_window.h | 10 +-
.../include/login_window_style_sheet.h | 387 +++++++++++++++---
.../include/registration_window_style_sheet.h | 58 ++-
ui/authorization-windows/src/login_window.cpp | 32 +-
.../src/registration_window.cpp | 2 +-
ui/authorization-windows/ui/login_window.ui | 22 +
6 files changed, 451 insertions(+), 60 deletions(-)
diff --git a/ui/authorization-windows/include/login_window.h b/ui/authorization-windows/include/login_window.h
index 5aed300..c2c4746 100644
--- a/ui/authorization-windows/include/login_window.h
+++ b/ui/authorization-windows/include/login_window.h
@@ -7,26 +7,30 @@
#include
#include "database_manager.hpp"
#include "lr_dao.hpp"
+#include
QT_BEGIN_NAMESPACE
-
namespace Ui {
class LoginWindow;
}
-
QT_END_NAMESPACE
class LoginWindow : public QWidget {
Q_OBJECT
public:
- explicit LoginWindow(QWidget *parent = nullptr);
+ explicit LoginWindow(QWidget *parent = nullptr, int number_of_theme_ = 3);
~LoginWindow();
+
+ static const std::vector THEMES;
private slots:
void on_switch_mode_clicked();
void on_push_enter_clicked();
+ void on_switch_theme_clicked();
private:
Ui::LoginWindow *ui;
+ int number_of_theme;
+ int counter_on_switch_theme_clicks = 0;
};
\ No newline at end of file
diff --git a/ui/authorization-windows/include/login_window_style_sheet.h b/ui/authorization-windows/include/login_window_style_sheet.h
index f5cb58a..1641a4a 100644
--- a/ui/authorization-windows/include/login_window_style_sheet.h
+++ b/ui/authorization-windows/include/login_window_style_sheet.h
@@ -3,54 +3,343 @@
#include "ui_login_window.h"
namespace Ui {
-QString login_window_light_theme = R"(
- QWidget {
- background-color: #f5f5f5;
- }
-
- QLabel {
- font-family: 'Arial';
- font-size: 13px;
- color: #089083;
- padding: 1px;
- }
-
- QPushButton#pushEnter {
- font-family: 'Arial';
- border-radius: 10px;
- background-color: #fea36b;
- color: white;
- padding: 5px 10px;
- }
-
- QPushButton#switchMode {
- font-family: 'Arial';
- border-radius: 10px;
- background-color: white;
- color: #fea36b;
- padding: 5px 10px;
- }
-
- QPushButton#pushEnter:hover {
- background-color: #d58745;
- }
-
- QPushButton#switchMode:hover {
- background-color: #dadada;
- }
-
- QLineEdit {
- border-radius: 10px;
- border: 1px solid white;
- background: white;
- color: black;
- padding: 5px;
- }
-
- QLineEdit::placeholder {
- color: #727272;
- }
-
-)";
+ QString login_window_light_autumn_theme = R"(
+ QWidget {
+ background-color: #f5f5f5;
+ }
+
+ QLabel {
+ background-color: transparent;
+ font-family: 'Arial';
+ font-size: 13px;
+ color: #089083;
+ padding: 1px;
+ }
+
+ QPushButton#pushEnter {
+ font-family: 'Arial';
+ border-radius: 10px;
+ background-color: #fea36b;
+ color: white;
+ padding: 5px 10px;
+ }
+
+ QPushButton#switchMode {
+ font-family: 'Arial';
+ border-radius: 10px;
+ background-color: white;
+ color: #fea36b;
+ padding: 5px 10px;
+ }
+
+ QPushButton#pushEnter:hover {
+ background-color: #d58745;
+ }
+
+ QPushButton#switchMode:hover {
+ background-color: #dadada;
+ }
+
+ QLineEdit {
+ border-radius: 10px;
+ border: 1px solid white;
+ background: white;
+ color: black;
+ padding: 5px;
+ }
+
+ QLineEdit::placeholder {
+ color: #727272;
+ }
+ QPushButton#switch_theme {
+ background-color: rgb(163, 162, 162);
+ border-radius: 9px;
+ border: 2px solid #089083;
+ padding: 5px;
+ }
+ QPushButton::hover#switch_theme {
+ background-color: #089083;
+ }
+ QPushButton::pressed#switch_theme {
+ background-color:rgb(7, 110, 100);
+ }
+
+ )";
+
+ QString login_window_dark_autumn_theme = R"(
+ QWidget {
+ background-color: #202020;
+ }
+
+ QLabel {
+ background-color: transparent;
+ font-family: 'Arial';
+ font-size: 13px;
+ color: #089083;
+ padding: 1px;
+ }
+
+ QPushButton#pushEnter {
+ font-family: 'Arial';
+ border-radius: 10px;
+ background-color: #fea36b;
+ color: #263238;
+ padding: 5px 10px;
+ }
+
+ QPushButton#pushEnter:hover {
+ background-color:rgb(225, 133, 76);
+ }
+
+ QPushButton#switchMode {
+ font-family: 'Arial';
+ border-radius: 10px;
+ background-color: #089083;
+ color: white;
+ padding: 5px 10px;
+ }
+
+ QPushButton#switchMode:hover {
+ background-color: #01635d;
+ }
+
+ QLineEdit {
+ border-radius: 10px;
+ border: 1px solid rgb(0, 0, 0);
+ background:rgb(0, 0, 0);
+ color: #727272;
+ padding: 5px;
+ }
+
+ QLineEdit::placeholder {
+ color: #727272;
+ }
+
+ QPushButton#switch_theme {
+ background-color: #202020;
+ border-radius: 9px;
+ border: 2px solid #089083;
+ padding: 5px;
+ }
+ QPushButton::hover#switch_theme {
+ background-color: #089083;
+ }
+ QPushButton::pressed#switch_theme {
+ background-color:rgb(13, 93, 85);
+ }
+ )";
+
+
+
+ QString login_window_light_purple_theme = R"(
+ QWidget {
+ background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
+ stop:0 #9882B9, stop:0.5 rgb(176, 157, 205), stop:1 rgb(103, 88, 126));
+ margin: 0;
+ padding: 0;
+ border: none;
+ }
+
+ QLabel {
+ background-color: transparent;
+ font-family: 'Arial';
+ font-size: 13px;
+ color: rgb(42, 10, 25);
+ padding: 1px;
+ }
+
+ QPushButton#pushEnter {
+ font-family: 'Arial';
+ border-radius: 10px;
+ background-color: #722548;
+ color:rgb(206, 193, 224);
+ padding: 5px 10px;
+ }
+
+ QPushButton#pushEnter:hover {
+ background-color:rgb(98, 27, 59)
+ }
+
+ QPushButton#switchMode {
+ font-family: 'Arial';
+ border-radius: 10px;
+ background-color: rgb(42, 10, 25);
+ color: rgb(218, 207, 235);
+ padding: 5px 10px;
+ }
+
+ QPushButton#switchMode:hover {
+ background-color:rgb(27, 6, 16);
+ }
+
+ QLineEdit {
+ border-radius: 10px;
+ border: 1px solid rgb(221, 210, 238);
+ background: rgb(221, 210, 238);
+ color: #221932;
+ padding: 5px;
+ }
+
+ QLineEdit::placeholder {
+ color: white;
+ }
+
+ QPushButton#switch_theme {
+ background-color: #9882B9;
+ border-radius: 9px;
+ border: 2px solid #060407;
+ padding: 5px;
+ }
+ QPushButton::hover#switch_theme {
+ background-color: #060407;
+ }
+ QPushButton::pressed#switch_theme {
+ background-color:rgb(2, 0, 2);
+ }
+ )";
+
+ QString login_window_dark_purple_theme = R"(
+ QWidget {
+ background-color:rgb(9, 6, 10);
+ }
+
+ QLabel {
+ background-color: transparent;
+ font-family: 'Arial';
+ font-size: 13px;
+ color: #9882B9;
+ padding: 1px;
+ }
+
+ QPushButton#pushEnter {
+ font-family: 'Arial';
+ border-radius: 10px;
+ background-color: #722548;
+ color: #060407;
+ padding: 5px 10px;
+ }
+
+ QPushButton#pushEnter:hover {
+ background-color:rgb(98, 27, 59)
+ }
+
+ QPushButton#switchMode {
+ font-family: 'Arial';
+ border-radius: 10px;
+ background-color: rgb(42, 10, 25);
+ color: #9882B9;
+ padding: 5px 10px;
+ }
+
+ QPushButton#switchMode:hover {
+ background-color:rgb(27, 6, 16);
+ }
+
+ QLineEdit {
+ border-radius: 10px;
+ border: 1px solid #221932;
+ background: #221932;
+ color: #9882B9;
+ padding: 5px;
+ }
+
+ QLineEdit::placeholder {
+ color: white;
+ }
+
+ QPushButton#switch_theme {
+ background-color: #060407;
+ border-radius: 9px;
+ border: 2px solid #9882B9;
+ padding: 5px;
+ }
+ QPushButton::hover#switch_theme {
+ background-color: #9882B9;
+ }
+ QPushButton::pressed#switch_theme {
+ background-color:rgb(113, 93, 143);
+ }
+
+ )";
+
+ QString login_window_nature_flat_theme = R"(
+ QWidget {
+ background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
+ stop:0 #173C4C, stop:0.5 #326D6C, stop:1 #07142B);
+ margin: 0;
+ padding: 0;
+ border: none;
+ }
+
+ QLabel {
+ background-color: transparent;
+ font-family: 'Arial';
+ font-size: 13px;
+ color: #BDD1BD;
+ padding: 1px;
+ }
+
+ QPushButton#pushEnter {
+ font-family: 'Arial';
+ border-radius: 10px;
+ background-color: #568F7C;
+ color: #BDD1BD;
+ padding: 5px 10px;
+ border: none;
+ font-weight: bold;
+ }
+
+ QPushButton#pushEnter:hover {
+ background-color: #326D6C;
+ }
+
+ QPushButton#pushEnter:pressed {
+ background-color: #07142B;
+ }
+
+ QPushButton#switchMode {
+ font-family: 'Arial';
+ border-radius: 10px;
+ background-color: #326D6C;
+ color: #BDD1BD;
+ padding: 5px 10px;
+ border: 1px solid #568F7C;
+ }
+
+ QPushButton#switchMode:hover {
+ background-color: #568F7C;
+ color: #07142B;
+ }
+
+ QLineEdit {
+ border-radius: 10px;
+ border: 1px solid #568F7C;
+ background: #07142B;
+ color: #BDD1BD;
+ padding: 5px;
+ selection-background-color: #326D6C;
+ }
+
+ QLineEdit::placeholder {
+ color: #85B093;
+ opacity: 0.7;
+ }
+
+ QPushButton#switch_theme {
+ background-color: #173C4C;
+ border-radius: 9px;
+ border: 2px solid #85B093;
+ padding: 5px;
+ color: #BDD1BD;
+ }
+
+ QPushButton#switch_theme:hover {
+ background-color: #85B093;
+ }
+
+ QPushButton#switch_theme:pressed {
+ background-color:rgb(107, 141, 118);
+ }
+ )";
} // namespace Ui
\ No newline at end of file
diff --git a/ui/authorization-windows/include/registration_window_style_sheet.h b/ui/authorization-windows/include/registration_window_style_sheet.h
index d17480e..8045fa9 100644
--- a/ui/authorization-windows/include/registration_window_style_sheet.h
+++ b/ui/authorization-windows/include/registration_window_style_sheet.h
@@ -3,13 +3,65 @@
#include "ui_registration_window.h"
namespace Ui {
-QString registration_window_light_theme = R"(
+ QString registration_window_light_theme = R"(
+ QWidget {
+ background-color: #f5f5f5;
+ }
+
+ QLabel {
+ font-family: 'Arial';
+ background-color: transparent;
+ font-size: 13px;
+ color: #089083;
+ padding: 1px;
+ }
+
+ QPushButton#pushRegistration {
+ font-family: 'Arial';
+ border-radius: 10px;
+ background-color: #fea36b;
+ color: white;
+ padding: 5px 10px;
+ }
+
+ QPushButton#switchMode {
+ font-family: 'Arial';
+ border-radius: 10px;
+ background-color: white;
+ color: #fea36b;
+ padding: 5px 10px;
+ }
+
+ QPushButton#pushRegistration:hover {
+ background-color: #d58745;
+ }
+
+ QPushButton#switchMode:hover {
+ background-color: #dadada;
+ }
+
+ QLineEdit {
+ border-radius: 10px;
+ border: 1px solid white;
+ background: white;
+ color: black;
+ padding: 5px;
+ }
+
+ QLineEdit::placeholder {
+ color: #727272;
+ }
+
+ )";
+
+QString registration_window_dark_autumm_theme = R"(
QWidget {
- background-color: #f5f5f5;
+ background-color: #121318;
}
QLabel {
font-family: 'Arial';
+ background-color: transparent;
font-size: 13px;
color: #089083;
padding: 1px;
@@ -36,7 +88,7 @@ QString registration_window_light_theme = R"(
}
QPushButton#switchMode:hover {
- background-color: #dadada;
+ background-color: #300B1C;
}
QLineEdit {
diff --git a/ui/authorization-windows/src/login_window.cpp b/ui/authorization-windows/src/login_window.cpp
index 0583ef5..ac83043 100644
--- a/ui/authorization-windows/src/login_window.cpp
+++ b/ui/authorization-windows/src/login_window.cpp
@@ -10,21 +10,30 @@
#include "applicationwindow.h"
#include "bottombar.h"
#include "database_manager.hpp"
-#include "login_window_style_sheet.h"
#include "lr_dao.hpp"
#include "mainwindow.h"
#include "notelist.h"
#include "registration_window.h"
#include "serialization.hpp"
+#include "login_window_style_sheet.h"
+
+const std::vector LoginWindow::THEMES = {
+ Ui::login_window_light_autumn_theme,
+ Ui::login_window_dark_autumn_theme,
+ Ui::login_window_dark_purple_theme,
+ Ui::login_window_light_purple_theme,
+ Ui::login_window_nature_flat_theme
+};
-LoginWindow::LoginWindow(QWidget *parent)
- : QWidget(parent), ui(new Ui::LoginWindow) {
+LoginWindow::LoginWindow(QWidget *parent, int number_of_theme_)
+ : QWidget(parent), ui(new Ui::LoginWindow), number_of_theme(number_of_theme_) {
ui->setupUi(this);
setFixedSize(380, 480);
ui->inputLogin->setPlaceholderText("Введите логин:");
ui->inputPassword->setPlaceholderText("Введите пароль:");
- setStyleSheet(Ui::login_window_light_theme);
+
+ setStyleSheet(THEMES[number_of_theme_]);
ui->inputPassword->setEchoMode(QLineEdit::Password);
connect(
@@ -35,6 +44,10 @@ LoginWindow::LoginWindow(QWidget *parent)
ui->pushEnter, &QPushButton::clicked, this,
&LoginWindow::on_push_enter_clicked
);
+ connect(
+ ui->switch_theme, &QPushButton::clicked, this,
+ &LoginWindow::on_switch_theme_clicked
+ );
}
LoginWindow::~LoginWindow() {
@@ -115,4 +128,15 @@ void LoginWindow::on_push_enter_clicked() {
this, "Ошибка ввода данных", "Пожалуйста, заполните все поля!"
);
}
+}
+
+void LoginWindow::on_switch_theme_clicked() {
+ // Attention: костыль.
+ // Почему-то кнопка switch_theme дважды кликается,
+ // из-за чего темы переключаются не подряд, а через одну.
+ // Поэтому ведем счетчик кликов и только на нечетных переключаем тему.
+ if ((this->counter_on_switch_theme_clicks++)%2){
+ this->number_of_theme = (this->number_of_theme+1)%THEMES.size();
+ setStyleSheet(THEMES[this->number_of_theme]);
+ }
}
\ No newline at end of file
diff --git a/ui/authorization-windows/src/registration_window.cpp b/ui/authorization-windows/src/registration_window.cpp
index f30f7d8..f59ad6a 100644
--- a/ui/authorization-windows/src/registration_window.cpp
+++ b/ui/authorization-windows/src/registration_window.cpp
@@ -25,7 +25,7 @@ RegistrationWindow::RegistrationWindow(QWidget *parent)
ui->createLogin->setPlaceholderText("Введите логин:");
ui->createPassword->setPlaceholderText("Введите пароль:");
ui->repeatPassword->setPlaceholderText("Повторите пароль:");
- setStyleSheet(Ui::registration_window_light_theme);
+ setStyleSheet(Ui::registration_window_dark_autumm_theme);
ui->createPassword->setEchoMode(QLineEdit::Password);
ui->repeatPassword->setEchoMode(QLineEdit::Password);
diff --git a/ui/authorization-windows/ui/login_window.ui b/ui/authorization-windows/ui/login_window.ui
index 02ffce3..4fb7339 100644
--- a/ui/authorization-windows/ui/login_window.ui
+++ b/ui/authorization-windows/ui/login_window.ui
@@ -104,6 +104,28 @@ border-radius: 10px;
Еще нет аккаунта? Зарегистрируйтесь!
+
+
+
+ 350
+ 455
+ 20
+ 20
+
+
+
+
+ 20
+ 20
+
+
+
+
+ 20
+ 20
+
+
+