mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 08:30:42 +02:00
🎨 Database gallery view https://github.com/siyuan-note/siyuan/issues/10414
This commit is contained in:
parent
fb66a57551
commit
b58b33f795
2 changed files with 20 additions and 4 deletions
|
@ -257,6 +257,9 @@ func NewGalleryView() (ret *View) {
|
|||
Sorts: []*ViewSort{},
|
||||
PageSize: GalleryViewDefaultPageSize,
|
||||
},
|
||||
CoverFrom: CoverFromContentImage,
|
||||
CardSize: CardSizeMedium,
|
||||
ShowIcon: true,
|
||||
},
|
||||
}
|
||||
return
|
||||
|
|
|
@ -22,12 +22,25 @@ import "sort"
|
|||
type LayoutGallery struct {
|
||||
*BaseLayout
|
||||
|
||||
CoverFrom CoverFrom `json:"coverFrom"` // 封面来源,0:无,1:内容图,2:资源字段
|
||||
CoverFromAssetKeyID string `json:"coverFromAssetKeyId,omitempty"` // 资源字段 ID,CoverFrom 为 2 时有效
|
||||
CardFields []*ViewGalleryCardField `json:"fields"` // 画廊卡片字段
|
||||
CardIDs []string `json:"cardIds"` // 卡片 ID,用于自定义排序
|
||||
CoverFrom CoverFrom `json:"coverFrom"` // 封面来源,0:无,1:内容图,2:资源字段
|
||||
CoverFromAssetKeyID string `json:"coverFromAssetKeyId,omitempty"` // 资源字段 ID,CoverFrom 为 2 时有效
|
||||
CardSize CardSize `json:"cardSize"` // 卡片大小
|
||||
FitImage bool `json:"fitImage"` // 是否适应图片大小
|
||||
ShowIcon bool `json:"showIcon"` // 是否显示图标
|
||||
WrapField bool `json:"wrapField"` // 是否换行字段
|
||||
|
||||
CardFields []*ViewGalleryCardField `json:"fields"` // 画廊卡片字段
|
||||
CardIDs []string `json:"cardIds"` // 卡片 ID,用于自定义排序
|
||||
}
|
||||
|
||||
type CardSize int
|
||||
|
||||
const (
|
||||
CardSizeSmall CardSize = iota // 小卡片
|
||||
CardSizeMedium // 中卡片
|
||||
CardSizeLarge // 大卡片
|
||||
)
|
||||
|
||||
// CoverFrom 描述了画廊中的卡片封面来源的枚举类型。
|
||||
type CoverFrom int
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue