Showing the changes to interface/src/Menu.cpp (1 of 35 files). Show all
Unified · Split
| @@ -914,13 +914,11 @@ void Menu::showMetavoxelEditor() { · 913 unmodified lines | ||
| 914 | 914 | |
| 915 | 915 | void Menu::showChat() { |
| 916 | 916 | if (!_chatWindow) { |
| 917 | − _chatWindow = new ChatWindow(); | |
| 918 | − QMainWindow* mainWindow = Application::getInstance()->getWindow(); | |
| 919 | − QBoxLayout* boxLayout = static_cast<QBoxLayout*>(mainWindow->centralWidget()->layout()); | |
| 920 | − boxLayout->addWidget(_chatWindow, 0, Qt::AlignRight); | |
| 917 | + Application::getInstance()->getWindow()->addDockWidget(Qt::RightDockWidgetArea, _chatWindow = new ChatWindow()); | |
| 918 | + | |
| 921 | 919 | } else { |
| 922 | − if (!_chatWindow->isVisible()) { | |
| 923 | − _chatWindow->show(); | |
| 920 | + if (!_chatWindow->toggleViewAction()->isChecked()) { | |
| 921 | + _chatWindow->toggleViewAction()->trigger(); | |
| 924 | 922 | } |
| 925 | 923 | } |
| 926 | 924 | } |
| @@ -928,8 +926,8 @@ void Menu::showChat() { · 1 unmodified line | ||
| 928 | 926 | void Menu::toggleChat() { |
| 929 | 927 | #ifdef HAVE_QXMPP |
| 930 | 928 | _chatAction->setEnabled(XmppClient::getInstance().getXMPPClient().isConnected()); |
| 931 | − if (!_chatAction->isEnabled() && _chatWindow) { | |
| 932 | − _chatWindow->hide(); | |
| 929 | + if (!_chatAction->isEnabled() && _chatWindow && _chatWindow->toggleViewAction()->isChecked()) { | |
| 930 | + _chatWindow->toggleViewAction()->trigger(); | |
| 933 | 931 | } |
| 934 | 932 | #endif |
| 935 | 933 | } |