View Single Post
Old 01-19-2024, 02:24 PM   #26
Joentjuh
Junior Member
Joentjuh began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Apr 2014
Location: Netherlands
Device: Kobo Libra H2O
Update (what I have so far):
Running from source (git), edited src/calibre/gui2/library/delegates.py
Code:
$ mkdir dev && cd dev
$ git clone https://github.com/kovidgoyal/bypy.git
$ git clone https://github.com/kovidgoyal/calibre.git
$ cd calibre
$ ./setup.py bootstrap
$ ./setup.py install --staging-root ./
[changed delegates.py]
$ ./run-local calibre
Working column edit:
Code:
  [orig initial_geometry]:  PyQt6.QtCore.QRect(887, 0, 65, 30)
  _width: orig: 65  max: 64  new: 64
  >> new_width <= orig_width
  [new initial_geometry]:  PyQt6.QtCore.QRect(887, 0, 65, 30)
QAbstractItemView::closeEditor called with an editor that does not belong to this view
Not working column edit:
Code:
  [orig initial_geometry]:  PyQt6.QtCore.QRect(952, 0, 41, 30)
  _width: orig: 41  max: 64  new: 64
  >> new_width > orig_width
  LayoutDirection.LeftToRight
  space_ left: 952  right: -888
  consume_ left: 952  right: -888
  delta_ x: -952  width: -929
  [new initial_geometry]:  PyQt6.QtCore.QRect(0, 0, 64, 30)
QAbstractItemView::closeEditor called with an editor that does not belong to this view
The LayoutDirection block seems to be the issue... no idea why exactly, copying over the delegates.py file from 7.2 isn't enough.
But the compiled version from https://download.calibre-ebook.com/7.2.0/ (still) doesn't have the issue, so possible the problem lies elsewhere...?

Adding
Code:
delta_x = 0
delta_width = new_width
after the LayoutDirection if/else appears to have solved it for me (line 118).
As a bonus though, this change solved another issue I had with Yes/No columns (field loses focus after a change)

If there are things you'd like me to try further I'm willing, but for me this is about what I can do with the knowledge (don't know anything about Qt/GUI development) and time available that I have...

Edit: (personal reminder for if I ever have to do this again)
Spoiler:

$ mkdir /opt/calibre-dev
$ ./setup.py install --prefix=/opt/calibre-dev
$ ln -s /opt/calibre-dev/bin/calibre ~/bin/
edit files in [/opt/calibre-dev/lib/calibre]

Last edited by Joentjuh; 01-19-2024 at 04:05 PM.
Joentjuh is offline   Reply With Quote