Compare commits

...

14 Commits

Author SHA1 Message Date
ToMoree
a9ceff8f6f
Merge branch 'zhuzichu520:main' into add_disable_behavior_on_flutext 2024-11-22 16:45:43 +08:00
zhuzichu
8ab0cde2e9
Merge pull request #574 from lucky9loogn/fix
尝试修复 FluChart 和 FluProgressBar 的一些问题
2024-11-22 16:42:03 +08:00
ToMoree
0b371ecd3f
Merge branch 'zhuzichu520:main' into add_disable_behavior_on_flutext 2024-11-22 16:33:02 +08:00
zhuzichu
0171c3609a
Update README.md 2024-11-22 15:58:45 +08:00
lucky9loogn
489526988d 修复 FluProgressBar 放到 FluContentDialog 内对话框刚打开时动画卡顿问题 2024-11-22 15:40:32 +08:00
lucky9loogn
9d32e8e13b 修复 FluChart 在 Qt 5.15.2 下可选链 (?.) 报错 2024-11-22 14:56:32 +08:00
zhuzichu
c9e0732f99
Merge pull request #570 from gaetandezeiraud/feature-fluscrollablepage-reset-scroll
Add property autoResetScroll to FluScrollablePage
2024-11-17 15:11:42 +08:00
zhuzichu
4920407ed7
Merge pull request #569 from gaetandezeiraud/wrap-anywhere-to-wordwrap
Convert WrapAnywhere toWordWrap
2024-11-17 15:11:19 +08:00
zhuzichu
3647197d3b
Merge pull request #568 from gaetandezeiraud/fluchart-avoid-error
Update FluChart.qml
2024-11-17 15:10:44 +08:00
zhuzichu
a72ff03eeb
Merge pull request #567 from gaetandezeiraud/combobox-fix-appbar
Fix FluComboBox click issue with AppBar
2024-11-17 15:09:36 +08:00
Gaëtan Dezeiraud
3eaaa228d8 Add property autoResetScroll to FluScrollablePage
I use it in my app, I think it can be useful to integrate the featurein the main project. This property autoResetScroll  if true reset the scroll at the top when the StackView.onActivated is called.

So the first time a page is view but also when the user go back in the stack.
2024-11-16 20:27:48 +01:00
Gaëtan Dezeiraud
e0892fdb66 Convert WrapAnywhere toWordWrap
Maybe you have a valid reason to use Wrap Anywhere, but for english and french text, it is very unpleasant to read.

If this is a problem for Chinese, maybe a global variable to define the behavior?
2024-11-16 20:05:54 +01:00
Gaëtan Dezeiraud
8f5fbb4053 Update FluChart.qml
In some cases, not sure why but animateToNewData is called and jsChart is undefined so it generate an error. Adding a "?" operator avoid the issue if jsChart is not ready, no error and can be called later.
2024-11-16 20:03:37 +01:00
Gaëtan Dezeiraud
b5295ffe4c Fix FluComboBox click issue with AppBar
Fixed bug with Popup topMargin because click is consumed by FluAppBar
2024-11-16 20:02:23 +01:00
19 changed files with 67 additions and 30 deletions

View File

@ -1,3 +1,6 @@
# ATTENTION! THIS REPO HAS BEEN DEPRECATED!
# PLEASE USE THE BRAND NEW [FluentUI2](https://github.com/zhuzichu520/FluentUI2) INSTEAD!
# THIS REPO IS NO LONGER MAINTAINED.
<div align=center>
<img width=64 src="doc/preview/fluent_design.svg">

View File

@ -15,7 +15,9 @@ Canvas {
function animateToNewData()
{
chartAnimationProgress = 0.1;
d.jsChart.update();
if (d.jsChart) {
d.jsChart.update();
}
chartAnimator.restart();
}
QtObject{

View File

@ -107,7 +107,7 @@ T.ComboBox {
y: control.height
width: control.width
height: Math.min(contentItem.implicitHeight, control.Window.height - topMargin - bottomMargin)
topMargin: 6
topMargin: 32
bottomMargin: 6
modal: true
contentItem: ListView {

View File

@ -41,7 +41,7 @@ FluPopup {
FluText{
id:text_message
font: FluTextStyle.Body
wrapMode: Text.WrapAnywhere
wrapMode: Text.WordWrap
text:message
width: parent.width
topPadding: 4
@ -67,7 +67,7 @@ FluPopup {
topPadding: 20
leftPadding: 20
rightPadding: 20
wrapMode: Text.WrapAnywhere
wrapMode: Text.WordWrap
}
FluLoader{
sourceComponent: com_message

View File

@ -190,13 +190,13 @@ FluObject {
spacing: 5
FluText{
text:_super.text
wrapMode: Text.WrapAnywhere
wrapMode: Text.WordWrap
width: Math.min(implicitWidth,mcontrol.maxWidth)
}
FluText{
text: _super.moremsg
visible: _super.moremsg
wrapMode : Text.WrapAnywhere
wrapMode : Text.WordWrap
textColor: FluColors.Grey120
width: Math.min(implicitWidth,mcontrol.maxWidth)
}

View File

@ -20,7 +20,7 @@ TextArea{
return normalColor
}
font:FluTextStyle.Body
wrapMode: Text.WrapAnywhere
wrapMode: Text.WordWrap
padding: 8
leftPadding: padding+4
renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering

View File

@ -41,13 +41,15 @@ ProgressBar{
height: parent.height
radius: d._radius
color: control.color
PropertyAnimation on x {
id:animator_x
SequentialAnimation on x {
id: animator_x
running: control.indeterminate && control.visible
from: -rect_progress.width
to:control.width+rect_progress.width
loops: Animation.Infinite
duration: control.duration
PropertyAnimation {
from: -rect_progress.width
to: control.width + rect_progress.width
duration: control.duration
}
}
}
}

View File

@ -5,8 +5,11 @@ import QtQuick.Controls 2.15
import FluentUI 1.0
FluPage {
property bool autoResetScroll: false
default property alias content: container.data
Flickable{
id: flickable
clip: true
anchors.fill: parent
ScrollBar.vertical: FluScrollBar {}
@ -17,4 +20,14 @@ FluPage {
width: parent.width
}
}
function resetScroll() {
flickable.contentY = 0;
}
StackView.onActivated: {
if (autoResetScroll) {
resetScroll(); // Call this function to reset the scroll position to the top
}
}
}

View File

@ -98,7 +98,7 @@ Item{
Component{
id:com_lable
FluText{
wrapMode: Text.WrapAnywhere
wrapMode: Text.WordWrap
horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft
text: {
if(modelData.lable){
@ -113,7 +113,7 @@ Item{
Component{
id:com_text
FluText{
wrapMode: Text.WrapAnywhere
wrapMode: Text.WordWrap
horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft
text: modelData.text
textFormat: Text.RichText

View File

@ -175,7 +175,7 @@ Popup{
FluText{
id: text_desc
font: FluTextStyle.Body
wrapMode: Text.WrapAnywhere
wrapMode: Text.WordWrap
maximumLineCount: 4
elide: Text.ElideRight
text: {

View File

@ -14,7 +14,9 @@ Canvas {
function animateToNewData()
{
chartAnimationProgress = 0.1;
d.jsChart.update();
if (d.jsChart) {
d.jsChart.update();
}
chartAnimator.restart();
}
QtObject{

View File

@ -107,7 +107,7 @@ T.ComboBox {
y: control.height
width: control.width
height: Math.min(contentItem.implicitHeight, control.Window.height - topMargin - bottomMargin)
topMargin: 6
topMargin: 32
bottomMargin: 6
modal: true
contentItem: ListView {

View File

@ -41,7 +41,7 @@ FluPopup {
FluText{
id:text_message
font: FluTextStyle.Body
wrapMode: Text.WrapAnywhere
wrapMode: Text.WordWrap
text:message
width: parent.width
topPadding: 4
@ -67,7 +67,7 @@ FluPopup {
topPadding: 20
leftPadding: 20
rightPadding: 20
wrapMode: Text.WrapAnywhere
wrapMode: Text.WordWrap
}
FluLoader{
sourceComponent: com_message

View File

@ -190,13 +190,13 @@ FluObject {
spacing: 5
FluText{
text:_super.text
wrapMode: Text.WrapAnywhere
wrapMode: Text.WordWrap
width: Math.min(implicitWidth,mcontrol.maxWidth)
}
FluText{
text: _super.moremsg
visible: _super.moremsg
wrapMode : Text.WrapAnywhere
wrapMode : Text.WordWrap
textColor: FluColors.Grey120
width: Math.min(implicitWidth,mcontrol.maxWidth)
}

View File

@ -21,7 +21,7 @@ TextArea{
return normalColor
}
font:FluTextStyle.Body
wrapMode: Text.WrapAnywhere
wrapMode: Text.WordWrap
padding: 8
leftPadding: padding+4
renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering

View File

@ -42,13 +42,15 @@ ProgressBar{
height: parent.height
radius: d._radius
color: control.color
PropertyAnimation on x {
id:animator_x
SequentialAnimation on x {
id: animator_x
running: control.indeterminate && control.visible
from: -rect_progress.width
to:control.width+rect_progress.width
loops: Animation.Infinite
duration: control.duration
PropertyAnimation {
from: -rect_progress.width
to: control.width + rect_progress.width
duration: control.duration
}
}
}
}

View File

@ -5,8 +5,11 @@ import QtQuick.Controls
import FluentUI
FluPage {
property bool autoResetScroll: false
default property alias content: container.data
Flickable{
id: flickable
clip: true
anchors.fill: parent
ScrollBar.vertical: FluScrollBar {}
@ -17,4 +20,14 @@ FluPage {
width: parent.width
}
}
function resetScroll() {
flickable.contentY = 0;
}
StackView.onActivated: {
if (autoResetScroll) {
resetScroll(); // Call this function to reset the scroll position to the top
}
}
}

View File

@ -98,7 +98,7 @@ Item{
Component{
id:com_lable
FluText{
wrapMode: Text.WrapAnywhere
wrapMode: Text.WordWrap
horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft
text: {
if(modelData.lable){
@ -113,7 +113,7 @@ Item{
Component{
id:com_text
FluText{
wrapMode: Text.WrapAnywhere
wrapMode: Text.WordWrap
horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft
text: modelData.text
textFormat: Text.RichText

View File

@ -175,7 +175,7 @@ Popup{
FluText{
id: text_desc
font: FluTextStyle.Body
wrapMode: Text.WrapAnywhere
wrapMode: Text.WordWrap
maximumLineCount: 4
elide: Text.ElideRight
text: {