mirror of
https://github.com/brmlab/brmbar.git
synced 2025-06-07 21:04:00 +02:00
UI cleanup
This commit is contained in:
parent
1ba8099e8e
commit
3e8f44e5e0
18 changed files with 79 additions and 90 deletions
|
@ -1,16 +1,30 @@
|
|||
// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
|
||||
import QtQuick 1.1
|
||||
|
||||
Rectangle {
|
||||
id: rectangle1
|
||||
width: 240
|
||||
height: 83
|
||||
color: "#000000"
|
||||
gradient: Gradient {
|
||||
GradientStop {
|
||||
position: 0
|
||||
color: "#888888"
|
||||
}
|
||||
|
||||
GradientStop {
|
||||
position: 0.5
|
||||
color: "#000000"
|
||||
}
|
||||
|
||||
GradientStop {
|
||||
position: 1
|
||||
color: "#888888"
|
||||
}
|
||||
}
|
||||
border.color: btnColor
|
||||
|
||||
property string text: "Button"
|
||||
property int fontSize: 0.768 * 60
|
||||
property variant btnColor: "#aaaaaa"
|
||||
property string btnColor: "#aaaaaa"
|
||||
|
||||
signal buttonClick
|
||||
onButtonClick: { /* Supplied by component user. */ }
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
|
||||
import QtQuick 1.1
|
||||
|
||||
Rectangle {
|
||||
|
@ -6,8 +5,8 @@ Rectangle {
|
|||
width: 320
|
||||
height: 65
|
||||
property variant now: new Date()
|
||||
property variant textColor: "#000000"
|
||||
property variant textSize: 0.768 * 16
|
||||
property string textColor: "#000000"
|
||||
property real textSize: 0.768 * 16
|
||||
Timer {
|
||||
id: clockUpdater
|
||||
interval: 1000 // update clock every second
|
||||
|
|
|
@ -10,9 +10,9 @@ Rectangle {
|
|||
|
||||
property int scrollbarWidth: 20
|
||||
|
||||
property variant color: "white"
|
||||
property variant baseOpacityOff: 0.4
|
||||
property variant baseOpacityOn: 0.9
|
||||
property string color: "white"
|
||||
property real baseOpacityOff: 0.4
|
||||
property real baseOpacityOn: 0.9
|
||||
|
||||
radius: vertical ? width/2 : height/2
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
|
||||
import QtQuick 1.1
|
||||
|
||||
Item {
|
||||
|
@ -6,8 +5,8 @@ Item {
|
|||
width: 894
|
||||
height: 80
|
||||
|
||||
property variant hint_goal: ""
|
||||
property variant hint_action: ""
|
||||
property string hint_goal: ""
|
||||
property string hint_action: ""
|
||||
|
||||
Text {
|
||||
id: text1
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
|
||||
import QtQuick 1.1
|
||||
|
||||
TextInput {
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
|
||||
import QtQuick 1.1
|
||||
import QtQuick 1.0
|
||||
|
||||
Rectangle {
|
||||
width: 1024
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
|
||||
import QtQuick 1.1
|
||||
import QtQuick 1.0
|
||||
|
||||
Item {
|
||||
id: page
|
||||
anchors.fill: parent
|
||||
|
||||
property variant username: ""
|
||||
property variant userdbid: ""
|
||||
property variant amount: credit_pad.enteredText
|
||||
property string username: ""
|
||||
property string userdbid: ""
|
||||
property string amount: credit_pad.enteredText
|
||||
|
||||
Text {
|
||||
id: item_name
|
||||
|
@ -64,7 +62,7 @@ Item {
|
|||
status_text.setStatus("Unknown barcode", "#ff4444")
|
||||
return
|
||||
}
|
||||
if (acct.acctype == "debt") {
|
||||
if (acct.acctype === "debt") {
|
||||
username = acct.name
|
||||
userdbid = acct.id
|
||||
} else {
|
||||
|
|
|
@ -1,16 +1,14 @@
|
|||
// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
|
||||
import QtQuick 1.1
|
||||
import QtQuick 1.0
|
||||
|
||||
Item {
|
||||
id: page
|
||||
anchors.fill: parent
|
||||
|
||||
property variant item_name: item_name_pad.enteredText
|
||||
property variant dbid: ""
|
||||
property variant info: ""
|
||||
property variant buy_price: item_buyprice_pad.enteredText
|
||||
property variant price: item_sellprice_pad.enteredText
|
||||
property string item_name: item_name_pad.enteredText
|
||||
property string dbid: ""
|
||||
property string info: ""
|
||||
property string buy_price: item_buyprice_pad.enteredText
|
||||
property string price: item_sellprice_pad.enteredText
|
||||
|
||||
property string barcode: ""
|
||||
state: "normal"
|
||||
|
@ -28,7 +26,7 @@ Item {
|
|||
/* TODO: Allow override. */
|
||||
return
|
||||
}
|
||||
if (info.dbid == "") {
|
||||
if (info.dbid === "") {
|
||||
status_text.setStatus("Press [Create] first", "#ff4444")
|
||||
return
|
||||
}
|
||||
|
@ -310,35 +308,35 @@ Item {
|
|||
width: 360
|
||||
text: dbid == "" ? "Create" : "Save"
|
||||
onButtonClick: {
|
||||
var xi = info;
|
||||
xi["name"] = page.item_name;
|
||||
xi["buy_price"] = page.buy_price;
|
||||
xi["price"] = page.price;
|
||||
info = xi
|
||||
var xi = info;
|
||||
xi["name"] = page.item_name;
|
||||
xi["buy_price"] = page.buy_price;
|
||||
xi["price"] = page.price;
|
||||
info = xi
|
||||
|
||||
var res;
|
||||
if (dbid == "") {
|
||||
res = shop.newItem(info)
|
||||
if (!res) {
|
||||
status_text.setStatus("Please fill all values first.", "#ff4444")
|
||||
return
|
||||
}
|
||||
} else {
|
||||
res = shop.saveItem(dbid, info)
|
||||
}
|
||||
var res;
|
||||
if (dbid == "") {
|
||||
res = shop.newItem(info)
|
||||
if (!res) {
|
||||
status_text.setStatus("Please fill all values first.", "#ff4444")
|
||||
return
|
||||
}
|
||||
} else {
|
||||
res = shop.saveItem(dbid, info)
|
||||
}
|
||||
|
||||
if (res.cost) {
|
||||
status_text.setStatus((dbid == "" ? "Stocked!" : "Restocked!") + " Take " + res.cost + " from the money box.", "#ffff7c")
|
||||
} else {
|
||||
status_text.setStatus(dbid == "" ? "Item created" : "Changes saved", "#ffff7c")
|
||||
}
|
||||
if (res.cost) {
|
||||
status_text.setStatus((dbid == "" ? "Stocked!" : "Restocked!") + " Take " + res.cost + " from the money box.", "#ffff7c")
|
||||
} else {
|
||||
status_text.setStatus(dbid == "" ? "Item created" : "Changes saved", "#ffff7c")
|
||||
}
|
||||
|
||||
if (dbid == "") {
|
||||
dbid = res.dbid
|
||||
var xi = info; xi["dbid"] = page.dbid; info = xi
|
||||
} else {
|
||||
loadPage("StockMgmt")
|
||||
}
|
||||
if (dbid == "") {
|
||||
dbid = res.dbid
|
||||
xi = info; xi["dbid"] = page.dbid; info = xi
|
||||
} else {
|
||||
loadPage("StockMgmt")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
|
||||
import QtQuick 1.1
|
||||
import QtQuick 1.0
|
||||
|
||||
Item {
|
||||
id: page
|
||||
anchors.fill: parent
|
||||
|
||||
property variant name: ""
|
||||
property variant dbid: ""
|
||||
property variant price: ""
|
||||
property string name: ""
|
||||
property string dbid: ""
|
||||
property string price: ""
|
||||
|
||||
Text {
|
||||
id: item_name
|
||||
|
@ -52,7 +50,7 @@ Item {
|
|||
status_text.setStatus("Unknown barcode", "#ff4444")
|
||||
return
|
||||
}
|
||||
if (acct.acctype != "debt") {
|
||||
if (acct.acctype !== "debt") {
|
||||
loadPageByAcct(acct)
|
||||
return
|
||||
}
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
|
||||
import QtQuick 1.1
|
||||
import QtQuick 1.0
|
||||
|
||||
Item {
|
||||
id: page
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
|
||||
import QtQuick 1.1
|
||||
import QtQuick 1.0
|
||||
|
||||
Item {
|
||||
id: page
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
|
||||
import QtQuick 1.1
|
||||
import QtQuick 1.0
|
||||
|
||||
Item {
|
||||
id: page
|
||||
anchors.fill: parent
|
||||
|
||||
property variant user
|
||||
property variant description: item_name_pad.enteredText
|
||||
property variant amount: amount_pad.enteredText
|
||||
property string description: item_name_pad.enteredText
|
||||
property string amount: amount_pad.enteredText
|
||||
|
||||
state: "normal"
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
|
||||
import QtQuick 1.1
|
||||
import QtQuick 1.0
|
||||
|
||||
Item {
|
||||
id: page
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
|
||||
import QtQuick 1.1
|
||||
|
||||
Item {
|
||||
id: page
|
||||
anchors.fill: parent
|
||||
|
||||
property variant name: ""
|
||||
property variant dbid: ""
|
||||
property variant negbalance: ""
|
||||
property string name: ""
|
||||
property string dbid: ""
|
||||
property string negbalance: ""
|
||||
|
||||
Text {
|
||||
id: item_name
|
||||
|
@ -43,7 +42,7 @@ Item {
|
|||
status_text.setStatus("Unknown barcode", "#ff4444")
|
||||
return
|
||||
}
|
||||
if (acct.acctype == "recharge") {
|
||||
if (acct.acctype === "recharge") {
|
||||
loadPage("ChargeCredit", { "username": name, "userdbid": dbid, "amount": acct.amount })
|
||||
return
|
||||
}
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
|
||||
import QtQuick 1.1
|
||||
import QtQuick 1.0
|
||||
|
||||
Item {
|
||||
id: page
|
||||
|
@ -17,7 +15,7 @@ Item {
|
|||
status_text.setStatus("Unknown barcode", "#ff4444")
|
||||
return
|
||||
}
|
||||
if (acct.acctype != "debt") {
|
||||
if (acct.acctype !== "debt") {
|
||||
loadPageByAcct(acct)
|
||||
return
|
||||
}
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
|
||||
import QtQuick 1.1
|
||||
import QtQuick 1.0
|
||||
|
||||
Item {
|
||||
id: page
|
||||
anchors.fill: parent
|
||||
|
||||
property variant username: ""
|
||||
property variant userdbid: ""
|
||||
property variant amount: withdraw_pad.enteredText
|
||||
property string username: ""
|
||||
property string userdbid: ""
|
||||
property string amount: withdraw_pad.enteredText
|
||||
|
||||
Text {
|
||||
id: item_name
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by Qt Creator 2.5.0, 2012-09-05T02:10:11. -->
|
||||
<!-- Written by Qt Creator 2.5.0, 2013-01-31T18:05:42. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
||||
|
@ -112,7 +112,7 @@
|
|||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
|
||||
<value type="QString">{a277f310-b549-4ad7-87ca-cd03f76f19ff}</value>
|
||||
<value type="QString">{524378aa-09e0-4345-892b-1bd47313bcaf}</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
|
||||
import QtQuick 1.1
|
||||
|
||||
BasePage {
|
||||
|
@ -17,11 +16,11 @@ BasePage {
|
|||
}
|
||||
|
||||
function loadPageByAcct(acct) {
|
||||
if (acct.acctype == "inventory") {
|
||||
if (acct.acctype === "inventory") {
|
||||
loadPage("ItemInfo", { name: acct["name"], dbid: acct["id"], price: acct["price"] })
|
||||
} else if (acct.acctype == "debt") {
|
||||
} else if (acct.acctype === "debt") {
|
||||
loadPage("UserInfo", { name: acct["name"], dbid: acct["id"], negbalance: acct["negbalance"] })
|
||||
} else if (acct.acctype == "recharge") {
|
||||
} else if (acct.acctype === "recharge") {
|
||||
loadPage("ChargeCredit", { amount: acct["amount"] })
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue