add scrollbar to channel list, closing channels fixed

This commit is contained in:
Henrique Santiago 2012-04-06 19:14:39 -03:00
parent 43e2aeec73
commit 8cc0aaae23
2 changed files with 11 additions and 2 deletions

View File

@ -16,6 +16,7 @@ MainWindow
TextList
id: channelList
vertical-scrollbar: channelsScrollBar
anchors.fill: parent
anchors.bottom: next.top
margin-bottom: 10
@ -54,3 +55,11 @@ MainWindow
anchors.right: parent.right
anchors.bottom: parent.bottom
@onClick: self:getParent():destroy()
VerticalScrollBar
id: channelsScrollBar
anchors.top: channelList.top
anchors.bottom: channelList.bottom
anchors.right: channelList.right
step: 14
pixels-scroll: true

View File

@ -267,14 +267,14 @@ function Console.removeCurrentTab()
local tab = consoleTabBar:getCurrentTab()
if tab:getText() == "Default" or tab:getText() == "Server Log" then return end
consoleTabBar:removeTab(tab)
-- notificate the server that we are leaving the channel
if tab.channelId then
g_game.leaveChannel(tab.channelId)
elseif tab:getText() == "NPCs" then
g_game.closeNpcChannel()
end
consoleTabBar:removeTab(tab)
end
function Console.getTab(name)