feat(ui): add scroll support for hand cards

This commit is contained in:
Kieran Kihn
2025-12-18 23:34:24 +08:00
parent 150e29c25c
commit 1b52c87b0e

View File

@@ -660,7 +660,7 @@ export component GamePage inherits Rectangle {
// ===== 底部:当前玩家区域 ===== // ===== 底部:当前玩家区域 =====
Rectangle { Rectangle {
height: 320px * scale; height: 350px * scale;
background: #FDFBF8; background: #FDFBF8;
border-radius: 16px * scale; border-radius: 16px * scale;
drop-shadow-blur: 10px * scale; drop-shadow-blur: 10px * scale;
@@ -721,16 +721,19 @@ export component GamePage inherits Rectangle {
// 手牌列表 - 上方留出空间给选中效果 // 手牌列表 - 上方留出空间给选中效果
Rectangle { Rectangle {
height: 210px * scale; width: 1200px * scale;
height: 230px * scale;
horizontal-stretch: 1;
background: transparent; background: transparent;
// 手牌容器,向下偏移以给选中卡牌留空间,居中显示 // 手牌滚动容器
Rectangle { ScrollView {
x: (parent.width - self.width) / 2; width: 100%;
y: 25px * scale; height: 100%;
width: hand-cards-layout.preferred-width;
height: 180px * scale; // 手牌容器,向下偏移以给选中卡牌留空间
hand-cards-layout := HorizontalLayout { hand-cards-layout := HorizontalLayout {
y: 25px * scale;
alignment: center; alignment: center;
spacing: -35px * scale; // 卡牌重叠效果 spacing: -35px * scale; // 卡牌重叠效果