Skip to content

Commit

Permalink
Merge branch 'iced-rs:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
breynard0 authored Aug 1, 2024
2 parents 88d4946 + 169667e commit 86d1c07
Show file tree
Hide file tree
Showing 195 changed files with 8,094 additions and 6,784 deletions.
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/BUG-REPORT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@ body:
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: checkboxes
attributes:
label: Is your issue REALLY a bug?
description: |
This issue tracker is for __BUG REPORTS ONLY__.
It's obvious, right? This is a bug report form, after all! Still, some crazy users seem to forcefully fill out this form just to ask questions and request features.
The core team does not appreciate that. Don't do it.
If you want to ask a question or request a feature, please [go back here](https://github.com/iced-rs/iced/issues/new/choose) and read carefully.
options:
- label: My issue is indeed a bug!
required: true
- label: I am not crazy! I will not fill out this form just to ask a question or request a feature. Pinky promise.
required: true
- type: checkboxes
attributes:
label: Is there an existing issue for this?
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ contact_links:
- name: I have a question
url: https://discourse.iced.rs/c/learn/6
about: Ask and learn from others in the Discourse forum.
- name: I want to start a discussion
- name: I want to request a feature or start a discussion
url: https://discourse.iced.rs/c/request-feedback/7
about: Share your idea and gather feedback in the Discourse forum.
- name: I want to chat with other users of the library
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/document.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ jobs:
steps:
- uses: hecrj/setup-rust-action@v2
with:
rust-version: nightly-2023-12-11
rust-version: nightly
- uses: actions/checkout@v2
- name: Generate documentation
run: |
RUSTDOCFLAGS="--cfg docsrs" \
cargo doc --no-deps --all-features \
-p futures-core \
-p iced_core \
-p iced_highlighter \
-p iced_futures \
Expand Down
20 changes: 12 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ svg = ["iced_widget/svg"]
canvas = ["iced_widget/canvas"]
# Enables the `QRCode` widget
qr_code = ["iced_widget/qr_code"]
# Enables the `markdown` widget
markdown = ["iced_widget/markdown"]
# Enables lazy widgets
lazy = ["iced_widget/lazy"]
# Enables a debug view in native platforms (press F12)
Expand All @@ -51,7 +53,7 @@ web-colors = ["iced_renderer/web-colors"]
# Enables the WebGL backend, replacing WebGPU
webgl = ["iced_renderer/webgl"]
# Enables the syntax `highlighter` module
highlighter = ["iced_highlighter"]
highlighter = ["iced_highlighter", "iced_widget/highlighter"]
# Enables experimental multi-window support.
multi-window = ["iced_winit/multi-window"]
# Enables the advanced module
Expand All @@ -66,7 +68,7 @@ iced_core.workspace = true
iced_futures.workspace = true
iced_renderer.workspace = true
iced_widget.workspace = true
iced_winit.features = ["application"]
iced_winit.features = ["program"]
iced_winit.workspace = true

iced_highlighter.workspace = true
Expand Down Expand Up @@ -138,11 +140,11 @@ async-std = "1.0"
bitflags = "2.0"
bytemuck = { version = "1.0", features = ["derive"] }
bytes = "1.6"
cosmic-text = "0.10"
cosmic-text = "0.12"
dark-light = "1.0"
futures = "0.3"
glam = "0.25"
glyphon = { git = "https://github.com/hecrj/glyphon.git", rev = "f07e7bab705e69d39a5e6e52c73039a93c4552f8" }
glyphon = { git = "https://github.com/hecrj/glyphon.git", rev = "feef9f5630c2adb3528937e55f7bfad2da561a65" }
guillotiere = "0.6"
half = "2.2"
image = "0.24"
Expand All @@ -155,10 +157,11 @@ num-traits = "0.2"
once_cell = "1.0"
ouroboros = "0.18"
palette = "0.7"
pulldown-cmark = "0.11"
qrcode = { version = "0.13", default-features = false }
raw-window-handle = "0.6"
resvg = "0.36"
rustc-hash = "1.0"
resvg = "0.42"
rustc-hash = "2.0"
smol = "1.0"
smol_str = "0.2"
softbuffer = "0.4"
Expand All @@ -169,17 +172,18 @@ tiny-skia = "0.11"
tokio = "1.0"
tracing = "0.1"
unicode-segmentation = "1.0"
url = "2.5"
wasm-bindgen-futures = "0.4"
wasm-timer = "0.2"
web-sys = "=0.3.67"
web-time = "1.1"
wgpu = "0.19"
winapi = "0.3"
window_clipboard = "0.4.1"
winit = { git = "https://github.com/iced-rs/winit.git", rev = "8affa522bc6dcc497d332a28c03491d22a22f5a7" }
winit = { git = "https://github.com/iced-rs/winit.git", rev = "254d6b3420ce4e674f516f7a2bd440665e05484d" }

[workspace.lints.rust]
rust_2018_idioms = "forbid"
rust_2018_idioms = { level = "forbid", priority = -1 }
missing_debug_implementations = "deny"
missing_docs = "deny"
unsafe_code = "deny"
Expand Down
2 changes: 2 additions & 0 deletions DEPENDENCIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ pkgs.mkShell rec {
xorg.libXcursor
xorg.libXi
xorg.libXrandr
wayland
libxkbcommon
];
LD_LIBRARY_PATH =
Expand Down
3 changes: 0 additions & 3 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,5 @@ web-time.workspace = true
dark-light.workspace = true
dark-light.optional = true

[target.'cfg(windows)'.dependencies]
raw-window-handle.workspace = true

[dev-dependencies]
approx = "0.5"
20 changes: 20 additions & 0 deletions core/src/alignment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ pub enum Horizontal {
Right,
}

impl From<Alignment> for Horizontal {
fn from(alignment: Alignment) -> Self {
match alignment {
Alignment::Start => Self::Left,
Alignment::Center => Self::Center,
Alignment::End => Self::Right,
}
}
}

/// The vertical [`Alignment`] of some resource.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum Vertical {
Expand All @@ -58,3 +68,13 @@ pub enum Vertical {
/// Align bottom
Bottom,
}

impl From<Alignment> for Vertical {
fn from(alignment: Alignment) -> Self {
match alignment {
Alignment::Start => Self::Top,
Alignment::Center => Self::Center,
Alignment::End => Self::Bottom,
}
}
}
7 changes: 7 additions & 0 deletions core/src/angle.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::{Point, Rectangle, Vector};

use std::f32::consts::{FRAC_PI_2, PI};
use std::fmt::Display;
use std::ops::{Add, AddAssign, Div, Mul, RangeInclusive, Rem, Sub, SubAssign};

/// Degrees
Expand Down Expand Up @@ -237,3 +238,9 @@ impl PartialOrd<f32> for Radians {
self.0.partial_cmp(other)
}
}

impl Display for Radians {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{} rad", self.0)
}
}
Loading

0 comments on commit 86d1c07

Please sign in to comment.