Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dragging scroll bar presents weird behavior #61

Closed
HaroldLever opened this issue Apr 21, 2024 · 1 comment · Fixed by #62
Closed

Dragging scroll bar presents weird behavior #61

HaroldLever opened this issue Apr 21, 2024 · 1 comment · Fixed by #62
Labels
bug Something isn't working

Comments

@HaroldLever
Copy link
Contributor

Godot version

4.2.1 stable

Smooth scroll container version

d1a7891

Description

ScrollBarDragging1.mp4
  • h/v_scrollbar_dragging remains true when drags scroll bar until mouse enters content node's area.
  • any_scroll_bar_dragged() does not work, I guess it is because scroll bar 's 'focus_mode' is None by default.
ScrollBarDragging2.mp4

Then I tried to set scroll bars' 'focus_mode' to All, but something weird occurred.

  • Content node has offset when scroll bar is focused.
  • h/v_scrollbar_dragging and any_scroll_bar_dragged() remain true when drags scroll bar until lose focus.
  • Dragging doed not work when scroll bar is focused.

Steps to reproduce

Check properties on rich text label. Add these few lines in update_text() might help you check any_scroll_bar_dragged().

func update_text(ssc:SmoothScrollContainer):
	while true:
		await get_tree().process_frame
		new_text = ""
		for propertyInfo in property_list:
			var propertyName : String = propertyInfo.name
			var propertyValue = ssc.call("get", propertyName)
			var propertyType = propertyInfo.usage
			new_text += "[color=green]%s:[/color] %s\n" % [propertyName, propertyValue] if propertyType == 4096 else "[color=yellow]%s:[/color] %s\n" % [propertyName, propertyValue]
			# new lines
			if propertyName == "v_scrollbar_dragging":
				new_text += "[color=lightblue]%s:[/color] %s\n" % ["any_scroll_bar_dragged()", ssc.any_scroll_bar_dragged()]
@SpyrexDE
Copy link
Owner

It's probably better to use the scroll bar's gui_input event to determine if they are being dragged instead of relying on their focus_mode. The scroll behavior when scrollbars are focused is in fact weird but I can't think of a use case where a user would like to make the scroll bars focusable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants