zzag added a comment.

  > this is because you have to rely on maxIconWidth, even if the current item 
has no icon, when computing the checkbox space.
  
  I've came up with something like this
  
    if( showIcon && menuItemOption->maxIconWidth > 0 )
    {
        int dx = (iconRect.left() - Metrics::CheckBox_Size) / 2;
        checkBoxRect.moveLeft( dx );
    } else {
        int dx = (textRect.left() - Metrics::CheckBox_Size) / 2;
        checkBoxRect.moveLeft( dx );
    }
  
  so, it centers properly checkboxes in menu items with and without icons
  
  F5709869: f.png <https://phabricator.kde.org/F5709869>
  
  F5709874: g.png <https://phabricator.kde.org/F5709874>
  
  //(it can be simplified with a ternary operator)//
  
  is it a good approach?

REPOSITORY
  R31 Breeze

REVISION DETAIL
  https://phabricator.kde.org/D10480

To: zzag, #breeze, #vdg, hpereiradacosta
Cc: plasma-devel, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, 
abetts, sebas, apol, mart

Reply via email to