Calendar Widget: set the locale appropriate first day of the week

Also adjust the minimum size, given I changed this in commit
26855234ac ("Make date widget easier to read").

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-06-28 08:35:59 -07:00
parent 48a3d1b79c
commit 0ea86d83c1
3 changed files with 8 additions and 1 deletions

View file

@ -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__

View file

@ -103,6 +103,11 @@ QString uiLanguage(QLocale *callerLoc)
return uiLang;
}
QLocale getLocale()
{
return loc;
}
void init_ui(void)
{
// tell Qt to use system proxies

View file

@ -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()));