From a6593a0151eb1deaa39a9dd83f7cfb22ea5864b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lie=20Delhaie?= Date: Wed, 28 Sep 2022 21:14:10 +0200 Subject: [PATCH] Refresh GUI --- .gitignore | 1 + Chronos.pro | 24 +- Chronos.pro.user | 33 +- sources/mainwindow.cpp | 10 +- sources/tools.cpp | 10 +- ui/mainwindow.ui | 2329 ++++++++++++++++++---------------------- 6 files changed, 1074 insertions(+), 1333 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..89f64c7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.pro.* diff --git a/Chronos.pro b/Chronos.pro index f702758..d3fbe3b 100644 --- a/Chronos.pro +++ b/Chronos.pro @@ -3,8 +3,8 @@ greaterThan(QT_MAJOR_VERSION, 5): QT += widgets CONFIG += c++17 -win32:VERSION = 2.2.1.0 # major.minor.patch.build -else:VERSION = 2.2.1 # major.minor.patch +win32:VERSION = 2.3.0.0 # major.minor.patch.build +else:VERSION = 2.3.0 # major.minor.patch DEFINES += APP_VERSION=\"\\\"$${VERSION}\\\"\" @@ -48,21 +48,23 @@ macx { } } -linux-g++* { +linux-* { message("Build for Linux") DEFINES += APP_OS=\"\\\"$$system(cat /etc/issue | cut -d\' \' -f1)\\\"\" DEFINES += APP_OS_VERSION=\"\\\"$$system(uname -r)\\\"\" - DEFINES += APP_ARCH=\"\\\"amd64\\\"\" + DEFINES += APP_ARCH=\"\\\"$$system(uname -m)\\\"\" + ARCH = $$system(uname -m) + equals(ARCH, aarch64) { + message("CPU Architecture : aarch64") + QMAKE_CXXFLAGS_RELEASE += -mtune=cortex-a72 + } + equals(ARCH, amd64) { + message("CPU Architecture : amd64") + QMAKE_CXXFLAGS_RELEASE += -march=skylake + } QMAKE_CXXFLAGS_RELEASE *= -O3 - QMAKE_CXXFLAGS_RELEASE += -march=skylake - VERSION = 1.1.0 } -# add the desired -O3 if not present, MinGW only -# QMAKE_CXXFLAGS_RELEASE *= -O3 - - - # The following define makes your compiler emit warnings if you use # any Qt feature that has been marked deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the diff --git a/Chronos.pro.user b/Chronos.pro.user index d120d41..5cc895c 100644 --- a/Chronos.pro.user +++ b/Chronos.pro.user @@ -1,10 +1,10 @@ - + EnvironmentId - {23c6a5b6-2840-4c04-84d4-91387dc9bb9f} + {0573a7c9-abc6-4015-92f3-a282f03c4c02} ProjectExplorer.Project.ActiveTarget @@ -70,14 +70,11 @@ 0 true - - true - Builtin.BuildSystem true true Builtin.DefaultTidyAndClazy - 8 + 3 @@ -89,16 +86,16 @@ ProjectExplorer.Project.Target.0 Desktop - Desktop Qt 6.2.3 GCC 64bit - Desktop Qt 6.2.3 GCC 64bit - qt.qt6.623.gcc_64_kit + Desktop + Desktop + {2ec0b4a4-ede9-4dae-8af2-a01a18376181} 0 0 0 0 - /home/aurelie/src/build-Chronos-Desktop_Qt_6_2_3_GCC_64bit-Debug - /home/aurelie/src/build-Chronos-Desktop_Qt_6_2_3_GCC_64bit-Debug + /home/aurelie/Documents/build-Chronos-Desktop-Debug + /home/aurelie/Documents/build-Chronos-Desktop-Debug true @@ -136,8 +133,8 @@ 2 - /home/aurelie/src/build-Chronos-Desktop_Qt_6_2_3_GCC_64bit-Release - /home/aurelie/src/build-Chronos-Desktop_Qt_6_2_3_GCC_64bit-Release + /home/aurelie/Documents/build-Chronos-Desktop-Release + /home/aurelie/Documents/build-Chronos-Desktop-Release true @@ -177,8 +174,8 @@ 0 - /home/aurelie/src/build-Chronos-Desktop_Qt_6_2_3_GCC_64bit-Profile - /home/aurelie/src/build-Chronos-Desktop_Qt_6_2_3_GCC_64bit-Profile + /home/aurelie/Documents/build-Chronos-Desktop-Profile + /home/aurelie/Documents/build-Chronos-Desktop-Profile true @@ -238,14 +235,14 @@ 2 - Qt4ProjectManager.Qt4RunConfiguration:/home/aurelie/src/Chronos/Chronos.pro - /home/aurelie/src/Chronos/Chronos.pro + Qt4ProjectManager.Qt4RunConfiguration:/home/aurelie/Documents/Chronos/Chronos.pro + /home/aurelie/Documents/Chronos/Chronos.pro false true true false true - /home/aurelie/src/build-Chronos-Desktop_Qt_6_2_3_GCC_64bit-Debug + /home/aurelie/Documents/build-Chronos-Desktop-Debug 1 diff --git a/sources/mainwindow.cpp b/sources/mainwindow.cpp index f9bcc38..aab088c 100644 --- a/sources/mainwindow.cpp +++ b/sources/mainwindow.cpp @@ -76,23 +76,23 @@ void MainWindow::highlightDayOfWeek() { ui->today_button->setDisabled(true); switch (dayOfWeek) { case 1: { - ui->monLabel->setText(QString("> %1 <").arg(ui->monLabel->text())); + ui->monLabel->setText(QString("%1 <").arg(ui->monLabel->text())); break; } case 2: { - ui->tueLabel->setText(QString("> %1 <").arg(ui->tueLabel->text())); + ui->tueLabel->setText(QString("%1 <").arg(ui->tueLabel->text())); break; } case 3: { - ui->wedLabel->setText(QString("> %1 <").arg(ui->wedLabel->text())); + ui->wedLabel->setText(QString("%1 <").arg(ui->wedLabel->text())); break; } case 4: { - ui->thuLabel->setText(QString("> %1 <").arg(ui->thuLabel->text())); + ui->thuLabel->setText(QString("%1 <").arg(ui->thuLabel->text())); break; } case 5: { - ui->friLabel->setText(QString("> %1 <").arg(ui->friLabel->text())); + ui->friLabel->setText(QString("%1 <").arg(ui->friLabel->text())); break; } default: break; diff --git a/sources/tools.cpp b/sources/tools.cpp index a78e815..5ef19e4 100644 --- a/sources/tools.cpp +++ b/sources/tools.cpp @@ -2,12 +2,12 @@ QString Tools::double_to_string_time(double value) { const int h = floor(value); - value = round((value - h) * 60); - if (value == 0.0) { + int m = round((value - h) * 60); + if (m == 0) { return QString("%1h").arg(QString::number(h)); - } else if (value < 10.0) { - return QString("%1h0%2").arg(QString::number(h), QString::number(value)); + } else if (m < 10) { + return QString("%1h0%2").arg(QString::number(h), QString::number(m)); } - return QString("%1h%2").arg(QString::number(h), QString::number(value)); + return QString("%1h%2").arg(QString::number(h), QString::number(m)); } diff --git a/ui/mainwindow.ui b/ui/mainwindow.ui index cbb7559..fc349db 100644 --- a/ui/mainwindow.ui +++ b/ui/mainwindow.ui @@ -7,7 +7,7 @@ 0 0 946 - 573 + 671 @@ -19,7 +19,7 @@ 946 - 573 + 671 @@ -41,9 +41,9 @@ - 640 - 530 - 291 + 670 + 620 + 241 31 @@ -51,18 +51,85 @@ Modifier la semaine de référence - + - 44 - 138 - 861 - 388 + 910 + 10 + 24 + 24 - - - + + + 24 + 24 + + + + + 24 + 24 + + + + false + + + border-image: url(:/clock/pictures/about.png) 0 0 0 0 stretch stretch; + + + + + + true + + + + + + 50 + 620 + 91 + 31 + + + + Options + + + + + + 50 + 10 + 231 + 141 + + + + font-size: 70px; +color: white; + + + 0h + + + + + + 50 + 160 + 222 + 441 + + + + + QLayout::SetDefaultConstraint + + + @@ -79,45 +146,28 @@ font-size: 22px; Lundi - Qt::AlignCenter + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + + Qt::Horizontal + + - 0 - 42 + 40 + 20 - - font-size: 28px; -color: white; - - - 0h - - - Qt::AlignCenter - - + - - - - - Qt::Horizontal - - - - 40 - 20 - - - - + + + 6 + @@ -168,179 +218,12 @@ color: white; - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - - - - - - - - - font-size: 14px; - - - Arrivée - - - - - - - - 0 - 42 - - - - color: white; -font-size: 22px; - - - 00h00 - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - - - - - - font-size: 14px; - - - Pause - - - - - - - - 0 - 42 - - - - color: white; -font-size: 22px; - - - 00h00 - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - - - - - - font-size: 14px; - - - Départ - - - - - - - - 0 - 42 - - - - color: white; -font-size: 22px; - - - 00h00 - - - Qt::AlignCenter - - - - - - - - - - - Qt::Horizontal - - - - - - - - 0 - 31 - - - - Modifier - - - - - - - Qt::Vertical - - - - - + + @@ -357,45 +240,25 @@ font-size: 22px; Mardi - Qt::AlignCenter + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + + Qt::Horizontal + + - 0 - 42 + 40 + 20 - - font-size: 28px; -color: white; - - - 0h - - - Qt::AlignCenter - - + - - - - - Qt::Horizontal - - - - 40 - 20 - - - - + @@ -446,179 +309,12 @@ color: white; - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - - - - - - - - - font-size: 14px; - - - Arrivée - - - - - - - - 0 - 42 - - - - color: white; -font-size: 22px; - - - 00h00 - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - - - - - - font-size: 14px; - - - Pause - - - - - - - - 0 - 42 - - - - color: white; -font-size: 22px; - - - 00h00 - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - - - - - - font-size: 14px; - - - Départ - - - - - - - - 0 - 42 - - - - color: white; -font-size: 22px; - - - 00h00 - - - Qt::AlignCenter - - - - - - - - - - - Qt::Horizontal - - - - - - - - 0 - 31 - - - - Modifier - - - - - - - Qt::Vertical - - - - - + + @@ -635,45 +331,25 @@ font-size: 22px; Mercredi - Qt::AlignCenter + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + + Qt::Horizontal + + - 0 - 42 + 40 + 20 - - font-size: 28px; -color: white; - - - 0h - - - Qt::AlignCenter - - + - - - - - Qt::Horizontal - - - - 40 - 20 - - - - + @@ -724,179 +400,12 @@ color: white; - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - - - - - - - - - font-size: 14px; - - - Arrivée - - - - - - - - 0 - 42 - - - - color: white; -font-size: 22px; - - - 00h00 - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - - - - - - font-size: 14px; - - - Pause - - - - - - - - 0 - 42 - - - - color: white; -font-size: 22px; - - - 00h00 - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - - - - - - font-size: 14px; - - - Départ - - - - - - - - 0 - 42 - - - - color: white; -font-size: 22px; - - - 00h00 - - - Qt::AlignCenter - - - - - - - - - - - Qt::Horizontal - - - - - - - - 0 - 31 - - - - Modifier - - - - - - - Qt::Vertical - - - - - + + @@ -918,40 +427,20 @@ font-size: 22px; - - + + + Qt::Horizontal + + - 0 - 42 + 40 + 20 - - font-size: 28px; -color: white; - - - 0h - - - Qt::AlignCenter - - + - - - - - Qt::Horizontal - - - - 40 - 20 - - - - + @@ -1002,179 +491,12 @@ color: white; - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - - - - - - - - - font-size: 14px; - - - Arrivée - - - - - - - - 0 - 42 - - - - color: white; -font-size: 22px; - - - 00h00 - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - - - - - - font-size: 14px; - - - Pause - - - - - - - - 0 - 42 - - - - color: white; -font-size: 22px; - - - 00h00 - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal - - - - - - - - - font-size: 14px; - - - Départ - - - - - - - - 0 - 42 - - - - color: white; -font-size: 22px; - - - 00h00 - - - Qt::AlignCenter - - - - - - - - - - - Qt::Horizontal - - - - - - - - 0 - 31 - - - - Modifier - - - - - - - Qt::Vertical - - - - - + + @@ -1196,40 +518,20 @@ font-size: 22px; - - + + + Qt::Horizontal + + - 0 - 42 + 40 + 20 - - font-size: 28px; -color: white; - - - 0h - - - Qt::AlignCenter - - + - - - - - Qt::Horizontal - - - - 40 - 20 - - - - + @@ -1280,152 +582,630 @@ color: white; - - - - Qt::Horizontal - - - - 40 - 20 - - - - + + + + + + + + 310 + 170 + 601 + 422 + + + + + - - - Qt::Horizontal + + + + 0 + 42 + + + + font-size: 40px; +color: white; + + + 0h + + + Qt::AlignCenter - + + + + 0 + 31 + + + + Modifier + + + + + + + Qt::Vertical + + + + + - - - - - font-size: 14px; - - - Arrivée - - - - - - - - 0 - 42 - - - - color: white; -font-size: 22px; - - - 00h00 - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal + + + font-size: 14px; + + + Arrivée + + + Qt::AlignCenter - - - - - font-size: 14px; - - - Pause - - - - - - - - 0 - 42 - - - - color: white; + + + + 0 + 42 + + + + color: white; font-size: 22px; - - - 00h00 - - - Qt::AlignCenter - - - - - - - - - Qt::Horizontal + + + 00h00 + + + Qt::AlignCenter - - - - - - font-size: 14px; - - - Départ - - - - - - - - 0 - 42 - - - - color: white; -font-size: 22px; - - - 00h00 - - - Qt::AlignCenter - - - - - - + + + + + + 0 + 42 + + + + + -1 + + + + color: rgb(118, 118, 118); +font-size: 18px; + + + 00h00 + + + Qt::AlignCenter + + + + + + + + + + + font-size: 14px; + + + Départ + + + Qt::AlignCenter + + + + + + + + 0 + 42 + + + + color: white; +font-size: 22px; + + + 00h00 + + + Qt::AlignCenter + + + + + + + + + + + Qt::Horizontal + + + + + + + + + + 0 + 42 + + + + font-size: 40px; +color: white; + + + 0h + + + Qt::AlignCenter + + + + + + + + 0 + 31 + + + + Modifier + + + + + - Qt::Horizontal + Qt::Vertical + + + + + + + + + font-size: 14px; + + + Arrivée + + + Qt::AlignCenter + + + + + + + + 0 + 42 + + + + color: white; +font-size: 22px; + + + 00h00 + + + Qt::AlignCenter + + + + + + + + + + 0 + 42 + + + + color: rgb(118, 118, 118); +font-size: 18px; + + + 00h00 + + + Qt::AlignCenter + + + + + + + + + font-size: 14px; + + + Départ + + + Qt::AlignCenter + + + + + + + + 0 + 42 + + + + color: white; +font-size: 22px; + + + 00h00 + + + Qt::AlignCenter + + + + + + + + + + + Qt::Horizontal + + + + + + + + + + 0 + 42 + + + + font-size: 40px; +color: white; + + + 0h + + + Qt::AlignCenter + + + + + + + + 0 + 31 + + + + Modifier + + + + + + + Qt::Vertical + + + + + + + + + font-size: 14px; + + + Arrivée + + + Qt::AlignCenter + + + + + + + + 0 + 42 + + + + color: white; +font-size: 22px; + + + 00h00 + + + Qt::AlignCenter + + + + + + + + + + 0 + 42 + + + + color: rgb(118, 118, 118); +font-size: 18px; + + + 00h00 + + + Qt::AlignCenter + + + + + + + + + font-size: 14px; + + + Départ + + + Qt::AlignCenter + + + + + + + + 0 + 42 + + + + color: white; +font-size: 22px; + + + 00h00 + + + Qt::AlignCenter + + + + + + + + + + + Qt::Horizontal + + + + + + + + + + 0 + 42 + + + + font-size: 40px; +color: white; + + + 0h + + + Qt::AlignCenter + + + + + + + + 0 + 31 + + + + Modifier + + + + + + + Qt::Vertical + + + + + + + + + font-size: 14px; + + + Arrivée + + + Qt::AlignCenter + + + + + + + + 0 + 42 + + + + color: white; +font-size: 22px; + + + 00h00 + + + Qt::AlignCenter + + + + + + + + + + 0 + 42 + + + + color: rgb(118, 118, 118); +font-size: 18px; + + + 00h00 + + + Qt::AlignCenter + + + + + + + + + font-size: 14px; + + + Départ + + + Qt::AlignCenter + + + + + + + + 0 + 42 + + + + color: white; +font-size: 22px; + + + 00h00 + + + Qt::AlignCenter + + + + + + + + + + + Qt::Horizontal + + + + + + + + + + 0 + 42 + + + + font-size: 40px; +color: white; + + + 0h + + + Qt::AlignCenter @@ -1442,406 +1222,367 @@ font-size: 22px; + + + + Qt::Vertical + + + + + + + + + font-size: 14px; + + + Arrivée + + + Qt::AlignCenter + + + + + + + + 0 + 42 + + + + color: white; +font-size: 22px; + + + 00h00 + + + Qt::AlignCenter + + + + + + + + + + 0 + 42 + + + + color: rgb(118, 118, 118); +font-size: 18px; + + + 00h00 + + + Qt::AlignCenter + + + + + + + + + font-size: 14px; + + + Départ + + + Qt::AlignCenter + + + + + + + + 0 + 42 + + + + color: white; +font-size: 22px; + + + 00h00 + + + Qt::AlignCenter + + + + + - + - 30 - 530 - 24 - 24 + 530 + 23 + 109 + 21 - - - 24 - 24 - - - - - 24 - 24 - - - - false + + + -1 + - border-image: url(:/clock/pictures/about.png) 0 0 0 0 stretch stretch; + font-size: 14px; - + Semaine : 0 - - true + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - + + + false + - 800 - 10 - 111 - 111 - - - - - - - - 100 - 32 - - - - - 100 - 32 - - - - - - - border: none; - - - false - - - false - - - Qt::AlignCenter - - - false - - - QAbstractSpinBox::NoButtons - - - QAbstractSpinBox::CorrectToNearestValue - - - true - - - - - - - - - - Semaine : 0 - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - false - - - Aujourd'hui - - - - - - - - - 0 - 129 - 951 - 16 - - - - Qt::Horizontal - - - - - - 540 - 530 - 91 + 160 + 620 + 109 31 - Options + Aujourd'hui + + + + + + 810 + 130 + 100 + 32 + + + + + 100 + 32 + + + + + 100 + 32 + + + + + + + border: none; + + + false + + + false + + + Qt::AlignCenter + + + false + + + QAbstractSpinBox::NoButtons + + + QAbstractSpinBox::CorrectToNearestValue + + + true - 13 - 7 - 771 - 133 + 310 + 20 + 201 + 121 - - - QLayout::SetFixedSize - + - + - - - - 59 - 59 - - - - - 59 - 59 - - + - border-image: url(:/clock/pictures/clock-8-128.png) 0 0 0 0 stretch stretch; + font-size: 14px; - - QFrame::StyledPanel - - - QFrame::Raised + + Retard (Total) - - - - - font-size: 14px; - - - Temps total (Semaine) - - - - - - - font-size: 50px; -color: white; - - - 0h - - - - + + + font-size: 14px; +font-weight: bold; + + + 0h + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + - - - Qt::Vertical - - - - - + - - - - 59 - 59 - - - - - 59 - 59 - - + - border-image: url(:/clock/pictures/sport.png) 0 0 0 0 stretch stretch; + font-size: 14px; - - QFrame::StyledPanel - - - QFrame::Raised + + <html><head/><body><p>Retard (Semaine)</p></body></html> - - - - - font-size: 14px; - - - Retard (Total) - - - - - - - font-size: 28px; -color: white; - - - 0h - - - - - - - Qt::Horizontal - - - - - - - font-size: 14px; - - - <html><head/><body><p>Retard (Semaine)</p></body></html> - - - - - - - font-size: 20px; -color: white; - - - 0h - - - - + + + font-size: 14px; +font-weight: bold; + + + 0h + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + - - - Qt::Vertical - - - - - + - - - - 59 - 59 - - - - - 59 - 59 - - + - border-image: url(:/clock/pictures/calendar.png) 0 0 0 0 stretch stretch; + font-size: 14px; - - QFrame::StyledPanel - - - QFrame::Raised + + Avance (Total) - - - - - font-size: 14px; - - - Avance (Total) - - - - - - - font-size: 28px; -color: white; - - - 0h - - - - - - - Qt::Horizontal - - - - - - - font-size: 14px; - - - <html><head/><body><p>Avance (Semaine)</p></body></html> - - - - - - - font-size: 20px; -color: white; - - - 0h - - - - + + + font-size: 14px; +font-weight: bold; + + + 0h + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + font-size: 14px; + + + <html><head/><body><p>Avance (Semaine)</p></body></html> + + + + + + + font-size: 14px; +font-weight: bold; + + + 0h + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + layoutWidget - line layoutWidget layoutWidget - layoutWidget_2 - line_2 + layoutWidget + layoutWidget + layoutWidget template_settings_button - layoutWidget aboutButton - line_27 week_options_button + thuLabel + thurdayValidate + thurdayWarning + thu_time_label + label_28 + thuStartLabel + thuBreakLabel + thuEndLabel + label_32 + line_4 + fri_time_label + friLabel + fridayValidate + fridayWarning + label_34 + friStartLabel + friBreakLabel + label_38 + friEndLabel + line_5 + total_time_label + late_time_label + label_4 + label_8 + late_time_label_week + label_6 + overtime_time_label + label_9 + overtime_time_label_week + + + label_semaine + today_button + dateEdit