mirror of
https://github.com/slint-ui/slint.git
synced 2025-07-07 21:25:33 +00:00
Examples/Demos: fix warning about unused padding
This commit is contained in:
parent
d49fe14e4a
commit
27f026aeea
8 changed files with 13 additions and 40 deletions
|
@ -52,8 +52,7 @@ export component Settings inherits Page {
|
||||||
|
|
||||||
callback close();
|
callback close();
|
||||||
|
|
||||||
padding-left: 0;
|
horizontal-padding: 0;
|
||||||
padding-right: 0;
|
|
||||||
|
|
||||||
VerticalLayout {
|
VerticalLayout {
|
||||||
padding-left: Theme.spaces.medium;
|
padding-left: Theme.spaces.medium;
|
||||||
|
|
|
@ -6,10 +6,9 @@ import { Theme } from "../theme.slint";
|
||||||
export component Page inherits Rectangle {
|
export component Page inherits Rectangle {
|
||||||
in property <int> index;
|
in property <int> index;
|
||||||
in property <int> current-index;
|
in property <int> current-index;
|
||||||
|
in property <length> horizontal-padding: 14px;
|
||||||
out property <bool> active: index == current-index;
|
out property <bool> active: index == current-index;
|
||||||
|
|
||||||
padding-left: 14px;
|
|
||||||
padding-right: 14px;
|
|
||||||
x: (index - current-index) * self.width;
|
x: (index - current-index) * self.width;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
@ -17,8 +16,8 @@ export component Page inherits Rectangle {
|
||||||
animate x { duration: Theme.durations.fast; }
|
animate x { duration: Theme.durations.fast; }
|
||||||
|
|
||||||
GridLayout {
|
GridLayout {
|
||||||
padding-left: root.padding-left;
|
padding-left: root.horizontal-padding;
|
||||||
padding-right: root.padding-right;
|
padding-right: root.horizontal-padding;
|
||||||
|
|
||||||
@children
|
@children
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,7 +75,6 @@ export component AboutBox {
|
||||||
AboutFelgo {
|
AboutFelgo {
|
||||||
height: 84%;
|
height: 84%;
|
||||||
preferred-width: 200px;
|
preferred-width: 200px;
|
||||||
padding-bottom: 10px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,6 @@ component CityWeatherList inherits Flickable {
|
||||||
|
|
||||||
VerticalLayout {
|
VerticalLayout {
|
||||||
alignment: start;
|
alignment: start;
|
||||||
padding: 0px;
|
|
||||||
|
|
||||||
for city-weather-info[index] in CityWeather.city-weather:
|
for city-weather-info[index] in CityWeather.city-weather:
|
||||||
CitySlideArea {
|
CitySlideArea {
|
||||||
|
@ -171,8 +170,6 @@ export component CityListView inherits PageBase {
|
||||||
property<TileInfo> selected-tile;
|
property<TileInfo> selected-tile;
|
||||||
|
|
||||||
CityWeatherList {
|
CityWeatherList {
|
||||||
padding: 16px;
|
|
||||||
|
|
||||||
expand(index, absolute-position, width, height) => {
|
expand(index, absolute-position, width, height) => {
|
||||||
root.selected-tile = {
|
root.selected-tile = {
|
||||||
index: index,
|
index: index,
|
||||||
|
|
|
@ -28,11 +28,7 @@ export component FloatingTextButton inherits Rectangle {
|
||||||
background: AppPalette.background;
|
background: AppPalette.background;
|
||||||
border-radius: Math.min(self.width, self.height) / 2;
|
border-radius: Math.min(self.width, self.height) / 2;
|
||||||
|
|
||||||
padding: 12px;
|
property<length> margins: 12px;
|
||||||
padding-left: self.padding;
|
|
||||||
padding-right: self.padding;
|
|
||||||
padding-top: self.padding;
|
|
||||||
padding-bottom: self.padding;
|
|
||||||
|
|
||||||
preferred-width: 48px;
|
preferred-width: 48px;
|
||||||
preferred-height: 48px;
|
preferred-height: 48px;
|
||||||
|
@ -41,8 +37,8 @@ export component FloatingTextButton inherits Rectangle {
|
||||||
height: self.preferred-height;
|
height: self.preferred-height;
|
||||||
|
|
||||||
icon := AppIcon {
|
icon := AppIcon {
|
||||||
width: parent.width - parent.padding-left - parent.padding-right;
|
width: parent.width - 2 * parent.margins;
|
||||||
height: parent.height - parent.padding-top - parent.padding-bottom;
|
height: parent.height - 2 * parent.margins;
|
||||||
}
|
}
|
||||||
|
|
||||||
TouchArea {
|
TouchArea {
|
||||||
|
@ -77,24 +73,15 @@ export component TextField inherits Rectangle {
|
||||||
|
|
||||||
forward-focus: text-input;
|
forward-focus: text-input;
|
||||||
|
|
||||||
padding: 5px;
|
property <length> margins: 5px;
|
||||||
padding-top: self.padding;
|
preferred-height: text-input.preferred-height + 2 * self.margins;
|
||||||
padding-right: self.padding;
|
|
||||||
padding-bottom: self.padding;
|
|
||||||
padding-left: self.padding;
|
|
||||||
|
|
||||||
preferred-height: text-input.preferred-height + self.padding-top + self.padding-bottom;
|
|
||||||
height: self.preferred-height;
|
height: self.preferred-height;
|
||||||
|
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
background: white.with-alpha(15%);
|
background: white.with-alpha(15%);
|
||||||
|
|
||||||
HorizontalLayout {
|
HorizontalLayout {
|
||||||
x: root.padding-left;
|
padding: parent.margins;
|
||||||
width: parent.width - root.padding-left - root.padding-right;
|
|
||||||
|
|
||||||
y: root.padding-top;
|
|
||||||
height: parent.height - root.padding-top - root.padding-bottom;
|
|
||||||
|
|
||||||
spacing: icon.preferred-width > 0 ? 10px : 0px;
|
spacing: icon.preferred-width > 0 ? 10px : 0px;
|
||||||
|
|
||||||
|
|
|
@ -67,8 +67,7 @@ export component RainInfo inherits Rectangle {
|
||||||
|
|
||||||
property<float> max-bar-volume: 10;
|
property<float> max-bar-volume: 10;
|
||||||
|
|
||||||
padding-top: 2px;
|
property<length> margin: 2px;
|
||||||
padding-bottom: 2px;
|
|
||||||
|
|
||||||
opacity: root.minimal ? (root.precipitation-probability * 30% + 70%) : 100%;
|
opacity: root.minimal ? (root.precipitation-probability * 30% + 70%) : 100%;
|
||||||
|
|
||||||
|
@ -77,7 +76,7 @@ export component RainInfo inherits Rectangle {
|
||||||
y: parent.height - self.height;
|
y: parent.height - self.height;
|
||||||
|
|
||||||
width: 3px;
|
width: 3px;
|
||||||
height: (parent.height - parent.padding-top - parent.padding-bottom) *
|
height: (parent.height - 2 * parent.margin) *
|
||||||
Math.min(root.volume, root.max-bar-volume) / root.max-bar-volume * 100%;
|
Math.min(root.volume, root.max-bar-volume) / root.max-bar-volume * 100%;
|
||||||
|
|
||||||
background: root.type-color;
|
background: root.type-color;
|
||||||
|
|
|
@ -255,16 +255,10 @@ export component ExpandedCityWeatherTile inherits TouchArea {
|
||||||
clip: true;
|
clip: true;
|
||||||
|
|
||||||
Flickable {
|
Flickable {
|
||||||
padding-top: 15px;
|
|
||||||
padding-bottom: 15px;
|
|
||||||
|
|
||||||
y: self.padding-top;
|
|
||||||
height: parent.height - self.padding-top - self.padding-bottom;
|
|
||||||
|
|
||||||
VerticalLayout {
|
VerticalLayout {
|
||||||
alignment: start;
|
alignment: start;
|
||||||
padding-left: 15px;
|
padding: 15px;
|
||||||
padding-right: 15px;
|
|
||||||
|
|
||||||
ForecastTitleLine {}
|
ForecastTitleLine {}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,6 @@ export component MainWindow inherits Window {
|
||||||
width: 320px;
|
width: 320px;
|
||||||
height: 240px;
|
height: 240px;
|
||||||
background: Theme.window-background;
|
background: Theme.window-background;
|
||||||
padding: Theme.spacing-regular;
|
|
||||||
forward-focus: carousel;
|
forward-focus: carousel;
|
||||||
default-font-family: Theme.font-family;
|
default-font-family: Theme.font-family;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue