Unreadable headers in information sidebar
Open, Needs TriagePublic

Description

Headers like File Time: in SidebarInformationMeta Information sometimes are hardly readable. This happens either when starting Gwenview normally and switching to fullscreen, or when starting in fullscreen (gwenview -f) and switching to normal mode.

Been looking into this, and I can see the problem, but unsure of the best fix.

=== Problem ===
Those headings, like many places, have a custom palette set where the text alpha is modified. Therefore when the palette is changed (going to fullscreen and back), the palette isn't update.
Now, whenever the sidebar is toggled, AND when you switch between pages, these headings along with the rest of the content are cleared and recreated, fixing the issue.
So the issue is only present when the sidebar is open, and one switches to/from fullscreen.

=== Solution ===
I think the simplest solution is to find a way to update the contents when switching to/from fullscreen. Since this update happens every time you switch to the Information tab anyway, I don't think this is a waste of resources. (Rather than separating out the palette code and building some 'update palette' methods/signals/slots.)

But the issue with this solution is due to the structure of the code. Somehow we need to get from MainWindow::toggleFullScreen to InfoContextManagerItem::updateSideBarContent, which isn't simple, and would I believe require some mechanism similar to the selectionChanged signal.
On the other hand, we can simply call selectionChanged on mContextManager and achieve the result we want, but it's a bit hacky.

So either:

  1. Build some generic mechanism for MainWindow to be able to manually update sidebar content
  2. Just pretend the selection was changed to achieve the same result

    What do you think? Hopefully I'm making sense.
rkflx created this task.Mar 1 2018, 10:47 PM

(Will look into it later.)

huoni added a comment.Mar 3 2018, 9:56 AM

Just to clarify option two in my above comment, adding

emit d->mContextManager->selectionChanged();

to line 1291 of mainwindow.cpp (at the end of toggleFullScreen) fixes this issue. Simple fix, but seems hacky to me as the selection isn't actually changing, it's just using it to trigger a refresh.