
marc2332/freya
Developer tools이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
Rust용 🦀 크로스 플랫폼 및 비웹 GUI 라이브러리로, Skia가 구동🎨합니다.
개요
:경고: 최근에 https://github.com/marc2332/freya/pull/1351,에서 프레이야의 상당 부분을 다시 작성해서 메인 브랜치가 최신 안정판과 많이 다릅니다. Freya의 컴포넌트 모델은 의존하는 상태가 변할 때 자동으로 재렌더링되는 재사용 가능한 UI 요소를 만들 수 있게 해줍니다. 컴포넌트는 자체 내부 상태를 유지하거나 공유 상태를 구독할 수 있으며, UI를 출력으로 생성합니다. 컴포넌트 특성을 구현하는 모든 타입은 컴포넌트가 될 수 있고, 루트(앱) 컴포넌트는 단순히 함수일 수 있습니다. 내장 예로는 Button과 Switch 같은 컴포넌트가 있습니다. Freya는 Button, Switch, Slider 같은 간단한 기능부터 VirtualScrollView, Calendar, ColorPicker 같은 복잡한 것까지 기본 구성 요소 세트를 제공합니다. component_로 시작하는 예제는 examples 폴더에서 확인할 수 있습니다. 색상, 크기, 위치 및 기타 시각적 속성에 대한 전환을 만드세요.
개요(AI 번역)
웹사이트 | 문서 | 디스코드 | 연락처
Freya는 크로스 플랫폼, 네이티브, 선언형 Rust🦀용 GUI 라이브러리입니다.
사용 📜
최신 안정 버전:
다음 릴리스:
main 분기:
시도해 보려 🚀
개발 설정(Development Setup)을 준비해 두세요.
⚠️ 이 저장소는 git 서브모듈을 사용합니다,
--recurse-submodules없이 클론하면 예제가 컴파일되지 않습니다.
이미 서브 모듈 없이 복제했나요?
git submodule update --init --recursive를 실행해서 가져오세요.
그다음 예제를 실행해 봅니다:
⚠️ 만약 윈도우에서
windows-gnu를 사용 중이고 컴파일 오류가 발생한다면, 이 문제를 확인해 보시는 것도 좋을 것 같습니다.
구성 요소 및 주
Freya의 컴포넌트 모델은 의존하는 상태가 변할 때 자동으로 재렌더링되는 재사용 가능한 UI 요소를 만들 수 있게 해줍니다. 컴포넌트는 자체 내부 상태를 유지하거나 공유 상태를 구독할 수 있으며, UI를 출력으로 생성합니다. Component 특성을 구현한 타입은 컴포넌트가 될 수 있고, 루트(app) 컴포넌트는 단순히 함수일 수 있습니다. 내장 예로는 Button와 [Switch 같은 컴포넌트가 있습니다.
박스에서 나온 부품
이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.
README
원문 README의 일부입니다. 원문 보기.
Freya 🦀
Website | Documentation | Discord | Contact
Freya is a cross-platform, native, declarative GUI library for Rust 🦀.
Usage 📜
Latest stable release:
freya = "0.4"
Next release:
freya = "0.5.0-rc.13"
main branch:
freya = { git = "https://github.com/marc2332/freya", branch = "main" }
Trying it out 🚀
Make sure to have Development Setup ready.
⚠️ This repo uses git submodules, cloning without
--recurse-submoduleswill make the examples fail to compile.
git clone --recurse-submodules https://github.com/marc2332/freya.git
cd freya
Already cloned without submodules? Run
git submodule update --init --recursiveto fetch them.
Then run an example:
cargo run --example counter
⚠️ If you happen to be on Windows using
windows-gnuand get compile errors, maybe go check this issue.
Components & State
Freya’s component model lets you create reusable UI elements that automatically re-render when the state they depend on changes. Components can hold their own internal state or subscribe to shared state, and they produce UI as their output. Any type that implements the Component trait can be a component, while the root (app) component can simply be a function. Built-in examples include components like Button and Switch.
fn app() -> impl IntoElement {
let mut count = use_state(|| 4);
let counter = rect()
.width(Size::fill())
.height(Size::percent(50.))
.center()
.color((255, 255, 255))
.background((15, 163, 242))
.font_weight(FontWeight::BOLD)
.font_size(75.)
.shadow((0., 4., 20., 4., (0, 0, 0, 80)))
.child(count.read().to_string());
let actions = rect()
.horizontal()
.width(Size::fill())
.height(Size::percent(50.))
.center()
.spacing(8.0)
.child(
Button::new()
.on_press(move |_| {
*count.write() += 1;
})
.child("Increase"),
추천 도구
다른 키워드를 입력하거나 필터를 제거해 보세요.
설치
npx skillfish add marc2332/freya