fix time zone \

+ crop text when too large \
+ muted icon sticker
This commit is contained in:
Gaëlle Braud 2025-01-23 15:32:47 +00:00
parent 96772fabac
commit dc45edf172
3 changed files with 20 additions and 13 deletions

View file

@ -285,7 +285,9 @@ QString Utils::formatDate(const QDateTime &date, bool includeTime) {
if (date.date() == QDate::currentDate()) dateDay = tr("Aujourd'hui"); if (date.date() == QDate::currentDate()) dateDay = tr("Aujourd'hui");
else if (date.date() == QDate::currentDate().addDays(-1)) dateDay = tr("Hier"); else if (date.date() == QDate::currentDate().addDays(-1)) dateDay = tr("Hier");
else { else {
QString format = date.date().year() == QDateTime::currentDateTime().date().year() ? "dd MMMM" : "dd MMMM yyyy"; QString format = date.date().year() == QDateTime::currentDateTime(date.timeZone()).date().year()
? "dd MMMM"
: "dd MMMM yyyy";
dateDay = App::getInstance()->getLocale().toString(date.date(), format); dateDay = App::getInstance()->getLocale().toString(date.date(), format);
} }
if (!includeTime) return dateDay; if (!includeTime) return dateDay;
@ -305,7 +307,7 @@ QString Utils::formatDateElapsedTime(const QDateTime &date) {
// if (M > 0) return QString::number(M) + " months"; // if (M > 0) return QString::number(M) + " months";
// auto w = floor(seconds / 604800); // auto w = floor(seconds / 604800);
// if (w > 0) return QString::number(w) + " week"; // if (w > 0) return QString::number(w) + " week";
auto dateSec = date.secsTo(QDateTime::currentDateTime()); auto dateSec = date.secsTo(QDateTime::currentDateTime(date.timeZone()));
auto d = floor(dateSec / 86400); auto d = floor(dateSec / 86400);
if (d > 7) { if (d > 7) {
@ -413,7 +415,7 @@ QString Utils::generateSavedFilename(const QString &from, const QString &to) {
return QString(str).replace(regexp, ""); return QString(str).replace(regexp, "");
}; };
return QStringLiteral("%1_%2_%3") return QStringLiteral("%1_%2_%3")
.arg(QDateTime::currentDateTime().toString("yyyy-MM-dd_hh-mm-ss")) .arg(QDateTime::currentDateTime(QTimeZone::systemTimeZone()).toString("yyyy-MM-dd_hh-mm-ss"))
.arg(escape(from)) .arg(escape(from))
.arg(escape(to)); .arg(escape(to));
} }
@ -1263,7 +1265,7 @@ QString Utils::toDateMonthAndYearString(const QDateTime &date) {
bool Utils::isCurrentDay(QDateTime date) { bool Utils::isCurrentDay(QDateTime date) {
auto dateDayNum = date.date().day(); auto dateDayNum = date.date().day();
auto currentDate = QDateTime::currentDateTime(); auto currentDate = QDateTime::currentDateTime(date.timeZone());
auto currentDayNum = currentDate.date().day(); auto currentDayNum = currentDate.date().day();
auto daysTo = date.daysTo(currentDate); auto daysTo = date.daysTo(currentDate);
return (dateDayNum == currentDayNum && daysTo == 0); return (dateDayNum == currentDayNum && daysTo == 0);
@ -1289,11 +1291,11 @@ bool Utils::dateisInMonth(const QDate &a, int month, int year) {
QDateTime Utils::createDateTime(const QDate &date, int hour, int min) { QDateTime Utils::createDateTime(const QDate &date, int hour, int min) {
QTime time(hour, min); QTime time(hour, min);
return QDateTime(date, time); return QDateTime(date, time, QTimeZone::systemTimeZone());
} }
QDateTime Utils::getCurrentDateTime() { QDateTime Utils::getCurrentDateTime() {
return QDateTime::currentDateTime(); return QDateTime::currentDateTime(QTimeZone::systemTimeZone());
} }
QDateTime Utils::getCurrentDateTimeUtc() { QDateTime Utils::getCurrentDateTimeUtc() {

View file

@ -43,6 +43,8 @@ ListView {
? modelData.core.conference.core.subject ? modelData.core.conference.core.subject
: remoteNameObj ? remoteNameObj.value : "" : remoteNameObj ? remoteNameObj.value : ""
font.pixelSize: 14 * DefaultStyle.dp font.pixelSize: 14 * DefaultStyle.dp
Layout.fillWidth: true
maximumLineCount: 1
} }
Text { Text {
id: callStateText id: callStateText

View file

@ -280,17 +280,20 @@ Item {
height: 18 * DefaultStyle.dp height: 18 * DefaultStyle.dp
spacing: 0 spacing: 0
CheckableButton { Rectangle {
id: muteIcon id: muteIcon
icon.source: AppIcons.microphoneSlash
Layout.preferredWidth: Math.min(mainItem.width / 16, 20 * DefaultStyle.dp) Layout.preferredWidth: Math.min(mainItem.width / 16, 20 * DefaultStyle.dp)
Layout.preferredHeight: Math.min(mainItem.width / 16, 20 * DefaultStyle.dp) Layout.preferredHeight: Math.min(mainItem.width / 16, 20 * DefaultStyle.dp)
visible: mainItem.mutedStatus visible: mainItem.mutedStatus
icon.width: Math.min(mainItem.width / 16, 20 * DefaultStyle.dp) color: DefaultStyle.grey_0
icon.height: Math.min(mainItem.width / 16, 20 * DefaultStyle.dp) radius: width /2
enabled: false EffectImage {
contentImageColor: DefaultStyle.main2_500main anchors.centerIn: parent
backgroundColor: DefaultStyle.grey_0 imageWidth: Math.min(mainItem.width / 16, 20 * DefaultStyle.dp)
imageHeight: Math.min(mainItem.width / 16, 20 * DefaultStyle.dp)
imageSource: AppIcons.microphoneSlash
colorizationColor: DefaultStyle.main2_500main
}
} }
} }
} }