mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-17 02:43:04 +00:00
em: polish menu (#2366)
This commit is contained in:
parent
656569be0d
commit
2da2f51929
9 changed files with 111 additions and 129 deletions
|
|
@ -13,7 +13,7 @@ import { Navigation, MenuButton, Menu, Value } from "widgets/widgets.slint";
|
||||||
import { BalanceAdapter, OverviewAdapter, UsageAdapter, WeatherAdapter, MenuPageAdapter, MenuOverviewAdapter, SettingsAdapter } from "pages/pages.slint";
|
import { BalanceAdapter, OverviewAdapter, UsageAdapter, WeatherAdapter, MenuPageAdapter, MenuOverviewAdapter, SettingsAdapter } from "pages/pages.slint";
|
||||||
import { KioskOverlay } from "blocks/kiosk_overlay.slint";
|
import { KioskOverlay } from "blocks/kiosk_overlay.slint";
|
||||||
|
|
||||||
export { OverviewAdapter, UsageAdapter, Value, WeatherAdapter, MenuPageAdapter, MenuOverviewAdapter, SettingsAdapter,
|
export { OverviewAdapter, UsageAdapter, Value, WeatherAdapter, MenuPageAdapter, MenuOverviewAdapter, SettingsAdapter,
|
||||||
BarTileModel, Images, HeaderAdapter }
|
BarTileModel, Images, HeaderAdapter }
|
||||||
|
|
||||||
export component MainWindow inherits Window {
|
export component MainWindow inherits Window {
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import { Theme } from "theme.slint";
|
||||||
import { Menu, PageScrollView, PageContainer } from "widgets/widgets.slint";
|
import { Menu, PageScrollView, PageContainer } from "widgets/widgets.slint";
|
||||||
import { MenuPage } from "pages/pages.slint";
|
import { MenuPage } from "pages/pages.slint";
|
||||||
import { Balance, Overview, Usage, UsageAdapter, Weather } from "pages/pages.slint";
|
import { Balance, Overview, Usage, UsageAdapter, Weather } from "pages/pages.slint";
|
||||||
|
|
||||||
export component MidMain {
|
export component MidMain {
|
||||||
private property <int> page-count: 4;
|
private property <int> page-count: 4;
|
||||||
private property <length> item-width: i-page-scroll-view.viewport-width / page-count;
|
private property <length> item-width: i-page-scroll-view.viewport-width / page-count;
|
||||||
|
|
@ -16,29 +16,45 @@ export component MidMain {
|
||||||
Rectangle {
|
Rectangle {
|
||||||
background: Theme.palette.background-gradient;
|
background: Theme.palette.background-gradient;
|
||||||
|
|
||||||
VerticalLayout {
|
VerticalLayout {
|
||||||
padding-bottom: 50px;
|
padding-bottom: 50px;
|
||||||
spacing: 35px;
|
spacing: 35px;
|
||||||
|
|
||||||
Header {}
|
Header {}
|
||||||
|
|
||||||
i-page-scroll-view := PageScrollView {
|
i-page-scroll-view := PageScrollView {
|
||||||
vertical-stretch: 1;
|
vertical-stretch: 1;
|
||||||
|
|
||||||
PageContainer {
|
PageContainer {
|
||||||
Overview {}
|
Overview {}
|
||||||
|
|
||||||
|
clicked => {
|
||||||
|
show-page(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PageContainer {
|
PageContainer {
|
||||||
Usage {}
|
Usage {}
|
||||||
|
|
||||||
|
clicked => {
|
||||||
|
show-page(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PageContainer {
|
PageContainer {
|
||||||
Balance {}
|
Balance {}
|
||||||
|
|
||||||
|
clicked => {
|
||||||
|
show-page(2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PageContainer {
|
PageContainer {
|
||||||
Weather {}
|
Weather {}
|
||||||
|
|
||||||
|
clicked => {
|
||||||
|
show-page(3);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
animate viewport-x { duration: Theme.durations.medium; }
|
animate viewport-x { duration: Theme.durations.medium; }
|
||||||
|
|
@ -47,16 +63,16 @@ export component MidMain {
|
||||||
|
|
||||||
i-menu := Menu {
|
i-menu := Menu {
|
||||||
stays-open: true;
|
stays-open: true;
|
||||||
|
|
||||||
start-y: 35px;
|
start-y: 35px;
|
||||||
end-y: 75px;
|
end-y: 75px;
|
||||||
menu-width: root.width / 3;
|
menu-width: root.width / 3;
|
||||||
menu-height: root.height - 75px;
|
menu-height: root.height - 75px;
|
||||||
|
|
||||||
i-menu-page := MenuPage {
|
i-menu-page := MenuPage {
|
||||||
page-changed(index) => {
|
page-changed(index) => {
|
||||||
i-menu.hide();
|
i-menu.hide();
|
||||||
i-page-scroll-view.viewport-x = min(0px, max(max-viewport-x, -(index * item-width)));
|
show-page(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
close => {
|
close => {
|
||||||
|
|
@ -69,4 +85,8 @@ export component MidMain {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function show-page(index: int) {
|
||||||
|
i-page-scroll-view.viewport-x = min(0px, max(max-viewport-x, -(index * item-width)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -16,43 +16,4 @@ export global MenuOverviewAdapter {
|
||||||
];
|
];
|
||||||
in-out property <int> current-page;
|
in-out property <int> current-page;
|
||||||
out property <int> count: model.length;
|
out property <int> count: model.length;
|
||||||
}
|
|
||||||
|
|
||||||
export component MenuOverview inherits Page {
|
|
||||||
callback page-changed <=> i-page-list.selection-changed;
|
|
||||||
callback show-settings <=> i-settings-button.clicked;
|
|
||||||
callback show-about <=> i-about-button.clicked;
|
|
||||||
|
|
||||||
in property <[StandardListViewItem]> model <=> MenuOverviewAdapter.model;
|
|
||||||
in-out property <int> current-page <=> MenuOverviewAdapter.current-page;
|
|
||||||
|
|
||||||
padding-left: 0;
|
|
||||||
padding-right: 0;
|
|
||||||
|
|
||||||
VerticalLayout {
|
|
||||||
padding: Theme.spaces.medium;
|
|
||||||
spacing: Theme.spaces.small;
|
|
||||||
|
|
||||||
HorizontalLayout {
|
|
||||||
vertical-stretch: 0;
|
|
||||||
|
|
||||||
i-settings-button := IconButton {
|
|
||||||
icon: Images.settings;
|
|
||||||
}
|
|
||||||
|
|
||||||
// spacer
|
|
||||||
Rectangle {
|
|
||||||
horizontal-stretch: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
i-about-button := IconButton {
|
|
||||||
icon: Images.information;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
i-page-list := ListView {
|
|
||||||
model: root.model;
|
|
||||||
selected-index <=> root.current-page;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
|
||||||
|
|
||||||
import { About } from "about.slint";
|
import { About } from "about.slint";
|
||||||
import { MenuOverview, MenuOverviewAdapter } from "menu_overview.slint";
|
import { MenuOverviewAdapter } from "menu_overview.slint";
|
||||||
import { Settings, SettingsAdapter } from "settings.slint";
|
import { Settings, SettingsAdapter } from "settings.slint";
|
||||||
import { Theme } from "../../theme.slint";
|
import { Theme } from "../../theme.slint";
|
||||||
|
|
||||||
|
|
@ -31,45 +31,27 @@ export component MenuPage {
|
||||||
width: 2 * parent.width;
|
width: 2 * parent.width;
|
||||||
clip: true;
|
clip: true;
|
||||||
|
|
||||||
if(parent.x > -parent.width) : MenuOverview {
|
if(current-index == 0) : Settings {
|
||||||
width: root.width;
|
width: root.width;
|
||||||
|
|
||||||
page-changed(index) => {
|
|
||||||
root.page-changed(index);
|
|
||||||
}
|
|
||||||
show-settings => {
|
|
||||||
show-settings = true;
|
|
||||||
current-index = 1;
|
|
||||||
|
|
||||||
}
|
|
||||||
show-about => {
|
show-about => {
|
||||||
show-settings = false;
|
|
||||||
current-index = 1;
|
current-index = 1;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(!show-settings && current-index == 1) : About {
|
|
||||||
x: root.width;
|
|
||||||
width: root.width;
|
|
||||||
|
|
||||||
back => {
|
|
||||||
back();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(show-settings && current-index == 1) : Settings {
|
|
||||||
x: root.width;
|
|
||||||
width: root.width;
|
|
||||||
|
|
||||||
back => {
|
|
||||||
back();
|
|
||||||
}
|
|
||||||
|
|
||||||
close => {
|
close => {
|
||||||
root.close();
|
root.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(current-index == 1) : About {
|
||||||
|
x: root.width;
|
||||||
|
width: root.width;
|
||||||
|
|
||||||
|
back => {
|
||||||
|
back();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
animate x { duration: Theme.durations.fast; }
|
animate x { duration: Theme.durations.fast; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import { IconButton, CheckBox, RadioButton, Switch, ScrollView, Item, ItemGroupB
|
||||||
|
|
||||||
export global SettingsAdapter {
|
export global SettingsAdapter {
|
||||||
callback check-radio-option(int /* index */);
|
callback check-radio-option(int /* index */);
|
||||||
|
|
||||||
// fuctions
|
// fuctions
|
||||||
in-out property <bool> fuction-one-checked: true;
|
in-out property <bool> fuction-one-checked: true;
|
||||||
in-out property <bool> kiosk-mode-checked;
|
in-out property <bool> kiosk-mode-checked;
|
||||||
|
|
@ -28,7 +29,7 @@ export global SettingsAdapter {
|
||||||
radio-option-one-checked = true;
|
radio-option-one-checked = true;
|
||||||
radio-option-two-checked = false;
|
radio-option-two-checked = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
radio-option-one-checked = false;
|
radio-option-one-checked = false;
|
||||||
radio-option-two-checked = true;
|
radio-option-two-checked = true;
|
||||||
|
|
@ -37,7 +38,7 @@ export global SettingsAdapter {
|
||||||
|
|
||||||
export component Settings inherits Page {
|
export component Settings inherits Page {
|
||||||
callback close();
|
callback close();
|
||||||
callback back <=> i-back-button.clicked;
|
callback show-about <=> i-back-button.clicked;
|
||||||
callback check-radio-option <=> SettingsAdapter.check-radio-option;
|
callback check-radio-option <=> SettingsAdapter.check-radio-option;
|
||||||
|
|
||||||
// fuctions
|
// fuctions
|
||||||
|
|
@ -57,28 +58,28 @@ export component Settings inherits Page {
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
padding-right: 0;
|
padding-right: 0;
|
||||||
|
|
||||||
VerticalLayout {
|
VerticalLayout {
|
||||||
padding-left: Theme.spaces.medium;
|
padding-left: Theme.spaces.medium;
|
||||||
padding-right: Theme.spaces.medium;
|
padding-right: Theme.spaces.medium;
|
||||||
padding-top: Theme.spaces.medium;
|
padding-top: Theme.spaces.medium;
|
||||||
padding-bottom: Theme.spaces.large;
|
padding-bottom: Theme.spaces.large;
|
||||||
spacing: Theme.spaces.medium;
|
spacing: Theme.spaces.medium;
|
||||||
|
|
||||||
HorizontalLayout {
|
HorizontalLayout {
|
||||||
vertical-stretch: 0;
|
vertical-stretch: 0;
|
||||||
alignment: start;
|
alignment: end;
|
||||||
|
|
||||||
i-back-button := IconButton {
|
i-back-button := IconButton {
|
||||||
horizontal-stretch: 0;
|
horizontal-stretch: 0;
|
||||||
icon: Images.arrow-left;
|
icon: Images.information;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// spacer
|
// spacer
|
||||||
ScrollView {
|
ScrollView {
|
||||||
vertical-stretch: 1;
|
vertical-stretch: 1;
|
||||||
|
|
||||||
VerticalLayout {
|
VerticalLayout {
|
||||||
alignment: start;
|
alignment: start;
|
||||||
spacing: Theme.spaces.medium;
|
spacing: Theme.spaces.medium;
|
||||||
|
|
||||||
|
|
@ -94,17 +95,17 @@ export component Settings inherits Page {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemGroupBox {
|
ItemGroupBox {
|
||||||
title: "Subtitle";
|
title: "Subtitle";
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
text: "Option One";
|
text: "Option One";
|
||||||
has-separator: true;
|
has-separator: true;
|
||||||
|
|
||||||
i-radio-option-one := RadioButton {
|
i-radio-option-one := RadioButton {
|
||||||
checked: root.radio-option-one-checked;
|
checked: root.radio-option-one-checked;
|
||||||
|
|
||||||
clicked => {
|
clicked => {
|
||||||
root.check-radio-option(0);
|
root.check-radio-option(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -117,10 +118,10 @@ export component Settings inherits Page {
|
||||||
Item {
|
Item {
|
||||||
text: "Option Two";
|
text: "Option Two";
|
||||||
|
|
||||||
i-radio-option-two := RadioButton {
|
i-radio-option-two := RadioButton {
|
||||||
checked: root.radio-option-two-checked;
|
checked: root.radio-option-two-checked;
|
||||||
|
|
||||||
clicked => {
|
clicked => {
|
||||||
root.check-radio-option(1);
|
root.check-radio-option(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -131,9 +132,9 @@ export component Settings inherits Page {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemGroupBox {
|
ItemGroupBox {
|
||||||
title: "Subtitle";
|
title: "Subtitle";
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
text: "Option One";
|
text: "Option One";
|
||||||
has-separator: true;
|
has-separator: true;
|
||||||
|
|
@ -176,7 +177,7 @@ export component Settings inherits Page {
|
||||||
Item {
|
Item {
|
||||||
text: "Kiosk mode";
|
text: "Kiosk mode";
|
||||||
|
|
||||||
i-kiosk-mode := Switch {
|
i-kiosk-mode := Switch {
|
||||||
checked <=> root.kiosk-mode-checked;
|
checked <=> root.kiosk-mode-checked;
|
||||||
|
|
||||||
changed => {
|
changed => {
|
||||||
|
|
@ -192,7 +193,7 @@ export component Settings inherits Page {
|
||||||
Item {
|
Item {
|
||||||
text: "Function Three";
|
text: "Function Three";
|
||||||
|
|
||||||
i-fuction-three := Switch {
|
i-fuction-three := Switch {
|
||||||
checked <=> root.fuction-three-checked;
|
checked <=> root.fuction-three-checked;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,8 @@ import { MenuPage, MenuPageAdapter, MenuOverviewAdapter, SettingsAdapter } from
|
||||||
|
|
||||||
export { Balance, BalanceAdapter }
|
export { Balance, BalanceAdapter }
|
||||||
export { Overview, OverviewAdapter }
|
export { Overview, OverviewAdapter }
|
||||||
export { Usage, UsageAdapter }
|
export { Usage, UsageAdapter }
|
||||||
export { Weather, WeatherAdapter }
|
export { Weather, WeatherAdapter }
|
||||||
export { Page }
|
export { Page }
|
||||||
export { Dashboard }
|
export { Dashboard }
|
||||||
export { MenuPage, MenuPageAdapter, MenuOverviewAdapter, SettingsAdapter }
|
export { MenuPage, MenuPageAdapter, MenuOverviewAdapter, SettingsAdapter }
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ export component SmallMain {
|
||||||
}
|
}
|
||||||
|
|
||||||
pagination-clicked => {
|
pagination-clicked => {
|
||||||
i-menu.show-button();
|
i-menu.open-menu();
|
||||||
i-navigation.hide();
|
i-navigation.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ export component Menu {
|
||||||
visible: container-visibility == 1.0;
|
visible: container-visibility == 1.0;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
background: Theme.palette.ebony-radial-gradient;
|
background: Theme.palette.ebony-radial-gradient;
|
||||||
|
clip: true;
|
||||||
|
|
||||||
// avoid click-through
|
// avoid click-through
|
||||||
TouchArea {}
|
TouchArea {}
|
||||||
|
|
@ -54,9 +55,12 @@ export component Menu {
|
||||||
alignment: start;
|
alignment: start;
|
||||||
|
|
||||||
i-menu-button := MenuButton {
|
i-menu-button := MenuButton {
|
||||||
|
|
||||||
clicked => {
|
clicked => {
|
||||||
toggle-open();
|
if(open) {
|
||||||
|
hide();
|
||||||
|
} else {
|
||||||
|
open-menu();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -69,19 +73,8 @@ export component Menu {
|
||||||
menu-button-visible = false;
|
menu-button-visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function show-button() {
|
public function open-menu() {
|
||||||
menu-button-visible = true;
|
open = true;
|
||||||
}
|
|
||||||
|
|
||||||
function toggle-open() {
|
|
||||||
menu-button-visible = false;
|
|
||||||
open = !open;
|
|
||||||
|
|
||||||
if(open) {
|
|
||||||
opend();
|
|
||||||
} else {
|
|
||||||
closed();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function hide() {
|
public function hide() {
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,9 @@ import { Theme } from "../theme.slint";
|
||||||
component ScrollBar {
|
component ScrollBar {
|
||||||
private property <length> ref-width: self.width - 4px;
|
private property <length> ref-width: self.width - 4px;
|
||||||
|
|
||||||
in property <float> range;
|
in-out property<length> page-size;
|
||||||
in property <float> value;
|
in-out property<length> value;
|
||||||
|
in-out property<length> maximum;
|
||||||
|
|
||||||
min-height: 14px;
|
min-height: 14px;
|
||||||
|
|
||||||
|
|
@ -18,22 +19,45 @@ component ScrollBar {
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
border-color: Theme.palette.slint-blue-300;
|
border-color: Theme.palette.slint-blue-300;
|
||||||
|
|
||||||
Rectangle {
|
i-indicator := Rectangle {
|
||||||
x: 2px - ref-width * value;
|
x: 2px + (root.ref-width - i-indicator.width) * (-root.value / root.maximum);
|
||||||
y: 2px;
|
|
||||||
height: parent.height - 4px;
|
height: parent.height - 4px;
|
||||||
background: Theme.palette.slint-blue-300;
|
background: Theme.palette.slint-blue-300;
|
||||||
width: ref-width * range;
|
width: max(32px, ref-width * root.page-size / (root.maximum + root.page-size));
|
||||||
border-radius: parent.border-radius - 2px;
|
border-radius: parent.border-radius - 2px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TouchArea {
|
||||||
|
property <length> pressed-value;
|
||||||
|
|
||||||
|
width: parent.width;
|
||||||
|
height: parent.height;
|
||||||
|
|
||||||
|
pointer-event(event) => {
|
||||||
|
if (event.button == PointerEventButton.left && event.kind == PointerEventKind.down) {
|
||||||
|
self.pressed-value = -root.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
moved => {
|
||||||
|
if (self.enabled && self.pressed) {
|
||||||
|
root.value = -max(0px, min(root.maximum, self.pressed-value + (
|
||||||
|
(self.mouse-x - self.pressed-x) * (root.maximum / (root.width - i-indicator.width))
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export component PageContainer {
|
export component PageContainer {
|
||||||
|
callback clicked <=> i-touch-area.clicked;
|
||||||
|
|
||||||
min-width: 320px;
|
min-width: 320px;
|
||||||
min-height: 240px;
|
min-height: 240px;
|
||||||
max-height: 300px;
|
max-height: 300px;
|
||||||
|
|
||||||
|
i-touch-area := TouchArea {}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
background: Theme.palette.dark-deep-blue;
|
background: Theme.palette.dark-deep-blue;
|
||||||
|
|
@ -61,15 +85,15 @@ export component PageScrollView {
|
||||||
|
|
||||||
i-flickable := Flickable {
|
i-flickable := Flickable {
|
||||||
vertical-stretch: 1;
|
vertical-stretch: 1;
|
||||||
|
|
||||||
i-layout := HorizontalLayout {
|
i-layout := HorizontalLayout {
|
||||||
padding-left: 20px;
|
padding-left: 20px;
|
||||||
padding-right: 20px;
|
padding-right: 20px;
|
||||||
spacing: 20px;
|
spacing: 20px;
|
||||||
|
|
||||||
@children
|
@children
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HorizontalLayout {
|
HorizontalLayout {
|
||||||
|
|
@ -78,7 +102,7 @@ export component PageScrollView {
|
||||||
padding-left: 25px;
|
padding-left: 25px;
|
||||||
padding-right: 25px;
|
padding-right: 25px;
|
||||||
|
|
||||||
FloatButton {
|
FloatButton {
|
||||||
visible: i-flickable.viewport-x < 0;
|
visible: i-flickable.viewport-x < 0;
|
||||||
horizontal-stretch: 0;
|
horizontal-stretch: 0;
|
||||||
icon: Images.arrow-left;
|
icon: Images.arrow-left;
|
||||||
|
|
@ -93,16 +117,17 @@ export component PageScrollView {
|
||||||
horizontal-stretch: 1;
|
horizontal-stretch: 1;
|
||||||
|
|
||||||
ScrollBar {
|
ScrollBar {
|
||||||
value: i-flickable.viewport-x / i-flickable.viewport-width;
|
maximum: i-flickable.viewport-width - i-flickable.width;
|
||||||
range: i-flickable.width / i-flickable.viewport-width;
|
page-size: i-flickable.width;
|
||||||
|
value <=> i-flickable.viewport-x;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FloatButton {
|
FloatButton {
|
||||||
visible: i-flickable.viewport-x > i-flickable.width - i-flickable.viewport-width;
|
visible: i-flickable.viewport-x > i-flickable.width - i-flickable.viewport-width;
|
||||||
horizontal-stretch: 0;
|
horizontal-stretch: 0;
|
||||||
icon: Images.arrow-right;
|
icon: Images.arrow-right;
|
||||||
|
|
||||||
clicked => {
|
clicked => {
|
||||||
scroll-right();
|
scroll-right();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue