View Single Post
Old 06-21-2019, 04:28 PM   #18
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,809
Karma: 6000000
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by BeckyEbook View Post
I know, I know ... an old thread, discussed many times, and also linked to an even older one.
It worried me a few years (!), but I think I have an idea that should appeal to both programmers and users.

I know exactly how to check the semantics (guide in opf, landmarks in nav, hover or report), but I want to SEE immediately those files that have set semantics.

And ... I succeeded.

I have the "X" icon assigned to .xhtml files by default (other people usually have a browser icon there). An icon with a checkmark means a file with semantics. I suggest the default icon "document-validate_16px.png" for testing

Now, when checkmark (or something else) I know straight away that there is semantics in this file and then I can easily look at the tooltip. When an ebook has 100 chapters - it makes a difference!

The change requires only two lines of code.
File: \src\MainUI\OPFModel.cpp
Code:
        if (semantic_type_all.contains(path)) {
            tooltip += " (" + semantic_type_all[path] + ")";
            item->setIcon(QIcon(QString::fromUtf8(":/main/document-validate_16px.png")));
        }
        if (manifest_properties_all.contains(path)) {
            tooltip += " [" + manifest_properties_all[path] + "]";
            item->setIcon(QIcon(QString::fromUtf8(":/main/document-validate_16px.png")));
        }
Only two things are worrying me:
1. It rather works in Windows, but since Sigil is a multi-system program, the solution should work everywhere, including Linux and Mac. Can anyone build a version in these systems and check it out?

2. Is this idea just an unnecessary bloat or a useful change?

Proof of concept – animated gif.
Mixing Icons and Text on MacOS systems has many bugs in Qt (especially with tabs) which is why we remove the icons from tabs on Mac now.

So this would not be my preferred solution.
KevinH is offline   Reply With Quote