This commit is contained in:
朱子楚\zhuzi 2023-08-12 11:01:40 +08:00
parent 855305f197
commit 0b17d03f23
6 changed files with 29 additions and 34 deletions

View File

@ -22,7 +22,7 @@ FluScrollablePage{
Item{ Item{
Layout.fillWidth: true Layout.fillWidth: true
height: 320 Layout.preferredHeight: 320
Image { Image {
id: bg id: bg
fillMode:Image.PreserveAspectCrop fillMode:Image.PreserveAspectCrop
@ -77,6 +77,7 @@ FluScrollablePage{
anchors.fill: parent anchors.fill: parent
tintColor: FluTheme.dark ? Qt.rgba(0,0,0,1) : Qt.rgba(1,1,1,1) tintColor: FluTheme.dark ? Qt.rgba(0,0,0,1) : Qt.rgba(1,1,1,1)
target: bg target: bg
tintOpacity: FluTheme.dark ? 0.8 : 0.9
blurRadius : 40 blurRadius : 40
targetRect: Qt.rect(list.x-list.contentX+10+(control.width)*index,list.y+10,width,height) targetRect: Qt.rect(list.x-list.contentX+10+(control.width)*index,list.y+10,width,height)
} }
@ -86,14 +87,14 @@ FluScrollablePage{
color:{ color:{
if(FluTheme.dark){ if(FluTheme.dark){
if(item_mouse.containsMouse){ if(item_mouse.containsMouse){
return Qt.rgba(1,1,1,0.06) return Qt.rgba(1,1,1,0.03)
} }
return Qt.rgba(0,0,0,0.03) return Qt.rgba(0,0,0,0.0)
}else{ }else{
if(item_mouse.containsMouse){ if(item_mouse.containsMouse){
return Qt.rgba(0,0,0,0.09) return Qt.rgba(0,0,0,0.03)
} }
return Qt.rgba(0,0,0,0.06) return Qt.rgba(0,0,0,0.0)
} }
} }
} }
@ -135,7 +136,8 @@ FluScrollablePage{
id:item_mouse id:item_mouse
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: true
onWheel: (wheel)=>{ onWheel:
(wheel)=>{
if (wheel.angleDelta.y > 0) scrollbar_header.decrease() if (wheel.angleDelta.y > 0) scrollbar_header.decrease()
else scrollbar_header.increase() else scrollbar_header.increase()
} }
@ -249,7 +251,7 @@ FluScrollablePage{
GridView{ GridView{
Layout.fillWidth: true Layout.fillWidth: true
implicitHeight: contentHeight Layout.preferredHeight: contentHeight
cellHeight: 120 cellHeight: 120
cellWidth: 320 cellWidth: 320
model:ItemsOriginal.getRecentlyAddedData() model:ItemsOriginal.getRecentlyAddedData()
@ -266,7 +268,7 @@ FluScrollablePage{
GridView{ GridView{
Layout.fillWidth: true Layout.fillWidth: true
implicitHeight: contentHeight Layout.preferredHeight: contentHeight
cellHeight: 120 cellHeight: 120
cellWidth: 320 cellWidth: 320
interactive: false interactive: false

View File

@ -24,7 +24,7 @@ FluScrollablePage{
id:com_lable id:com_lable
FluText{ FluText{
wrapMode: Text.WrapAnywhere wrapMode: Text.WrapAnywhere
horizontalAlignment: textAlignment horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft
text: modelData.lable text: modelData.lable
color: FluTheme.primaryColor.dark color: FluTheme.primaryColor.dark
MouseArea{ MouseArea{
@ -41,7 +41,7 @@ FluScrollablePage{
id:com_text id:com_text
FluText{ FluText{
wrapMode: Text.WrapAnywhere wrapMode: Text.WrapAnywhere
horizontalAlignment: textAlignment horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft
text: modelData.text text: modelData.text
font.bold: true font.bold: true
MouseArea{ MouseArea{

View File

@ -25,7 +25,7 @@ FluItem {
} }
Rectangle{ Rectangle{
anchors.fill: parent anchors.fill: parent
color: Qt.rgba(255, 255, 255, luminosity) color: Qt.rgba(1, 1, 1, luminosity)
} }
Rectangle{ Rectangle{
anchors.fill: parent anchors.fill: parent

View File

@ -66,10 +66,6 @@ Item {
} }
return data return data
} }
function refreshWindow(){
Window.window.height = Window.window.height-1
Window.window.height = Window.window.height+1
}
} }
Component.onCompleted: { Component.onCompleted: {
d.displayMode = Qt.binding(function(){ d.displayMode = Qt.binding(function(){
@ -713,11 +709,6 @@ Item {
NumberAnimation{ NumberAnimation{
duration: 167 duration: 167
easing.type: Easing.OutCubic easing.type: Easing.OutCubic
onRunningChanged: {
if(!running){
d.refreshWindow()
}
}
} }
} }
Behavior on x { Behavior on x {
@ -725,11 +716,6 @@ Item {
NumberAnimation{ NumberAnimation{
duration: 167 duration: 167
easing.type: Easing.OutCubic easing.type: Easing.OutCubic
onRunningChanged: {
if(!running){
d.refreshWindow()
}
}
} }
} }
visible: { visible: {

View File

@ -90,7 +90,7 @@ Item{
id:com_lable id:com_lable
FluText{ FluText{
wrapMode: Text.WrapAnywhere wrapMode: Text.WrapAnywhere
horizontalAlignment: textAlignment horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft
text: modelData.lable text: modelData.lable
color: FluTheme.primaryColor.dark color: FluTheme.primaryColor.dark
} }
@ -98,13 +98,11 @@ Item{
Component{ Component{
id:com_text id:com_text
FluText{ FluText{
wrapMode: Text.WrapAnywhere wrapMode: Text.WrapAnywhere
horizontalAlignment: textAlignment horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft
text: modelData.text text: modelData.text
} }
} }
Column{ Column{
@ -152,7 +150,7 @@ Item{
Loader{ Loader{
property var modelData: control.model.get(index) property var modelData: control.model.get(index)
property int textAlignment: state === "Right" ? Qt.AlignRight : Qt.AlignLeft property bool isRight: state === "Right"
id:loader_lable id:loader_lable
sourceComponent: { sourceComponent: {
if(!modelData){ if(!modelData){
@ -223,7 +221,7 @@ Item{
Loader{ Loader{
id:loader_text id:loader_text
property var modelData: control.model.get(index) property var modelData: control.model.get(index)
property int textAlignment: state === "Right" ? Qt.AlignRight : Qt.AlignLeft property bool isRight: state === "Right"
state: { state: {
if(d.isRight){ if(d.isRight){
return "Right" return "Right"

View File

@ -58,9 +58,18 @@ Popup{
target: d.window target: d.window
function onWidthChanged(){ function onWidthChanged(){
canvas.requestPaint() canvas.requestPaint()
timer_delay.restart()
} }
function onHeightChanged(){ function onHeightChanged(){
canvas.requestPaint() canvas.requestPaint()
timer_delay.restart()
}
}
Timer{
id:timer_delay
interval: 200
onTriggered: {
canvas.requestPaint()
} }
} }
Canvas{ Canvas{