mirror of
https://github.com/hulthe/inkopslista.git
synced 2026-09-18 18:03:39 +02:00
finished implementing setting category
This commit is contained in:
+6
-2
@@ -13,8 +13,6 @@ import {
|
||||
import { SettingsView } from "settings.slint";
|
||||
import { State, SItem, SButtonItem } from "state.slint";
|
||||
export { State, SItem }
|
||||
|
||||
|
||||
component GoodListItem inherits Rectangle {
|
||||
in-out property <SItem> item;
|
||||
background: #ffffff10;
|
||||
@@ -281,16 +279,22 @@ component ShopView inherits VerticalLayout {
|
||||
|
||||
component CatItem inherits HorizontalBox {
|
||||
in-out property <SButtonItem> item;
|
||||
|
||||
Text {
|
||||
text: item.name;
|
||||
vertical-alignment: center;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
ComboBox {
|
||||
model: ["kyl", "skafferi", "frys", "övrigt"];
|
||||
current-value: item.category;
|
||||
width: 60%;
|
||||
selected(category) => { State.set-cat(item.name, category) }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
component CatView inherits VerticalLayout {
|
||||
in-out property <[SButtonItem]> cats;
|
||||
|
||||
|
||||
+2
-3
@@ -4,9 +4,7 @@ export struct SItem {
|
||||
amount: int,
|
||||
}
|
||||
|
||||
export struct SButtonItem{
|
||||
name: string,
|
||||
category: string}
|
||||
export struct SButtonItem { name: string, category: string }
|
||||
|
||||
export global State {
|
||||
in-out property <[SItem]> list: [
|
||||
@@ -20,6 +18,7 @@ export global State {
|
||||
callback delete-checked();
|
||||
callback inc-amount(string);
|
||||
callback dec-amount(string);
|
||||
callback set-cat(string, string);
|
||||
in-out property <string> server-address;
|
||||
in property <[SButtonItem]> favorites: [
|
||||
{ name: "mjölk", category: "kyl" },
|
||||
|
||||
Reference in New Issue
Block a user