Skip to content

Commit

Permalink
Janitor: Remove trailing spaces in most files
Browse files Browse the repository at this point in the history
  • Loading branch information
ogoffart committed May 4, 2023
1 parent b098234 commit 6441968
Show file tree
Hide file tree
Showing 51 changed files with 215 additions and 216 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/torizon_demos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
Expand Down
2 changes: 1 addition & 1 deletion FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ or [GNU GPLv3](LICENSES/GPL-3.0-only.txt)
### Can I license my code under an open-source license more permissive than GPL?

Yes. While the binary or the package containing Slint needs to be licensed under GPL,
the code you write can be under any license compatible with the GPL, such as BSD, MIT, or Apache license.
the code you write can be under any license compatible with the GPL, such as BSD, MIT, or Apache license.
For more info, you can check the following GPL FAQs:

- [https://www.gnu.org/licenses/gpl-faq.en.html#LinkingWithGPL](https://www.gnu.org/licenses/gpl-faq.en.html#LinkingWithGPL)
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.cpp-image
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RUN apt-get update && \


ENV RUSTUP_HOME=/rust
ENV CARGO_HOME=/cargo
ENV CARGO_HOME=/cargo
ENV PATH=/cargo/bin:/rust/bin:$PATH

RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.torizon-demos
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ENV WEATHER_API=$WEATHER_API_KEY

# Install Rust
ENV RUSTUP_HOME=/rust
ENV CARGO_HOME=/cargo
ENV CARGO_HOME=/cargo
ENV PATH=/cargo/bin:/rust/bin:$PATH

RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
Expand Down
6 changes: 3 additions & 3 deletions docs/language/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,16 @@ Getting Started
---------------

To use `Slint <https://slint-ui.com>`_ you need to embed your slint files in a project written
in a supported programming language, like C++, Rust, or JavaScript.
in a supported programming language, like C++, Rust, or JavaScript.

There are three different pathways to get started with Slint:

1. `SlintPad <https://slint-ui.com/editor>`_ - Use this to get a feel of the Slint design markup language.
This is a web browser-based tool where you can try Slint out.

2. As a UI Designer, working with Slint files locally, we recommend the following combination of software tools:
- Visual Studio Code

- Visual Studio Code
- The Slint for Visual Studio Code Extension

3. As a Software Developer, integrating Slint into a new or existing code base, choose one of these languages to
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial/cpp/src/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
In this tutorial, we use C++ as the host programming language. We also support other programming languages like
[Rust](https://slint-ui.com/docs/rust/slint/) or [JavaScript](https://slint-ui.com/docs/node/).

You will need a development environment that can compile C++20, [CMake 3.21](https://cmake.org/download/),
You will need a development environment that can compile C++20, [CMake 3.21](https://cmake.org/download/),
and we recommend [Ninja](https://ninja-build.org) for `-GNinja`.
We don't provide binaries of Slint yet, so we will use the CMake integration that will automatically build
the tools and library from source. Since it's implemented in the Rust programming language, this means that
Expand Down
4 changes: 2 additions & 2 deletions examples/carousel/ui/card.slint
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Theme } from "theme.slint";
import { TitleLabel } from "title_label.slint";

export component Card inherits Rectangle {
callback clicked <=> touch-area.clicked;
callback clicked <=> touch-area.clicked;

in property <string> title: "title";
in property <bool> is-selected: false;
Expand All @@ -31,7 +31,7 @@ export component Card inherits Rectangle {

animate colorize { duration: Theme.duration-fast; }
}

// Selection text
title-label := TitleLabel {
x: (parent.width - self.width) / 2;
Expand Down
20 changes: 10 additions & 10 deletions examples/carousel/ui/carousel.slint
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ export component Carousel inherits FocusScope {
forward-focus: focus-scope;
height: Theme.size-big;

move-right => {
move-right => {
root.selected-index = min(root.selected-index + 1, root.count - 1);
}

move-left => {
move-left => {
root.selected-index = max(root.selected-index - 1, 0);
}

focus-scope:= FocusScope {
key-pressed(event) => {
if(event.text == Key.UpArrow) {
Expand All @@ -47,7 +47,7 @@ export component Carousel inherits FocusScope {
}
}

TouchArea {
TouchArea {
width: parent.width;
height: parent.height;

Expand All @@ -57,20 +57,20 @@ export component Carousel inherits FocusScope {
}


Rectangle {
Rectangle {
clip: true;
background: transparent;

Flickable {
interactive: false;
animate viewport-x { duration: root.duation; easing: ease-in; }
viewport-x: root.center-x - root.selected-index * (root.itemWidth + root.spacing);
HorizontalLayout {

HorizontalLayout {
spacing <=> root.spacing;

@children
}
}
}
}
}
6 changes: 3 additions & 3 deletions examples/carousel/ui/carousel_demo.slint
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ export component MainWindow inherits Window {
forward-focus: carousel;
default-font-family: Theme.font-family;

carousel := Carousel {
carousel := Carousel {
y: (root.height - self.height) / 2;
height: 100%;
itemWidth: Theme.size-medium;
count: root.navigation-items.length;
selected-index <=> root.selected-index;
spacing: Theme.spacing-medium;

for item[index] in root.navigation-items : Card {
is-selected: index == root.selected-index;
title: item.title;
image-source: item.image;
y: (parent.height - self.height) / 2;

clicked => { root.selected-index = index; }
}
}
}
}
20 changes: 10 additions & 10 deletions examples/energy-monitor/ui/blocks/header.slint
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ export component Header {
min-height: 50px;
vertical-stretch: 0;

HorizontalLayout {
HorizontalLayout {
padding: 20px;
spacing: 5px;

Rectangle {
Rectangle {
horizontal-stretch: 1;

Text {
Text {
x: 0px;
color: Theme.palette.white;
text: date;
Expand All @@ -36,19 +36,19 @@ export component Header {
}
}

Rectangle {
Rectangle {
horizontal-stretch: 1;

Image {
height: 30px;
source: logo;
}
}
Rectangle {

Rectangle {
horizontal-stretch: 1;

Text {
Text {
x: i-time-suffix.x - 5px - self.width;
horizontal-alignment: right;
color: Theme.palette.white;
Expand All @@ -57,8 +57,8 @@ export component Header {
font-weight: Theme.typo.header-item.weight;
}

i-time-suffix := Text {
x: parent.width - self.width;
i-time-suffix := Text {
x: parent.width - self.width;
horizontal-stretch: 0;
color: Theme.palette.shark-gray;
text: time-suffix;
Expand Down
2 changes: 1 addition & 1 deletion examples/energy-monitor/ui/blocks/kiosk_overlay.slint
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export component KioskOverlay {
}
}

Rectangle {
Rectangle {
x: i-text.x - 1px;
y: i-text.y - 1px;
width: i-text.width + 2px;
Expand Down
8 changes: 4 additions & 4 deletions examples/energy-monitor/ui/components/state_layer.slint
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ import { Theme } from "../theme.slint";

export component StateLayer inherits TouchArea {
in property <length> border-radius <=> i-container.border-radius;

width: 100%;
height: 100%;

i-container := Rectangle {
i-container := Rectangle {
width: 100%;
height: 100%;
background: Theme.palette.pure-black;
opacity: 0.0;

animate background { duration: Theme.durations.medium; }
}

states [
states [
pressed when root.pressed : {
i-container.opacity: 0.12;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/energy-monitor/ui/pages/page.slint
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export component Page inherits Rectangle {

animate x { duration: Theme.durations.fast; }

GridLayout {
GridLayout {
padding-left: root.padding-left;
padding-right: root.padding-right;

Expand Down
18 changes: 9 additions & 9 deletions examples/energy-monitor/ui/widgets/chart_axis.slint
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ export component ChartAxis {
in property <int> y-max;
in property <string> y-unit;

VerticalLayout {
VerticalLayout {
horizontal-stretch: 1;
alignment: end;
HorizontalLayout {

HorizontalLayout {
spacing: 1px;

for text in x-model : Rectangle {
Expand All @@ -37,16 +37,16 @@ export component ChartAxis {
}
}
}
}
}

HorizontalLayout {
HorizontalLayout {
alignment: end;
Rectangle {

Rectangle {
background: green;

for value in y-model : AxisLabel {
y: (value >= 0 ? parent.height * (1 - (value - y-min) / (y-max - y-min)) :
y: (value >= 0 ? parent.height * (1 - (value - y-min) / (y-max - y-min)) :
y-zero + parent.height * (-1 * value / (y-max - y-min))) - self.height / 2;
text: "\{value}\{y-unit}";
}
Expand Down
10 changes: 5 additions & 5 deletions examples/energy-monitor/ui/widgets/check_box.slint
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ export component CheckBox {
min-height: 18px;
width: self.height;

i-container := Rectangle {
i-container := Rectangle {
border-color: Theme.palette.slint-blue-300;
border-width: 2px;
border-radius: 2px;

i-check-icon := Image {
i-check-icon := Image {
opacity: 0.0;
colorize: Theme.palette.pure-black;
source: Images.check;
Expand All @@ -27,13 +27,13 @@ export component CheckBox {
animate background { duration: Theme.durations.fast; }
}

i-touch-area := TouchArea {
clicked => {
i-touch-area := TouchArea {
clicked => {
checked = !checked;
}
}

states [
states [
checked when checked : {
i-container.border-width: 0;
i-container.background: Theme.palette.limon-green;
Expand Down
4 changes: 2 additions & 2 deletions examples/energy-monitor/ui/widgets/icon_button.slint
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export component IconButton {
min-width: 24px;
min-height: 24px;

GridLayout {
GridLayout {
padding: 4px;

i-icon := Image {
Expand All @@ -26,7 +26,7 @@ export component IconButton {

i-touch-area := TouchArea {}

states [
states [
disabled when !root.enabled : {
opacity: 0.25;
}
Expand Down
Loading

0 comments on commit 6441968

Please sign in to comment.