mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 04:23:33 +02:00
Update chat window to use new Frameless Dialog
The new dialog class needed to be updated to handle windows in different positions and windows that don't delete on close.
This commit is contained in:
parent
4afea2d228
commit
cb1408d26d
7 changed files with 267 additions and 277 deletions
|
@ -1060,23 +1060,22 @@ void Menu::showMetavoxelEditor() {
|
||||||
void Menu::showChat() {
|
void Menu::showChat() {
|
||||||
QMainWindow* mainWindow = Application::getInstance()->getWindow();
|
QMainWindow* mainWindow = Application::getInstance()->getWindow();
|
||||||
if (!_chatWindow) {
|
if (!_chatWindow) {
|
||||||
mainWindow->addDockWidget(Qt::RightDockWidgetArea, _chatWindow = new ChatWindow());
|
_chatWindow = new ChatWindow(mainWindow);
|
||||||
}
|
}
|
||||||
if (!_chatWindow->toggleViewAction()->isChecked()) {
|
if (_chatWindow->isHidden()) {
|
||||||
const QRect& windowGeometry = mainWindow->geometry();
|
_chatWindow->show();
|
||||||
_chatWindow->move(windowGeometry.topRight().x() - _chatWindow->width(),
|
|
||||||
windowGeometry.topRight().y() + (windowGeometry.height() / 2) - (_chatWindow->height() / 2));
|
|
||||||
|
|
||||||
_chatWindow->resize(0, _chatWindow->height());
|
|
||||||
_chatWindow->toggleViewAction()->trigger();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Menu::toggleChat() {
|
void Menu::toggleChat() {
|
||||||
#ifdef HAVE_QXMPP
|
#ifdef HAVE_QXMPP
|
||||||
_chatAction->setEnabled(XmppClient::getInstance().getXMPPClient().isConnected());
|
_chatAction->setEnabled(XmppClient::getInstance().getXMPPClient().isConnected());
|
||||||
if (!_chatAction->isEnabled() && _chatWindow && _chatWindow->toggleViewAction()->isChecked()) {
|
if (!_chatAction->isEnabled() && _chatWindow) {
|
||||||
_chatWindow->toggleViewAction()->trigger();
|
if (_chatWindow->isHidden()) {
|
||||||
|
_chatWindow->show();
|
||||||
|
} else {
|
||||||
|
_chatWindow->hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,12 +12,10 @@
|
||||||
#include <QGridLayout>
|
#include <QGridLayout>
|
||||||
#include <QFrame>
|
#include <QFrame>
|
||||||
#include <QLayoutItem>
|
#include <QLayoutItem>
|
||||||
#include <QMainWindow>
|
|
||||||
#include <QPalette>
|
#include <QPalette>
|
||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
#include <QSizePolicy>
|
#include <QSizePolicy>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QWidget>
|
|
||||||
|
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
#include "FlowLayout.h"
|
#include "FlowLayout.h"
|
||||||
|
@ -32,18 +30,16 @@ const int NUM_MESSAGES_TO_TIME_STAMP = 20;
|
||||||
|
|
||||||
const QRegularExpression regexLinks("((?:(?:ftp)|(?:https?))://\\S+)");
|
const QRegularExpression regexLinks("((?:(?:ftp)|(?:https?))://\\S+)");
|
||||||
|
|
||||||
ChatWindow::ChatWindow() :
|
ChatWindow::ChatWindow(QWidget* parent) :
|
||||||
|
FramelessDialog(parent, 0, POSITION_RIGHT),
|
||||||
ui(new Ui::ChatWindow),
|
ui(new Ui::ChatWindow),
|
||||||
numMessagesAfterLastTimeStamp(0),
|
numMessagesAfterLastTimeStamp(0),
|
||||||
_mousePressed(false),
|
_mousePressed(false),
|
||||||
_mouseStartPosition()
|
_mouseStartPosition()
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
setAttribute(Qt::WA_DeleteOnClose, false);
|
||||||
|
|
||||||
// remove the title bar (see the Qt docs on setTitleBarWidget), but we keep it for undocking
|
ui->setupUi(this);
|
||||||
//
|
|
||||||
titleBar = titleBarWidget();
|
|
||||||
setTitleBarWidget(new QWidget());
|
|
||||||
|
|
||||||
FlowLayout* flowLayout = new FlowLayout(0, 4, 4);
|
FlowLayout* flowLayout = new FlowLayout(0, 4, 4);
|
||||||
ui->usersWidget->setLayout(flowLayout);
|
ui->usersWidget->setLayout(flowLayout);
|
||||||
|
@ -89,41 +85,23 @@ ChatWindow::~ChatWindow() {
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatWindow::mousePressEvent(QMouseEvent *e) {
|
|
||||||
if (e->button() == Qt::LeftButton && isFloating()) {
|
|
||||||
_mousePressed = true;
|
|
||||||
_mouseStartPosition = e->pos();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ChatWindow::mouseMoveEvent(QMouseEvent *e) {
|
|
||||||
if (_mousePressed) {
|
|
||||||
move(mapToParent(e->pos() - _mouseStartPosition));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ChatWindow::mouseReleaseEvent( QMouseEvent *e ) {
|
|
||||||
if ( e->button() == Qt::LeftButton ) {
|
|
||||||
_mousePressed = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ChatWindow::keyPressEvent(QKeyEvent* event) {
|
void ChatWindow::keyPressEvent(QKeyEvent* event) {
|
||||||
QDockWidget::keyPressEvent(event);
|
|
||||||
if (event->key() == Qt::Key_Escape) {
|
if (event->key() == Qt::Key_Escape) {
|
||||||
hide();
|
hide();
|
||||||
|
} else {
|
||||||
|
FramelessDialog::keyPressEvent(event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatWindow::showEvent(QShowEvent* event) {
|
void ChatWindow::showEvent(QShowEvent* event) {
|
||||||
QDockWidget::showEvent(event);
|
FramelessDialog::showEvent(event);
|
||||||
if (!event->spontaneous()) {
|
if (!event->spontaneous()) {
|
||||||
activateWindow();
|
|
||||||
ui->messagePlainTextEdit->setFocus();
|
ui->messagePlainTextEdit->setFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ChatWindow::eventFilter(QObject* sender, QEvent* event) {
|
bool ChatWindow::eventFilter(QObject* sender, QEvent* event) {
|
||||||
|
FramelessDialog::eventFilter(sender, event);
|
||||||
if (sender == ui->messagePlainTextEdit) {
|
if (sender == ui->messagePlainTextEdit) {
|
||||||
if (event->type() != QEvent::KeyPress) {
|
if (event->type() != QEvent::KeyPress) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
|
#include "FramelessDialog.h"
|
||||||
|
|
||||||
#ifdef HAVE_QXMPP
|
#ifdef HAVE_QXMPP
|
||||||
|
|
||||||
|
@ -29,23 +30,19 @@ namespace Ui {
|
||||||
class ChatWindow;
|
class ChatWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
class ChatWindow : public QDockWidget {
|
class ChatWindow : public FramelessDialog {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ChatWindow();
|
ChatWindow(QWidget* parent);
|
||||||
~ChatWindow();
|
~ChatWindow();
|
||||||
|
|
||||||
virtual void keyPressEvent(QKeyEvent *event);
|
|
||||||
virtual void showEvent(QShowEvent* event);
|
|
||||||
|
|
||||||
virtual void mousePressEvent(QMouseEvent *e);
|
|
||||||
virtual void mouseMoveEvent(QMouseEvent *e);
|
|
||||||
virtual void mouseReleaseEvent(QMouseEvent *e);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool eventFilter(QObject* sender, QEvent* event);
|
bool eventFilter(QObject* sender, QEvent* event);
|
||||||
|
|
||||||
|
virtual void keyPressEvent(QKeyEvent *event);
|
||||||
|
virtual void showEvent(QShowEvent* event);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#ifdef HAVE_QXMPP
|
#ifdef HAVE_QXMPP
|
||||||
QString getParticipantName(const QString& participant);
|
QString getParticipantName(const QString& participant);
|
||||||
|
@ -56,7 +53,6 @@ private:
|
||||||
void scrollToBottom();
|
void scrollToBottom();
|
||||||
|
|
||||||
Ui::ChatWindow* ui;
|
Ui::ChatWindow* ui;
|
||||||
QWidget* titleBar;
|
|
||||||
int numMessagesAfterLastTimeStamp;
|
int numMessagesAfterLastTimeStamp;
|
||||||
QDateTime lastMessageStamp;
|
QDateTime lastMessageStamp;
|
||||||
bool _mousePressed;
|
bool _mousePressed;
|
||||||
|
|
|
@ -14,8 +14,13 @@
|
||||||
|
|
||||||
const int RESIZE_HANDLE_WIDTH = 7;
|
const int RESIZE_HANDLE_WIDTH = 7;
|
||||||
|
|
||||||
FramelessDialog::FramelessDialog(QWidget *parent, Qt::WindowFlags flags) :
|
FramelessDialog::FramelessDialog(QWidget *parent, Qt::WindowFlags flags, Position position) :
|
||||||
QDialog(parent, flags | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint) {
|
QDialog(parent, flags | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint),
|
||||||
|
_position(position),
|
||||||
|
_selfHidden(false),
|
||||||
|
_isResizing(false),
|
||||||
|
_resizeInitialWidth(0) {
|
||||||
|
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
|
||||||
// handle rezize and move events
|
// handle rezize and move events
|
||||||
|
@ -29,29 +34,37 @@ bool FramelessDialog::eventFilter(QObject* sender, QEvent* event) {
|
||||||
switch (event->type()) {
|
switch (event->type()) {
|
||||||
case QEvent::Move:
|
case QEvent::Move:
|
||||||
if (sender == parentWidget()) {
|
if (sender == parentWidget()) {
|
||||||
// move to upper left corner on app move
|
resizeAndPosition(false);
|
||||||
move(parentWidget()->geometry().topLeft());
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case QEvent::Resize:
|
case QEvent::Resize:
|
||||||
if (sender == parentWidget()) {
|
if (sender == parentWidget()) {
|
||||||
// keep full app height on resizing the app
|
resizeAndPosition(false);
|
||||||
setFixedHeight(parentWidget()->size().height());
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case QEvent::WindowStateChange:
|
case QEvent::WindowStateChange:
|
||||||
if (parentWidget()->isMinimized()) {
|
if (parentWidget()->isMinimized()) {
|
||||||
setHidden(true);
|
if (isVisible()) {
|
||||||
} else {
|
_selfHidden = true;
|
||||||
|
setHidden(true);
|
||||||
|
}
|
||||||
|
} else if (_selfHidden) {
|
||||||
|
_selfHidden = false;
|
||||||
setHidden(false);
|
setHidden(false);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case QEvent::ApplicationDeactivate:
|
case QEvent::ApplicationDeactivate:
|
||||||
// hide on minimize and focus lost
|
// hide on minimize and focus lost
|
||||||
setHidden(true);
|
if (isVisible()) {
|
||||||
|
_selfHidden = true;
|
||||||
|
setHidden(true);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case QEvent::ApplicationActivate:
|
case QEvent::ApplicationActivate:
|
||||||
setHidden(false);
|
if (_selfHidden) {
|
||||||
|
_selfHidden = false;
|
||||||
|
setHidden(false);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -70,21 +83,38 @@ void FramelessDialog::setStyleSheetFile(const QString& fileName) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void FramelessDialog::showEvent(QShowEvent* event) {
|
void FramelessDialog::showEvent(QShowEvent* event) {
|
||||||
// move to upper left corner
|
resizeAndPosition();
|
||||||
move(parentWidget()->geometry().topLeft());
|
}
|
||||||
|
|
||||||
|
void FramelessDialog::resizeAndPosition(bool resizeParent) {
|
||||||
// keep full app height
|
// keep full app height
|
||||||
setFixedHeight(parentWidget()->size().height());
|
setFixedHeight(parentWidget()->size().height());
|
||||||
|
|
||||||
// resize parrent if width is smaller than this dialog
|
// resize parrent if width is smaller than this dialog
|
||||||
if (parentWidget()->size().width() < size().width()) {
|
if (resizeParent && parentWidget()->size().width() < size().width()) {
|
||||||
parentWidget()->resize(size().width(), parentWidget()->size().height());
|
parentWidget()->resize(size().width(), parentWidget()->size().height());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_position == POSITION_LEFT) {
|
||||||
|
// move to upper left corner
|
||||||
|
move(parentWidget()->geometry().topLeft());
|
||||||
|
} else if (_position == POSITION_RIGHT) {
|
||||||
|
// move to upper right corner
|
||||||
|
QPoint pos = parentWidget()->geometry().topRight();
|
||||||
|
pos.setX(pos.x() - size().width());
|
||||||
|
move(pos);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FramelessDialog::mousePressEvent(QMouseEvent* mouseEvent) {
|
void FramelessDialog::mousePressEvent(QMouseEvent* mouseEvent) {
|
||||||
if (abs(mouseEvent->pos().x() - size().width()) < RESIZE_HANDLE_WIDTH && mouseEvent->button() == Qt::LeftButton) {
|
if (mouseEvent->button() == Qt::LeftButton) {
|
||||||
_isResizing = true;
|
bool hitLeft = _position == POSITION_LEFT && abs(mouseEvent->pos().x() - size().width()) < RESIZE_HANDLE_WIDTH;
|
||||||
QApplication::setOverrideCursor(Qt::SizeHorCursor);
|
bool hitRight = _position == POSITION_RIGHT && mouseEvent->pos().x() < RESIZE_HANDLE_WIDTH;
|
||||||
|
if (hitLeft || hitRight) {
|
||||||
|
_isResizing = true;
|
||||||
|
_resizeInitialWidth = size().width();
|
||||||
|
QApplication::setOverrideCursor(Qt::SizeHorCursor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,6 +125,14 @@ void FramelessDialog::mouseReleaseEvent(QMouseEvent* mouseEvent) {
|
||||||
|
|
||||||
void FramelessDialog::mouseMoveEvent(QMouseEvent* mouseEvent) {
|
void FramelessDialog::mouseMoveEvent(QMouseEvent* mouseEvent) {
|
||||||
if (_isResizing) {
|
if (_isResizing) {
|
||||||
resize(mouseEvent->pos().x(), size().height());
|
if (_position == POSITION_LEFT) {
|
||||||
|
resize(mouseEvent->pos().x(), size().height());
|
||||||
|
} else if (_position == POSITION_RIGHT) {
|
||||||
|
setUpdatesEnabled(false);
|
||||||
|
resize(_resizeInitialWidth - mouseEvent->pos().x(), size().height());
|
||||||
|
resizeAndPosition();
|
||||||
|
_resizeInitialWidth = size().width();
|
||||||
|
setUpdatesEnabled(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,10 @@ class FramelessDialog : public QDialog {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
FramelessDialog(QWidget* parent = 0, Qt::WindowFlags flags = 0);
|
enum Position { POSITION_LEFT, POSITION_RIGHT };
|
||||||
|
|
||||||
|
FramelessDialog(QWidget* parent = 0, Qt::WindowFlags flags = 0,
|
||||||
|
Position position = POSITION_LEFT);
|
||||||
void setStyleSheetFile(const QString& fileName);
|
void setStyleSheetFile(const QString& fileName);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -31,7 +34,12 @@ protected:
|
||||||
bool eventFilter(QObject* sender, QEvent* event);
|
bool eventFilter(QObject* sender, QEvent* event);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void resizeAndPosition(bool resizeParent = true);
|
||||||
|
|
||||||
bool _isResizing;
|
bool _isResizing;
|
||||||
|
int _resizeInitialWidth;
|
||||||
|
bool _selfHidden; ///< true when the dialog itself because of a window event (deactivation or minimization)
|
||||||
|
Position _position;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ const int SCROLL_PANEL_BOTTOM_MARGIN = 30;
|
||||||
const int OK_BUTTON_RIGHT_MARGIN = 30;
|
const int OK_BUTTON_RIGHT_MARGIN = 30;
|
||||||
const int BUTTONS_TOP_MARGIN = 24;
|
const int BUTTONS_TOP_MARGIN = 24;
|
||||||
|
|
||||||
PreferencesDialog::PreferencesDialog(QWidget* parent, Qt::WindowFlags flags) : FramelessDialog(parent, flags) {
|
PreferencesDialog::PreferencesDialog(QWidget* parent, Qt::WindowFlags flags) : FramelessDialog(parent, flags, POSITION_LEFT) {
|
||||||
|
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
setStyleSheetFile("styles/preferences.qss");
|
setStyleSheetFile("styles/preferences.qss");
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>ChatWindow</class>
|
<class>ChatWindow</class>
|
||||||
<widget class="QDockWidget" name="ChatWindow">
|
<widget class="QDialog" name="ChatWindow">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>400</width>
|
<width>400</width>
|
||||||
<height>608</height>
|
<height>440</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
|
@ -16,127 +16,95 @@
|
||||||
<height>238</height>
|
<height>238</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">font-family: Helvetica, Arial, sans-serif;</string>
|
|
||||||
</property>
|
|
||||||
<property name="features">
|
|
||||||
<set>QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable</set>
|
|
||||||
</property>
|
|
||||||
<property name="allowedAreas">
|
|
||||||
<set>Qt::NoDockWidgetArea</set>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Chat</string>
|
<string>Chat</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="dockWidgetContents">
|
<property name="styleSheet">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<string notr="true">font-family: Helvetica, Arial, sans-serif;</string>
|
||||||
<property name="spacing">
|
</property>
|
||||||
<number>0</number>
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
</property>
|
<property name="leftMargin">
|
||||||
<property name="leftMargin">
|
<number>0</number>
|
||||||
<number>8</number>
|
</property>
|
||||||
</property>
|
<property name="topMargin">
|
||||||
<property name="topMargin">
|
<number>0</number>
|
||||||
<number>8</number>
|
</property>
|
||||||
</property>
|
<property name="rightMargin">
|
||||||
<property name="rightMargin">
|
<number>0</number>
|
||||||
<number>8</number>
|
</property>
|
||||||
</property>
|
<property name="bottomMargin">
|
||||||
<property name="bottomMargin">
|
<number>0</number>
|
||||||
<number>8</number>
|
</property>
|
||||||
</property>
|
<item row="0" column="0">
|
||||||
<item>
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<widget class="QLabel" name="connectingToXMPPLabel">
|
<property name="spacing">
|
||||||
<property name="sizePolicy">
|
<number>0</number>
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
</property>
|
||||||
<horstretch>0</horstretch>
|
<property name="leftMargin">
|
||||||
<verstretch>0</verstretch>
|
<number>8</number>
|
||||||
</sizepolicy>
|
</property>
|
||||||
</property>
|
<property name="topMargin">
|
||||||
<property name="text">
|
<number>8</number>
|
||||||
<string>Connecting to XMPP...</string>
|
</property>
|
||||||
</property>
|
<property name="rightMargin">
|
||||||
<property name="alignment">
|
<number>8</number>
|
||||||
<set>Qt::AlignCenter</set>
|
</property>
|
||||||
</property>
|
<property name="bottomMargin">
|
||||||
</widget>
|
<number>8</number>
|
||||||
</item>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<widget class="QLabel" name="connectingToXMPPLabel">
|
||||||
<item>
|
<property name="sizePolicy">
|
||||||
<widget class="QLabel" name="numOnlineLabel">
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||||
<property name="sizePolicy">
|
<horstretch>0</horstretch>
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
<verstretch>0</verstretch>
|
||||||
<horstretch>0</horstretch>
|
</sizepolicy>
|
||||||
<verstretch>0</verstretch>
|
</property>
|
||||||
</sizepolicy>
|
<property name="text">
|
||||||
</property>
|
<string>Connecting to XMPP...</string>
|
||||||
<property name="styleSheet">
|
</property>
|
||||||
<string notr="true">font-weight: bold; color: palette(shadow); margin-bottom: 4px;</string>
|
<property name="alignment">
|
||||||
</property>
|
<set>Qt::AlignCenter</set>
|
||||||
<property name="text">
|
</property>
|
||||||
<string> online now:</string>
|
</widget>
|
||||||
</property>
|
</item>
|
||||||
</widget>
|
<item>
|
||||||
</item>
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="togglePinnedButton">
|
<widget class="QLabel" name="numOnlineLabel">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximumSize">
|
<property name="styleSheet">
|
||||||
<size>
|
<string notr="true">font-weight: bold; color: palette(shadow); margin-bottom: 4px;</string>
|
||||||
<width>16</width>
|
</property>
|
||||||
<height>16</height>
|
<property name="text">
|
||||||
</size>
|
<string> online now:</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="focusPolicy">
|
</widget>
|
||||||
<enum>Qt::NoFocus</enum>
|
</item>
|
||||||
</property>
|
<item>
|
||||||
<property name="text">
|
<widget class="QPushButton" name="closeButton">
|
||||||
<string/>
|
<property name="sizePolicy">
|
||||||
</property>
|
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||||
<property name="icon">
|
<horstretch>0</horstretch>
|
||||||
<iconset>
|
<verstretch>0</verstretch>
|
||||||
<normaloff>../resources/images/pin.svg</normaloff>
|
</sizepolicy>
|
||||||
<normalon>../resources/images/pinned.svg</normalon>../resources/images/pin.svg</iconset>
|
</property>
|
||||||
</property>
|
<property name="maximumSize">
|
||||||
<property name="checkable">
|
<size>
|
||||||
<bool>true</bool>
|
<width>16</width>
|
||||||
</property>
|
<height>16</height>
|
||||||
<property name="checked">
|
</size>
|
||||||
<bool>true</bool>
|
</property>
|
||||||
</property>
|
<property name="focusPolicy">
|
||||||
<property name="default">
|
<enum>Qt::NoFocus</enum>
|
||||||
<bool>false</bool>
|
</property>
|
||||||
</property>
|
<property name="styleSheet">
|
||||||
<property name="flat">
|
<string notr="true">QPushButton {
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QPushButton" name="closeButton">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>16</width>
|
|
||||||
<height>16</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="focusPolicy">
|
|
||||||
<enum>Qt::NoFocus</enum>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">QPushButton {
|
|
||||||
background-color: rgba( 0, 0, 0, 0% );
|
background-color: rgba( 0, 0, 0, 0% );
|
||||||
border: none;
|
border: none;
|
||||||
image: url(../resources/images/close.svg)
|
image: url(../resources/images/close.svg)
|
||||||
|
@ -148,102 +116,105 @@ QPushButton:pressed {
|
||||||
border: none;
|
border: none;
|
||||||
image: url(../resources/images/close_down.svg)
|
image: url(../resources/images/close_down.svg)
|
||||||
}</string>
|
}</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
<property name="flat">
|
<property name="flat">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QWidget" name="usersWidget" native="true"/>
|
<widget class="QWidget" name="usersWidget" native="true"/>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QScrollArea" name="messagesScrollArea">
|
<widget class="QScrollArea" name="messagesScrollArea">
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">margin-top: 12px;</string>
|
<string notr="true">margin-top: 12px;</string>
|
||||||
</property>
|
|
||||||
<property name="horizontalScrollBarPolicy">
|
|
||||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
|
||||||
</property>
|
|
||||||
<property name="widgetResizable">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>382</width>
|
|
||||||
<height>16</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
</property>
|
||||||
|
<property name="horizontalScrollBarPolicy">
|
||||||
|
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||||
|
</property>
|
||||||
|
<property name="widgetResizable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>382</width>
|
||||||
|
<height>16</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">margin-top: 0px;</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="messagesGridLayout">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QTextEdit" name="messagePlainTextEdit">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="minimumSize">
|
||||||
<string notr="true">margin-top: 0px;</string>
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>60</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">border-color: palette(dark); border-style: solid; border-left-width: 1px; border-right-width: 1px; border-bottom-width: 1px;</string>
|
||||||
|
</property>
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::NoFrame</enum>
|
||||||
|
</property>
|
||||||
|
<property name="horizontalScrollBarPolicy">
|
||||||
|
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeAdjustPolicy">
|
||||||
|
<enum>QAbstractScrollArea::AdjustToContents</enum>
|
||||||
|
</property>
|
||||||
|
<property name="tabChangesFocus">
|
||||||
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="messagesGridLayout">
|
|
||||||
<property name="leftMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</item>
|
||||||
</item>
|
</layout>
|
||||||
<item>
|
</item>
|
||||||
<widget class="QPlainTextEdit" name="messagePlainTextEdit">
|
</layout>
|
||||||
<property name="sizePolicy">
|
<zorder>messagePlainTextEdit</zorder>
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
<zorder>dockWidgetContents</zorder>
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>60</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">border-color: palette(dark); border-style: solid; border-left-width: 1px; border-right-width: 1px; border-bottom-width: 1px;</string>
|
|
||||||
</property>
|
|
||||||
<property name="frameShape">
|
|
||||||
<enum>QFrame::NoFrame</enum>
|
|
||||||
</property>
|
|
||||||
<property name="horizontalScrollBarPolicy">
|
|
||||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeAdjustPolicy">
|
|
||||||
<enum>QAbstractScrollArea::AdjustToContents</enum>
|
|
||||||
</property>
|
|
||||||
<property name="tabChangesFocus">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
</widget>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
<tabstop>messagePlainTextEdit</tabstop>
|
<tabstop>messagePlainTextEdit</tabstop>
|
||||||
|
|
Loading…
Reference in a new issue