Changeset View
Changeset View
Standalone View
Standalone View
lookandfeel/contents/components/ActionButton.qml
Show All 12 Lines | |||||
13 | * | 13 | * | ||
14 | * You should have received a copy of the GNU Library General Public | 14 | * You should have received a copy of the GNU Library General Public | ||
15 | * License along with this program; if not, write to the | 15 | * License along with this program; if not, write to the | ||
16 | * Free Software Foundation, Inc., | 16 | * Free Software Foundation, Inc., | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | import QtQuick 2.2 | 20 | import QtQuick 2.2 | ||
21 | import QtGraphicalEffects 1.0 | ||||
22 | | ||||
21 | import org.kde.plasma.core 2.0 as PlasmaCore | 23 | import org.kde.plasma.core 2.0 as PlasmaCore | ||
22 | import org.kde.plasma.components 2.0 as PlasmaComponents | 24 | import org.kde.plasma.components 2.0 as PlasmaComponents | ||
23 | 25 | | |||
24 | Item { | 26 | Item { | ||
25 | id: root | 27 | id: root | ||
26 | property alias text: label.text | 28 | property alias text: label.text | ||
27 | property alias iconSource: icon.source | 29 | property alias iconSource: icon.source | ||
28 | property alias containsMouse: mouseArea.containsMouse | 30 | property alias containsMouse: mouseArea.containsMouse | ||
29 | property alias font: label.font | 31 | property alias font: label.font | ||
30 | signal clicked | 32 | signal clicked | ||
31 | 33 | | |||
32 | activeFocusOnTab: true | 34 | activeFocusOnTab: true | ||
33 | 35 | | |||
34 | property int iconSize: units.gridUnit * 3 | 36 | property int iconSize: units.gridUnit * 3 | ||
35 | 37 | | |||
36 | implicitWidth: Math.max(iconSize + units.largeSpacing * 2, label.contentWidth) | 38 | implicitWidth: Math.max(iconSize + units.largeSpacing * 2, label.contentWidth) | ||
37 | implicitHeight: iconSize + units.smallSpacing + label.implicitHeight | 39 | implicitHeight: iconSize + units.smallSpacing + label.implicitHeight | ||
38 | 40 | | |||
41 | DropShadow { | ||||
42 | anchors.fill: content | ||||
43 | source: content | ||||
44 | horizontalOffset: 0 | ||||
45 | verticalOffset: 1 | ||||
46 | radius: 12 | ||||
47 | samples: 32 | ||||
48 | spread: 0.35 | ||||
49 | color: PlasmaCore.ColorScope.backgroundColor | ||||
mart: those and the stronger shadows to the clock seems unrelated, as on this contrast is doing by… | |||||
The stronger clock shadows do show up on the login screen since before the UI shows up, you see the clock with its shadow. I can move the button shadow change to the other patch though. ngraham: The stronger clock shadows do show up on the login screen since before the UI shows up, you see… | |||||
50 | } | ||||
51 | | ||||
52 | // This container holds the icon and label so we can apply a shadow to both | ||||
53 | Item { | ||||
54 | id: content | ||||
55 | anchors.fill: parent | ||||
39 | PlasmaCore.IconItem { | 56 | PlasmaCore.IconItem { | ||
40 | id: icon | 57 | id: icon | ||
41 | anchors { | 58 | anchors { | ||
42 | top: parent.top | 59 | top: parent.top | ||
43 | horizontalCenter: parent.horizontalCenter | 60 | horizontalCenter: parent.horizontalCenter | ||
44 | } | 61 | } | ||
45 | width: iconSize | 62 | width: iconSize | ||
46 | height: iconSize | 63 | height: iconSize | ||
Show All 9 Lines | 70 | anchors { | |||
56 | left: parent.left | 73 | left: parent.left | ||
57 | right: parent.right | 74 | right: parent.right | ||
58 | } | 75 | } | ||
59 | horizontalAlignment: Text.AlignHCenter | 76 | horizontalAlignment: Text.AlignHCenter | ||
60 | verticalAlignment: Text.AlignTop | 77 | verticalAlignment: Text.AlignTop | ||
61 | wrapMode: Text.WordWrap | 78 | wrapMode: Text.WordWrap | ||
62 | font.underline: root.activeFocus | 79 | font.underline: root.activeFocus | ||
63 | } | 80 | } | ||
81 | } | ||||
64 | 82 | | |||
65 | MouseArea { | 83 | MouseArea { | ||
66 | id: mouseArea | 84 | id: mouseArea | ||
67 | hoverEnabled: true | 85 | hoverEnabled: true | ||
68 | onClicked: root.clicked() | 86 | onClicked: root.clicked() | ||
69 | anchors.fill: parent | 87 | anchors.fill: parent | ||
70 | } | 88 | } | ||
71 | 89 | | |||
72 | Keys.onEnterPressed: clicked() | 90 | Keys.onEnterPressed: clicked() | ||
73 | Keys.onReturnPressed: clicked() | 91 | Keys.onReturnPressed: clicked() | ||
74 | Keys.onSpacePressed: clicked() | 92 | Keys.onSpacePressed: clicked() | ||
75 | 93 | | |||
76 | Accessible.onPressAction: clicked() | 94 | Accessible.onPressAction: clicked() | ||
77 | Accessible.role: Accessible.Button | 95 | Accessible.role: Accessible.Button | ||
78 | Accessible.name: label.text | 96 | Accessible.name: label.text | ||
79 | } | 97 | } |
those and the stronger shadows to the clock seems unrelated, as on this contrast is doing by darkening the background and not adding unneeded shadows.
this seems more the unrelated change to the login screen to not have the blurred background?