1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

style fixes to conform to Allman style

This commit is contained in:
zero-one 2015-03-23 02:38:24 -07:00
parent c15cc60137
commit a1e228e60d
3 changed files with 23 additions and 13 deletions

View File

@ -373,7 +373,7 @@ instead of system taskbar.</string>
<item row="2" column="1">
<widget class="QCheckBox" name="cbFauxOfflineMessaging">
<property name="toolTip">
<string comment="toolTip for Faux offline messaging setting">Messages you are trying to send your friends when they are not online
<string comment="toolTip for Faux offline messaging setting">Messages you are trying to send to your friends when they are not online
will be sent to them when they appear online to you.</string>
</property>
<property name="text">
@ -394,7 +394,7 @@ will be sent to them when they appear online to you.</string>
<item row="2" column="2">
<widget class="QCheckBox" name="cbGroupchatPosition">
<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 at the bottom.</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>
</property>
<property name="text">
<string>Place groupchats at top of friend list</string>

View File

@ -42,12 +42,14 @@ FriendListWidget::FriendListWidget(QWidget *parent, bool groupchatPosition) :
layouts[static_cast<int>(s)] = l;
}
if(groupchatPosition){
if(groupchatPosition)
{
mainLayout->addLayout(groupLayout, 0, 0);
mainLayout->addLayout(layouts[static_cast<int>(Status::Online)], 1, 0);
mainLayout->addLayout(layouts[static_cast<int>(Status::Offline)], 2, 0);
}
else{
else
{
mainLayout->addLayout(layouts[static_cast<int>(Status::Online)], 0, 0);
mainLayout->addLayout(groupLayout, 1, 0);
mainLayout->addLayout(layouts[static_cast<int>(Status::Offline)], 2, 0);
@ -73,11 +75,13 @@ void FriendListWidget::onGroupchatPositionChanged(bool top)
{
mainLayout->removeItem(groupLayout);
mainLayout->removeItem(getFriendLayout(Status::Online));
if(top){
if(top)
{
mainLayout->addLayout(groupLayout, 0, 0);
mainLayout->addLayout(layouts[static_cast<int>(Status::Online)], 1, 0);
}
else{
else
{
mainLayout->addLayout(layouts[static_cast<int>(Status::Online)], 0, 0);
mainLayout->addLayout(groupLayout, 1, 0);
}
@ -85,14 +89,17 @@ void FriendListWidget::onGroupchatPositionChanged(bool top)
void FriendListWidget::moveWidget(QWidget *w, Status s, int hasNewEvents)
{
getFriendLayout(s)->removeWidget(w);
QVBoxLayout* l = getFriendLayout(s);
l->removeWidget(w);
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());
if(w1 != NULL){
if(w1 != NULL)
{
Friend* f = FriendList::findFriend(w1->friendId);
if(f->getDisplayedName().localeAwareCompare(g->getDisplayedName()) > 0){
if(f->getDisplayedName().localeAwareCompare(g->getDisplayedName()) > 0)
{
l->insertWidget(i,w);
return;
}

View File

@ -629,11 +629,14 @@ void Widget::onFriendStatusChanged(int friendId, Status status)
bool isActualChange = f->getStatus() != status;
if(isActualChange){
if(f->getStatus() == Status::Offline){
if(isActualChange)
{
if(f->getStatus() == Status::Offline)
{
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());
}
}