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

KDEUI

  • KStyle
  • MenuItem
Public Types | List of all members
KStyle::MenuItem Struct Reference
KStyle widget representation

#include <kstyle.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 828 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 833 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 863 of file kstyle.h.


The documentation for this struct was generated from the following file:
  • kstyle.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal