KDELibs4Support

K4Style::MenuItem Struct Reference

#include <k4style.h>

Public Types

enum  LayoutProp {
  Margin, CheckAlongsideIcon = Margin + MarginInc, CheckWidth, CheckSpace,
  IconWidth, IconSpace, AccelSpace, ArrowSpace,
  ArrowWidth, SeparatorHeight, MinHeight, ActiveTextColor,
  TextColor, DisabledTextColor, ActiveDisabledTextColor
}
 
enum  Primitive {
  CheckColumn, CheckOn, CheckOff, RadioOn,
  RadioOff, CheckIcon, Separator, ItemIndicator
}
 

Detailed Description

Describes an item in a menu.

MenuItems are layouted like this:

  1. There are two MenuItem modes, toggled by LP_MenuItem_CheckAlongsideIcon. Horizontal layout inside the items is as follow:
    • LP_MenuItem_CheckAlongsideIcon disabled: |icon/checkmark|IconSpace|text|AccelSpace|accel|ArrowSpace|ArrowWidth|
    • LP_MenuItem_CheckAlongsideIcon enabled: |checkmark|CheckSpace|icon|IconSpace|text|AccelSpace|accel|ArrowSpace|ArrowWidth|
  2. The icon/checkmark column is at least LP_MenuItem_CheckWidth wide in all cases.
  3. Then Margin is applied outside that.
Note
For the subprimitives the passed rect is their own.
Background is erased with WT_Menu/Menu::Background.
See also
WT_MenuItem

Definition at line 782 of file k4style.h.

Member Enumeration Documentation

See also
setWidgetLayoutProp()
Enumerator
Margin 

(2) margin for each entry

CheckAlongsideIcon 

(0) Set to non-zero to have checkmarks painted separate from icons.

CheckWidth 

(12) size of the checkmark column (CheckAlongsideButton enabled).

CheckSpace 

(3) Space between the checkmark column and the icon column (CheckAlongsideButton enabled).

IconWidth 

(12) minimum size of the icon column

IconSpace 

(3) space between the icon column and text column

AccelSpace 

(0 ?) space between text and keyboard accelerator label

ArrowSpace 

(3) space between the text column and arrow column (indicating sub menus)

ArrowWidth 

(11) space to reserve for the menu arrow column

SeparatorHeight 

(0) heigh of separator

MinHeight 

(16) limit on the size of item content

ActiveTextColor 

(ColorMode(QPalette::HighlightedText)) color for active text and arrow

TextColor 

(ColorMode(QPalette::Text)) color for inactive text and arrow

DisabledTextColor 

(ColorMode(QPalette::Text)) color for inactive + disabled text and arrow

ActiveDisabledTextColor 

(ColorMode(QPalette::Text)) color for active + disabled text and arrow

Definition at line 786 of file k4style.h.

Relevant Generic elements:

See also
drawKStylePrimitive()
Enumerator
CheckColumn 

Background of the checkmark/icon column.

CheckOn 

The checkmark - checked.

CheckOff 

The checkmark - not checked.

RadioOn 

The checkmark of exclusive actions - selected.

RadioOff 

The checkmark of exclusive actions - not selected.

CheckIcon 

When CheckAlongsideIcon is disabled and item is checked: checkmark Indicator painted below the icon.

Definition at line 815 of file k4style.h.


The documentation for this struct was generated from the following file:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Aug 5 2020 22:56:35 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.