1
mirror of https://github.com/monero-project/monero-gui synced 2024-12-19 04:45:53 +01:00

repo: remove isMobile leftovers

This commit is contained in:
selsta 2019-09-06 00:11:12 +02:00
parent a267712d10
commit 8dab0755d3
No known key found for this signature in database
GPG Key ID: 2EA0A99A8B07AE5E
31 changed files with 48 additions and 360 deletions

View File

@ -84,7 +84,7 @@ Rectangle {
menuColumn.previousButton.checked = true
}
width: (isMobile)? appWindow.width : 300
width: 300
color: "transparent"
anchors.bottom: parent.bottom
anchors.top: parent.top
@ -390,7 +390,6 @@ Rectangle {
}
MoneroComponents.Label {
visible: !isMobile
id: balanceLabel
text: qsTr("Balance") + translationManager.emptyString
color: "white"
@ -418,7 +417,7 @@ Rectangle {
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.top: (isMobile)? parent.top : column1.bottom
anchors.top: column1.bottom
color: "transparent"
Flickable {

View File

@ -46,7 +46,6 @@ Rectangle {
property Item currentView
property Item previousView
property bool basicMode : isMobile
property string balanceLabelText: qsTr("Balance") + translationManager.emptyString
property string balanceText
property string unlockedBalanceLabelText: qsTr("Unlocked Balance") + translationManager.emptyString

View File

@ -58,7 +58,7 @@ Item {
RowLayout {
id: checkBoxLayout
layoutDirection: iconOnTheLeft ? Qt.LeftToRight : Qt.RightToLeft
spacing: (!isMobile ? 10 : 8)
spacing: 10
Item {
id: checkMark

View File

@ -1,118 +0,0 @@
import QtQuick 2.9
import QtGraphicalEffects 1.0
import QtQuick.Layouts 1.1
import moneroComponents.Wallet 1.0
import "../components" as MoneroComponents
// BasicPanel header
Rectangle {
id: header
anchors.leftMargin: 1
anchors.rightMargin: 1
Layout.fillWidth: true
Layout.preferredHeight: 64
color: "#FFFFFF"
Image {
id: logo
visible: appWindow.width > 460
anchors.verticalCenter: parent.verticalCenter
anchors.verticalCenterOffset: -5
anchors.left: parent.left
anchors.leftMargin: 50
source: "qrc:///images/moneroLogo2.png"
}
Image {
id: icon
visible: !logo.visible
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: 40
source: "qrc:///images/moneroIcon.png"
}
Grid {
anchors.verticalCenter: parent.verticalCenter
anchors.top: parent.top
anchors.right: parent.right
anchors.topMargin: 10
width: 256
columns: 3
MoneroComponents.TextPlain {
id: balanceLabel
width: 116
height: 20
font.family: "Arial"
font.pixelSize: 12
font.letterSpacing: -1
elide: Text.ElideRight
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignBottom
color: "#535353"
text: leftPanel.balanceLabelText + ":"
}
MoneroComponents.TextPlain {
id: balanceText
width: 110
height: 20
font.family: "Arial"
font.pixelSize: 18
font.letterSpacing: -1
elide: Text.ElideRight
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignBottom
color: "#000000"
text: leftPanel.balanceText
}
Item {
height: 20
width: 20
Image {
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
source: "qrc:///images/lockIcon.png"
}
}
MoneroComponents.TextPlain {
width: 116
height: 20
font.family: "Arial"
font.pixelSize: 12
font.letterSpacing: -1
elide: Text.ElideRight
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignBottom
color: "#535353"
text: qsTr("Unlocked Balance:")
}
MoneroComponents.TextPlain {
id: availableBalanceText
width: 110
height: 20
font.family: "Arial"
font.pixelSize: 14
font.letterSpacing: -1
elide: Text.ElideRight
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignBottom
color: "#000000"
text: leftPanel.unlockedBalanceText
}
}
Rectangle {
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
height: 1
color: "#DBDBDB"
}
}

View File

@ -74,7 +74,7 @@ Item {
MoneroComponents.TextPlain {
id: label
Layout.leftMargin: (!isMobile ? 10 : 8)
Layout.leftMargin: 10
color: MoneroComponents.Style.defaultFontColor
font.family: MoneroComponents.Style.fontRegular.name
font.pixelSize: radioButton.fontSize

View File

@ -35,7 +35,7 @@ import "../js/Utils.js" as Utils
import "../components" as MoneroComponents
GridLayout {
columns: (isMobile) ? 1 : 2
columns: 2
columnSpacing: 32
id: root
property alias daemonAddrText: daemonAddr.text

View File

@ -82,10 +82,8 @@ Rectangle {
function open() {
// Center
if(!isMobile) {
root.x = parent.width/2 - root.width/2
root.y = 100
}
root.x = parent.width/2 - root.width/2
root.y = 100
root.z = 11
root.visible = true;
}
@ -96,14 +94,14 @@ Rectangle {
}
// TODO: implement without hardcoding sizes
width: isMobile ? screenWidth : 520
height: isMobile ? screenHeight : 380
width: 520
height: 380
ColumnLayout {
id: mainLayout
spacing: 10
anchors.fill: parent
anchors.margins: (isMobile? 17 : 20)
anchors.margins: 20
RowLayout {
id: column

View File

@ -45,7 +45,7 @@ Rectangle {
property bool showCloseButton: true
height: {
if(!persistentSettings.customDecorations || isMobile) return 0;
if(!persistentSettings.customDecorations) return 0;
return 50;
}

View File

@ -46,7 +46,6 @@ function showSeedPage() {
leftPanel.selectItem(middlePanel.state);
}
passwordDialog.open();
if(isMobile) hideMenu();
updateBalance();
}

View File

@ -39,10 +39,8 @@ function switchPage(next) {
console.log("switchpage: currentPage: ", currentPage);
// Update prev/next button positions for mobile/desktop
prevButton.anchors.verticalCenter = (!isMobile) ? wizard.verticalCenter : undefined
prevButton.anchors.bottom = (isMobile) ? wizard.bottom : undefined
nextButton.anchors.verticalCenter = (!isMobile) ? wizard.verticalCenter : undefined
nextButton.anchors.bottom = (isMobile) ? wizard.bottom : undefined
prevButton.anchors.verticalCenter = wizard.verticalCenter
nextButton.anchors.verticalCenter = wizard.verticalCenter
if (currentPage > 0 || currentPage < pages.length - 1) {
pages[currentPage].opacity = 0

180
main.qml
View File

@ -69,7 +69,6 @@ ApplicationWindow {
property bool foundNewBlock: false
property bool qrScannerEnabled: (typeof builtWithScanner != "undefined") && builtWithScanner
property int blocksToSync: 1
property var isMobile: (appWindow.width > 700 && !isAndroid) ? false : true
property bool isMining: false
property int walletMode: persistentSettings.walletMode
property var cameraUi
@ -489,14 +488,14 @@ ApplicationWindow {
leftPanel.networkStatus.connected = status
// update local daemon status.
if(!isMobile && walletManager.isDaemonLocal(currentDaemonAddress))
if(walletManager.isDaemonLocal(currentDaemonAddress))
daemonRunning = status;
// Update fee multiplier dropdown on transfer page
middlePanel.transferView.updatePriorityDropdown();
// If wallet isnt connected, advanced wallet mode and no daemon is running - Ask
if (!isMobile && appWindow.walletMode >= 2 && walletManager.isDaemonLocal(currentDaemonAddress) && !walletInitialized && status === Wallet.ConnectionStatus_Disconnected) {
if (appWindow.walletMode >= 2 && walletManager.isDaemonLocal(currentDaemonAddress) && !walletInitialized && status === Wallet.ConnectionStatus_Disconnected) {
daemonManager.runningAsync(persistentSettings.nettype, function(running) {
if (!running) {
daemonManagerDialog.open();
@ -1154,16 +1153,6 @@ ApplicationWindow {
});
}
function hideMenu() {
goToBasicAnimation.start();
console.log(appWindow.width)
}
function showMenu() {
goToProAnimation.start();
console.log(appWindow.width)
}
objectName: "appWindow"
visible: true
@ -1615,149 +1604,87 @@ ApplicationWindow {
PropertyChanges { target: middlePanel; visible: false }
PropertyChanges { target: wizard; visible: true }
PropertyChanges { target: resizeArea; visible: true }
PropertyChanges { target: mobileHeader; visible: false }
PropertyChanges { target: titleBar; state: "essentials" }
}, State {
name: "normal"
PropertyChanges { target: leftPanel; visible: (isMobile)? false : true }
PropertyChanges { target: leftPanel; visible: true }
PropertyChanges { target: middlePanel; visible: true }
PropertyChanges { target: titleBar; basicButtonVisible: true }
PropertyChanges { target: wizard; visible: false }
PropertyChanges { target: resizeArea; visible: true }
PropertyChanges { target: titleBar; state: "default" }
PropertyChanges { target: mobileHeader; visible: isMobile ? true : false }
}
]
MobileHeader {
id: mobileHeader
visible: isMobile
anchors.left: parent.left
anchors.right: parent.right
height: visible? 65 : 0
MouseArea {
enabled: persistentSettings.customDecorations
property var previousPosition
anchors.fill: parent
propagateComposedEvents: true
onPressed: previousPosition = globalCursor.getPosition()
onPositionChanged: {
if (pressedButtons == Qt.LeftButton) {
var pos = globalCursor.getPosition()
var dx = pos.x - previousPosition.x
var dy = pos.y - previousPosition.y
appWindow.x += dx
appWindow.y += dy
previousPosition = pos
}
}
}
}
LeftPanel {
id: leftPanel
anchors.top: mobileHeader.bottom
anchors.top: parent.top
anchors.left: parent.left
anchors.bottom: parent.bottom
onTransferClicked: {
middlePanel.state = "Transfer";
middlePanel.flickable.contentY = 0;
if(isMobile) {
hideMenu();
}
updateBalance();
}
onReceiveClicked: {
middlePanel.state = "Receive";
middlePanel.flickable.contentY = 0;
if(isMobile) {
hideMenu();
}
updateBalance();
}
onMerchantClicked: {
middlePanel.state = "Merchant";
middlePanel.flickable.contentY = 0;
if(isMobile) {
hideMenu();
}
updateBalance();
}
onTxkeyClicked: {
middlePanel.state = "TxKey";
middlePanel.flickable.contentY = 0;
if(isMobile) {
hideMenu();
}
updateBalance();
}
onSharedringdbClicked: {
middlePanel.state = "SharedRingDB";
middlePanel.flickable.contentY = 0;
if(isMobile) {
hideMenu();
}
updateBalance();
}
onHistoryClicked: {
middlePanel.state = "History";
middlePanel.flickable.contentY = 0;
if(isMobile) {
hideMenu();
}
updateBalance();
}
onAddressBookClicked: {
middlePanel.state = "AddressBook";
middlePanel.flickable.contentY = 0;
if(isMobile) {
hideMenu();
}
updateBalance();
}
onMiningClicked: {
middlePanel.state = "Mining";
middlePanel.flickable.contentY = 0;
if(isMobile) {
hideMenu();
}
updateBalance();
}
onSignClicked: {
middlePanel.state = "Sign";
middlePanel.flickable.contentY = 0;
if(isMobile) {
hideMenu();
}
updateBalance();
}
onSettingsClicked: {
middlePanel.state = "Settings";
middlePanel.flickable.contentY = 0;
if(isMobile) {
hideMenu();
}
updateBalance();
}
onAccountClicked: {
middlePanel.state = "Account";
middlePanel.flickable.contentY = 0;
if(isMobile) {
hideMenu();
}
updateBalance();
}
}
@ -1765,102 +1692,13 @@ ApplicationWindow {
MiddlePanel {
id: middlePanel
anchors.top: mobileHeader.bottom
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.left: leftPanel.visible ? leftPanel.right : parent.left
anchors.right: parent.right
state: "Transfer"
}
SequentialAnimation {
id: goToBasicAnimation
// PropertyAction {
// target: appWindow
// properties: "visibility"
// value: Window.Windowed
// }
// PropertyAction {
// target: titleBar
// properties: "maximizeButtonVisible"
// value: false
// }
// PropertyAction {
// target: frameArea
// properties: "blocked"
// value: true
// }
PropertyAction {
target: resizeArea
properties: "visible"
value: true
}
// PropertyAction {
// target: appWindow
// properties: "height"
// value: 30
// }
// PropertyAction {
// target: appWindow
// properties: "width"
// value: 326
// }
PropertyAction {
target: leftPanel
properties: "visible"
value: false
}
PropertyAction {
target: middlePanel
properties: "basicMode"
value: true
}
// PropertyAction {
// target: appWindow
// properties: "height"
// value: middlePanel.height
// }
onStopped: {
// middlePanel.visible = false
leftPanel.visible = false
}
}
SequentialAnimation {
id: goToProAnimation
// PropertyAction {
// target: appWindow
// properties: "height"
// value: 30
// }
PropertyAction {
target: middlePanel
properties: "basicMode"
value: false
}
PropertyAction {
targets: [leftPanel, middlePanel, resizeArea]
properties: "visible"
value: true
}
// PropertyAction {
// target: appWindow
// properties: "height"
// value: maxWindowHeight
// }
// PropertyAction {
// target: frameArea
// properties: "blocked"
// value: false
// }
// PropertyAction {
// target: titleBar
// properties: "maximizeButtonVisible"
// value: true
// }
}
WizardController {
id: wizard
anchors.fill: parent
@ -1932,13 +1770,7 @@ ApplicationWindow {
onMaximizeClicked: appWindow.visibility = appWindow.visibility !== Window.Maximized ? Window.Maximized : Window.Windowed
onMinimizeClicked: appWindow.visibility = Window.Minimized
onGoToBasicVersion: {
if (yes) {
// basicPanel.currentView = middlePanel.currentView
goToBasicAnimation.start()
} else {
// middlePanel.currentView = basicPanel.currentView
goToProAnimation.start()
}
//nop
}
}

View File

@ -64,7 +64,7 @@ Rectangle {
/* main layout */
ColumnLayout {
id: mainLayout
anchors.margins: (isMobile)? 17 : 20
anchors.margins: 20
anchors.topMargin: 40
anchors.left: parent.left

View File

@ -52,7 +52,7 @@ Rectangle {
ColumnLayout {
id: mainLayout
anchors.margins: (isMobile)? 17 : 20
anchors.margins: 20
anchors.topMargin: 40
anchors.left: parent.left

View File

@ -52,7 +52,7 @@ Rectangle {
anchors.top: parent.top
anchors.right: parent.right
anchors.margins: (isMobile)? 17 : 20
anchors.margins: 20
anchors.topMargin: 40
spacing: 30

View File

@ -41,7 +41,7 @@ Rectangle {
ColumnLayout {
id: mainLayout
Layout.fillWidth: true
anchors.margins: (isMobile)? 17 : 20
anchors.margins: 20
anchors.topMargin: 40
anchors.left: parent.left
anchors.top: parent.top

View File

@ -66,7 +66,7 @@ Rectangle {
/* main layout */
ColumnLayout {
id: mainLayout
anchors.margins: (isMobile)? 17 : 20
anchors.margins: 20
anchors.topMargin: 40
anchors.left: parent.left

View File

@ -80,7 +80,7 @@ Rectangle {
ColumnLayout {
id: mainLayout
Layout.fillWidth: true
anchors.margins: (isMobile)? 17 : 20
anchors.margins: 20
anchors.topMargin: 40
anchors.left: parent.left
@ -296,7 +296,7 @@ Rectangle {
GridLayout{
Layout.topMargin: 12
columns: (isMobile) ? 1 : 2
columns: 2
columnSpacing: 32
ColumnLayout {
@ -368,7 +368,7 @@ Rectangle {
GridLayout {
columnSpacing: 20
columns: (isMobile) ? 1 : 2
columns: 2
MoneroComponents.CheckBox {
id: segregatePreForkOutputs
@ -405,7 +405,7 @@ Rectangle {
id: segregationHeightRow
Layout.fillWidth: true
Layout.topMargin: 17
columns: (isMobile) ? 1 : 2
columns: 2
columnSpacing: 32
MoneroComponents.LineEdit {

View File

@ -88,7 +88,7 @@ Rectangle {
ColumnLayout {
id: mainLayout
Layout.fillWidth: true
anchors.margins: (isMobile)? 17 : 20
anchors.margins: 20
anchors.topMargin: 40
anchors.left: parent.left

View File

@ -123,7 +123,7 @@ Rectangle {
ColumnLayout {
id: pageRoot
anchors.margins: (isMobile)? 17 : 20
anchors.margins: 20
anchors.topMargin: 40
anchors.left: parent.left
@ -144,7 +144,7 @@ Rectangle {
}
GridLayout {
columns: (isMobile || !(appWindow.walletMode >= 2)) ? 1 : 2
columns: appWindow.walletMode < 2 ? 1 : 2
Layout.fillWidth: true
columnSpacing: 32
@ -443,7 +443,7 @@ Rectangle {
anchors.top: pageRoot.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.margins: (isMobile)? 17 : 20
anchors.margins: 20
anchors.topMargin: 32
spacing: 26
enabled: !viewOnly || pageRoot.enabled
@ -462,7 +462,7 @@ Rectangle {
GridLayout {
visible: persistentSettings.transferShowAdvanced && appWindow.walletMode >= 2
columns: (isMobile) ? 2 : 6
columns: 6
StandardButton {
id: sweepUnmixableButton

View File

@ -45,7 +45,7 @@ Rectangle {
/* main layout */
ColumnLayout {
id: mainLayout
anchors.margins: (isMobile)? 17 : 20
anchors.margins: 20
anchors.topMargin: 40
anchors.left: parent.left
anchors.top: parent.top

View File

@ -44,7 +44,7 @@ Rectangle {
property bool showCloseButton: true
height: {
if(!persistentSettings.customDecorations || isMobile) return 0;
if(!persistentSettings.customDecorations) return 0;
return 50;
}

View File

@ -61,9 +61,7 @@ Rectangle {
property string borderColor: MoneroComponents.Style.blackTheme ? "#808080" : "#B9B9B9"
property int textMargin: {
// left-right margins for a given cell
if(isMobile){
return 10;
} else if(appWindow.width < 890){
if(appWindow.width < 890){
return 32;
} else {
return 64;

View File

@ -57,7 +57,7 @@ Rectangle {
anchors.left: parent.left
anchors.top: parent.top
anchors.right: parent.right
anchors.margins: (isMobile)? 17 : 20
anchors.margins: 20
anchors.topMargin: 0
spacing: 30

View File

@ -47,12 +47,11 @@ Rectangle {
anchors.left: parent.left
anchors.top: parent.top
anchors.right: parent.right
anchors.margins: (isMobile)? 17 : 20
anchors.margins: 20
anchors.topMargin: 0
spacing: 6
MoneroComponents.CheckBox {
visible: !isMobile
id: customDecorationsCheckBox
checked: persistentSettings.customDecorations
onClicked: Windows.setCustomWindowDecorations(checked)
@ -60,7 +59,6 @@ Rectangle {
}
MoneroComponents.CheckBox {
visible: !isMobile
id: hideBalanceCheckBox
checked: persistentSettings.hideBalance
onClicked: {
@ -71,7 +69,6 @@ Rectangle {
}
MoneroComponents.CheckBox {
visible: !isMobile
id: showPidCheckBox
checked: persistentSettings.showPid
onClicked: {
@ -91,7 +88,6 @@ Rectangle {
}
MoneroComponents.CheckBox {
visible: !isMobile
id: userInActivityCheckbox
checked: persistentSettings.lockOnUserInActivity
onClicked: persistentSettings.lockOnUserInActivity = !persistentSettings.lockOnUserInActivity
@ -267,14 +263,6 @@ Rectangle {
appWindow.toggleLanguageView();
}
}
MoneroComponents.TextBlock {
visible: isMobile
font.pixelSize: 14
textFormat: Text.RichText
Layout.fillWidth: true
text: qsTr("No Layout options exist yet in mobile mode.") + translationManager.emptyString;
}
}
ListModel {

View File

@ -47,7 +47,7 @@ Rectangle {
anchors.left: parent.left
anchors.top: parent.top
anchors.right: parent.right
anchors.margins: (isMobile)? 17 : 20
anchors.margins: 20
anchors.topMargin: 0
spacing: 10

View File

@ -42,7 +42,7 @@ Rectangle{
/* main layout */
ColumnLayout {
id: root
anchors.margins: (isMobile)? 17 : 20
anchors.margins: 20
anchors.topMargin: 0
anchors.left: parent.left
@ -276,7 +276,7 @@ Rectangle{
spacing: 20
Layout.fillWidth: true
Layout.topMargin: 20
visible: !isMobile && persistentSettings.useRemoteNode
visible: persistentSettings.useRemoteNode
MoneroComponents.WarningBox {
Layout.topMargin: 26
@ -308,7 +308,7 @@ Rectangle{
}
GridLayout {
columns: (isMobile) ? 1 : 2
columns: 2
columnSpacing: 32
MoneroComponents.LineEdit {
@ -368,7 +368,7 @@ Rectangle{
id: localNodeLayout
spacing: 20
Layout.topMargin: 40
visible: !isMobile && !persistentSettings.useRemoteNode
visible: !persistentSettings.useRemoteNode
MoneroComponents.StandardButton {
small: true
@ -427,7 +427,7 @@ Rectangle{
}
RowLayout {
visible: !isMobile && !persistentSettings.useRemoteNode
visible: !persistentSettings.useRemoteNode
ColumnLayout {
Layout.fillWidth: true

View File

@ -45,7 +45,7 @@ Rectangle {
anchors.left: parent.left
anchors.top: parent.top
anchors.right: parent.right
anchors.margins: (isMobile)? 17 : 20
anchors.margins: 20
anchors.topMargin: 0
spacing: 0

View File

@ -107,7 +107,6 @@
<file>components/DaemonConsole.qml</file>
<file>components/QRCodeScanner.qml</file>
<file>components/Notifier.qml</file>
<file>components/MobileHeader.qml</file>
<file>components/TextBlock.qml</file>
<file>components/RemoteNodeEdit.qml</file>
<file>pages/Keys.qml</file>

View File

@ -121,9 +121,7 @@ Rectangle {
property int flickableHeightMargin: 200
property int layoutScale: {
if(isMobile){
return 0;
} else if(appWindow.width < 800){
if(appWindow.width < 800){
return 1;
} else {
return 2;

View File

@ -41,9 +41,7 @@ Rectangle {
color: "transparent"
anchors.fill: parent
property int layoutScale: {
if(isMobile){
return 0;
} else if(appWindow.width < 800){
if(appWindow.width < 800){
return 1;
} else {
return 2;

View File

@ -149,7 +149,7 @@ Rectangle {
GridLayout {
id: buttonsGrid
opacity: 0
columns: isMobile ? 1 : 2
columns: 2
Layout.alignment: Qt.AlignCenter
Layout.topMargin: 20
Layout.fillWidth: true