Been meaning to post this for a few years…
Scrollbar scroll speed in seemingly all parts of the Designer and Vision clients is really really slow (it seems like the scroll pixel amount per ‘click’ is very low, something like 1-2px).
This includes things like: Script console, drop down menus, alarm tables, tables, list components, etc. etc.
Props to @nminchin for bringing up all these creature comfort requests. There are others out here noticing this stuff (even if we aren’t always requesting fixes).
But thanks for posting about this, I’ve taken the habit of clicking and moving the slider instead of scrolling so I hardly notice it anymore, but… that would be a nice QoL improvement.
Hi there,
I managed to change the scrollbar speed of my template repeater. This should also work for any other Vision components. I simply fire this code on the window event internalFrameOpened:
I actually use something similar for scrollable components, but fixing the path to the vertical scrollbar is a tiny bit prone to breaking in updates (fairly unlikely, but there’s still a chance if IA changes it up for some reason). So I find the vertical scrollbar instead in code and also set the scroll speed based on the number of items shown:
def fixScrollSpeed(scrollableObj):
'''
Description:
Set the scroll 'speed' from extremely slow (default) to useable
Usage:
if event.propertyName in ['componentRunning', 'editor']:
shared.components.scrollable.fixScrollSpeed(event.source)
'''
components = scrollableObj.getComponents()
# find the embedded JideScrollPane component
for component in components:
if str(type(component)) == "<type 'com.jidesoft.swing.JideScrollPane'>":
scrollPane = component
size = scrollPane.getSize()
# set the scroll increment for the arrows to a fraction of the height of the scrollable panel
scrollPane.getVerticalScrollBar().setUnitIncrement(size.height/4) #scroll amount for wheel and arrows
# set the scroll increment when clicking on the scrollbar track piece to the height of the scrollable panel i.e. move 1 whole 'page' up/down
scrollPane.getVerticalScrollBar().setBlockIncrement(size.height) #scroll amount clicking on scrollbar track
Unfortunately though it’s impossible* to use something like this to change the scroll speed of the components in the Designer like the script console
Thankyou for the inspiration!
With some tweaking I got it to work for Vision template canvas also:-)
# set unit increment for the vertical scrollbar
tc = system.gui.getParentWindow(event).getComponentForPath('Root Container.TC')
verticalScrollPane = tc.getComponents()[2].getComponents()[1]
verticalScrollPane.setUnitIncrement(10)
It's easy. Run this code from the script console, and it will apply the properties from your script to every scroll bar in the designer:
def fixScrollSpeed(scrollableObj):
for component in scrollableObj.components:
if 'ScrollBar' in component.__class__.__name__:
component.setUnitIncrement(component.maximum/4)
component.setBlockIncrement(component.maximum)
else:
fixScrollSpeed(component)
from java.awt import Window
for window in Window.getWindows():
fixScrollSpeed(window)
I'll just add that 24 and 480 were pretty balanced for me. I think each line is 24px tall, and my Windows mouse properties multiply my mouse scroll by 3, so I get 3 lines in each tick of scrolling. Approximately 20x3 lines per "page" seemed fitting for the block increment too.
def fixScrollSpeed(scrollableObj):
for component in scrollableObj.components:
if 'ScrollBar' in component.__class__.__name__:
component.setUnitIncrement(24)
component.setBlockIncrement(480)
else:
fixScrollSpeed(component)
from java.awt import Window
for window in Window.getWindows():
fixScrollSpeed(window)
I'm almost certain now that there's a way to do this to most Designer scrollables, but I'll have to dive into that another time...