window_stack.py (1752B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\packages\chat\client\window_stack.py 2 import eveicon 3 import localization 4 import uthread2 5 from carbonui.window.stack import WindowStack 6 from carbonui.uicore import uicore 7 import eve.client.script.ui.shared.pointerTool.pointerToolConst as pConst 8 from uihider import UiHiderMixin 9 from chat.client.util import get_chat_default_height, get_chat_default_width 10 11 class ChatWindowStack(UiHiderMixin, WindowStack): 12 uniqueUiName = pConst.UNIQUE_NAME_CHAT_STACK 13 default_left = 16 14 15 def ApplyAttributes(self, attributes): 16 super(ChatWindowStack, self).ApplyAttributes(attributes) 17 self._AddTabButton() 18 19 @staticmethod 20 def default_top(): 21 return uicore.desktop.height - ChatWindowStack.default_height() - 16 22 23 @staticmethod 24 def default_width(): 25 return get_chat_default_width() 26 27 @staticmethod 28 def default_height(): 29 return get_chat_default_height() 30 31 def _AddTabButton(self): 32 tabs = self.GetTabGroup() 33 if tabs is not None: 34 join_channel_button = tabs.AddButton(icon=eveicon.add, func=self._open_channels_window, hint=localization.GetByLabel('UI/Chat/OpenChannelWindow')) 35 join_channel_button.uniqueUiName = pConst.UNIQUE_NAME_CHANNEL_WND 36 37 def RemoveWnd(self, wnd, grab, correctpos = 1, idx = 0, dragging = 0, check = 1): 38 WindowStack.RemoveWnd(self, wnd, grab, correctpos, idx, dragging, check) 39 if wnd.destroyed: 40 return 41 if not dragging: 42 uthread2.start_tasklet(wnd.StackSelf) 43 44 def _open_channels_window(self, *args, **kwargs): 45 from xmppchatclient.xmppchatchannels import XmppChatChannels 46 XmppChatChannels.Open()