parent
10931f6acb
commit
ca4f6ad5f1
@ -0,0 +1,39 @@
|
|||||||
|
{
|
||||||
|
"default": {
|
||||||
|
"fontColor": "white",
|
||||||
|
"fontColorDimmed": "#cccccc",
|
||||||
|
"fontColorBright": "white",
|
||||||
|
"backgroundGradientStartColor": "#194f64",
|
||||||
|
"backgroundGradientStopColor": "#192e43",
|
||||||
|
"backgroundColor": "#1b2939",
|
||||||
|
"divideColor": "50ffffff",
|
||||||
|
"btnEnteredColor": "#aa3b689b",
|
||||||
|
"btnExitedColor": "#aa375c87",
|
||||||
|
"btnPressedColor": "#aa467dbb",
|
||||||
|
"btnTextHoverColor": "white",
|
||||||
|
"btnTextColor": "white",
|
||||||
|
"btnMainMenuBackground": "#aa3b689b",
|
||||||
|
"historyBackgroundColor": "#2c435d",
|
||||||
|
"historyBackgroundColorBright": "#406288",
|
||||||
|
"historyFontColorPlusAmount": "#00d304",
|
||||||
|
"historyFontColorMinAmount": "red"
|
||||||
|
},
|
||||||
|
"wownero": {
|
||||||
|
"fontColor": "#bd93f9",
|
||||||
|
"fontColorBright": "#e5d3ff",
|
||||||
|
"backgroundGradientStartColor": "#383a59",
|
||||||
|
"backgroundGradientStopColor": "#282a36",
|
||||||
|
"backgroundColor": "#282a36",
|
||||||
|
"divideColor": "50ffffff",
|
||||||
|
"btnEnteredColor": "#bd93f9",
|
||||||
|
"btnExitedColor": "#50000000",
|
||||||
|
"btnPressedColor": "#bd93f9",
|
||||||
|
"btnTextHoverColor": "black",
|
||||||
|
"btnTextColor": "#bcc2cd",
|
||||||
|
"btnMainMenuBackground": "#50000000",
|
||||||
|
"historyBackgroundColor": "#30314d",
|
||||||
|
"historyBackgroundColorBright": "#383a59",
|
||||||
|
"historyFontColorPlusAmount": "#00d304",
|
||||||
|
"historyFontColorMinAmount": "red"
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,124 @@
|
|||||||
|
import QtQuick 2.7
|
||||||
|
import QtQuick.Controls 2.0
|
||||||
|
import QtQuick.Layouts 1.2
|
||||||
|
|
||||||
|
import "."
|
||||||
|
import "common"
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
id: root
|
||||||
|
property bool needsRestart: false
|
||||||
|
|
||||||
|
spacing: 30
|
||||||
|
Layout.fillHeight: true
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
spacing: 30
|
||||||
|
Layout.topMargin: 40
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.leftMargin: 40
|
||||||
|
Layout.rightMargin: 40
|
||||||
|
|
||||||
|
MyText {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
fontSize: 26
|
||||||
|
text: "Settings"
|
||||||
|
wrap: true
|
||||||
|
}
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
spacing: 30
|
||||||
|
|
||||||
|
MyText {
|
||||||
|
text: "Theme"
|
||||||
|
}
|
||||||
|
|
||||||
|
MyComboBox {
|
||||||
|
id: themeCombo
|
||||||
|
Layout.preferredHeight: 60
|
||||||
|
Layout.preferredWidth: 378
|
||||||
|
|
||||||
|
displayText: "-"
|
||||||
|
|
||||||
|
model: [""]
|
||||||
|
|
||||||
|
delegate: ItemDelegate {
|
||||||
|
width: parent.width
|
||||||
|
text: modelData.text
|
||||||
|
hoverEnabled: true
|
||||||
|
contentItem: MyText {
|
||||||
|
horizontalAlignment: Text.AlignLeft
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
text: parent.text
|
||||||
|
color: parent.enabled ? Style.fontColor : Style.fontColorDimmed
|
||||||
|
}
|
||||||
|
background: Rectangle {
|
||||||
|
color: parent.pressed ? "#406288" : (parent.hovered ? "#365473" : "#2c435d")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onCurrentIndexChanged: {
|
||||||
|
displayText = themeCombo.model[currentIndex]["text"];
|
||||||
|
if(displayText !== "" && displayText !== appWindow.theme) {
|
||||||
|
appWindow.changeTheme(displayText);
|
||||||
|
needsRestart = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
}
|
||||||
|
|
||||||
|
MyDialogOkPopup {
|
||||||
|
id: restartPopup
|
||||||
|
dialogTitle: "Restart required"
|
||||||
|
dialogText: "WowletVR needs a restart to load the theme. Exiting."
|
||||||
|
onClosed: {
|
||||||
|
OverlayController.exitApp();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MyPushButton {
|
||||||
|
text: "Back"
|
||||||
|
Layout.leftMargin: 40
|
||||||
|
Layout.preferredWidth: 220
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
if(root.needsRestart) {
|
||||||
|
restartPopup.open();
|
||||||
|
} else {
|
||||||
|
mainView.pop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.fillHeight: true
|
||||||
|
}
|
||||||
|
|
||||||
|
function onPageCompleted(previousView){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: appWindow
|
||||||
|
|
||||||
|
function onInitTheme() {
|
||||||
|
// populate combobox
|
||||||
|
let themeComboBoxItems = [{ value: 0, text: ""}];
|
||||||
|
for (let _theme in appWindow.themes){
|
||||||
|
if (!appWindow.themes.hasOwnProperty(_theme))
|
||||||
|
continue;
|
||||||
|
themeComboBoxItems.push({ value: 0, text: _theme });
|
||||||
|
}
|
||||||
|
themeCombo.model = themeComboBoxItems;
|
||||||
|
themeCombo.displayText = appWindow.theme;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// OverlayController.exitApp();
|
@ -0,0 +1,96 @@
|
|||||||
|
import QtQuick 2.7
|
||||||
|
import QtQuick.Controls 2.0
|
||||||
|
import QtQuick.Layouts 1.2
|
||||||
|
|
||||||
|
import "."
|
||||||
|
|
||||||
|
// This file is used to debug the background gradient animation and can be ignored.
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
property int start_x: 0
|
||||||
|
property int start_y: 64
|
||||||
|
property int end_x: 1080
|
||||||
|
property int end_y: 416
|
||||||
|
|
||||||
|
visible: false
|
||||||
|
width: parent.width
|
||||||
|
height: parent.height
|
||||||
|
|
||||||
|
MyText {
|
||||||
|
fontColor: "red"
|
||||||
|
text: "start_x: " + start_x
|
||||||
|
}
|
||||||
|
|
||||||
|
MySlider {
|
||||||
|
from: 0
|
||||||
|
to: 1600
|
||||||
|
value: start_x
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.preferredHeight: 40
|
||||||
|
|
||||||
|
onValueChanged: {
|
||||||
|
appWindow.start_x = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MyText {
|
||||||
|
fontColor: "red"
|
||||||
|
text: "start_y: " + start_y
|
||||||
|
}
|
||||||
|
|
||||||
|
MySlider {
|
||||||
|
from: 0
|
||||||
|
to: 1600
|
||||||
|
value: start_y
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.preferredHeight: 40
|
||||||
|
|
||||||
|
onValueChanged: {
|
||||||
|
appWindow.start_y = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.fillHeight: true
|
||||||
|
}
|
||||||
|
|
||||||
|
MyText {
|
||||||
|
fontColor: "red"
|
||||||
|
text: "end_x: " + end_x
|
||||||
|
}
|
||||||
|
|
||||||
|
MySlider {
|
||||||
|
from: 0
|
||||||
|
to: 1600
|
||||||
|
value: end_x
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.preferredHeight: 40
|
||||||
|
|
||||||
|
onValueChanged: {
|
||||||
|
appWindow.end_x = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MyText {
|
||||||
|
fontColor: "red"
|
||||||
|
text: "end_y: " + end_y
|
||||||
|
}
|
||||||
|
|
||||||
|
MySlider {
|
||||||
|
from: 0
|
||||||
|
to: 1600
|
||||||
|
value: end_y
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.preferredHeight: 40
|
||||||
|
|
||||||
|
onValueChanged: {
|
||||||
|
appWindow.end_y = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.fillHeight: true
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,36 @@
|
|||||||
|
// Copyright (c) 2014-2019, The Monero Project
|
||||||
|
|
||||||
|
import QtQuick 2.9
|
||||||
|
import QtGraphicalEffects 1.0
|
||||||
|
|
||||||
|
Item {
|
||||||
|
// Use this component to color+opacity change images with transparency (svg/png)
|
||||||
|
// Does not work in low graphics mode, use fontAwesome fallback option.
|
||||||
|
|
||||||
|
id: root
|
||||||
|
property string image: ""
|
||||||
|
property string color: ""
|
||||||
|
|
||||||
|
property alias svgMask: svgMask
|
||||||
|
property alias imgMockColor: imgMockColor
|
||||||
|
|
||||||
|
width: 0
|
||||||
|
height: 0
|
||||||
|
|
||||||
|
Image {
|
||||||
|
id: svgMask
|
||||||
|
source: root.image
|
||||||
|
sourceSize.width: root.width
|
||||||
|
sourceSize.height: root.height
|
||||||
|
smooth: true
|
||||||
|
mipmap: true
|
||||||
|
visible: false
|
||||||
|
}
|
||||||
|
|
||||||
|
ColorOverlay {
|
||||||
|
id: imgMockColor
|
||||||
|
anchors.fill: root
|
||||||
|
source: svgMask
|
||||||
|
color: root.color
|
||||||
|
}
|
||||||
|
}
|
@ -1,15 +1,15 @@
|
|||||||
import QtQuick 2.7
|
import QtQuick 2.7
|
||||||
import QtQuick.Controls 2.0
|
import QtQuick.Controls 2.0
|
||||||
|
import "."
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
property bool wrap: false
|
property bool wrap: false
|
||||||
property int fontSize: 16
|
property int fontSize: 16
|
||||||
property bool fontBold: false
|
property bool fontBold: false
|
||||||
property string fontColor: "#ffffff"
|
property string fontColor: Style.fontColor
|
||||||
|
|
||||||
color: fontColor
|
color: fontColor
|
||||||
font.bold: fontBold
|
font.bold: fontBold
|
||||||
font.pointSize: fontSize
|
font.pointSize: fontSize
|
||||||
wrapMode: wrap ? Text.WordWrap : Text.NoWrap
|
wrapMode: wrap ? Text.Wrap : Text.NoWrap
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,31 @@
|
|||||||
|
pragma Singleton
|
||||||
|
|
||||||
|
import QtQuick 2.7
|
||||||
|
|
||||||
|
// These color codes are overriden by assets/themes.json, we are just
|
||||||
|
// making sure the property names exist.
|
||||||
|
|
||||||
|
QtObject {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
property string fontColor: "white"
|
||||||
|
property string fontColorDimmed: "#cccccc"
|
||||||
|
property string fontColorBright: "white"
|
||||||
|
property string backgroundGradientStartColor: "#194f64"
|
||||||
|
property string backgroundGradientStopColor: "#192e43"
|
||||||
|
property string backgroundColor: "#1b2939"
|
||||||
|
|
||||||
|
property string dividerColor: "#50ffffff"
|
||||||
|
|
||||||
|
property string btnEnteredColor: "#aa3b689b"
|
||||||
|
property string btnExitedColor: "#aa375c87"
|
||||||
|
property string btnPressedColor: "#aa467dbb"
|
||||||
|
property string btnTextColor: "white"
|
||||||
|
property string btnTextHoverColor: "white"
|
||||||
|
property string btnMainMenuBackground: "#aa3b689b"
|
||||||
|
|
||||||
|
property string historyBackgroundColor: "#2c435d"
|
||||||
|
property string historyBackgroundColorBright: "#406288"
|
||||||
|
property string historyFontColorPlusAmount: "#00d304"
|
||||||
|
property string historyFontColorMinAmount: "red"
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
singleton Style 1.0 Style.qml
|
@ -0,0 +1,44 @@
|
|||||||
|
import QtQuick 2.7
|
||||||
|
import QtQuick.Controls 2.0
|
||||||
|
import QtQuick.Layouts 1.3
|
||||||
|
import "../../common"
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: root
|
||||||
|
color: Style.btnExitedColor
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.fillHeight: true
|
||||||
|
|
||||||
|
property string displayText: ""
|
||||||
|
|
||||||
|
signal clicked();
|
||||||
|
|
||||||
|
MyText{
|
||||||
|
id: btnText
|
||||||
|
text: displayText
|
||||||
|
fontSize: 24
|
||||||
|
fontColor: Style.btnTextColor
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
hoverEnabled: true
|
||||||
|
onEntered: {
|
||||||
|
parent.color = Style.btnEnteredColor;
|
||||||
|
btnText.fontColor = Style.btnTextHoverColor;
|
||||||
|
}
|
||||||
|
onExited: {
|
||||||
|
parent.color = Style.btnExitedColor;
|
||||||
|
btnText.fontColor = Style.btnTextColor;
|
||||||
|
}
|
||||||
|
onPressed: {
|
||||||
|
parent.color = Style.btnPressedColor;
|
||||||
|
btnText.fontColor = Style.btnTextHoverColor;
|
||||||
|
}
|
||||||
|
onClicked: {
|
||||||
|
root.clicked();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue