mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'chat-scrolling-hack' into 'master'
Trying to fix chat hiding behind the chat window. See merge request veloren/veloren!2678
This commit is contained in:
commit
d5b134e355
@ -214,6 +214,14 @@ impl<'a> Widget for Chat<'a> {
|
||||
|
||||
let chat_tabs = &chat_settings.chat_tabs;
|
||||
let current_chat_tab = chat_settings.chat_tab_index.and_then(|i| chat_tabs.get(i));
|
||||
|
||||
// Empty old messages
|
||||
state.update(|s| {
|
||||
while s.messages.len() > MAX_MESSAGES {
|
||||
s.messages.pop_front();
|
||||
}
|
||||
});
|
||||
|
||||
// Maintain scrolling //
|
||||
if !self.new_messages.is_empty() {
|
||||
//new messages - update chat w/ them & scroll down if at bottom of chat
|
||||
@ -236,13 +244,6 @@ impl<'a> Widget for Chat<'a> {
|
||||
state.update(|s| s.scroll_next = true); //make scroll happen only once any filters to the messages have already been applied
|
||||
}
|
||||
|
||||
// Empty old messages
|
||||
state.update(|s| {
|
||||
while s.messages.len() > MAX_MESSAGES {
|
||||
s.messages.pop_front();
|
||||
}
|
||||
});
|
||||
|
||||
if let Some(comps) = &self.force_completions {
|
||||
state.update(|s| s.completions = comps.clone());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user