mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2024-11-27 05:38:37 +08:00
update
This commit is contained in:
parent
f13f1727af
commit
c42f3ef70f
@ -5,14 +5,12 @@
|
|||||||
|
|
||||||
CircularReveal::CircularReveal(QQuickItem* parent) : QQuickPaintedItem(parent)
|
CircularReveal::CircularReveal(QQuickItem* parent) : QQuickPaintedItem(parent)
|
||||||
{
|
{
|
||||||
|
|
||||||
_anim = new QPropertyAnimation(this, "radius", this);
|
_anim = new QPropertyAnimation(this, "radius", this);
|
||||||
_anim->setDuration(333);
|
_anim->setDuration(333);
|
||||||
_anim->setEasingCurve(QEasingCurve::OutCubic);
|
_anim->setEasingCurve(QEasingCurve::OutCubic);
|
||||||
connect(_anim, &QPropertyAnimation::finished,this,[=](){
|
connect(_anim, &QPropertyAnimation::finished,this,[=](){
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(this,&CircularReveal::radiusChanged,this,[=](){
|
connect(this,&CircularReveal::radiusChanged,this,[=](){
|
||||||
update();
|
update();
|
||||||
});
|
});
|
||||||
|
@ -15,7 +15,6 @@ class CircularReveal : public QQuickPaintedItem
|
|||||||
public:
|
public:
|
||||||
CircularReveal(QQuickItem* parent = nullptr);
|
CircularReveal(QQuickItem* parent = nullptr);
|
||||||
void paint(QPainter* painter) override;
|
void paint(QPainter* painter) override;
|
||||||
|
|
||||||
Q_INVOKABLE void start(int w,int h,const QPoint& center,int radius);
|
Q_INVOKABLE void start(int w,int h,const QPoint& center,int radius);
|
||||||
Q_SIGNAL void imageChanged();
|
Q_SIGNAL void imageChanged();
|
||||||
Q_SLOT void handleGrabResult();
|
Q_SLOT void handleGrabResult();
|
||||||
|
@ -9,6 +9,9 @@ Rectangle {
|
|||||||
property var columnSource
|
property var columnSource
|
||||||
property var dataSource
|
property var dataSource
|
||||||
property color selectionColor: Qt.alpha(FluTheme.primaryColor.lightest,0.6)
|
property color selectionColor: Qt.alpha(FluTheme.primaryColor.lightest,0.6)
|
||||||
|
property color hoverButtonColor: Qt.alpha(selectionColor,0.2)
|
||||||
|
property color pressedButtonColor: Qt.alpha(selectionColor,0.4)
|
||||||
|
|
||||||
id:control
|
id:control
|
||||||
color: FluTheme.dark ? Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(251/255,251/255,253/255,1)
|
color: FluTheme.dark ? Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(251/255,251/255,253/255,1)
|
||||||
onColumnSourceChanged: {
|
onColumnSourceChanged: {
|
||||||
@ -31,6 +34,7 @@ Rectangle {
|
|||||||
QtObject{
|
QtObject{
|
||||||
id:d
|
id:d
|
||||||
property var header_rows:[]
|
property var header_rows:[]
|
||||||
|
property bool selectionFlag: true
|
||||||
function obtEditDelegate(column,row){
|
function obtEditDelegate(column,row){
|
||||||
var display = table_model.data(table_model.index(row,column),"display")
|
var display = table_model.data(table_model.index(row,column),"display")
|
||||||
var cellItem = table_view.itemAtCell(column, row)
|
var cellItem = table_view.itemAtCell(column, row)
|
||||||
@ -186,6 +190,9 @@ Rectangle {
|
|||||||
id:item_table
|
id:item_table
|
||||||
property var position: Qt.point(column,row)
|
property var position: Qt.point(column,row)
|
||||||
required property bool selected
|
required property bool selected
|
||||||
|
onSelectedChanged: {
|
||||||
|
d.selectionFlag = !d.selectionFlag
|
||||||
|
}
|
||||||
color: (row%2!==0) ? control.color : (FluTheme.dark ? Qt.rgba(1,1,1,0.06) : Qt.rgba(0,0,0,0.06))
|
color: (row%2!==0) ? control.color : (FluTheme.dark ? Qt.rgba(1,1,1,0.06) : Qt.rgba(0,0,0,0.06))
|
||||||
implicitHeight: 40
|
implicitHeight: 40
|
||||||
implicitWidth: columnSource[column].width
|
implicitWidth: columnSource[column].width
|
||||||
@ -267,7 +274,7 @@ Rectangle {
|
|||||||
bottomRightHandle:com_handle
|
bottomRightHandle:com_handle
|
||||||
topLeftHandle: com_handle
|
topLeftHandle: com_handle
|
||||||
onDraggingChanged: {
|
onDraggingChanged: {
|
||||||
if(dragging === false){
|
if(!dragging){
|
||||||
table_view.interactive = true
|
table_view.interactive = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -286,29 +293,43 @@ Rectangle {
|
|||||||
syncView: table_view
|
syncView: table_view
|
||||||
boundsBehavior: Flickable.StopAtBounds
|
boundsBehavior: Flickable.StopAtBounds
|
||||||
clip: true
|
clip: true
|
||||||
delegate: Rectangle {
|
delegate: FluControl {
|
||||||
|
id:column_item_control
|
||||||
readonly property real cellPadding: 8
|
readonly property real cellPadding: 8
|
||||||
readonly property var obj : columnSource[column]
|
readonly property var obj : columnSource[column]
|
||||||
implicitWidth: column_text.implicitWidth + (cellPadding * 2)
|
implicitWidth: column_text.implicitWidth + (cellPadding * 2)
|
||||||
implicitHeight: Math.max(header_horizontal.height, column_text.implicitHeight + (cellPadding * 2))
|
implicitHeight: Math.max(header_horizontal.height, column_text.implicitHeight + (cellPadding * 2))
|
||||||
color: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(247/255,247/255,247/255,1)
|
Rectangle{
|
||||||
border.color: FluTheme.dark ? "#252525" : "#e4e4e4"
|
anchors.fill: parent
|
||||||
|
color:{
|
||||||
|
d.selectionFlag
|
||||||
|
if(column_item_control.pressed){
|
||||||
|
return control.pressedButtonColor
|
||||||
|
}
|
||||||
|
if(selection_model.isColumnSelected(column)){
|
||||||
|
return control.hoverButtonColor
|
||||||
|
}
|
||||||
|
return column_item_control.hovered ? control.hoverButtonColor : FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(247/255,247/255,247/255,1)
|
||||||
|
}
|
||||||
|
border.color: FluTheme.dark ? "#252525" : "#e4e4e4"
|
||||||
|
}
|
||||||
FluText {
|
FluText {
|
||||||
id: column_text
|
id: column_text
|
||||||
text: display
|
text: model.display
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: parent.height
|
height: parent.height
|
||||||
font.bold: true
|
font.bold:{
|
||||||
|
d.selectionFlag
|
||||||
|
return selection_model.columnIntersectsSelection(column)
|
||||||
|
}
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
}
|
}
|
||||||
TapHandler{
|
onClicked: {
|
||||||
onDoubleTapped: {
|
closeEditor()
|
||||||
closeEditor()
|
selection_model.clear()
|
||||||
selection_model.clear()
|
for(var i=0;i<=table_view.rows;i++){
|
||||||
for(var i=0;i<=table_view.rows;i++){
|
selection_model.select(table_model.index(i,column),ItemSelectionModel.Select)
|
||||||
selection_model.select(table_model.index(i,column),ItemSelectionModel.Select)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MouseArea{
|
MouseArea{
|
||||||
@ -364,25 +385,39 @@ Rectangle {
|
|||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
delegate: Rectangle{
|
delegate: FluControl{
|
||||||
|
id:item_control
|
||||||
readonly property real cellPadding: 8
|
readonly property real cellPadding: 8
|
||||||
implicitWidth: Math.max(header_vertical.width, row_text.implicitWidth + (cellPadding * 2))
|
implicitWidth: Math.max(header_vertical.width, row_text.implicitWidth + (cellPadding * 2))
|
||||||
implicitHeight: row_text.implicitHeight + (cellPadding * 2)
|
implicitHeight: row_text.implicitHeight + (cellPadding * 2)
|
||||||
color:FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(247/255,247/255,247/255,1)
|
Rectangle{
|
||||||
border.color: FluTheme.dark ? "#252525" : "#e4e4e4"
|
anchors.fill: parent
|
||||||
|
color: {
|
||||||
|
d.selectionFlag
|
||||||
|
if(item_control.pressed){
|
||||||
|
return control.pressedButtonColor
|
||||||
|
}
|
||||||
|
if(selection_model.isRowSelected(row)){
|
||||||
|
return control.hoverButtonColor
|
||||||
|
}
|
||||||
|
return item_control.hovered ? control.hoverButtonColor : FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(247/255,247/255,247/255,1)
|
||||||
|
}
|
||||||
|
border.color: FluTheme.dark ? "#252525" : "#e4e4e4"
|
||||||
|
}
|
||||||
FluText{
|
FluText{
|
||||||
id:row_text
|
id:row_text
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
text: row + 1
|
text: row + 1
|
||||||
font.bold: true
|
font.bold:{
|
||||||
|
d.selectionFlag
|
||||||
|
return selection_model.rowIntersectsSelection(row)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
TapHandler{
|
onClicked: {
|
||||||
onDoubleTapped: {
|
closeEditor()
|
||||||
closeEditor()
|
selection_model.clear()
|
||||||
selection_model.clear()
|
for(var i=0;i<=columnSource.length;i++){
|
||||||
for(var i=0;i<=columnSource.length;i++){
|
selection_model.select(table_model.index(row,i),ItemSelectionModel.Select)
|
||||||
selection_model.select(table_model.index(row,i),ItemSelectionModel.Select)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MouseArea{
|
MouseArea{
|
||||||
|
Loading…
Reference in New Issue
Block a user