config moved to c++ plugin, removed old qml + fileview implementation
This commit is contained in:
@@ -6,7 +6,8 @@ import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import qs.Components
|
||||
import qs.Helpers
|
||||
import qs.Config
|
||||
import ZShell.Config
|
||||
import qs.Services
|
||||
|
||||
Item {
|
||||
id: root
|
||||
@@ -30,9 +31,9 @@ Item {
|
||||
anchors.left: parent.left
|
||||
anchors.right: entries.right
|
||||
anchors.top: parent.top
|
||||
color: DynamicColors.tPalette.m3surfaceContainer
|
||||
color: Colors.tPalette.m3surfaceContainer
|
||||
implicitHeight: 50
|
||||
radius: Appearance.rounding.full
|
||||
radius: Tokens.rounding.full
|
||||
|
||||
SearchBar {
|
||||
id: searchField
|
||||
@@ -41,7 +42,7 @@ Item {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
color: DynamicColors.palette.m3onSurface
|
||||
color: Colors.palette.m3onSurface
|
||||
placeholderText: "Search clipboard history..."
|
||||
|
||||
Keys.onDownPressed: view.incrementCurrentIndex()
|
||||
@@ -58,10 +59,10 @@ Item {
|
||||
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.left: entries.right
|
||||
anchors.leftMargin: Appearance.spacing.normal
|
||||
anchors.leftMargin: Tokens.spacing.normal
|
||||
anchors.top: parent.top
|
||||
color: DynamicColors.tPalette.m3surfaceContainer
|
||||
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(textPreviewColumn.width + textPreviewColumn.anchors.margins * 2, Config.clipboard.sizes.previewWidth), Config.clipboard.sizes.minPreviewWidth)
|
||||
color: Colors.tPalette.m3surfaceContainer
|
||||
implicitWidth: ClipHistory.previewIsImage ? Math.max(Math.min(imagePreview.sourceSize.width + Tokens.padding.large * 2, Config.clipboard.sizes.previewWidth), Config.clipboard.sizes.minPreviewWidth) : Math.max(Math.min(textPreviewColumn.width + textPreviewColumn.anchors.margins * 2, Config.clipboard.sizes.previewWidth), Config.clipboard.sizes.minPreviewWidth)
|
||||
radius: 25
|
||||
|
||||
Behavior on implicitWidth {
|
||||
@@ -74,7 +75,7 @@ Item {
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 0
|
||||
anchors.margins: Appearance.padding.normal
|
||||
anchors.margins: Tokens.padding.normal
|
||||
anchors.top: parent.top
|
||||
visible: !ClipHistory.previewIsImage
|
||||
|
||||
@@ -89,21 +90,21 @@ Item {
|
||||
required property int index
|
||||
required property var modelData
|
||||
|
||||
spacing: Appearance.spacing.normal
|
||||
spacing: Tokens.spacing.normal
|
||||
|
||||
CustomRect {
|
||||
color: lineRow.index % 2 ? DynamicColors.tPalette.m3surfaceContainer : "transparent"
|
||||
implicitHeight: lineText.paintedHeight + Appearance.padding.extraSmall * 2
|
||||
color: lineRow.index % 2 ? Colors.tPalette.m3surfaceContainer : "transparent"
|
||||
implicitHeight: lineText.paintedHeight + Tokens.padding.extraSmall * 2
|
||||
implicitWidth: 50
|
||||
|
||||
CustomText {
|
||||
id: number
|
||||
|
||||
anchors.margins: Appearance.padding.large
|
||||
anchors.margins: Tokens.padding.large
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
color: DynamicColors.palette.m3onSurfaceVariant
|
||||
font.pointSize: Appearance.font.size.small
|
||||
color: Colors.palette.m3onSurfaceVariant
|
||||
font.pointSize: Tokens.font.size.small
|
||||
text: lineRow.modelData.line
|
||||
}
|
||||
}
|
||||
@@ -113,7 +114,7 @@ Item {
|
||||
|
||||
RowLayout {
|
||||
height: lineText.height
|
||||
width: lineText.height + Appearance.spacing.extraSmall
|
||||
width: lineText.height + Tokens.spacing.extraSmall
|
||||
|
||||
Item {
|
||||
Layout.fillHeight: true
|
||||
@@ -121,10 +122,10 @@ Item {
|
||||
|
||||
CustomRect {
|
||||
anchors.centerIn: parent
|
||||
color: DynamicColors.tPalette.m3surfaceContainer
|
||||
color: Colors.tPalette.m3surfaceContainer
|
||||
implicitHeight: parent.height / 8
|
||||
implicitWidth: parent.height / 8
|
||||
radius: Appearance.rounding.full
|
||||
radius: Tokens.rounding.full
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,10 +135,10 @@ Item {
|
||||
|
||||
CustomRect {
|
||||
anchors.centerIn: parent
|
||||
color: DynamicColors.tPalette.m3surfaceContainer
|
||||
color: Colors.tPalette.m3surfaceContainer
|
||||
implicitHeight: parent.height / 8
|
||||
implicitWidth: parent.height / 8
|
||||
radius: Appearance.rounding.full
|
||||
radius: Tokens.rounding.full
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,10 +148,10 @@ Item {
|
||||
|
||||
CustomRect {
|
||||
anchors.centerIn: parent
|
||||
color: DynamicColors.tPalette.m3surfaceContainer
|
||||
color: Colors.tPalette.m3surfaceContainer
|
||||
implicitHeight: parent.height / 8
|
||||
implicitWidth: parent.height / 8
|
||||
radius: Appearance.rounding.full
|
||||
radius: Tokens.rounding.full
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -159,8 +160,8 @@ Item {
|
||||
CustomText {
|
||||
id: lineText
|
||||
|
||||
color: DynamicColors.palette.m3onSurface
|
||||
height: lineText.paintedHeight + Appearance.padding.extraSmall * 2
|
||||
color: Colors.palette.m3onSurface
|
||||
height: lineText.paintedHeight + Tokens.padding.extraSmall * 2
|
||||
text: lineRow.modelData.text.trim()
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
wrapMode: Text.Wrap
|
||||
@@ -191,7 +192,7 @@ Item {
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.top: search.bottom
|
||||
anchors.topMargin: Appearance.spacing.normal
|
||||
anchors.topMargin: Tokens.spacing.normal
|
||||
implicitWidth: Config.clipboard.sizes.width
|
||||
|
||||
CustomListView {
|
||||
@@ -203,7 +204,7 @@ Item {
|
||||
highlightRangeMode: ListView.ApplyRange
|
||||
preferredHighlightBegin: 0
|
||||
preferredHighlightEnd: height
|
||||
spacing: Appearance.spacing.normal
|
||||
spacing: Tokens.spacing.normal
|
||||
|
||||
CustomScrollBar.vertical: CustomScrollBar {
|
||||
flickable: view
|
||||
@@ -217,7 +218,7 @@ Item {
|
||||
|
||||
implicitHeight: root.itemHeight
|
||||
implicitWidth: view.width
|
||||
radius: textLayer.pressed ? (Appearance.rounding.small / 2) : Appearance.rounding.small
|
||||
radius: textLayer.pressed ? (Tokens.rounding.small / 2) : Tokens.rounding.small
|
||||
|
||||
Behavior on radius {
|
||||
Anim {
|
||||
@@ -227,7 +228,7 @@ Item {
|
||||
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
spacing: Appearance.spacing.small
|
||||
spacing: Tokens.spacing.small
|
||||
|
||||
CustomClippingRect {
|
||||
id: textRect
|
||||
@@ -249,9 +250,9 @@ Item {
|
||||
id: icon
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.margins: Appearance.padding.normal
|
||||
anchors.margins: Tokens.padding.normal
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
font.pointSize: Appearance.font.size.large
|
||||
font.pointSize: Tokens.font.size.large
|
||||
text: clipItem.isImage ? "image" : "text_fields"
|
||||
}
|
||||
|
||||
@@ -259,7 +260,7 @@ Item {
|
||||
id: text
|
||||
|
||||
anchors.left: icon.right
|
||||
anchors.margins: Appearance.spacing.normal
|
||||
anchors.margins: Tokens.spacing.normal
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
elide: Text.ElideRight
|
||||
text: clipItem.isImage ? qsTr("Image") : ClipHistory.displayText(clipItem.modelData)
|
||||
@@ -291,11 +292,11 @@ Item {
|
||||
|
||||
IconButton {
|
||||
Layout.fillHeight: true
|
||||
Layout.margins: Appearance.padding.normal
|
||||
Layout.margins: Tokens.padding.normal
|
||||
Layout.preferredWidth: height
|
||||
icon: "delete"
|
||||
inactiveColor: Qt.alpha(DynamicColors.palette.m3error, 0.8)
|
||||
inactiveOnColor: DynamicColors.palette.m3onError
|
||||
inactiveColor: Qt.alpha(Colors.palette.m3error, 0.8)
|
||||
inactiveOnColor: Colors.palette.m3onError
|
||||
isToggle: false
|
||||
|
||||
onClicked: ClipHistory.deleteEntry(clipItem.modelData)
|
||||
@@ -309,17 +310,17 @@ Item {
|
||||
}
|
||||
}
|
||||
highlight: CustomRect {
|
||||
color: DynamicColors.palette.m3onSurface
|
||||
color: Colors.palette.m3onSurface
|
||||
implicitHeight: view.currentItem?.height ?? 0
|
||||
implicitWidth: view.width
|
||||
opacity: 0.08
|
||||
radius: Appearance.rounding.small
|
||||
radius: Tokens.rounding.small
|
||||
y: view.currentItem?.y ?? 0
|
||||
|
||||
Behavior on y {
|
||||
Anim {
|
||||
duration: Appearance.anim.durations.small
|
||||
easing.bezierCurve: Appearance.anim.curves.expressiveEffects
|
||||
duration: Tokens.anim.durations.small
|
||||
easing.bezierCurve: Tokens.anim.curves.expressiveEffects
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -341,7 +342,7 @@ Item {
|
||||
CustomClippingWrapperRect {
|
||||
anchors.fill: parent
|
||||
child: view.contentItem
|
||||
radius: Appearance.rounding.small
|
||||
radius: Tokens.rounding.small
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user