Fix sendbox enter not working
This commit is contained in:
		
							
								
								
									
										5
									
								
								TODO.md
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								TODO.md
									
									
									
									
									
								
							@@ -1,13 +1,12 @@
 | 
				
			|||||||
- Refactoring
 | 
					- Refactoring
 | 
				
			||||||
  - Migrate more JS functions to their own files / Implement in Python instead
 | 
					  - Migrate more JS functions to their own files / Implement in Python instead
 | 
				
			||||||
  - Don't bake in size properties for components
 | 
					  - Don't bake in size properties for components
 | 
				
			||||||
 | 
					  - Cleanup unused icons
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- Bug fixes
 | 
					- Bug fixes
 | 
				
			||||||
  - Sendbox
 | 
					 | 
				
			||||||
  - 100% CPU usage when hitting top edge to trigger messages loading
 | 
					  - 100% CPU usage when hitting top edge to trigger messages loading
 | 
				
			||||||
  - Sending `` → not clickable?
 | 
					  - Sending `` → not clickable?
 | 
				
			||||||
  - Icons and images aren't reloaded
 | 
					  - Icons, images and HStyle singleton aren't reloaded
 | 
				
			||||||
  - HStyle singleton isn't reloaded
 | 
					 | 
				
			||||||
  - `MessageDelegate.qml:63: TypeError: 'reloadPreviousItem' not a function`
 | 
					  - `MessageDelegate.qml:63: TypeError: 'reloadPreviousItem' not a function`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- UI
 | 
					- UI
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,6 +9,7 @@ ScrollView {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    default property alias textAreaData: textArea.data
 | 
					    default property alias textAreaData: textArea.data
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    id: scrollView
 | 
				
			||||||
    clip: true
 | 
					    clip: true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    TextArea {
 | 
					    TextArea {
 | 
				
			||||||
@@ -25,6 +26,8 @@ ScrollView {
 | 
				
			|||||||
            id: textAreaBackground
 | 
					            id: textAreaBackground
 | 
				
			||||||
            color: HStyle.controls.textArea.background
 | 
					            color: HStyle.controls.textArea.background
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Keys.forwardTo: [scrollView]
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -40,6 +40,7 @@ HGlassRectangle {
 | 
				
			|||||||
            area.onEditingFinished: setTyping(false)  // when lost focus
 | 
					            area.onEditingFinished: setTyping(false)  // when lost focus
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Keys.onReturnPressed: {
 | 
					            Keys.onReturnPressed: {
 | 
				
			||||||
 | 
					                console.log( "enter")
 | 
				
			||||||
                event.accepted = true
 | 
					                event.accepted = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (event.modifiers & Qt.ShiftModifier ||
 | 
					                if (event.modifiers & Qt.ShiftModifier ||
 | 
				
			||||||
@@ -52,10 +53,11 @@ HGlassRectangle {
 | 
				
			|||||||
                if (textArea.text === "") { return }
 | 
					                if (textArea.text === "") { return }
 | 
				
			||||||
                Backend.clients.get(chatPage.userId)
 | 
					                Backend.clients.get(chatPage.userId)
 | 
				
			||||||
                       .sendMarkdown(chatPage.roomId, textArea.text)
 | 
					                       .sendMarkdown(chatPage.roomId, textArea.text)
 | 
				
			||||||
                textArea.clear()
 | 
					                area.clear()
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            Keys.onEnterPressed: Keys.onReturnPressed(event)  // numpad enter
 | 
					            // Numpad enter
 | 
				
			||||||
 | 
					            Keys.onEnterPressed: Keys.onReturnPressed(event)
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user