koreader icon indicating copy to clipboard operation
koreader copied to clipboard

[MovableContainer] allow widget repositioning on non-touch devices

Open Commodore64user opened this issue 7 months ago • 6 comments

what's new

  • Added key event bindings in MovableContainer:init() to allow users to move the dialog up or down using keyboard modifiers (Shift or ScreenKB) combined with arrow keys (Up and Down). These events trigger the new MovePosition event.
  • Added a property is_movable_with_keys to the MovableContainer class, that allows disabling it on widget where it is not necessary or not desirable, like dictionary widget.
  • Introduced the MovableContainer:onMovePosition(is_moving_to_top) method to handle dialog repositioning. This method calculates the new vertical position based on the screen height, dialog height, and padding, updates the dialog's offset, and forces a screen redraw to reflect the changes.

screen recording

buttondialog
  • closes #12596

This change is Reviewable

Commodore64user avatar May 01 '25 00:05 Commodore64user

Can it be done in MovableContainer to apply to all movable widgets?

hius07 avatar May 01 '25 03:05 hius07

I thought about that, but that would mean losing two shortcuts, with dictionary one for example, it would mean getting movement (not really needed) and losing access to text selection.

Edit: but thinking more clearly now, i guess it could have a property that is set on/off and when off (moving not needed), it frees up the shortcuts.

Commodore64user avatar May 01 '25 08:05 Commodore64user

can you all see the screen recording? I opened this page on "edge" and the .mov is not shown there, so now I am wondering, can other browsers also not play it?

Commodore64user avatar May 01 '25 13:05 Commodore64user

I can't atm om my phone.

Frenzie avatar May 01 '25 13:05 Frenzie

android I figure... mmm I'll have to convert to .mp4 from now on then. Do let me know if the browser works though

Commodore64user avatar May 01 '25 14:05 Commodore64user

Do let me know if the browser works though

Works for me in-browser with Firefox. With Edge, it is downloaded.

poire-z avatar May 01 '25 20:05 poire-z

Any other relevant comments here?

Commodore64user avatar May 24 '25 09:05 Commodore64user