feat: complete quickshell redesign
This commit is contained in:
1 parent
1eb0820083
commit
0ff727898a
25 files changed
+1410
-401
No files matched your search
@@ -1,26 +1,47 @@
|
||||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
import "."
|
||||
|
||||
// Base panel/card chrome shared by menus, pickers, and dialogs: rounded
|
||||
// background, border, optional colored glow.
|
||||
Rectangle {
|
||||
// Base panel/card chrome shared by menus, pickers, and dialogs: sharp
|
||||
// corners, a solid 2px border, and a hard offset "shadow" - a flat duplicate
|
||||
// rectangle displaced down-right, never blurred. `glow` switches the border
|
||||
// and shadow from the default crust to `tint` (DESIGN.md's "Focused /
|
||||
// Active" state, also used for danger/selected emphasis). `pressed`
|
||||
// collapses the shadow and slides the face onto it - the mechanical
|
||||
// depression press effect. Children declared on a Surface instance attach
|
||||
// to the face, not the outer Item, so they translate together with it.
|
||||
Item {
|
||||
id: surface
|
||||
|
||||
property color tint: Theme.colors.border
|
||||
default property alias content: face.data
|
||||
property alias color: face.color
|
||||
property color tint: Theme.colors.primary
|
||||
property bool glow: false
|
||||
property bool pressed: false
|
||||
|
||||
radius: Theme.geometry.radiusMedium
|
||||
color: Theme.colors.background
|
||||
border.color: tint
|
||||
border.width: 1
|
||||
readonly property int offset: glow ? Theme.elevation.high : Theme.elevation.low
|
||||
readonly property color edgeColor: glow ? tint : Theme.colors.crust
|
||||
|
||||
layer.enabled: glow
|
||||
layer.effect: MultiEffect {
|
||||
shadowEnabled: true
|
||||
shadowColor: surface.tint
|
||||
shadowOpacity: Theme.elevation.medium.opacity
|
||||
shadowBlur: Theme.elevation.medium.blur
|
||||
shadowVerticalOffset: 2
|
||||
Rectangle {
|
||||
id: shadow
|
||||
x: surface.offset
|
||||
y: surface.offset
|
||||
width: surface.width
|
||||
height: surface.height
|
||||
color: surface.edgeColor
|
||||
visible: !surface.pressed
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: face
|
||||
x: surface.pressed ? surface.offset : 0
|
||||
y: surface.pressed ? surface.offset : 0
|
||||
width: surface.width
|
||||
height: surface.height
|
||||
color: Theme.colors.background
|
||||
border.width: Theme.geometry.borderWidth
|
||||
border.color: surface.edgeColor
|
||||
|
||||
Behavior on x { NumberAnimation { duration: Theme.animation.durationFast; easing.type: Easing.Linear } }
|
||||
Behavior on y { NumberAnimation { duration: Theme.animation.durationFast; easing.type: Easing.Linear } }
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user