• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDEUI

KStyle::MenuItem

KStyle::MenuItem Struct Reference
[KStyle widget representation]

Describes an item in a menu. More...

#include <kstyle.h>

List of all members.

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/MenuBackground.
See also:
WT_MenuItem

Definition at line 827 of file kstyle.h.


Member Enumeration Documentation

enum KStyle::MenuItem::LayoutProp
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 832 of file kstyle.h.

enum KStyle::MenuItem::Primitive

Relevant Generic elements:

  • Generic::Text the text of the menu item
  • Generic::ArrowLeft Generic::ArrowRight arrows indicating a sub-menu.

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.

Separator 
ItemIndicator 

Definition at line 862 of file kstyle.h.


The documentation for this struct was generated from the following file:
  • kstyle.h

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal