The change in #1048 prevented opening of blank tab and urls that are no longer valid. Now, we will need to open them as well, as we will need the exact number of tabs to reopen in order to correctly restore current tab index.
Clicking and hovering the description dropdown of zim no longer whites out. Replaced manual drawing with default handling as it is no longer necessary.
Before this change a library entry having keyboard focus (selected with
tab and up/down keys) was not readable since the text was displayed in
white colour on light blue background.
Now the library entry line separator extends all the way to the right
(into the book open/download control column).
This is achieved by having QStyledItemDelegate::paint() execute before
ContentManagerDelegate::paintBookState() and the latter must take care
to not paint over the line separator painted by the former.
Indirect access from ContentManagerModel to ContentManager (via
KiwixApp) contained a race condition that could lead to a crash.
Here is the call chain:
- In KiwixApp::init() the KiwixApp::mp_manager data member is initialized
as follows:
mp_manager = new ContentManager(&m_library, mp_downloader);
- ContentManager's constructor creates the model and the view:
mp_view = new ContentManagerView();
managerModel = new ContentManagerModel(this);
updateModel();
auto treeView = mp_view->getView();
treeView->setModel(managerModel);
treeView->show();
- This starts a cascade of asynchronous events that will eventually
result in ContentManagerModel::sort() being executed. The latter has
to call ContentManager::sortBy() and if it does so indirectly via
`KiwixApp::getContentManager()` before the constructor of
ContentManager has completed (and KiwixApp::mp_manager has been
assigned to) a crash is imminent.
This commit eliminates that issue.
- made the download ring a little darker so that it doesn't become
invisible when highlighted
- changed the background color of the button for the Open/Download actions
(drawn in the last column) from white to transparent so that it
doesn't look ugly on the highlighted line.
Now ContentManagerModel returns for 0th column an icon object that can
be painted by `QStyledItemDelegate::paint()` correctly (albeit in a
slightly less indented position).
As a side-effect of this minor improvement of the design, the thumbnail
column is included in highlighting on mouse hover.
Refactored existing file static function makeHttpUrl to a member function that retrieves the remote library url from the request manager. Will be used for implementing the preview functionality.
Created a ON-OFF action for Bookmark and added in Edit Menu Actions. Assigned shortcut Ctrl + D, which the Donation shortcut is now Ctrl + SHIFT + D. Action disabled for non-Zim tabs