-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
widget.ScrollContainer scroll speed is slow #775
Comments
Can you please provide more information about your operating system, version etc etc. Mouse events like scroll are different for each OS so there isn't much to comment on without those details. The regular bug template asks for these details for a reason :) |
Thank you for the reply. My environment is as follows.
|
Hey @mondy, can you also provide some information about your ScrollContainer and the content it is scrolling? Is your issue that ScrollContainer takes too long to update/render after a scroll event, or that you need to scroll many times to get the ScrollContainer to move the amount you want? |
Simplified code: labels := []fyne.CanvasObject{
widget.NewLabel("aaa"), // Will use icon and label
widget.NewLabel("bbb"),
widget.NewLabel("ccc"),
...
}
layout := layout.NewFixedGridLayout(fyne.NewSize(300, 300))
container := fyne.NewContainerWithLayout(layout, labels...)
scrollContainer := widget.NewScrollContainer(container)
That's right. |
Can you confirm how far, for your computer, it scrolls for each mouse scroll - and how far you expect it to scroll? |
It was 12px for fyne and 98px for gtk.
I think we not have scroll configuration. |
Sorry, I was meaning have you configured Ubuntu/Gnome? When I compare them on my (Arch linux) system they seem to scroll at the same increment. |
Yes, my desktop environment is GNOME. It as-installed. |
What is the status of this issue? |
I'm not sure what to do. I loaded an Ubuntu instance to test this and other bugs and it worked as expected for me on my mousewheel and touch pad. I have been thinking about it but can't quite think why 98px scroll for a single wheel movement is a sensible default - that's going to be about 6 lines of text isn't it? |
I tried to solve this problem by extending the ScrollContainer widget. Try the following code. package main
import (
"fyne.io/fyne"
"fyne.io/fyne/app"
"fyne.io/fyne/layout"
"fyne.io/fyne/theme"
"fyne.io/fyne/widget"
)
// ScrollContainer ScrollContainer
type ScrollContainer struct {
widget.ScrollContainer
Rate float64
}
// NewScrollContainer NewScrollContainer
func NewScrollContainer(content fyne.CanvasObject) *ScrollContainer {
scroll := &ScrollContainer{
ScrollContainer: widget.ScrollContainer{
Content: content,
Direction: widget.ScrollBoth,
},
Rate: 1,
}
scroll.ExtendBaseWidget(scroll)
return scroll
}
// Scrolled Scrolled
func (scroll *ScrollContainer) Scrolled(event *fyne.ScrollEvent) {
event.DeltaX = int(float64(event.DeltaX) * scroll.Rate)
event.DeltaY = int(float64(event.DeltaY) * scroll.Rate)
scroll.ScrollContainer.Scrolled(event)
}
func main() {
application := app.New()
window := application.NewWindow("")
gridLayout := layout.NewFixedGridLayout(fyne.NewSize(100, 100))
icons := make([]fyne.CanvasObject, 500)
for i := range icons {
icons[i] = widget.NewIcon(theme.FyneLogo())
}
scroll := NewScrollContainer(fyne.NewContainerWithLayout(gridLayout, icons...))
scroll.Rate = 3
top := widget.NewEntry()
bottom := widget.NewEntry()
layout := layout.NewBorderLayout(top, bottom, nil, nil)
window.SetContent(fyne.NewContainerWithLayout(layout, top, bottom, scroll))
window.ShowAndRun()
} Environment is as follows.
|
Unfortunately the scrollcontainer widget Currently does not extend well - the drivers perform clipping only on widget.ScrollContainer - we were looking to fix this but other priorities got in the way for 1.3. I would love to fix this problem within the toolkit, any answers to my previous questions would be helpful. Having read more about GTK scroll it seems they may be accelerating based on screen density as well - perhaps you could confirm what output device (resolution and physical size) you are using? |
I use two monitors side by side. |
Approximate is fine, thanks. A few other questions that might help: If you unplug and plug back in your mouse, does the speed of either GTK or Fyne change? Can you use |
I tried it with two mice.
Plugging and unplugging both mice did not change them.
The output of the command is as follows.
|
Thanks. I notice that both of your mice have acceleration turned up to the maximum, I wonder if this makes a difference
Is that something that you enabled? And/or what happens if you turn it off (set to 0). |
No, I don't remember setting it up. |
You might need to log out of Gnome and back in again, I don't know how this works myself. |
I can't persist the settings, so I can't try for them after you log out. Sorry.
I don't want to put a new desktop environment on my current Ubuntu. But I can try a desktop environment using VirtualBox, I'd like to choose between Ubuntu flavors, which one is better, Kubuntu (KDE), Xubuntu (Xfce), Lubuntu (LXDE), and more... |
If you are creating a new test environment (thanks) then try to use one as close as possible to your current system as ideally we need to replicate the issue then compare other desktop environments alongside. |
Just to add a data point. I had it fast on desktop but slow on mobile(ios iphone 11) https://github.com/yeo/bima/blob/master/render/code.go#L189-L224 |
@v9n thanks. Are you referring to how many rows move for an down-scroll action, or are you referring to a latency in the view updating when you scroll? What you describe seems more like #1163 which was included in v1.3.2. Let me know if that is what you were describing, and what Fyne version you are using? |
I noticed a similar problem on my machine in my own On both host and guest OSes, a single click of my scroll wheel travels about 9px, while other applications scroll about 81px per click. Host OS:
Guest OS:
|
You mention guest and host OS @mrthrill, but not what technology is connecting them. |
VirtualBox is the connective tissue @andydotxyz |
OK thanks. I guess I need to try and build out an Ubuntu host to replicate, as my Linux/BSD boxes don't seem to have this |
same issue ,
Mouse :
|
May I suggest adding dynamic scrolling? So it can scrolls more when you scroll faster, while still letting you have precision while scrolling slowly. |
Can you perhaps compare to another windows app please @zivoy? |
a simple approach to try and adjust for expectatios for faster-than-hardware scrolling. Fixes fyne-io#775
If you are able please test #2420 as it may provide the sort of adjustment you're looking for |
@andydotxyz my display is 1080p Also, here are some gifs of scrolling in different apps. I first went one "click" of the mouse at a time, then scrolled quickly In the cases of both the fyne file browser and the scroll container, the scrolling steps are very small when I spin the wheel just one position, and it takes way too many spins to get to the bottom of the page. with #2420 there is an improvement. The scrolling now feels smoother and less jumpy. but the steps are still small, and it still takes many scrolls to get to the bottom of the page. whereas in the other apps I just have to scroll a bit quicker and it reaches the bottom faster. Fyne vscroll container (with #2420) |
What sort of mouse are you using? When I scroll mine by the smallest amount it moves by 1px in all apps (macOS and Windows). This "precision scroll" is what we want to support, whilst allowing faster scroll when needed. |
My mouse is a t7 thunderbird. |
I read through this issue but I'm still not sure how to speed up scrolling globally for my app. Is there any solution? Scrolling a table still goes very slowly. |
You might need more info @williambrode are you on latest Fyne, what sort of mouse speeds are not matching your OS etc. |
Windows 10, Just upgraded to latest Fyne and still an issue. I don't get what was improved in this ticket but the original request was a way to specify a scroll modifier (like 2 for 2x the speed). Things like chrome, slack, notepad++ seem to move 4 text lines or so per mouse scroll pip. My table in Fyne moves about 1/2 text line per pip, about 8x slower. |
Ah, I just noticed it happens (very slow scroll) on the left bar on the fyne demo too. In case that helps with tracking it down. |
I have the same issue with windows 10, fyne version v2.2.2 |
Can you tell us anything about your hardware and graphics card @Czyhandsome ? My guess is we have some issue that is taxing a particular graphics configuration... |
Would you please tell me how to collect the hardware and graphics card info that you need? |
Sorry for the delay I am not hugely familiar with all the ways that windows drivers work - but I think somewhere in the hardware manager there is an about panel for the graphics card / driver - version numbers etc especially if it mentions OpenGL. However also please update your Fyne version to latest, and then open a new issue instead of continuing here. |
I used widget.ScrollContainer.
But scroll speed is slow.
Is there an option to increase the amount of movement on the screen for a single mouse wheel movement.
For example, if you specify 2 as an option, I want the movement on the screen to double.
The text was updated successfully, but these errors were encountered: