Compare commits

..

4 Commits

Author SHA1 Message Date
zhuzichu
7204e18afe
Merge pull request #583 from luckyloogn/fix/flupivot-animation-issues
修复FluPivot 切换选中项目时标题下划线动画未能完全关闭的问题
2025-01-02 17:04:23 +08:00
zhuzichu
985e90bffc
Merge pull request #582 from luckyloogn/fix/color-picker-sync-issues
修复 FluColorPicker 存在的颜色同步与输入问题
2025-01-02 17:04:02 +08:00
luckyloogn
e82000e6f8 fix(FluPivot): 修复 title 下划线动画未能完全关闭的问题
修复了在 `FluTheme.animationEnabled = false` 时,从文字较少的 title 切换到文字较多的 title 时,下划线仍然存在尺寸变化动画的问题。
2025-01-01 17:24:31 +08:00
luckyloogn
444d9b2d28 fix(FluColorPicker): 修复多项颜色同步与输入问题
- 修复了 FluColorPicker 打开时滑块与 RGBA/HEX 数值未正确匹配当前颜色的问题。
- 修复了 FluColorPicker 设置 HEX 值时,RGBA 数值未同步更新的问题。
- 修复了 FluColorPicker HEX 输入框只能接受大写 A-F 字符的问题。
2025-01-01 17:20:39 +08:00
4 changed files with 74 additions and 20 deletions

View File

@ -47,6 +47,17 @@ Button{
implicitWidth: 326
implicitHeight: 560
closePolicy: Popup.CloseOnEscape
onClosed: {
text_box_r.focus = false;
text_box_g.focus = false;
text_box_b.focus = false;
text_box_a.focus = false;
text_box_color.focus = false;
}
onOpened: {
layout_color_hue.updateColorText(current);
text_box_color.textEdited();
}
Rectangle{
id:layout_actions
width: parent.width
@ -148,7 +159,9 @@ Button{
if(color.a===1){
colorString = "FF"+colorString
}
text_box_color.text = colorString.toUpperCase()
if (!text_box_color.activeFocus) {
text_box_color.text = colorString.toUpperCase();
}
}
property color blackColor: {
var c = whiteColor
@ -279,6 +292,11 @@ Button{
preventStealing: true
function handleMouse(mouse) {
if (mouse.buttons & Qt.LeftButton) {
text_box_r.focus = false;
text_box_g.focus = false;
text_box_b.focus = false;
text_box_a.focus = false;
text_box_color.focus = false;
pickerCursor.x = Math.max(0,Math.min(mouse.x - colorHandleRadius,width-2*colorHandleRadius));
pickerCursor.y = Math.max(0,Math.min(mouse.y - colorHandleRadius,height-2*colorHandleRadius));
}
@ -369,6 +387,11 @@ Button{
preventStealing: true
function handleMouse(mouse) {
if (mouse.buttons & Qt.LeftButton) {
text_box_r.focus = false;
text_box_g.focus = false;
text_box_b.focus = false;
text_box_a.focus = false;
text_box_color.focus = false;
blackCursor.x = Math.max(0,Math.min(mouse.x - 6,width-2*6));
blackCursor.y = 0
}
@ -438,6 +461,11 @@ Button{
preventStealing: true
function handleMouse(mouse) {
if (mouse.buttons & Qt.LeftButton) {
text_box_r.focus = false;
text_box_g.focus = false;
text_box_b.focus = false;
text_box_a.focus = false;
text_box_color.focus = false;
opacityCursor.x = Math.max(0,Math.min(mouse.x - 6,width-2*6));
opacityCursor.y = 0
}
@ -472,7 +500,7 @@ Button{
id:text_box_color
width: 136
validator: RegularExpressionValidator {
regularExpression: /^[0-9A-F]{8}$/
regularExpression: /^[0-9A-Fa-f]{8}$/
}
anchors{
right: parent.right
@ -495,6 +523,11 @@ Button{
parseInt(colorString.substring(6, 8), 16) / 255,
parseInt(colorString.substring(0, 2), 16) / 255)
layout_color_hue.colorValue = c
layout_color_hue.updateColorText(c);
text_box_r.textEdited();
text_box_g.textEdited();
text_box_b.textEdited();
text_box_a.textEdited();
}
}
}

View File

@ -31,21 +31,15 @@ Page {
interactive: false
orientation: ListView.Horizontal
highlightMoveDuration: FluTheme.animationEnabled ? 167 : 0
highlightResizeDuration: FluTheme.animationEnabled ? 167 : 0
highlight: Item{
clip: true
Rectangle{
height: 3
radius: 1.5
color: FluTheme.primaryColor
width: nav_list.currentItem ? nav_list.currentItem.width : 0
width: nav_list.currentItem.width
y:d.tabY
Behavior on width {
enabled: FluTheme.animationEnabled
NumberAnimation{
duration: 167
easing.type: Easing.OutCubic
}
}
}
}
delegate: Button{

View File

@ -48,6 +48,17 @@ Button{
implicitWidth: 326
implicitHeight: 560
closePolicy: Popup.CloseOnEscape
onClosed: {
text_box_r.focus = false;
text_box_g.focus = false;
text_box_b.focus = false;
text_box_a.focus = false;
text_box_color.focus = false;
}
onOpened: {
layout_color_hue.updateColorText(current);
text_box_color.textEdited();
}
Rectangle{
id:layout_actions
width: parent.width
@ -149,7 +160,9 @@ Button{
if(color.a===1){
colorString = "FF"+colorString
}
text_box_color.text = colorString.toUpperCase()
if (!text_box_color.activeFocus) {
text_box_color.text = colorString.toUpperCase();
}
}
property color blackColor: {
var c = whiteColor
@ -280,6 +293,11 @@ Button{
preventStealing: true
function handleMouse(mouse) {
if (mouse.buttons & Qt.LeftButton) {
text_box_r.focus = false;
text_box_g.focus = false;
text_box_b.focus = false;
text_box_a.focus = false;
text_box_color.focus = false;
pickerCursor.x = Math.max(0,Math.min(mouse.x - colorHandleRadius,width-2*colorHandleRadius));
pickerCursor.y = Math.max(0,Math.min(mouse.y - colorHandleRadius,height-2*colorHandleRadius));
}
@ -370,6 +388,11 @@ Button{
preventStealing: true
function handleMouse(mouse) {
if (mouse.buttons & Qt.LeftButton) {
text_box_r.focus = false;
text_box_g.focus = false;
text_box_b.focus = false;
text_box_a.focus = false;
text_box_color.focus = false;
blackCursor.x = Math.max(0,Math.min(mouse.x - 6,width-2*6));
blackCursor.y = 0
}
@ -439,6 +462,11 @@ Button{
preventStealing: true
function handleMouse(mouse) {
if (mouse.buttons & Qt.LeftButton) {
text_box_r.focus = false;
text_box_g.focus = false;
text_box_b.focus = false;
text_box_a.focus = false;
text_box_color.focus = false;
opacityCursor.x = Math.max(0,Math.min(mouse.x - 6,width-2*6));
opacityCursor.y = 0
}
@ -473,7 +501,7 @@ Button{
id:text_box_color
width: 136
validator: RegularExpressionValidator {
regularExpression: /^[0-9A-F]{8}$/
regularExpression: /^[0-9A-Fa-f]{8}$/
}
anchors{
right: parent.right
@ -496,6 +524,11 @@ Button{
parseInt(colorString.substring(6, 8), 16) / 255,
parseInt(colorString.substring(0, 2), 16) / 255)
layout_color_hue.colorValue = c
layout_color_hue.updateColorText(c);
text_box_r.textEdited();
text_box_g.textEdited();
text_box_b.textEdited();
text_box_a.textEdited();
}
}
}

View File

@ -32,21 +32,15 @@ Page {
interactive: false
orientation: ListView.Horizontal
highlightMoveDuration: FluTheme.animationEnabled ? 167 : 0
highlightResizeDuration: FluTheme.animationEnabled ? 167 : 0
highlight: Item{
clip: true
Rectangle{
height: 3
radius: 1.5
color: FluTheme.primaryColor
width: nav_list.currentItem ? nav_list.currentItem.width : 0
width: nav_list.currentItem.width
y:d.tabY
Behavior on width {
enabled: FluTheme.animationEnabled
NumberAnimation{
duration: 167
easing.type: Easing.OutCubic
}
}
}
}
delegate: Button{