-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
373 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Theme } from "../theme.slint"; | ||
|
||
export component Blanket inherits Rectangle { | ||
opacity: 0.3; | ||
background: Theme.basic-black-color; | ||
TouchArea { } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import { Theme, Icons } from "../theme.slint"; | ||
import { Store } from "../store.slint"; | ||
import { Logic } from "../logic.slint"; | ||
import { IconBtn } from "./icon-btn.slint"; | ||
import { CenterLayout } from "./center-layout.slint"; | ||
|
||
import { Button } from "std-widgets.slint"; | ||
|
||
export component Dialog inherits Rectangle { | ||
in-out property title <=> txt.text; | ||
in-out property<color> title-bg: Theme.brand-color; | ||
in-out property<bool> is-hide-btns: false; | ||
|
||
callback cancel-clicked(); | ||
callback ok-clicked(); | ||
|
||
visible: false; | ||
width: 800px; | ||
height: vbox.preferred-height; | ||
background: Theme.base-background-light; | ||
|
||
vbox := VerticalLayout { | ||
alignment: space-between; | ||
|
||
Rectangle { | ||
height: txt.preferred-height * 1.33; | ||
background: root.title-bg; | ||
txt := Text { | ||
color: Colors.white; | ||
font-size: Theme.title3-font-size; | ||
} | ||
|
||
if (is-hide-btns) : HorizontalLayout { | ||
alignment: end; | ||
padding-right: Theme.padding; | ||
CenterLayout { | ||
IconBtn { | ||
width: Theme.icon-size; | ||
icon: Icons.close; | ||
colorize: txt.color; | ||
clicked => { root.cancel-clicked(); } | ||
} | ||
} | ||
} | ||
} | ||
|
||
VerticalLayout { | ||
@children | ||
} | ||
|
||
if (!is-hide-btns) : HorizontalLayout { | ||
alignment: center; | ||
spacing: Theme.spacing * 8; | ||
padding: Theme.padding * 2; | ||
|
||
cancel-btn := Button { | ||
width: 120px; | ||
text: Logic.tr(Store.is-cn, "取消"); | ||
icon: Icons.cancel; | ||
colorize-icon: true; | ||
clicked => { root.cancel-clicked(); } | ||
} | ||
|
||
Button { | ||
width: 120px; | ||
text: Logic.tr(Store.is-cn, "确认"); | ||
icon: Icons.success-fill; | ||
primary: true; | ||
colorize-icon: true; | ||
clicked => { root.ok-clicked(); } | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { Theme } from "../theme.slint"; | ||
|
||
export component Divider inherits Rectangle { | ||
height: 1px; | ||
background: Theme.brand-border-color; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Theme } from "../theme.slint"; | ||
|
||
export component Link inherits Text { | ||
in-out property <bool> is-read; | ||
|
||
callback clicked <=> touch.clicked; | ||
|
||
wrap: word-wrap; | ||
font-size: Theme.title5-font-size; | ||
color: root.is-read ? Theme.have-read-text-color : Theme.link-text-color; | ||
|
||
touch := TouchArea { } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Dialog } from "./dialog.slint"; | ||
import { Store } from "../store.slint"; | ||
import { Util } from "../util.slint"; | ||
import { Logic } from "../logic.slint"; | ||
import { Theme } from "../theme.slint"; | ||
|
||
export component OkCancelDialog inherits Dialog { | ||
visible: Store.ok-cancel-dialog-setting.body-text != ""; | ||
title: Store.ok-cancel-dialog-setting.title-text; | ||
title-bg: Util.text-color(Store.ok-cancel-dialog-setting.title-type); | ||
width: 450px; | ||
height: 200px; | ||
background: rect.background; | ||
|
||
rect := Rectangle { | ||
background: Theme.base-background-light; | ||
Text { | ||
width: 100%; | ||
horizontal-alignment: center; | ||
color: Theme.primary-text-color; | ||
text: Store.ok-cancel-dialog-setting.body-text; | ||
wrap: word-wrap; | ||
font-size: Theme.title4-font-size; | ||
} | ||
} | ||
|
||
ok-clicked => { | ||
Logic.handle-ok-cancel-dialog(Store.ok-cancel-dialog-setting.handle-type, Store.ok-cancel-dialog-setting.handle-uuid); | ||
Store.ok-cancel-dialog-setting.body-text = ""; | ||
} | ||
|
||
cancel-clicked => { | ||
Store.ok-cancel-dialog-setting.body-text = ""; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.