Compare commits

..
2 Commits
Author SHA1 Message Date
ide 0d1ce85853 removed swipe gesture handler 2026-10-01 12:41:03 +02:00
ide 57be975287 feature: possible to swipe between tabs and fix: ui bug 2026-09-30 17:07:54 +02:00
4 changed files with 965 additions and 1289 deletions

No files matched your search

-36
View File
@@ -1,36 +0,0 @@
# Compile and bundle the gui into Android APKs
# The resulting APKs are uploaded to gitea as artifacts, attached to the workflow run.
name: APK Builder
run-name: Build Android APK
on: [push]
jobs:
build-apk:
runs-on: amd64
container:
image: docker.nubo.sh/inkopslista-builder:2026-01-11
strategy:
matrix:
arch: [aarch64, x86_64]
steps:
# git clone
- name: Check out repository code
uses: actions/checkout@v4
# set the name of the output .apk based on commit and architecture
- run: echo "SHA_SHORT=$(echo ${{ gitea.sha }} | head -c 8)" >> $GITEA_ENV
- run: echo "OUT_NAME=inkopslista.${{ env.SHA_SHORT }}.${{ matrix.arch }}.apk" >> $GITEA_ENV
# build the apk
- run: cargo apk build --lib --release -p inkopslista --target ${{ matrix.arch }}-linux-android
- run: mv "$CARGO_TARGET_DIR/release/apk/inkopslista.apk" "$OUT_NAME"
# upload the apk to gitea
- uses: https://gitea.com/actions/gitea-upload-artifact@v4
with:
name : "${{ env.OUT_NAME }}"
path: "${{ env.OUT_NAME }}"
if-no-files-found: error
overwrite: true
retention-days: 360 # delete it after one year
Generated
+930 -1224
View File
File diff suppressed because it is too large. Load diff
+2 -2
View File
@@ -39,7 +39,7 @@ serde_json = "1.0.148"
anyhow = "1.0.100"
[dependencies.slint]
version = "1.17.1"
version = "1.18.0"
default-features = false
features = [
"live-preview",
@@ -63,4 +63,4 @@ wasm-bindgen-futures = "0.4.56"
web-sys = "0.3.83"
[build-dependencies]
slint-build = "1.17.1"
slint-build = "1.18.0"
+33 -27
View File
@@ -9,12 +9,13 @@ import {
GridBox,
HorizontalBox,
ComboBox,
Palette, Spinner, SpinBox,
Palette,
Spinner,
SpinBox,
} from "std-widgets.slint";
import { SettingsView } from "settings.slint";
import { ConnectionStatus, State, SItem, SButtonItem } from "state.slint";
export { ConnectionStatus, State, SItem }
component GoodListItem inherits Rectangle {
in-out property <SItem> item;
background: Palette.alternate-background;
@@ -185,9 +186,9 @@ component GoodButtons inherits ScrollView {
property <int> count-x: floor(root.width / (button-min-width + button-spacing));
property <int> count-y: ceil(State.favorites.length / count-x);
property <length> button-width: ((self.width + button-spacing ) / count-x) - button-spacing;
property <length> button-width: ((self.width + button-spacing) / count-x) - button-spacing;
viewport-height: (count-y * (button-height + button-spacing));
content-height: (count-y * (button-height + button-spacing));
mouse-drag-pan-enabled: true;
for item[idx] in State.favorites: Button {
@@ -225,7 +226,7 @@ component ConnStatusIndicator inherits Rectangle {
}
component RefreshButton inherits HorizontalLayout {
spacing: 8px;
spacing: 8px;
alignment: center;
Button {
text: "Refresh";
@@ -234,6 +235,7 @@ component RefreshButton inherits HorizontalLayout {
State.refresh-list();
}
}
ConnStatusIndicator { }
}
@@ -243,7 +245,7 @@ component AddView inherits VerticalLayout {
padding: 8px;
spacing: 8px;
RefreshButton {}
RefreshButton { }
goods := GoodsListAdd {
items <=> list;
@@ -281,24 +283,25 @@ component AddView inherits VerticalLayout {
GoodButtons { }
}
component ShopView inherits VerticalLayout {
component ShopView inherits ScrollView {
in property <[SItem]> list;
mouse-drag-pan-enabled: true;
VerticalLayout {
RefreshButton { }
padding: 8px;
spacing: 8px;
padding: 8px;
spacing: 8px;
goods := GoodsList {
items <=> list;
}
RefreshButton { }
goods := GoodsList {
items <=> list;
}
HorizontalLayout {
padding: 12px;
Button {
text: "I am done hehe";
clicked => {
State.delete-checked();
HorizontalLayout {
padding: 12px;
Button {
text: "I am done hehe";
clicked => {
State.delete-checked();
}
}
}
}
@@ -322,23 +325,26 @@ component CatItem inherits HorizontalBox {
}
component CatView inherits VerticalLayout {
component CatView inherits ScrollView {
in-out property <[SButtonItem]> cats;
for item in cats: CatItem {
item: item;
mouse-drag-pan-enabled: true;
VerticalLayout {
for item in cats: CatItem {
item: item;
}
}
}
export component App inherits Window {
in property <int> prefered-start-tab: 0;
title: "Inköpslista";
icon: @image-url("../images/icon.svg");
preferred-height: 700px;
preferred-width: 480px;
TabWidget {
tabs := TabWidget {
current-index: prefered-start-tab;
Tab {
title: "Add";
AddView {