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 | void Menu::showChat() { | 915 | void Menu::showChat() { |
| 916 | if (!_chatWindow) { | 916 | if (!_chatWindow) { |
| 917 | _chatWindow = new ChatWindow(); | 917 | Application::getInstance()->getWindow()->addDockWidget(Qt::RightDockWidgetArea, _chatWindow = new ChatWindow()); |
| 918 | QMainWindow* mainWindow = Application::getInstance()->getWindow(); | 918 | |
| 919 | QBoxLayout* boxLayout = static_cast<QBoxLayout*>(mainWindow->centralWidget()->layout()); | ||
| 920 | boxLayout->addWidget(_chatWindow, 0, Qt::AlignRight); | ||
| 921 | } else { | 919 | } else { |
| 922 | if (!_chatWindow->isVisible()) { | 920 | if (!_chatWindow->toggleViewAction()->isChecked()) { |
| 923 | _chatWindow->show(); | 921 | _chatWindow->toggleViewAction()->trigger(); |
| 924 | } | 922 | } |
| 925 | } | 923 | } |
| 926 | } | 924 | } |
| @@ -928,8 +926,8 @@ void Menu::showChat() { · 1 unmodified line | |||
| 928 | void Menu::toggleChat() { | 926 | void Menu::toggleChat() { |
| 929 | #ifdef HAVE_QXMPP | 927 | #ifdef HAVE_QXMPP |
| 930 | _chatAction->setEnabled(XmppClient::getInstance().getXMPPClient().isConnected()); | 928 | _chatAction->setEnabled(XmppClient::getInstance().getXMPPClient().isConnected()); |
| 931 | if (!_chatAction->isEnabled() && _chatWindow) { | 929 | if (!_chatAction->isEnabled() && _chatWindow && _chatWindow->toggleViewAction()->isChecked()) { |
| 932 | _chatWindow->hide(); | 930 | _chatWindow->toggleViewAction()->trigger(); |
| 933 | } | 931 | } |
| 934 | #endif | 932 | #endif |
| 935 | } | 933 | } |