Problem with icons

Issue #52 resolved
Anonymous created an issue

I cannot see several icons in menu (like for example one of help icon, or paste icon). The latest source from git (access at 30.03.2012)

Comments (8)

  1. Rui repo owner

    Cheers, thanks for the report.

    I'm not seeing this. Can you provide some more details about you environment?

    • Qt version
    • Distribution/Os
    • Desktop environment
  2. Anonymous

    Hello there, I got the same issue, here are my data:

    - Archlinux (3.2 Kernel), - Desktop: Kde 4.8 - Qt-Version: qt-4.8.1-1

    Following icons are missing: Print, Back (Forward is there), cut, copy, paste and help (search help is there)

    best regards, jan

  3. Anonymous


    same issue Archlinux (3.2 ck Kernel), - Desktop: Kde 4.8.2 - Qt-Version: qt-4.8.1 All icons are missing but the "launch make" one.


  4. Rui repo owner

    As much as I try I seem to be unable to replicate this. On a virtual machine with a freshly installed Arch(kde 4.8.2) I am unable to replicate it.

    When vim-qt loads the icons for the toolbar it tries to get the icons from two locations:

    1. From the current desktop theme
    2. or from a set of oxygen icons shipped with vim-qt

    I'm clearly missing something here :S

  5. Rui repo owner

    I'm really sorry about the delay on this, I promise this is in my TODO list :D

    So it seems this only happens when the system is configured for other language (I assume not English??) - which is why I could not replicate this at all, my system is alway in english :D

    For example this will miss some icons in the toolbar

    $ LC_ALL=pt_PT qvim

    But this should be Ok

    $ LC_ALL=pt_PT qvim

    The following patch should address it

    diff --git a/src/qt/vimaction.cpp b/src/qt/vimaction.cpp
    index cb72350..dcd09ea 100644
    --- a/src/qt/vimaction.cpp
    +++ b/src/qt/vimaction.cpp
    @@ -3,8 +3,18 @@
     VimAction::VimAction(vimmenu_T* menu, QObject *parent)
     :QAction(parent), m_menu(menu)
    +       QString iconName;
    +#ifdef FEAT_MULTI_LANG
    +       iconName = QString::fromUtf8((char*)
    +                                       (menu->en_name ? menu->en_name : menu->name)
    +                                       );
    +       iconName = QString::fromUtf8((char*)menu->name);
            if ( menu_is_toolbar(menu->parent->name) ) {
    -               setIcon( VimWrapper::icon(QString::fromUtf8((char*)menu->name)) );
    +               setIcon( VimWrapper::icon(iconName) );
                    setToolTip(QString::fromUtf8((char*) menu->strings[MENU_INDEX_TIP]));
            } else {
                    setText( QString::fromUtf8((char*)menu->name) );

    The problem in a nutshell is:

    1. We build the toolbar entries from from vimmenu_T struct Vim gives us. 2. Menu entry names were used as icon identifiers, and mapped into icons 3. When the menu/toolbar are in a different language this breaks down because the names change.

    The quickest fix to get this working is probably the patch above, the correct solution is to properly map Vim icon identifiers into our icons (:h builtin-tools provides the full icon table).

    On a side note, it seems clear that we are also missing other features in the toolbar icons, such as the ability to load a custom icon.

  6. Log in to comment