Changeset View
Changeset View
Standalone View
Standalone View
src/declarativeimports/plasmacomponents3/TabButton.qml
Show All 28 Lines | 26 | T.TabButton { | |||
---|---|---|---|---|---|
29 | implicitWidth: contentItem.implicitWidth + leftPadding + rightPadding | 29 | implicitWidth: contentItem.implicitWidth + leftPadding + rightPadding | ||
30 | implicitHeight: contentItem.implicitHeight + topPadding + bottomPadding | 30 | implicitHeight: contentItem.implicitHeight + topPadding + bottomPadding | ||
31 | baselineOffset: contentItem.y + contentItem.baselineOffset | 31 | baselineOffset: contentItem.y + contentItem.baselineOffset | ||
32 | 32 | | |||
33 | padding: units.smallSpacing | 33 | padding: units.smallSpacing | ||
34 | 34 | | |||
35 | hoverEnabled: true | 35 | hoverEnabled: true | ||
36 | 36 | | |||
37 | contentItem: Label { | 37 | contentItem: GridLayout { | ||
38 | text: control.text | 38 | columns: control.display == T.AbstractButton.TextBesideIcon ? 2 : 1 | ||
39 | PlasmaCore.IconItem { | ||||
40 | id: icon | ||||
41 | Layout.fillWidth: true | ||||
42 | Layout.fillHeight: true | ||||
43 | colorGroup: PlasmaCore.Theme.ButtonColorGroup | ||||
44 | visible: source.length > 0 | ||||
45 | source: control.icon ? (control.icon.name || control.icon.source) : "" | ||||
46 | status: buttonSvg.hasElement("hint-focus-highlighted-background") && control.activeFocus && !control.pressed && !control.checked ? PlasmaCore.Svg.Selected : PlasmaCore.Svg.Normal | ||||
47 | } | ||||
48 | Label { | ||||
49 | Layout.fillWidth: true | ||||
50 | Layout.fillHeight: true | ||||
51 | visible: text.length > 0 | ||||
52 | text: control.Kirigami.MnemonicData.richTextLabel | ||||
39 | font: control.font | 53 | font: control.font | ||
40 | elide: Text.ElideRight | 54 | opacity: enabled || control.highlighted || control.checked ? 1 : 0.4 | ||
41 | opacity: enabled ? 1 : 0.3 | 55 | color: buttonSvg.hasElement("hint-focus-highlighted-background") && control.activeFocus && !control.down ? theme.highlightedTextColor : theme.buttonTextColor | ||
42 | color: PlasmaCore.ColorScope.textColor | | |||
43 | horizontalAlignment: Text.AlignHCenter | 56 | horizontalAlignment: Text.AlignHCenter | ||
44 | verticalAlignment: Text.AlignVCenter | 57 | verticalAlignment: Text.AlignVCenter | ||
58 | elide: Text.ElideRight | ||||
59 | } | ||||
45 | } | 60 | } | ||
46 | 61 | | |||
47 | background: Item {} | 62 | background: Item {} | ||
48 | } | 63 | } |