mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
get UserListProxy from TabSupervisor instead of passing it in the constructor (#5490)
This commit is contained in:
parent
92a903b035
commit
2bc71095dd
14 changed files with 32 additions and 52 deletions
|
|
@ -5,6 +5,7 @@
|
|||
#include "../../client/ui/pixel_map_generator.h"
|
||||
#include "../../settings/cache_settings.h"
|
||||
#include "../user/user_context_menu.h"
|
||||
#include "../user/user_list_manager.h"
|
||||
#include "../user/user_list_proxy.h"
|
||||
#include "user_level.h"
|
||||
|
||||
|
|
@ -22,13 +23,10 @@ UserMessagePosition::UserMessagePosition(QTextCursor &cursor)
|
|||
relativePosition = cursor.position() - block.position();
|
||||
}
|
||||
|
||||
ChatView::ChatView(TabSupervisor *_tabSupervisor,
|
||||
const UserListProxy *_userListProxy,
|
||||
TabGame *_game,
|
||||
bool _showTimestamps,
|
||||
QWidget *parent)
|
||||
: QTextBrowser(parent), tabSupervisor(_tabSupervisor), game(_game), userListProxy(_userListProxy), evenNumber(true),
|
||||
showTimestamps(_showTimestamps), hoveredItemType(HoveredNothing)
|
||||
ChatView::ChatView(TabSupervisor *_tabSupervisor, TabGame *_game, bool _showTimestamps, QWidget *parent)
|
||||
: QTextBrowser(parent), tabSupervisor(_tabSupervisor), game(_game),
|
||||
userListProxy(_tabSupervisor->getUserListManager()), evenNumber(true), showTimestamps(_showTimestamps),
|
||||
hoveredItemType(HoveredNothing)
|
||||
{
|
||||
if (palette().windowText().color().lightness() > 200) {
|
||||
document()->setDefaultStyleSheet(R"(
|
||||
|
|
@ -46,7 +44,7 @@ ChatView::ChatView(TabSupervisor *_tabSupervisor,
|
|||
linkColor = palette().link().color();
|
||||
}
|
||||
|
||||
userContextMenu = new UserContextMenu(tabSupervisor, userListProxy, this, game);
|
||||
userContextMenu = new UserContextMenu(tabSupervisor, this, game);
|
||||
connect(userContextMenu, SIGNAL(openMessageDialog(QString, bool)), this, SIGNAL(openMessageDialog(QString, bool)));
|
||||
|
||||
ownUserName = userListProxy->getOwnUsername();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue