Skip to content

Commit c7ab866

Browse files
committed
update v0.5.2
1 parent 50ea8ea commit c7ab866

File tree

6 files changed

+52
-42
lines changed

6 files changed

+52
-42
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ description = ""
99
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1010

1111
[dependencies]
12-
slint = "1.6.0"
12+
slint = "1.8.0"
1313

1414
[build-dependencies]
15-
slint-build = "1.6.0"
15+
slint-build = "1.8.0"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ And this template use `SurrealismUI` as default Component Library
1212

1313
| name | version |
1414
| ------------ | ---------- |
15-
| slint | 1.6.0 |
15+
| slint | 1.8.0 |
1616
| rust | after 2021 |
17-
| SurrealismUI | 0.5.0 |
17+
| SurrealismUI | 0.5.2 |
1818

1919
## Recommend IDE
2020

ui/modules/surrealism-ui/src/collapse/item.slint

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import { SIcon } from "../icon/index.slint";
4040
import { Themes,UseIcons,PaddingType,ShadowType,BorderType } from "../../use/index.slint";
4141

4242
export component CollapseItem inherits Rectangle{
43-
height: header.height;
43+
height: is-show?details-height:header.height;
4444
background: transparent;
4545
in-out property <int> font-weight : DefaultSCollapseProps.font-weight;
4646
in-out property <length> font-size: DefaultSCollapseProps.font-size;
@@ -129,18 +129,27 @@ export component CollapseItem inherits Rectangle{
129129
theme: root.theme;
130130
height: 16px;
131131
width: 16px;
132+
rotation: is-show?{
133+
rotation-angle: 90deg,
134+
rotation-origin-x: icon.width / 2,
135+
rotation-origin-y: icon.height / 2,
136+
}:{
137+
rotation-angle: 0deg,
138+
rotation-origin-x: icon.width / 2,
139+
rotation-origin-y: icon.height / 2,
140+
};
132141
source: root.collapse-icon;
133142
clicked => {
134-
area.clicked()
143+
area.clicked()
135144
}
136145
}
137146
}
138147
}
139148
}
140149
details-view:= SCard{
141-
height: root.is-show ? root.details-height : 0;
150+
height: root.is-show ? root.height - header.height : 0;
142151
width: header.width;
143-
visible: false;
152+
visible: root.is-show;
144153
border-radius: 0;
145154
drop-shadow-blur: 0;
146155
theme: root.theme;

ui/modules/surrealism-ui/src/select/select.slint

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ export component Select inherits SCard {
5151
in property <string> placeholder : DefaultSSelectProps.placeholder;
5252
in-out property <bool> is-show : DefaultSSelectProps.is-show;
5353
in-out property <int> active: -1;
54+
out property <bool> has-hover <=> selector.has-hover;
55+
out property <bool> expand-hover <=> expand-area.has-hover;
5456
callback changed(int, SOption);
5557
public function open() {
5658
expand.visible=true;
@@ -68,7 +70,6 @@ export component Select inherits SCard {
6870
return root.active >= 0 && root.active <= options.length - 1;
6971
}
7072
selector:=TouchArea{
71-
z: 111;
7273
HorizontalLayout{
7374
padding-left: root.padding-left;
7475
padding-right: root.padding-right;
@@ -81,7 +82,6 @@ export component Select inherits SCard {
8182
font-italic: root.font-italic;
8283
}
8384
select-icon-view:=Rectangle{
84-
z: 110;
8585
width: select-icon.width;
8686
select-icon:=SIcon{
8787
theme: root.theme;
@@ -108,35 +108,38 @@ export component Select inherits SCard {
108108
y: parent.height + 6px;
109109
card-width: parent.card-width;
110110
height: UseSurrealismFn.count-height(root.item-font-size,root.card-padding.padding-top) * 3;
111-
list:=ListView {
112-
padding-top: parent.padding-top;
113-
padding-bottom: parent.padding-bottom;
114-
for range[index] in root.options : Rectangle{
115-
height: area.height;
116-
background:area.has-hover?expand.background.brighter(0.1):expand.background;
117-
area:=TouchArea{
118-
mouse-cursor: pointer;
119-
z: 111;
120-
height: list-item.height;
121-
clicked => {
122-
root.active = index;
123-
root.changed(index, range);
124-
}
125-
list-item:= SText {
126-
height: UseSurrealismFn.count-height(root.item-font-size,root.card-padding.padding-top);
127-
padding-left: root.padding-left;
128-
padding-right: root.padding-right;
129-
width: root.width - self.padding-left - self.padding-right;
130-
theme: root.theme;
131-
text: range.label;
132-
font-family: item-font-family;
133-
font-size: item-font-size;
134-
font-weight: item-font-weight;
135-
font-italic: item-font-italic;
111+
expand-area:= TouchArea {
112+
mouse-cursor: pointer;
113+
height: parent.height;
114+
width: parent.width;
115+
list:=ListView {
116+
padding-top: parent.padding-top;
117+
padding-bottom: parent.padding-bottom;
118+
for range[index] in root.options : Rectangle{
119+
height: area.height;
120+
background:area.has-hover?expand.background.brighter(0.1):expand.background;
121+
area:=TouchArea{
122+
mouse-cursor: pointer;
123+
height: list-item.height;
124+
clicked => {
125+
root.active = index;
126+
root.changed(index, range);
127+
}
128+
list-item:= SText {
129+
height: UseSurrealismFn.count-height(root.item-font-size,root.card-padding.padding-top);
130+
padding-left: root.padding-left;
131+
padding-right: root.padding-right;
132+
width: root.width - self.padding-left - self.padding-right;
133+
theme: root.theme;
134+
text: range.label;
135+
font-family: item-font-family;
136+
font-size: item-font-size;
137+
font-weight: item-font-weight;
138+
font-italic: item-font-italic;
139+
}
136140
}
137141
}
138142
}
139143
}
140144
}
141-
}
142-
145+
}

ui/modules/surrealism-ui/surrealism-ui.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "surrealism-ui"
3-
version = "0.5.0"
3+
version = "0.5.2"
44
edition = "2024"
55
description = "SurrealismUI is a third-party component library built entirely using Slint"
66
authors = ["syf20020816@outlook.com"]
@@ -11,4 +11,4 @@ keywords = ["slint-ui", "slint", "ui-components", "gui", "widgets"]
1111

1212

1313
[dependencies]
14-
slint = "1.6.0"
14+
slint = "1.8.0"

ui/modules/surrealism-ui/use/src/icon.slint

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ struct Icons {
2020
Link_left:image,
2121
Preview_close:image,
2222
Preview_open:image,
23-
Close_one:image,
2423
Setting_two:image,
2524
Folder:image,
2625
Folder_filled:image,
@@ -55,7 +54,6 @@ global UseIcons {
5554
Link_left:@image-url("../../icons/link-left.svg"),
5655
Preview_close:@image-url("../../icons/preview-close.svg"),
5756
Preview_open:@image-url("../../icons/preview-open.svg"),
58-
Close_one:@image-url("../../icons/close-one.svg"),
5957
Setting_two:@image-url("../../icons/setting-two.svg"),
6058
Folder:@image-url("../../icons/folder-open.svg"),
6159
Folder_filled:@image-url("../../icons/folder-open-filled.svg"),
@@ -84,4 +82,4 @@ struct SIconProps {
8482
source-clip-width : int
8583
}
8684

87-
export { Icons,IconProps,UseIcons,SIconProps }
85+
export { Icons,IconProps,UseIcons,SIconProps }

0 commit comments

Comments
 (0)