summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-28 08:35:59 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-28 08:38:16 -0700
commit0ea86d83c14dde31b36eb6d3ad3a8dcf10706e22 (patch)
treefc36852ab53d9768c10d312a0a04e4747034cfce
parent48a3d1b79cd94b872e4aa974f0954d42c7c64d09 (diff)
downloadsubsurface-0ea86d83c14dde31b36eb6d3ad3a8dcf10706e22.tar.gz
Calendar Widget: set the locale appropriate first day of the week
Also adjust the minimum size, given I changed this in commit 26855234acef ("Make date widget easier to read"). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--helpers.h1
-rw-r--r--qt-gui.cpp5
-rw-r--r--qt-ui/simplewidgets.cpp3
3 files changed, 8 insertions, 1 deletions
diff --git a/helpers.h b/helpers.h
index 4d9684e9c..d2f6e23c0 100644
--- a/helpers.h
+++ b/helpers.h
@@ -33,6 +33,7 @@ QString get_dive_date_string(timestamp_t when);
QString get_short_dive_date_string(timestamp_t when);
QString get_trip_date_string(timestamp_t when, int nr);
QString uiLanguage(QLocale *callerLoc);
+QLocale getLocale();
void selectedDivesGasUsed(QVector<QPair<QString, int> > &gasUsed);
#if defined __APPLE__
diff --git a/qt-gui.cpp b/qt-gui.cpp
index 23dc8b75f..4dc21e88f 100644
--- a/qt-gui.cpp
+++ b/qt-gui.cpp
@@ -103,6 +103,11 @@ QString uiLanguage(QLocale *callerLoc)
return uiLang;
}
+QLocale getLocale()
+{
+ return loc;
+}
+
void init_ui(void)
{
// tell Qt to use system proxies
diff --git a/qt-ui/simplewidgets.cpp b/qt-ui/simplewidgets.cpp
index e87f324de..e14e61552 100644
--- a/qt-ui/simplewidgets.cpp
+++ b/qt-ui/simplewidgets.cpp
@@ -295,10 +295,11 @@ DateWidget::DateWidget(QWidget *parent) : QWidget(parent),
calendarWidget(new QCalendarWidget())
{
setDate(QDate::currentDate());
- setMinimumSize(QSize(64,64));
+ setMinimumSize(QSize(80,64));
setFocusPolicy(Qt::StrongFocus);
calendarWidget->setWindowFlags(Qt::FramelessWindowHint);
calendarWidget->setWindowFlags(Qt::WindowStaysOnTopHint);
+ calendarWidget->setFirstDayOfWeek(getLocale().firstDayOfWeek());
connect(calendarWidget, SIGNAL(activated(QDate)), calendarWidget, SLOT(hide()));
connect(calendarWidget, SIGNAL(clicked(QDate)), calendarWidget, SLOT(hide()));