- fix running timer in some cases + make font bigger
This commit is contained in:
parent
3175b435a2
commit
3777a11397
@ -32,7 +32,7 @@ MainWindow::~MainWindow()
|
|||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool isDarkTheme()
|
/*static bool isDarkTheme()
|
||||||
{
|
{
|
||||||
// Thanks to stackoverflow ! Another idea is to use https://successfulsoftware.net/2021/03/31/how-to-add-a-dark-theme-to-your-qt-application/
|
// Thanks to stackoverflow ! Another idea is to use https://successfulsoftware.net/2021/03/31/how-to-add-a-dark-theme-to-your-qt-application/
|
||||||
auto label = QLabel("am I in the dark?");
|
auto label = QLabel("am I in the dark?");
|
||||||
@ -41,7 +41,7 @@ static bool isDarkTheme()
|
|||||||
bool dark_theme_found = text_hsv_value > bg_hsv_value;
|
bool dark_theme_found = text_hsv_value > bg_hsv_value;
|
||||||
|
|
||||||
return dark_theme_found;
|
return dark_theme_found;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
QIcon MainWindow::getAppIcon()
|
QIcon MainWindow::getAppIcon()
|
||||||
{
|
{
|
||||||
@ -64,15 +64,6 @@ void MainWindow::init()
|
|||||||
// Icon
|
// Icon
|
||||||
setWindowIcon(getAppIcon());
|
setWindowIcon(getAppIcon());
|
||||||
|
|
||||||
// ToDo: finish the multiple monitor support
|
|
||||||
/*QDesktopWidget *widget = QApplication::desktop();
|
|
||||||
qDebug() << "Number of screens:" << widget->screenCount();
|
|
||||||
|
|
||||||
connect(widget, &QDesktopWidget::screenCountChanged, this, [](int screenCount){});
|
|
||||||
if (widget->screenCount() > 1) {
|
|
||||||
} else if (widget->screenCount() == 1){
|
|
||||||
}*/
|
|
||||||
|
|
||||||
// Tray icon
|
// Tray icon
|
||||||
createTrayIcon();
|
createTrayIcon();
|
||||||
|
|
||||||
@ -315,8 +306,12 @@ void MainWindow::onLongBreakEnd()
|
|||||||
// Hide the window
|
// Hide the window
|
||||||
hideMe();
|
hideMe();
|
||||||
|
|
||||||
|
mProgressTimer->stop();
|
||||||
|
|
||||||
// Start new timer
|
// Start new timer
|
||||||
|
mTimer->stop();
|
||||||
mTimer->start(std::chrono::seconds(mAppConfig.longbreak_interval));
|
mTimer->start(std::chrono::seconds(mAppConfig.longbreak_interval));
|
||||||
|
mNotifyTimer->stop();
|
||||||
mNotifyTimer->start(std::chrono::seconds(mAppConfig.longbreak_interval - 30));
|
mNotifyTimer->start(std::chrono::seconds(mAppConfig.longbreak_interval - 30));
|
||||||
|
|
||||||
// Refresh UI
|
// Refresh UI
|
||||||
@ -334,7 +329,9 @@ void MainWindow::onLongBreakPostpone()
|
|||||||
ui->mProgressBar->setValue(0);
|
ui->mProgressBar->setValue(0);
|
||||||
|
|
||||||
// Start timer again
|
// Start timer again
|
||||||
|
mTimer->stop();
|
||||||
mTimer->start(std::chrono::seconds(mAppConfig.longbreak_postpone_interval));
|
mTimer->start(std::chrono::seconds(mAppConfig.longbreak_postpone_interval));
|
||||||
|
mNotifyTimer->stop();
|
||||||
mNotifyTimer->start(std::chrono::seconds(mAppConfig.longbreak_postpone_interval - 30));
|
mNotifyTimer->start(std::chrono::seconds(mAppConfig.longbreak_postpone_interval - 30));
|
||||||
|
|
||||||
// Refresh UI
|
// Refresh UI
|
||||||
|
|||||||
@ -62,6 +62,11 @@
|
|||||||
<height>0</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>14</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
<property name="value">
|
<property name="value">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
@ -69,6 +74,11 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="mRemainingLabel">
|
<widget class="QLabel" name="mRemainingLabel">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>14</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string notr="true">Remaining:</string>
|
<string notr="true">Remaining:</string>
|
||||||
</property>
|
</property>
|
||||||
@ -117,6 +127,12 @@
|
|||||||
<height>100</height>
|
<height>100</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>14</pointsize>
|
||||||
|
<underline>true</underline>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string notr="true">Postpone for 10 minutes</string>
|
<string notr="true">Postpone for 10 minutes</string>
|
||||||
</property>
|
</property>
|
||||||
@ -155,6 +171,12 @@
|
|||||||
<height>16777215</height>
|
<height>16777215</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>14</pointsize>
|
||||||
|
<underline>true</underline>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Skip this break</string>
|
<string>Skip this break</string>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user