Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
Breeze Style for QQC2
Commits
812dc857
Commit
812dc857
authored
Mar 05, 2021
by
Noah Davis
🌵
Browse files
[Delegates, MenuItem] Fix disabled colors
somehow -1 works for resetting the colorset
parent
be0c2411
Changes
7
Hide whitespace changes
Inline
Side-by-side
style/qtquickcontrols/CheckDelegate.qml
View file @
812dc857
...
...
@@ -43,13 +43,7 @@ T.CheckDelegate {
icon.width
:
Kirigami
.
Units
.
iconSizes
.
auto
icon.height
:
Kirigami
.
Units
.
iconSizes
.
auto
Kirigami.Theme.colorSet
:
{
if
(
control
.
down
||
control
.
highlighted
)
{
return
Kirigami
.
Theme
.
Button
}
else
{
return
parent
.
Kirigami
.
Theme
.
colorSet
??
Kirigami
.
Theme
.
View
}
}
Kirigami.Theme.colorSet
:
control
.
down
||
control
.
highlighted
?
Kirigami
.
Theme
.
Button
:
-
1
Kirigami.Theme.inherit
:
!
background
||
!
background
.
visible
&&
!
(
control
.
highlighted
||
control
.
down
)
contentItem
:
IconLabelContent
{
...
...
style/qtquickcontrols/ItemDelegate.qml
View file @
812dc857
...
...
@@ -42,13 +42,7 @@ T.ItemDelegate {
icon.width
:
Kirigami
.
Units
.
iconSizes
.
auto
icon.height
:
Kirigami
.
Units
.
iconSizes
.
auto
Kirigami.Theme.colorSet
:
{
if
(
control
.
down
||
control
.
highlighted
)
{
return
Kirigami
.
Theme
.
Button
}
else
{
return
parent
.
Kirigami
.
Theme
.
colorSet
??
Kirigami
.
Theme
.
View
}
}
Kirigami.Theme.colorSet
:
control
.
down
||
control
.
highlighted
?
Kirigami
.
Theme
.
Button
:
-
1
Kirigami.Theme.inherit
:
!
background
||
!
background
.
visible
&&
!
(
control
.
highlighted
||
control
.
down
)
contentItem
:
IconLabelContent
{
...
...
style/qtquickcontrols/Menu.qml
View file @
812dc857
// NOTE: check this
/*
SPDX-FileCopyrightText: 2017 Marco Martin <mart@kde.org>
SPDX-FileCopyrightText: 2017 The Qt Company Ltd.
...
...
@@ -18,7 +17,7 @@ import "impl"
T.Menu
{
id
:
control
property
bool
__hasIndicators
:
false
property
bool
__hasIcons
:
false
property
bool
__hasArrows
:
false
...
...
@@ -30,19 +29,18 @@ T.Menu {
contentHeight
+
topPadding
+
bottomPadding
)
margins
:
0
overlap
:
background
.
border
.
width
overlap
:
background
&&
background
.
hasOwnProperty
(
"
border
"
)
?
background
.
border
.
width
:
0
delegate
:
Controls.MenuItem
{
__reserveSpaceForIndicator
:
control
.
__hasIndicators
__reserveSpaceForIcon
:
control
.
__hasIcons
__reserveSpaceForArrow
:
control
.
__hasArrows
}
// The default contentItem is a ListView, which has its own contentItem property,
// so delegates will be created as children of control.contentItem.contentItem
delegate
:
Controls.MenuItem
{}
contentItem
:
ListView
{
implicitHeight
:
contentHeight
implicitWidth
:
contentWidth
model
:
control
.
contentModel
highlightMoveDuration
:
Kirigami
.
Units
.
shortDuration
//
highlightMoveVelocity:
contentHeight
highlightMoveVelocity
:
Kirigami
.
Units
.
gridUnit
*
20
highlight
:
ListViewHighlight
{
currentIndex
:
control
.
currentIndex
count
:
control
.
count
...
...
@@ -51,42 +49,21 @@ T.Menu {
// using it causes separators and disabled items to be highlighted
keyNavigationWraps
:
true
interactive
:
Window
.
window
?
contentHeight
+
control
.
topPadding
+
control
.
bottomPadding
>
Window
.
window
.
height
:
false
clip
:
true
// Makes it so you can't drag/flick the list view around unless the menu is taller than the window
interactive
:
Window
.
window
?
contentHeight
+
control
.
topPadding
+
control
.
bottomPadding
>
Window
.
window
.
height
:
false
clip
:
interactive
// Only needed when the ListView can be dragged/flicked
currentIndex
:
control
.
currentIndex
||
0
ScrollBar.vertical
:
Controls.ScrollBar
{}
}
//Connections {
//target: control.contentItem.contentItem
//function onChildrenChanged()
//{
//for (var i in control.contentItem.contentItem.children) {
//var child = control.contentItem.contentItem.children[i];
//if (child.indicator && child.indicator.visible) {
//control.__hasIndicators = true;
//}
//if (child.contentItem && child.contentItem.hasIcon) {
//control.__hasIcons = true;
//}
//if (child.arrow && child.arrow.visible) {
//control.__hasArrows = true
//}
//}
//}
//}
enter
:
Transition
{
ParallelAnimation
{
NumberAnimation
{
property
:
"
opacity
"
from
:
0
to
:
1
easing.type
:
Easing
.
Out
Quad
easing.type
:
Easing
.
Out
Cubic
duration
:
Kirigami
.
Units
.
shortDuration
}
}
...
...
@@ -98,7 +75,7 @@ T.Menu {
property
:
"
opacity
"
from
:
1
to
:
0
easing.type
:
Easing
.
OutQuad
easing.type
:
Easing
.
InCubic
duration
:
Kirigami
.
Units
.
shortDuration
}
}
...
...
@@ -115,7 +92,7 @@ T.Menu {
width
:
Kirigami
.
Units
.
smallBorder
}
Medium
Shadow
{
Large
Shadow
{
radius
:
parent
.
radius
}
}
...
...
style/qtquickcontrols/MenuItem.qml
View file @
812dc857
...
...
@@ -19,13 +19,7 @@ T.MenuItem {
property
bool
__reserveSpaceForArrow
:
true
Kirigami.Theme.colorSet
:
Kirigami
.
Theme
.
Button
Kirigami.Theme.colorSet
:
{
if
(
control
.
down
||
control
.
highlighted
)
{
return
Kirigami
.
Theme
.
Button
}
else
{
return
parent
.
Kirigami
.
Theme
.
colorSet
??
Kirigami
.
Theme
.
Window
}
}
Kirigami.Theme.colorSet
:
control
.
down
||
control
.
highlighted
?
Kirigami
.
Theme
.
Button
:
-
1
Kirigami.Theme.inherit
:
!
background
||
!
background
.
visible
&&
!
(
control
.
highlighted
||
control
.
down
)
implicitWidth
:
Math
.
max
(
implicitBackgroundWidth
+
leftInset
+
rightInset
,
...
...
style/qtquickcontrols/RadioDelegate.qml
View file @
812dc857
...
...
@@ -43,13 +43,7 @@ T.RadioDelegate {
icon.width
:
Kirigami
.
Units
.
iconSizes
.
auto
icon.height
:
Kirigami
.
Units
.
iconSizes
.
auto
Kirigami.Theme.colorSet
:
{
if
(
control
.
down
||
control
.
highlighted
)
{
return
Kirigami
.
Theme
.
Button
}
else
{
return
parent
.
Kirigami
.
Theme
.
colorSet
??
Kirigami
.
Theme
.
View
}
}
Kirigami.Theme.colorSet
:
control
.
down
||
control
.
highlighted
?
Kirigami
.
Theme
.
Button
:
-
1
Kirigami.Theme.inherit
:
!
background
||
!
background
.
visible
&&
!
(
control
.
highlighted
||
control
.
down
)
contentItem
:
IconLabelContent
{
...
...
style/qtquickcontrols/SwipeDelegate.qml
View file @
812dc857
...
...
@@ -41,13 +41,7 @@ T.SwipeDelegate {
icon.width
:
Kirigami
.
Units
.
iconSizes
.
auto
icon.height
:
Kirigami
.
Units
.
iconSizes
.
auto
Kirigami.Theme.colorSet
:
{
if
(
control
.
down
||
control
.
highlighted
)
{
return
Kirigami
.
Theme
.
Button
}
else
{
return
parent
.
Kirigami
.
Theme
.
colorSet
??
Kirigami
.
Theme
.
View
}
}
Kirigami.Theme.colorSet
:
control
.
down
||
control
.
highlighted
?
Kirigami
.
Theme
.
Button
:
-
1
Kirigami.Theme.inherit
:
!
background
||
!
background
.
visible
&&
!
(
control
.
highlighted
||
control
.
down
)
contentItem
:
IconLabelContent
{
...
...
style/qtquickcontrols/SwitchDelegate.qml
View file @
812dc857
...
...
@@ -43,13 +43,7 @@ T.SwitchDelegate {
icon.width
:
Kirigami
.
Units
.
iconSizes
.
auto
icon.height
:
Kirigami
.
Units
.
iconSizes
.
auto
Kirigami.Theme.colorSet
:
{
if
(
control
.
down
||
control
.
highlighted
)
{
return
Kirigami
.
Theme
.
Button
}
else
{
return
parent
.
Kirigami
.
Theme
.
colorSet
??
Kirigami
.
Theme
.
View
}
}
Kirigami.Theme.colorSet
:
control
.
down
||
control
.
highlighted
?
Kirigami
.
Theme
.
Button
:
-
1
Kirigami.Theme.inherit
:
!
background
||
!
background
.
visible
&&
!
(
control
.
highlighted
||
control
.
down
)
contentItem
:
IconLabelContent
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment