summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI/QtTabWidget.cpp')
-rw-r--r--Swift/QtUI/QtTabWidget.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/Swift/QtUI/QtTabWidget.cpp b/Swift/QtUI/QtTabWidget.cpp
index cda1847..67e3ae9 100644
--- a/Swift/QtUI/QtTabWidget.cpp
+++ b/Swift/QtUI/QtTabWidget.cpp
@@ -6,6 +6,10 @@
#include <Swift/QtUI/QtTabWidget.h>
+#include <QLabel>
+#include <QPainter>
+#include <QPoint>
+
#include <Swift/QtUI/Trellis/QtDNDTabBar.h>
namespace Swift {
@@ -46,4 +50,17 @@ void QtTabWidget::dropEvent(QDropEvent* event) {
}
}
+void QtTabWidget::paintEvent(QPaintEvent * event) {
+ QTabWidget::paintEvent(event);
+ if (count() == 0) {
+ QLabel label;
+ label.setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
+ label.setGeometry(QRect(QPoint(0,0), size()) - QMargins(10,10,10,10));
+ label.setWordWrap(true);
+ label.setText(tr("This empty cell is a placeholder for chat windows. You can move existing chats to this cell by dragging the tab over here. You can change the number of cells via the 'Change layout' dialog under the 'View' menu or by using the %1 shortcut.").arg(QKeySequence(tr("Ctrl+Alt+L")).toString(QKeySequence::NativeText)));
+ QPainter painter(this);
+ painter.drawPixmap(label.geometry().topLeft(), label.grab());
+ }
+}
+
}