|
|
|
@ -22,6 +22,7 @@
@@ -22,6 +22,7 @@
|
|
|
|
|
#include "src/widget/style.h" |
|
|
|
|
#include "src/widget/widget.h" |
|
|
|
|
#include <QDialogButtonBox> |
|
|
|
|
#include <QFontMetrics> |
|
|
|
|
#include <QHBoxLayout> |
|
|
|
|
#include <QLabel> |
|
|
|
|
#include <QPaintEvent> |
|
|
|
@ -30,7 +31,6 @@
@@ -30,7 +31,6 @@
|
|
|
|
|
#include <QPushButton> |
|
|
|
|
#include <QRect> |
|
|
|
|
#include <QVBoxLayout> |
|
|
|
|
#include <QFontMetrics> |
|
|
|
|
#include <assert.h> |
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -76,12 +76,12 @@ CallConfirmWidget::CallConfirmWidget(const QWidget* anchor)
@@ -76,12 +76,12 @@ CallConfirmWidget::CallConfirmWidget(const QWidget* anchor)
|
|
|
|
|
// Note: At the moment this may not work properly. For languages written
|
|
|
|
|
// from right to left, there is no translation for the phrase "Incoming call...".
|
|
|
|
|
// In this situation, the phrase "Incoming call..." looks as "...oming call..."
|
|
|
|
|
Qt::TextElideMode elideMode = (QGuiApplication::layoutDirection() == Qt::LeftToRight) |
|
|
|
|
? Qt::ElideRight : Qt::ElideLeft; |
|
|
|
|
Qt::TextElideMode elideMode = |
|
|
|
|
(QGuiApplication::layoutDirection() == Qt::LeftToRight) ? Qt::ElideRight : Qt::ElideLeft; |
|
|
|
|
int marginSize = 12; |
|
|
|
|
QFontMetrics fontMetrics(callLabel->font()); |
|
|
|
|
QString elidedText = fontMetrics.elidedText(callLabel->text(), elideMode, |
|
|
|
|
rectW - marginSize * 2 - 4); |
|
|
|
|
QString elidedText = |
|
|
|
|
fontMetrics.elidedText(callLabel->text(), elideMode, rectW - marginSize * 2 - 4); |
|
|
|
|
callLabel->setText(elidedText); |
|
|
|
|
|
|
|
|
|
QDialogButtonBox* buttonBox = new QDialogButtonBox(Qt::Horizontal, this); |
|
|
|
@ -154,14 +154,11 @@ void CallConfirmWidget::paintEvent(QPaintEvent*)
@@ -154,14 +154,11 @@ void CallConfirmWidget::paintEvent(QPaintEvent*)
|
|
|
|
|
|
|
|
|
|
void CallConfirmWidget::showEvent(QShowEvent*) |
|
|
|
|
{ |
|
|
|
|
// Kriby: Legacy comment, is this still true?
|
|
|
|
|
// If someone does show() from Widget or lower, the event will reach us
|
|
|
|
|
// because it's our parent, and we could show up in the wrong form.
|
|
|
|
|
// So check here if our friend's form is actually the active one.
|
|
|
|
|
// if (!Widget::getInstance()->isFriendWidgetCurActiveWidget(&f))
|
|
|
|
|
{ |
|
|
|
|
// QWidget::hide();
|
|
|
|
|
// return;
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
reposition(); |
|
|
|
|
update(); |
|
|
|
|
} |
|
|
|
|