Surrealism-All / SurrealismUI

A third-party UI library using Slint, I think it will give you an extraordinary experience
https://surrealism-all.github.io/SurrealismUI.github.io/
MIT License
216 stars 20 forks source link

推荐的使用姿势? #8

Closed zhangzqs closed 11 months ago

zhangzqs commented 11 months ago
  1. 目前好像只能将整个库复制到自己的slint项目的ui文件夹中使用?有没有办法以类似包管理器的方式使用?
  2. 使用内置icon必须直接依赖于具体的icon路径,是否有方式能够以import的方式使用这些icon?
syf20020816 commented 11 months ago

当前确实只能将发布包下载后复制到自己的slint项目的ui文件夹中使用,但预计在0.3+版本中构建类似于vite的包管理器方式直接进行使用或直接借助git clone的方式快速构建项目 内置Icon图标由IconPark支持,你可以直接使用IconPark的http形式使用图标(https://iconpark.oceanengine.com/home

syf20020816 commented 11 months ago

Slint Component Library Mapping

你可以配置setting.json中的Slint:Library Path方式设置路径映射

  "slint.libraryPaths": {
    "SurrealismUI":"E:\\Rust\\try\\surrealism-ui\\index.slint"
  }

视频讲解

B站:https://www.bilibili.com/video/BV19w411T7kG/?spm_id_from=333.999.0.0

syf20020816 commented 11 months ago

Slimk

A package manager for creating Slint with SurrealismUI

Commands

Create Slint Project

create a project by selecting configuration items

# use default strategy to create a new project
> slimk create hello 
# create a new project with a template
> slimk create hello --template slimk
> slimk create hello -t slimk

Init an empty Slint Project

this command creates a new project but use the default strategy with no template , you will get an empty slint project

you do not need to name the project , this way will use your root directory

# no name
> slimk init
# with name
> slimk init hello

Select Templates(Native,Remote)

# native
> slimk list -n
# remote 
> slimk list -r
# both
> slimk list -a

Select Configuration

> slimk config --get update

> slimk config --get create

Error Description

Network

Due to the lack of an independent server, I have designed it to rely on Github. Therefore, if you are unable to connect well to Github, the initialization of SLNs is likely to display network errors

Slimk : init conf successfully!
Slimk : Downloading | Updating default template...
thread 'main' panicked at 'download failed, please check your network settings!', src\lib\core.rs:229:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

solve

  1. go to : https://github.com/Surrealism-All/slimk-template and download latest release
  2. unzip it into repo directory
  3. write the following configuration into natives
{
  "natives": {
    "slimk-binary": {
      "id": 1701616493916,
      "url": "E:\\slimk\\repo\\slimk-binary",
      "note": "this is a native default template use Slint with SurrealismUI"
    }
  }
}

Res

img

Goals

Next Version Goals (V0.2+)

  1. Reduce the module section in the release of the slimk-template repository : Detach modules when downloading templates to prevent them from being forcibly dependent
  2. Add install command to add module into ui
  3. More humanized
  4. Stronger interaction