live data - maybe fixing mouse scrolling at least in some cases?

This commit is contained in:
rusefillc 2022-01-11 14:04:58 -05:00
parent 249dee3017
commit cbb7e83810
1 changed files with 4 additions and 6 deletions

View File

@ -6,7 +6,6 @@ import com.rusefi.core.Sensor;
import com.rusefi.enums.live_data_e; import com.rusefi.enums.live_data_e;
import com.rusefi.ldmp.StateDictionary; import com.rusefi.ldmp.StateDictionary;
import com.rusefi.livedata.LiveDataParserPanel; import com.rusefi.livedata.LiveDataParserPanel;
import com.rusefi.livedata.LiveDataView;
import com.rusefi.ui.util.UiUtils; import com.rusefi.ui.util.UiUtils;
import com.rusefi.ui.widgets.IntGaugeLabel; import com.rusefi.ui.widgets.IntGaugeLabel;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@ -44,11 +43,10 @@ public class LiveDataPane {
JPanel liveDataParserContent = LiveDataParserPanel.createLiveDataParserPanel(uiContext, view, values, fileName).getContent(); JPanel liveDataParserContent = LiveDataParserPanel.createLiveDataParserPanel(uiContext, view, values, fileName).getContent();
JButton shortCut = new JButton(fileName); JButton shortCut = new JButton(fileName);
shortCut.addActionListener(new ActionListener() { shortCut.addActionListener(e -> {
@Override scroll.getVerticalScrollBar().setValue(liveDataParserContent.getLocation().y);
public void actionPerformed(ActionEvent e) { // we want focus there so that mouse wheel scrolling would be active
scroll.getVerticalScrollBar().setValue(liveDataParserContent.getLocation().y); scroll.requestFocus();
}
}); });
leftList.add(shortCut); leftList.add(shortCut);