mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
put back the not so native window decoration, status panel respects
friendlist width, some tweaks to the layout
This commit is contained in:
parent
921b8478f6
commit
c9d04748dd
112
mainwindow.ui
112
mainwindow.ui
@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>882</width>
|
<width>716</width>
|
||||||
<height>600</height>
|
<height>543</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
@ -232,6 +232,12 @@
|
|||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>16777215</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="palette">
|
<property name="palette">
|
||||||
<palette>
|
<palette>
|
||||||
<active>
|
<active>
|
||||||
@ -536,6 +542,9 @@ QSplitter:handle{
|
|||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="handleWidth">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
<property name="childrenCollapsible">
|
<property name="childrenCollapsible">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
@ -546,18 +555,6 @@ QSplitter:handle{
|
|||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>225</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>1920</width>
|
|
||||||
<height>16777215</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="palette">
|
<property name="palette">
|
||||||
<palette>
|
<palette>
|
||||||
<active>
|
<active>
|
||||||
@ -1030,12 +1027,6 @@ QSplitter:handle{
|
|||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>225</width>
|
|
||||||
<height>60</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="palette">
|
<property name="palette">
|
||||||
<palette>
|
<palette>
|
||||||
<active>
|
<active>
|
||||||
@ -2076,17 +2067,11 @@ QSplitter:handle{
|
|||||||
<item>
|
<item>
|
||||||
<widget class="AdjustingScrollArea" name="friendList">
|
<widget class="AdjustingScrollArea" name="friendList">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>225</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="layoutDirection">
|
<property name="layoutDirection">
|
||||||
<enum>Qt::LeftToRight</enum>
|
<enum>Qt::LeftToRight</enum>
|
||||||
</property>
|
</property>
|
||||||
@ -2107,10 +2092,11 @@ QSplitter:handle{
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>501</width>
|
<width>335</width>
|
||||||
<height>430</height>
|
<height>379</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_5"/>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -2120,17 +2106,11 @@ QSplitter:handle{
|
|||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>225</width>
|
|
||||||
<height>35</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="palette">
|
<property name="palette">
|
||||||
<palette>
|
<palette>
|
||||||
<active>
|
<active>
|
||||||
@ -2597,22 +2577,6 @@ QSplitter:handle{
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer_4">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Maximum</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>500</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="groupButton">
|
<widget class="QPushButton" name="groupButton">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
@ -2639,22 +2603,6 @@ QSplitter:handle{
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer_5">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Maximum</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>500</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="transferButton">
|
<widget class="QPushButton" name="transferButton">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
@ -2687,22 +2635,6 @@ QSplitter:handle{
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer_6">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Maximum</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>500</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="settingsButton">
|
<widget class="QPushButton" name="settingsButton">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
@ -2742,17 +2674,11 @@ QSplitter:handle{
|
|||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="mainPanel" native="true">
|
<widget class="QWidget" name="mainPanel" native="true">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
|
||||||
<horstretch>1</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>375</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="palette">
|
<property name="palette">
|
||||||
<palette>
|
<palette>
|
||||||
<active>
|
<active>
|
||||||
@ -3301,7 +3227,7 @@ QSplitter:handle{
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>882</width>
|
<width>716</width>
|
||||||
<height>24</height>
|
<height>24</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
@ -18,18 +18,24 @@
|
|||||||
|
|
||||||
#include <QEvent>
|
#include <QEvent>
|
||||||
#include <QLayout>
|
#include <QLayout>
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
AdjustingScrollArea::AdjustingScrollArea(QWidget *parent) :
|
AdjustingScrollArea::AdjustingScrollArea(QWidget *parent) :
|
||||||
QScrollArea(parent)
|
QScrollArea(parent)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AdjustingScrollArea::resizeEvent(QResizeEvent *ev)
|
void AdjustingScrollArea::resizeEvent(QResizeEvent *ev)
|
||||||
{
|
{
|
||||||
if (widget())
|
updateGeometry();
|
||||||
{
|
|
||||||
widget()->setMinimumWidth(width());
|
|
||||||
}
|
|
||||||
|
|
||||||
QScrollArea::resizeEvent(ev);
|
QScrollArea::resizeEvent(ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QSize AdjustingScrollArea::sizeHint() const
|
||||||
|
{
|
||||||
|
if (widget())
|
||||||
|
return widget()->sizeHint();
|
||||||
|
|
||||||
|
return QScrollArea::sizeHint();
|
||||||
|
}
|
||||||
|
@ -26,6 +26,7 @@ public:
|
|||||||
explicit AdjustingScrollArea(QWidget *parent = 0);
|
explicit AdjustingScrollArea(QWidget *parent = 0);
|
||||||
|
|
||||||
virtual void resizeEvent(QResizeEvent *ev);
|
virtual void resizeEvent(QResizeEvent *ev);
|
||||||
|
virtual QSize sizeHint() const override;
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
FriendWidget::FriendWidget(int FriendId, QString id)
|
FriendWidget::FriendWidget(int FriendId, QString id)
|
||||||
: friendId(FriendId)
|
: friendId(FriendId)
|
||||||
{
|
{
|
||||||
|
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
|
||||||
this->setMouseTracking(true);
|
this->setMouseTracking(true);
|
||||||
this->setAutoFillBackground(true);
|
this->setAutoFillBackground(true);
|
||||||
this->setFixedHeight(55);
|
this->setFixedHeight(55);
|
||||||
@ -52,6 +53,9 @@ FriendWidget::FriendWidget(int FriendId, QString id)
|
|||||||
pal3.setColor(QPalette::Background, QColor(65,65,65,255));
|
pal3.setColor(QPalette::Background, QColor(65,65,65,255));
|
||||||
this->setPalette(pal3);
|
this->setPalette(pal3);
|
||||||
|
|
||||||
|
name.setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
|
||||||
|
statusMessage.setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
|
||||||
|
|
||||||
textLayout.addStretch();
|
textLayout.addStretch();
|
||||||
textLayout.addWidget(&name);
|
textLayout.addWidget(&name);
|
||||||
textLayout.addWidget(&statusMessage);
|
textLayout.addWidget(&statusMessage);
|
||||||
@ -67,6 +71,13 @@ FriendWidget::FriendWidget(int FriendId, QString id)
|
|||||||
layout.addSpacing(5);
|
layout.addSpacing(5);
|
||||||
|
|
||||||
isActiveWidget = 0;
|
isActiveWidget = 0;
|
||||||
|
|
||||||
|
layout.invalidate();
|
||||||
|
layout.update();
|
||||||
|
layout.activate();
|
||||||
|
updateGeometry();
|
||||||
|
|
||||||
|
qDebug() << "friend" << minimumSizeHint();
|
||||||
}
|
}
|
||||||
|
|
||||||
void FriendWidget::mouseReleaseEvent (QMouseEvent*)
|
void FriendWidget::mouseReleaseEvent (QMouseEvent*)
|
||||||
|
@ -56,44 +56,54 @@ Widget::Widget(QWidget *parent)
|
|||||||
restoreGeometry(Settings::getInstance().getWindowGeometry());
|
restoreGeometry(Settings::getInstance().getWindowGeometry());
|
||||||
restoreState(Settings::getInstance().getWindowState());
|
restoreState(Settings::getInstance().getWindowState());
|
||||||
|
|
||||||
ui->titleBar->hide();
|
if (Settings::getInstance().getUseNativeDecoration())
|
||||||
layout()->setContentsMargins(0, 0, 0, 0);
|
|
||||||
ui->friendList->setObjectName("friendList");
|
|
||||||
ui->friendList->setStyleSheet(Style::get(":ui/friendList/friendList.css"));
|
|
||||||
|
|
||||||
setStyleSheet(Style::get(":ui/window/window.css"));
|
|
||||||
//ui->statusPanel->setStyleSheet(QString(""));
|
|
||||||
//ui->friendList->setStyleSheet(QString(""));
|
|
||||||
|
|
||||||
ui->friendList->setObjectName("friendList");
|
|
||||||
ui->friendList->setStyleSheet(Style::get(":ui/friendList/friendList.css"));
|
|
||||||
|
|
||||||
ui->tbMenu->setIcon(QIcon(":ui/window/applicationIcon.png"));
|
|
||||||
ui->pbMin->setObjectName("minimizeButton");
|
|
||||||
ui->pbMax->setObjectName("maximizeButton");
|
|
||||||
ui->pbClose->setObjectName("closeButton");
|
|
||||||
|
|
||||||
if (!Settings::getInstance().getUseNativeDecoration())
|
|
||||||
{
|
{
|
||||||
|
ui->titleBar->hide();
|
||||||
|
this->layout()->setContentsMargins(0, 0, 0, 0);
|
||||||
|
|
||||||
|
ui->friendList->setObjectName("friendList");
|
||||||
|
ui->friendList->setStyleSheet(Style::get(":ui/friendList/friendList.css"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this->setObjectName("activeWindow");
|
||||||
|
this->setStyleSheet(Style::get(":ui/window/window.css"));
|
||||||
|
ui->statusPanel->setStyleSheet(QString(""));
|
||||||
|
ui->friendList->setStyleSheet(QString(""));
|
||||||
|
|
||||||
|
ui->friendList->setObjectName("friendList");
|
||||||
|
ui->friendList->setStyleSheet(Style::get(":ui/friendList/friendList.css"));
|
||||||
|
|
||||||
|
ui->tbMenu->setIcon(QIcon(":ui/window/applicationIcon.png"));
|
||||||
|
ui->pbMin->setObjectName("minimizeButton");
|
||||||
|
ui->pbMax->setObjectName("maximizeButton");
|
||||||
|
ui->pbClose->setObjectName("closeButton");
|
||||||
|
|
||||||
setWindowFlags(Qt::CustomizeWindowHint);
|
setWindowFlags(Qt::CustomizeWindowHint);
|
||||||
setWindowFlags(Qt::FramelessWindowHint);
|
setWindowFlags(Qt::FramelessWindowHint);
|
||||||
|
|
||||||
|
addAction(ui->actionClose);
|
||||||
|
|
||||||
|
connect(ui->pbMin, SIGNAL(clicked()), this, SLOT(minimizeBtnClicked()));
|
||||||
|
connect(ui->pbMax, SIGNAL(clicked()), this, SLOT(maximizeBtnClicked()));
|
||||||
|
connect(ui->pbClose, SIGNAL(clicked()), this, SLOT(close()));
|
||||||
|
|
||||||
|
m_titleMode = FullTitle;
|
||||||
|
moveWidget = false;
|
||||||
|
inResizeZone = false;
|
||||||
|
allowToResize = false;
|
||||||
|
resizeVerSup = false;
|
||||||
|
resizeHorEsq = false;
|
||||||
|
resizeDiagSupEsq = false;
|
||||||
|
resizeDiagSupDer = false;
|
||||||
|
|
||||||
|
if (isMaximized())
|
||||||
|
{
|
||||||
|
showMaximized();
|
||||||
|
ui->pbMax->setObjectName("restoreButton");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
addAction(ui->actionClose);
|
|
||||||
|
|
||||||
connect(ui->pbMin, SIGNAL(clicked()), this, SLOT(minimizeBtnClicked()));
|
|
||||||
connect(ui->pbMax, SIGNAL(clicked()), this, SLOT(maximizeBtnClicked()));
|
|
||||||
connect(ui->pbClose, SIGNAL(clicked()), this, SLOT(close()));
|
|
||||||
|
|
||||||
m_titleMode = FullTitle;
|
|
||||||
moveWidget = false;
|
|
||||||
inResizeZone = false;
|
|
||||||
allowToResize = false;
|
|
||||||
resizeVerSup = false;
|
|
||||||
resizeHorEsq = false;
|
|
||||||
resizeDiagSupEsq = false;
|
|
||||||
resizeDiagSupDer = false;
|
|
||||||
|
|
||||||
isWindowMinimized = 0;
|
isWindowMinimized = 0;
|
||||||
|
|
||||||
ui->mainContent->setLayout(new QVBoxLayout());
|
ui->mainContent->setLayout(new QVBoxLayout());
|
||||||
@ -102,9 +112,11 @@ Widget::Widget(QWidget *parent)
|
|||||||
ui->mainHead->layout()->setSpacing(0);
|
ui->mainHead->layout()->setSpacing(0);
|
||||||
|
|
||||||
QWidget* friendListWidget = new QWidget();
|
QWidget* friendListWidget = new QWidget();
|
||||||
|
//friendListWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding);
|
||||||
friendListWidget->setLayout(new QVBoxLayout());
|
friendListWidget->setLayout(new QVBoxLayout());
|
||||||
friendListWidget->layout()->setSpacing(0);
|
friendListWidget->layout()->setSpacing(0);
|
||||||
friendListWidget->layout()->setMargin(0);
|
friendListWidget->layout()->setMargin(0);
|
||||||
|
friendListWidget->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
|
||||||
ui->friendList->setWidget(friendListWidget);
|
ui->friendList->setWidget(friendListWidget);
|
||||||
|
|
||||||
// delay setting username and message until Core inits
|
// delay setting username and message until Core inits
|
||||||
@ -112,7 +124,6 @@ Widget::Widget(QWidget *parent)
|
|||||||
ui->nameLabel->label->setStyleSheet("QLabel { color : white; font-size: 11pt; font-weight:bold;}");
|
ui->nameLabel->label->setStyleSheet("QLabel { color : white; font-size: 11pt; font-weight:bold;}");
|
||||||
//ui->statusLabel->setText(core->getStatusMessage());
|
//ui->statusLabel->setText(core->getStatusMessage());
|
||||||
ui->statusLabel->label->setStyleSheet("QLabel { color : white; font-size: 8pt;}");
|
ui->statusLabel->label->setStyleSheet("QLabel { color : white; font-size: 8pt;}");
|
||||||
ui->friendList->widget()->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
|
|
||||||
|
|
||||||
ui->statusButton->setStyleSheet(Style::get(":/ui/statusButton/statusButton.css"));
|
ui->statusButton->setStyleSheet(Style::get(":/ui/statusButton/statusButton.css"));
|
||||||
|
|
||||||
@ -125,13 +136,6 @@ Widget::Widget(QWidget *parent)
|
|||||||
setStatusBusy->setIcon(QIcon(":ui/statusButton/dot_busy.png"));
|
setStatusBusy->setIcon(QIcon(":ui/statusButton/dot_busy.png"));
|
||||||
ui->statusButton->setMenu(statusButtonMenu);
|
ui->statusButton->setMenu(statusButtonMenu);
|
||||||
|
|
||||||
|
|
||||||
// this->setMouseTracking(true);
|
|
||||||
|
|
||||||
// QList<QWidget*> widgets = this->findChildren<QWidget*>();
|
|
||||||
// foreach (QWidget *widget, widgets)
|
|
||||||
// widget->setMouseTracking(true);
|
|
||||||
|
|
||||||
ui->titleBar->setMouseTracking(true);
|
ui->titleBar->setMouseTracking(true);
|
||||||
ui->LTitle->setMouseTracking(true);
|
ui->LTitle->setMouseTracking(true);
|
||||||
ui->tbMenu->setMouseTracking(true);
|
ui->tbMenu->setMouseTracking(true);
|
||||||
@ -140,11 +144,11 @@ Widget::Widget(QWidget *parent)
|
|||||||
ui->pbClose->setMouseTracking(true);
|
ui->pbClose->setMouseTracking(true);
|
||||||
ui->statusHead->setMouseTracking(true);
|
ui->statusHead->setMouseTracking(true);
|
||||||
|
|
||||||
ui->friendList->viewport()->installEventFilter(this);
|
//ui->friendList->viewport()->installEventFilter(this);
|
||||||
|
|
||||||
// QList<int> currentSizes = ui->centralWidget->sizes();
|
// disable proportional scaling
|
||||||
// currentSizes[0] = 225;
|
ui->centralWidget->setStretchFactor(0,0);
|
||||||
// ui->centralWidget->setSizes(currentSizes);
|
ui->centralWidget->setStretchFactor(1,1);
|
||||||
|
|
||||||
ui->statusButton->setObjectName("offline");
|
ui->statusButton->setObjectName("offline");
|
||||||
ui->statusButton->style()->polish(ui->statusButton);
|
ui->statusButton->style()->polish(ui->statusButton);
|
||||||
@ -617,7 +621,7 @@ void Widget::onGroupMessageReceived(int groupnumber, int friendgroupnumber, cons
|
|||||||
newMessageAlert();
|
newMessageAlert();
|
||||||
g->hasNewMessages = 1;
|
g->hasNewMessages = 1;
|
||||||
g->userWasMentioned = 1;
|
g->userWasMentioned = 1;
|
||||||
if (useNativeTheme)
|
if (Settings::getInstance().getUseNativeDecoration())
|
||||||
g->widget->statusPic.setPixmap(QPixmap(":img/status/dot_online_notification.png"));
|
g->widget->statusPic.setPixmap(QPixmap(":img/status/dot_online_notification.png"));
|
||||||
else
|
else
|
||||||
g->widget->statusPic.setPixmap(QPixmap(":img/status/dot_groupchat_notification.png"));
|
g->widget->statusPic.setPixmap(QPixmap(":img/status/dot_groupchat_notification.png"));
|
||||||
@ -626,7 +630,7 @@ void Widget::onGroupMessageReceived(int groupnumber, int friendgroupnumber, cons
|
|||||||
if (g->hasNewMessages == 0)
|
if (g->hasNewMessages == 0)
|
||||||
{
|
{
|
||||||
g->hasNewMessages = 1;
|
g->hasNewMessages = 1;
|
||||||
if (useNativeTheme)
|
if (Settings::getInstance().getUseNativeDecoration())
|
||||||
g->widget->statusPic.setPixmap(QPixmap(":img/status/dot_online_notification.png"));
|
g->widget->statusPic.setPixmap(QPixmap(":img/status/dot_online_notification.png"));
|
||||||
else
|
else
|
||||||
g->widget->statusPic.setPixmap(QPixmap(":img/status/dot_groupchat_newmessages.png"));
|
g->widget->statusPic.setPixmap(QPixmap(":img/status/dot_groupchat_newmessages.png"));
|
||||||
@ -673,7 +677,7 @@ void Widget::onGroupWidgetClicked(GroupWidget* widget)
|
|||||||
{
|
{
|
||||||
g->hasNewMessages = 0;
|
g->hasNewMessages = 0;
|
||||||
g->userWasMentioned = 0;
|
g->userWasMentioned = 0;
|
||||||
if (useNativeTheme)
|
if (Settings::getInstance().getUseNativeDecoration())
|
||||||
g->widget->statusPic.setPixmap(QPixmap(":img/status/dot_online.png"));
|
g->widget->statusPic.setPixmap(QPixmap(":img/status/dot_online.png"));
|
||||||
else
|
else
|
||||||
g->widget->statusPic.setPixmap(QPixmap(":img/status/dot_groupchat.png"));
|
g->widget->statusPic.setPixmap(QPixmap(":img/status/dot_groupchat.png"));
|
||||||
@ -712,7 +716,7 @@ Group *Widget::createGroup(int groupId)
|
|||||||
QWidget* widget = ui->friendList->widget();
|
QWidget* widget = ui->friendList->widget();
|
||||||
QLayout* layout = widget->layout();
|
QLayout* layout = widget->layout();
|
||||||
layout->addWidget(newgroup->widget);
|
layout->addWidget(newgroup->widget);
|
||||||
if (!useNativeTheme)
|
if (!Settings::getInstance().getUseNativeDecoration())
|
||||||
newgroup->widget->statusPic.setPixmap(QPixmap(":img/status/dot_groupchat.png"));
|
newgroup->widget->statusPic.setPixmap(QPixmap(":img/status/dot_groupchat.png"));
|
||||||
|
|
||||||
connect(newgroup->widget, SIGNAL(groupWidgetClicked(GroupWidget*)), this, SLOT(onGroupWidgetClicked(GroupWidget*)));
|
connect(newgroup->widget, SIGNAL(groupWidgetClicked(GroupWidget*)), this, SLOT(onGroupWidgetClicked(GroupWidget*)));
|
||||||
@ -758,7 +762,7 @@ bool Widget::event(QEvent * e)
|
|||||||
}
|
}
|
||||||
else if (e->type() == QEvent::WindowActivate)
|
else if (e->type() == QEvent::WindowActivate)
|
||||||
{
|
{
|
||||||
if (!useNativeTheme)
|
if (!Settings::getInstance().getUseNativeDecoration())
|
||||||
{
|
{
|
||||||
this->setObjectName("activeWindow");
|
this->setObjectName("activeWindow");
|
||||||
this->style()->polish(this);
|
this->style()->polish(this);
|
||||||
@ -775,18 +779,18 @@ bool Widget::event(QEvent * e)
|
|||||||
Group* g = GroupList::findGroup(activeGroupWidget->groupId);
|
Group* g = GroupList::findGroup(activeGroupWidget->groupId);
|
||||||
g->hasNewMessages = 0;
|
g->hasNewMessages = 0;
|
||||||
g->userWasMentioned = 0;
|
g->userWasMentioned = 0;
|
||||||
if (useNativeTheme)
|
if (Settings::getInstance().getUseNativeDecoration())
|
||||||
g->widget->statusPic.setPixmap(QPixmap(":img/status/dot_online.png"));
|
g->widget->statusPic.setPixmap(QPixmap(":img/status/dot_online.png"));
|
||||||
else
|
else
|
||||||
g->widget->statusPic.setPixmap(QPixmap(":img/status/dot_groupchat.png"));
|
g->widget->statusPic.setPixmap(QPixmap(":img/status/dot_groupchat.png"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (e->type() == QEvent::WindowDeactivate && !useNativeTheme)
|
else if (e->type() == QEvent::WindowDeactivate && !Settings::getInstance().getUseNativeDecoration())
|
||||||
{
|
{
|
||||||
this->setObjectName("inactiveWindow");
|
this->setObjectName("inactiveWindow");
|
||||||
this->style()->polish(this);
|
this->style()->polish(this);
|
||||||
}
|
}
|
||||||
else if (e->type() == QEvent::MouseMove && !useNativeTheme)
|
else if (e->type() == QEvent::MouseMove && !Settings::getInstance().getUseNativeDecoration())
|
||||||
{
|
{
|
||||||
QMouseEvent *k = (QMouseEvent *)e;
|
QMouseEvent *k = (QMouseEvent *)e;
|
||||||
int xMouse = k->pos().x();
|
int xMouse = k->pos().x();
|
||||||
@ -831,7 +835,7 @@ bool Widget::event(QEvent * e)
|
|||||||
|
|
||||||
void Widget::mousePressEvent(QMouseEvent *e)
|
void Widget::mousePressEvent(QMouseEvent *e)
|
||||||
{
|
{
|
||||||
if (!useNativeTheme)
|
if (!Settings::getInstance().getUseNativeDecoration())
|
||||||
{
|
{
|
||||||
if (e->button() == Qt::LeftButton)
|
if (e->button() == Qt::LeftButton)
|
||||||
{
|
{
|
||||||
@ -865,7 +869,7 @@ void Widget::mousePressEvent(QMouseEvent *e)
|
|||||||
|
|
||||||
void Widget::mouseReleaseEvent(QMouseEvent *e)
|
void Widget::mouseReleaseEvent(QMouseEvent *e)
|
||||||
{
|
{
|
||||||
if (!useNativeTheme)
|
if (!Settings::getInstance().getUseNativeDecoration())
|
||||||
{
|
{
|
||||||
moveWidget = false;
|
moveWidget = false;
|
||||||
allowToResize = false;
|
allowToResize = false;
|
||||||
@ -880,7 +884,7 @@ void Widget::mouseReleaseEvent(QMouseEvent *e)
|
|||||||
|
|
||||||
void Widget::mouseDoubleClickEvent(QMouseEvent *e)
|
void Widget::mouseDoubleClickEvent(QMouseEvent *e)
|
||||||
{
|
{
|
||||||
if (!useNativeTheme)
|
if (!Settings::getInstance().getUseNativeDecoration())
|
||||||
{
|
{
|
||||||
if (e->pos().x() < ui->tbMenu->geometry().right() and e->pos().y() < ui->tbMenu->geometry().bottom()
|
if (e->pos().x() < ui->tbMenu->geometry().right() and e->pos().y() < ui->tbMenu->geometry().bottom()
|
||||||
and e->pos().x() >= ui->tbMenu->geometry().x() and e->pos().y() >= ui->tbMenu->geometry().y()
|
and e->pos().x() >= ui->tbMenu->geometry().x() and e->pos().y() >= ui->tbMenu->geometry().y()
|
||||||
@ -904,7 +908,7 @@ void Widget::paintEvent (QPaintEvent *)
|
|||||||
|
|
||||||
void Widget::moveWindow(QMouseEvent *e)
|
void Widget::moveWindow(QMouseEvent *e)
|
||||||
{
|
{
|
||||||
if (!useNativeTheme)
|
if (!Settings::getInstance().getUseNativeDecoration())
|
||||||
{
|
{
|
||||||
if (e->buttons() & Qt::LeftButton)
|
if (e->buttons() & Qt::LeftButton)
|
||||||
{
|
{
|
||||||
@ -916,7 +920,7 @@ void Widget::moveWindow(QMouseEvent *e)
|
|||||||
|
|
||||||
void Widget::resizeWindow(QMouseEvent *e)
|
void Widget::resizeWindow(QMouseEvent *e)
|
||||||
{
|
{
|
||||||
if (!useNativeTheme)
|
if (!Settings::getInstance().getUseNativeDecoration())
|
||||||
{
|
{
|
||||||
if (allowToResize)
|
if (allowToResize)
|
||||||
{
|
{
|
||||||
|
@ -58,7 +58,6 @@ public:
|
|||||||
void newMessageAlert();
|
void newMessageAlert();
|
||||||
bool isFriendWidgetCurActiveWidget(Friend* f);
|
bool isFriendWidgetCurActiveWidget(Friend* f);
|
||||||
void updateFriendStatusLights(int friendId);
|
void updateFriendStatusLights(int friendId);
|
||||||
int useNativeTheme;
|
|
||||||
~Widget();
|
~Widget();
|
||||||
|
|
||||||
virtual void closeEvent(QCloseEvent *event);
|
virtual void closeEvent(QCloseEvent *event);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user