slight changes to clipboard history preview and item delegate
This commit is contained in:
@@ -27,8 +27,7 @@ Text {
|
||||
enabled: root.animate
|
||||
|
||||
SequentialAnimation {
|
||||
Anim {
|
||||
property: root.animateProp
|
||||
TAnim {
|
||||
target: root
|
||||
to: root.animateFrom
|
||||
type: Anim.FastEffects
|
||||
@@ -37,12 +36,18 @@ Text {
|
||||
PropertyAction {
|
||||
}
|
||||
|
||||
Anim {
|
||||
property: root.animateProp
|
||||
TAnim {
|
||||
target: root
|
||||
to: root.animateTo
|
||||
type: Anim.DefaultEffects
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
component TAnim: Anim {
|
||||
duration: root.animateDuration / 2
|
||||
properties: root.animateProp.split(",").length > 1 ? root.animateProp : ""
|
||||
property: root.animateProp.split(",").length === 1 ? root.animateProp : ""
|
||||
target: root
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ Item {
|
||||
anchors.leftMargin: Appearance.spacing.normal
|
||||
anchors.top: parent.top
|
||||
color: DynamicColors.tPalette.m3surfaceContainer
|
||||
implicitWidth: ClipHistory.previewIsImage ? Math.max(Math.min(imagePreview.sourceSize.width + imagePreview.anchors.margins * 2, Config.clipboard.sizes.previewWidth), Config.clipboard.sizes.minPreviewWidth) : Math.max(Math.min(textPreview.paintedWidth + textPreview.anchors.margins * 2, Config.clipboard.sizes.previewWidth), Config.clipboard.sizes.minPreviewWidth)
|
||||
implicitWidth: ClipHistory.previewIsImage ? Math.max(Math.min(imagePreview.sourceSize.width + Appearance.padding.large * 2, Config.clipboard.sizes.previewWidth), Config.clipboard.sizes.minPreviewWidth) : Math.max(Math.min(textPreview.paintedWidth + textPreview.anchors.margins * 2, Config.clipboard.sizes.previewWidth), Config.clipboard.sizes.minPreviewWidth)
|
||||
radius: 25
|
||||
|
||||
Behavior on implicitWidth {
|
||||
@@ -96,8 +96,7 @@ Item {
|
||||
Image {
|
||||
id: imagePreview
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.margins: Appearance.padding.large
|
||||
anchors.centerIn: parent
|
||||
asynchronous: true
|
||||
cache: false
|
||||
fillMode: Image.PreserveAspectFit
|
||||
@@ -106,6 +105,7 @@ Item {
|
||||
smooth: true
|
||||
source: ClipHistory.previewImageSource
|
||||
visible: ClipHistory.previewIsImage && ClipHistory.previewImageSource !== ""
|
||||
width: Math.min(sourceSize.width, Config.clipboard.sizes.previewWidth)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,33 +133,31 @@ Item {
|
||||
flickable: view
|
||||
minimumSize: 0.1
|
||||
}
|
||||
delegate: RowLayout {
|
||||
delegate: CustomRect {
|
||||
id: clipItem
|
||||
|
||||
readonly property bool isImage: ClipHistory.entryIsImage(modelData)
|
||||
required property string modelData
|
||||
|
||||
height: root.itemHeight
|
||||
implicitHeight: root.itemHeight
|
||||
implicitWidth: view.width
|
||||
radius: textLayer.pressed ? (Appearance.rounding.small / 2) : Appearance.rounding.small
|
||||
|
||||
Behavior on radius {
|
||||
Anim {
|
||||
type: Anim.FastEffects
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
spacing: Appearance.spacing.small
|
||||
width: view.width
|
||||
|
||||
CustomClippingRect {
|
||||
id: textRect
|
||||
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
radius: textLayer.pressed ? (Appearance.rounding.small / 2) : Appearance.rounding.small
|
||||
|
||||
Behavior on Layout.preferredWidth {
|
||||
Anim {
|
||||
type: Anim.FastEffects
|
||||
}
|
||||
}
|
||||
Behavior on radius {
|
||||
Anim {
|
||||
type: Anim.FastEffects
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
id: textWrapper
|
||||
@@ -213,21 +211,6 @@ Item {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StateLayer {
|
||||
id: textLayer
|
||||
|
||||
onClicked: ClipHistory.copy(clipItem.modelData)
|
||||
}
|
||||
}
|
||||
|
||||
IconButton {
|
||||
Layout.bottomMargin: Appearance.padding.normal
|
||||
Layout.fillHeight: true
|
||||
Layout.preferredWidth: height
|
||||
Layout.topMargin: Appearance.padding.normal
|
||||
icon: "content_copy"
|
||||
isToggle: false
|
||||
}
|
||||
|
||||
IconButton {
|
||||
@@ -238,6 +221,15 @@ Item {
|
||||
inactiveColor: Qt.alpha(DynamicColors.palette.m3error, 0.8)
|
||||
inactiveOnColor: DynamicColors.palette.m3onError
|
||||
isToggle: false
|
||||
|
||||
onClicked: ClipHistory.deleteEntry(clipItem.modelData)
|
||||
}
|
||||
}
|
||||
|
||||
StateLayer {
|
||||
id: textLayer
|
||||
|
||||
onClicked: ClipHistory.copy(clipItem.modelData)
|
||||
}
|
||||
}
|
||||
highlight: CustomRect {
|
||||
|
||||
Reference in New Issue
Block a user