Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace broken svg #6498

Merged
merged 3 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions examples/fancy-switches/DarkModeSwitch.slint
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
// Copyright © SixtyFPS GmbH <[email protected]>
// SPDX-License-Identifier: MIT

component SunRayThick {
export component RayThick {
NigelBreslaw marked this conversation as resolved.
Show resolved Hide resolved
in-out property colorize <=> i.colorize;
in-out property rotation <=> i.rotation-angle;
width: 0px;
height: 0px;
in property <angle> rotation <=> i.rotation-angle;
in property <brush> color <=> i.colorize;
Rectangle {
property <length> sizeMultiplyer: 0.7px;
i := Image {
source: @image-url("images/line2.svg");
width: self.source.width * sizeMultiplyer * 0.8;
height: self.source.height * sizeMultiplyer;
colorize: red;
}

i := Image {
property <length> sizeMultiplyer: 0.3px;
NigelBreslaw marked this conversation as resolved.
Show resolved Hide resolved
width: self.source.width * sizeMultiplyer * 0.8;
height: self.source.height * sizeMultiplyer * 1;
source: @image-url("images/line.png");
}

}

component SunRayThin {
export component RayThin {
in-out property colorize <=> i.colorize;
in-out property rotation <=> i.rotation-angle;
width: 0px;
height: 0px;
in property <angle> rotation <=> i.rotation-angle;
in property <brush> color <=> i.colorize;
Rectangle {
i := Image {
property <length> sizeMultiplyer: 0.6px;
source: @image-url("images/line2.svg");
width: self.source.width * sizeMultiplyer * 0.6;
height: self.source.height * sizeMultiplyer;
}

i := Image {
property <length> sizeMultiplyer: 0.25px;
width: self.source.width * sizeMultiplyer * 0.6;
height: self.source.height * sizeMultiplyer;
source: @image-url("images/line.png");
}
}

}


component SunIcon {
property <int> rays: 4;
Expand All @@ -51,17 +51,17 @@ component SunIcon {
border-color: root.color;
border-width: 5px;
}
for i in rays: SunRayThick {
for i in rays: RayThick {
property <angle> angle: i * 360deg / rays;
color: root.color;
colorize: root.color;
x: (sun-size / 2 + gap) * scale * angle.cos();
y: (sun-size / 2 + gap) * scale * angle.sin();

rotation: angle;
}
for i in rays: SunRayThin {
for i in rays: RayThin {
property <angle> angle: i * (360deg / rays) + 45deg;
color: root.color;
colorize: root.color;
x: (sun-size / 2 + gap) * angle.cos();
y: (sun-size / 2 + gap) * angle.sin();
rotation: angle;
Expand Down
Binary file added examples/fancy-switches/images/line.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion examples/fancy-switches/images/line.svg

This file was deleted.

1 change: 0 additions & 1 deletion examples/fancy-switches/images/line2.svg

This file was deleted.

Loading