python / python/cpython

IDLE: touchpad horizontal scrolling not working

未關閉
#140,389 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

topic-IDLE type-bug
主要語言
Python
星號
77.2k
分支
36k
PR 合併指標
PR 指標待擷取

描述

Bug report

Bug description:

I know that there isn't a horizontal scrollbar for a reason but I believe that horizontally scrolling on a touchpad/trackpad should still scroll the IDLE editor horizontally. Right now trying to horizontally scroll a file, scrolls it vertically which I find very counter intuitive. The reason for this behaviour is in Lib/idlelib/tree.py (which is used in Lib/idlelib/editor.py):

def wheel_event(event, widget=None):
    ...
    up = {EventType.MouseWheel: event.delta > 0,
          EventType.ButtonPress: event.num == 4}
    lines = -5 if up[event.type] else 5
    widget = event.widget if widget is None else widget
    widget.yview(SCROLL, lines, 'units')
    return 'break'

The function doesn't respect the direction of scrolling and instead just scrolls vertically (yview). I know this is a minor bug but it's annoying me so much when IDLE tries to scroll vertically when I am scrolling horizontally

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux, Windows

Linked PRs
  • gh-140390

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 Lib/idlelib/tree.py 中的 wheel_event() 開始,然後檢查 Lib/idlelib/editor.py 如何使用它。確認觸控板方向在受支援的事件類型中是如何表示的;完成的標準是,在 Linux 和 Windows 上,觸控板水平捲動會使 IDLE 編輯器水平移動,而不是垂直移動。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
desktop
Issue 類型
缺陷
難度
2/5
預估耗時
1-3 小時
活躍度
停滯
描述清晰度
描述清楚
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。