mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Style fixes
This commit is contained in:
parent
2a730d5e22
commit
27f58c9ca6
|
@ -24,7 +24,7 @@
|
||||||
struct FriendWidget;
|
struct FriendWidget;
|
||||||
class ChatForm;
|
class ChatForm;
|
||||||
|
|
||||||
struct Friend : QObject
|
class Friend : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -391,7 +391,7 @@ will be sent to them when they appear online to you.</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="2">
|
<item row="2" column="1">
|
||||||
<widget class="QCheckBox" name="cbGroupchatPosition">
|
<widget class="QCheckBox" name="cbGroupchatPosition">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string comment="toolTip for groupchat positioning">If checked, groupchats will be placed at the top of the friends list, otherwise, they'll be placed below online friends.</string>
|
<string comment="toolTip for groupchat positioning">If checked, groupchats will be placed at the top of the friends list, otherwise, they'll be placed below online friends.</string>
|
||||||
|
|
|
@ -42,7 +42,7 @@ FriendListWidget::FriendListWidget(QWidget *parent, bool groupchatPosition) :
|
||||||
layouts[static_cast<int>(s)] = l;
|
layouts[static_cast<int>(s)] = l;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(groupchatPosition)
|
if (groupchatPosition)
|
||||||
{
|
{
|
||||||
mainLayout->addLayout(groupLayout, 0, 0);
|
mainLayout->addLayout(groupLayout, 0, 0);
|
||||||
mainLayout->addLayout(layouts[static_cast<int>(Status::Online)], 1, 0);
|
mainLayout->addLayout(layouts[static_cast<int>(Status::Online)], 1, 0);
|
||||||
|
@ -75,7 +75,7 @@ void FriendListWidget::onGroupchatPositionChanged(bool top)
|
||||||
{
|
{
|
||||||
mainLayout->removeItem(groupLayout);
|
mainLayout->removeItem(groupLayout);
|
||||||
mainLayout->removeItem(getFriendLayout(Status::Online));
|
mainLayout->removeItem(getFriendLayout(Status::Online));
|
||||||
if(top)
|
if (top)
|
||||||
{
|
{
|
||||||
mainLayout->addLayout(groupLayout, 0, 0);
|
mainLayout->addLayout(groupLayout, 0, 0);
|
||||||
mainLayout->addLayout(layouts[static_cast<int>(Status::Online)], 1, 0);
|
mainLayout->addLayout(layouts[static_cast<int>(Status::Online)], 1, 0);
|
||||||
|
@ -92,13 +92,13 @@ void FriendListWidget::moveWidget(QWidget *w, Status s, int hasNewEvents)
|
||||||
QVBoxLayout* l = getFriendLayout(s);
|
QVBoxLayout* l = getFriendLayout(s);
|
||||||
l->removeWidget(w);
|
l->removeWidget(w);
|
||||||
Friend* g = FriendList::findFriend(dynamic_cast<FriendWidget*>(w)->friendId);
|
Friend* g = FriendList::findFriend(dynamic_cast<FriendWidget*>(w)->friendId);
|
||||||
for(int i = 0; i < l->count(); i++)
|
for (int i = 0; i < l->count(); i++)
|
||||||
{
|
{
|
||||||
FriendWidget* w1 = dynamic_cast<FriendWidget*>(l->itemAt(i)->widget());
|
FriendWidget* w1 = dynamic_cast<FriendWidget*>(l->itemAt(i)->widget());
|
||||||
if(w1 != NULL)
|
if (w1 != NULL)
|
||||||
{
|
{
|
||||||
Friend* f = FriendList::findFriend(w1->friendId);
|
Friend* f = FriendList::findFriend(w1->friendId);
|
||||||
if(f->getDisplayedName().localeAwareCompare(g->getDisplayedName()) > 0)
|
if (f->getDisplayedName().localeAwareCompare(g->getDisplayedName()) > 0)
|
||||||
{
|
{
|
||||||
l->insertWidget(i,w);
|
l->insertWidget(i,w);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -226,7 +226,7 @@ void Widget::setTranslation()
|
||||||
|
|
||||||
bool Widget::eventFilter(QObject *obj, QEvent *event)
|
bool Widget::eventFilter(QObject *obj, QEvent *event)
|
||||||
{
|
{
|
||||||
if(event->type() == QEvent::WindowStateChange && obj != NULL)
|
if (event->type() == QEvent::WindowStateChange && obj != NULL)
|
||||||
{
|
{
|
||||||
QWindowStateChangeEvent * ce = static_cast<QWindowStateChangeEvent*>(event);
|
QWindowStateChangeEvent * ce = static_cast<QWindowStateChangeEvent*>(event);
|
||||||
if (windowState() & Qt::WindowMinimized)
|
if (windowState() & Qt::WindowMinimized)
|
||||||
|
@ -426,7 +426,7 @@ void Widget::confirmExecutableOpen(const QFileInfo file)
|
||||||
|
|
||||||
if (dangerousExtensions.contains(file.suffix()))
|
if (dangerousExtensions.contains(file.suffix()))
|
||||||
{
|
{
|
||||||
if(!GUI::askQuestion(tr("Executable file", "popup title"), tr("You have asked qTox to open an executable file. Executable files can potentially damage your computer. Are you sure want to open this file?", "popup text"), false, true))
|
if (!GUI::askQuestion(tr("Executable file", "popup title"), tr("You have asked qTox to open an executable file. Executable files can potentially damage your computer. Are you sure want to open this file?", "popup text"), false, true))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -626,16 +626,16 @@ void Widget::onFriendStatusChanged(int friendId, Status status)
|
||||||
Friend* f = FriendList::findFriend(friendId);
|
Friend* f = FriendList::findFriend(friendId);
|
||||||
if (!f)
|
if (!f)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
bool isActualChange = f->getStatus() != status;
|
bool isActualChange = f->getStatus() != status;
|
||||||
|
|
||||||
if(isActualChange)
|
if (isActualChange)
|
||||||
{
|
{
|
||||||
if(f->getStatus() == Status::Offline)
|
if (f->getStatus() == Status::Offline)
|
||||||
{
|
{
|
||||||
contactListWidget->moveWidget(f->getFriendWidget(), Status::Online, f->getEventFlag());
|
contactListWidget->moveWidget(f->getFriendWidget(), Status::Online, f->getEventFlag());
|
||||||
}
|
}
|
||||||
else if(status == Status::Offline)
|
else if (status == Status::Offline)
|
||||||
{
|
{
|
||||||
contactListWidget->moveWidget(f->getFriendWidget(), Status::Offline, f->getEventFlag());
|
contactListWidget->moveWidget(f->getFriendWidget(), Status::Offline, f->getEventFlag());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user