Commit 94fd048a authored by Carson Black's avatar Carson Black

Refactor main.qml into multiple files

parent fd3bd3d0
import QtQuick 2.12
import org.kde.kirigami 2.5 as Kirigami
import QtQuick.Controls 2.5
Kirigami.OverlayDrawer {
edge: Qt.BottomEdge
height: root.height * 0.9
contentItem: ScrollView {
anchors.fill: parent
clip: true
Column {
width: root.width
Kirigami.Heading {
text: i18n("Breeze Colors")
}
Kirigami.Heading {
font.pointSize: 12
text: i18n("Neutral Colors")
}
Flow {
width: parent.width
ColorSwatch {
swatchColor: "#fcfcfc"
fancyName: "Paper White"
}
ColorSwatch {
swatchColor: "#eff0f1"
fancyName: "Cardboard Grey"
}
ColorSwatch {
swatchColor: "#bdc3c7"
fancyName: "Alternate Grey"
}
ColorSwatch {
swatchColor: "#95a5a6"
fancyName: "Alternate Alternate Grey"
}
ColorSwatch {
swatchColor: "#7f8c8d"
fancyName: "Coastal Fog"
}
ColorSwatch {
swatchColor: "#4d4d4d"
fancyName: "Icon Grey"
}
ColorSwatch {
swatchColor: "#31363b"
fancyName: "Charcoal Grey"
}
ColorSwatch {
swatchColor: "#232627"
fancyName: "Shade Black"
}
}
Kirigami.Heading {
font.pointSize: 12
text: i18n("Warm Colors")
}
Flow {
width: parent.width
ColorSwatch {
swatchColor: "#e74c3c"
fancyName: "Pimpinella"
}
ColorSwatch {
swatchColor: "#da4453"
fancyName: "Icon Red"
}
ColorSwatch {
swatchColor: "#ed1515"
fancyName: "Danger Red"
}
ColorSwatch {
swatchColor: "#c0392b"
fancyName: "Alternate Red"
}
ColorSwatch {
swatchColor: "#f47750"
fancyName: "Icon Orange"
}
ColorSwatch {
swatchColor: "#d35400"
fancyName: "Alternate Orange"
}
ColorSwatch {
swatchColor: "#fdbc4b"
fancyName: "Icon Yellow"
}
ColorSwatch {
swatchColor: "#f67400"
fancyName: "Beware Orange"
}
ColorSwatch {
swatchColor: "#c9ce3b"
fancyName: "Sunbeam Yellow"
}
ColorSwatch {
swatchColor: "#f39c1f"
fancyName: "Alternate Alternate Orange"
}
}
Kirigami.Heading {
font.pointSize: 12
text: i18n("Cool Colors")
}
Flow {
width: parent.width
ColorSwatch {
swatchColor: "#1cdc9a"
fancyName: "Mellow Turquoise"
}
ColorSwatch {
swatchColor: "#11d116"
fancyName: "Verdant Green"
}
ColorSwatch {
swatchColor: "#2ecc71"
fancyName: "Icon Green"
}
ColorSwatch {
swatchColor: "#27ae60"
fancyName: "Noble Fir"
}
ColorSwatch {
swatchColor: "#1abc9c"
fancyName: "Teal"
}
ColorSwatch {
swatchColor: "#16a085"
fancyName: "Alternate Teal"
}
ColorSwatch {
swatchColor: "#3498db"
fancyName: "Alternate Blue"
}
ColorSwatch {
swatchColor: "#2980b9"
fancyName: "Abyss Blue"
}
ColorSwatch {
swatchColor: "#3daee9"
fancyName: "Plasma Blue"
}
ColorSwatch {
swatchColor: "#1d99f3"
fancyName: "Icon Blue"
}
ColorSwatch {
swatchColor: "#9b59b6"
fancyName: "Purple"
}
ColorSwatch {
swatchColor: "#8e44ad"
fancyName: "Alternate Purple"
}
}
}
}
}
\ No newline at end of file
......@@ -4,10 +4,9 @@ import org.kde.kirigami 2.4 as Kirigami
Rectangle {
anchors.top: parent.top
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width * (9/10)
width: parent.width
height: pulledDown ? parent.height : Kirigami.Units.largeSpacing * 2
border.color: Qt.darker(color)
opacity: 0.9
opacity: 0.8
property bool pulledDown: false
Behavior on height {
NumberAnimation {
......
import QtQuick 2.12
import org.kde.kirigami 2.5 as Kirigami
Row {
spacing: 0
Rectangle {
height: parent.height
width: parent.width / 2
color: root.leftColor
LightIcon {
anchors.centerIn: parent
size: parent.width - (Kirigami.Units.largeSpacing * 2)
source: root.imageSource
}
}
Rectangle {
height: parent.height
width: parent.width / 2
color: root.rightColor
DarkIcon {
anchors.centerIn: parent
size: parent.width - (Kirigami.Units.largeSpacing * 2)
source: root.imageSource
}
}
}
\ No newline at end of file
import QtQuick 2.12
import QtQuick.Layouts 1.12
import org.kde.kirigami 2.5 as Kirigami
import org.kde.plasma.components 2.0 as PlasmaComponents
import QtWebEngine 1.1
import QtGraphicalEffects 1.12
Item {
ColumnLayout {
anchors.fill: parent
spacing: 0
Rectangle {
height: 32
Layout.fillWidth: true
Kirigami.Theme.colorSet: Kirigami.Theme.Window
color: Kirigami.Theme.backgroundColor
RowLayout {
anchors.fill: parent
PlasmaComponents.ToolButton {
enabled: webView.canGoBack
iconName: "draw-arrow-back"
text: i18n("Go Back")
onClicked: {
webView.goBack()
}
}
PlasmaComponents.ToolButton {
id: forwardBtn
enabled: webView.canGoForward
iconName: "draw-arrow-forward"
text: i18n("Go Forward")
onClicked: {
webView.goForward()
}
}
PlasmaComponents.TextField {
height: forwardBtn.height
Layout.fillWidth: true
text: webView.url
enabled: false
}
PlasmaComponents.ToolButton {
iconName: "go-home"
text: i18n("Return to HIG Home")
onClicked: {
webView.url = "https://hig.kde.org/style/icons/index.html"
}
}
}
}
WebEngineView {
id: webView
Layout.fillHeight: true
Layout.fillWidth: true
url: "https://hig.kde.org/style/icons/index.html"
}
}
Column {
id: iconColumn
LayoutMirroring.enabled: false
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
Rectangle {
height: 64
width: 64
color: root.leftColor
LightIcon {
anchors.centerIn: parent
height: 48
width: 48
source: root.imageSource
}
}
Rectangle {
height: 64
width: 64
color: root.rightColor
DarkIcon {
anchors.centerIn: parent
height: 48
width: 48
source: root.imageSource
}
}
}
DropShadow {
anchors.fill: iconColumn
radius: 8.0
samples: 17
color: "#80000000"
source: iconColumn
}
}
\ No newline at end of file
import QtQuick 2.12
import org.kde.kirigami 2.5 as Kirigami
import QtQuick.Controls 2.5
Kirigami.ApplicationWindow {
height: 256 + (Kirigami.Units.largeSpacing * 4)
flags: Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint
visible: false
width: 128
title: "HUD"
maximumHeight: height
maximumWidth: width
minimumHeight: height
minimumWidth: width
Column {
spacing: 0
Rectangle {
height: Kirigami.Units.largeSpacing * 4
width: 128
Kirigami.Theme.colorSet: Kirigami.Theme.Window
color: Kirigami.Theme.backgroundColor
Label {
color: Kirigami.Theme.textColor
text: i18nc("The title name of the HUD window", "HUD")
anchors.centerIn: parent
}
ToolButton {
icon.name: "tab-close-other"
height: parent.height * (3/4)
width: height
anchors.right: parent.right
anchors.rightMargin: Kirigami.Units.smallSpacing
anchors.verticalCenter: parent.verticalCenter
onClicked: {
hud.visible = false
}
}
MouseArea {
id: mouseRegion
anchors.fill: parent;
property int mouseXWin: 0
property int mouseYWin: 0
onPressed: {
mouseXWin = mouse.x
mouseYWin = mouse.y
cursorShape = Qt.SizeAllCursor
}
onReleased: {
cursorShape = Qt.ArrowCursor
}
onPositionChanged: {
var xdelta = mouse.x - mouseXWin
var ydelta = mouse.y - mouseYWin
hud.x = hud.x + xdelta
hud.y = hud.y + ydelta
}
}
}
Rectangle {
height: 128
width: 128
color: root.leftColor
LightIcon {
anchors.centerIn: parent
size: 48
source: root.imageSource
}
}
Rectangle {
height: 128
width: 128
color: root.rightColor
DarkIcon {
anchors.centerIn: parent
size: 48
source: root.imageSource
}
}
}
}
\ No newline at end of file
import QtQuick 2.12
import org.kde.kirigami 2.5 as Kirigami
import org.kde.plasma.components 2.0 as PlasmaComponents
Item {
Row {
anchors.fill: parent
Rectangle {
height: parent.height
width: parent.width / 2
color: root.leftColor
Behavior on color {
ColorAnimation {
duration: 500
}
}
}
Rectangle {
height: parent.height
width: parent.width / 2
color: root.rightColor
Behavior on color {
ColorAnimation {
duration: 500
}
}
}
}
Row {
anchors.fill: parent
spacing: 0
Column {
width: parent.width / 2
anchors.verticalCenter: parent.verticalCenter
Spacer {}
Row {
anchors.horizontalCenter: parent.horizontalCenter
spacing: 16
Repeater {
model: symSizesModel
LightIcon {
size: model["size"]
anchors.bottom: parent.bottom
source: root.imageSource
}
}
}
Row {
anchors.horizontalCenter: parent.horizontalCenter
spacing: 16
Repeater {
model: symSizesModel
LightIcon {
size: model["size"]
anchors.bottom: parent.bottom
source: root.symIcons[0]
}
}
}
Row {
anchors.horizontalCenter: parent.horizontalCenter
spacing: 16
Repeater {
model: symSizesModel
LightIcon {
size: model["size"]
anchors.bottom: parent.bottom
source: root.symIcons[1]
}
}
}
Row {
anchors.horizontalCenter: parent.horizontalCenter
spacing: 16
Repeater {
model: symSizesModel
LightIcon {
size: model["size"]
anchors.bottom: parent.bottom
source: root.symIcons[2]
}
}
}
Row {
anchors.horizontalCenter: parent.horizontalCenter
spacing: 16
Repeater {
model: symSizesModel
LightIcon {
size: model["size"]
anchors.bottom: parent.bottom
source: root.symIcons[3]
}
}
}
}
Column {
width: parent.width / 2
anchors.verticalCenter: parent.verticalCenter
Spacer {}
Row {
anchors.horizontalCenter: parent.horizontalCenter
spacing: 16
Repeater {
model: symSizesModel
DarkIcon {
overlayWhite: overlayCheck.checked
size: model["size"]
anchors.bottom: parent.bottom
source: root.imageSource
}
}
}
Row {
anchors.horizontalCenter: parent.horizontalCenter
spacing: 16
Repeater {
model: symSizesModel
DarkIcon {
size: model["size"]
anchors.bottom: parent.bottom
source: root.symIcons[0]
}
}
}
Row {
anchors.horizontalCenter: parent.horizontalCenter
spacing: 16
Repeater {
model: symSizesModel
DarkIcon {
size: model["size"]
anchors.bottom: parent.bottom
source: root.symIcons[1]
}
}
}
Row {
anchors.horizontalCenter: parent.horizontalCenter
spacing: 16
Repeater {
model: symSizesModel
DarkIcon {
size: model["size"]
anchors.bottom: parent.bottom
source: root.symIcons[2]
}
}
}
Row {
anchors.horizontalCenter: parent.horizontalCenter
spacing: 16
Repeater {
model: symSizesModel
DarkIcon {
size: model["size"]
anchors.bottom: parent.bottom
source: root.symIcons[3]
}
}
}
}
}
PlasmaComponents.CheckBox {
anchors.top: parent.top
anchors.topMargin: 10
anchors.left: parent.left
anchors.leftMargin: 10
id: overlayCheck
}
PlasmaComponents.Label {
anchors.left: overlayCheck.right
anchors.leftMargin: 5
color: "black"
anchors.verticalCenter: overlayCheck.verticalCenter
text: i18n("Enable white effect on icons on dark")
}
}
\ No newline at end of file
import QtQuick 2.12
import QtQuick.Controls 2.5
import QtQuick.Layouts 1.12
import org.kde.kirigami 2.5 as Kirigami
Item {
id: viewroot
Row {
anchors.fill: parent
Rectangle {
color: root.leftColor
height: parent.height
width: parent.width / 2
Image {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: lgrid.bottom
source: "qrc:/bg.jpg"
}
DropDown {
pulledDown: pullDown.checked
color: root.leftColor
}
Grid {
id: lgrid
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
anchors.verticalCenterOffset: -40
width: 384
height: 384
columns: 3
rows: 3
Repeater {
model: 4
GridRect {
LightIcon {
anchors.centerIn: parent
source: root.icons[index]
}
}
}
GridRect {
LightIcon {
anchors.centerIn: parent
source: root.imageSource
}
}
Repeater {
model: 4
GridRect {
LightIcon {
anchors.centerIn: parent
source: root.icons[index+4]
}
}
}
}
Grid {
height: 400/3
width: 384
anchors.top: lgrid.bottom
anchors.horizontalCenter: lgrid.horizontalCenter
columns: 4
rows: 2
Repeater {
model: sizesModel
SmallGridRect {
LightIcon {
anchors.bottomMargin: -Kirigami.Units.largeSpacing
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
source: root.imageSource
size: model["size"]
}
}
}
Repeater {
model: sizesModel
SmallGridRect {
Label {
anchors.centerIn: parent
color: root.rightColor
text: model["size"]
}
}
}
}
}
Rectangle {
color: root.rightColor
height: parent.height
width: parent.width / 2
Image {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: rgrid.bottom
source: "qrc:/bg-dark.jpg"
}
DropDown {
pulledDown: pullDown.checked
color: root.rightColor
}
Grid {
id: rgrid
width: 384
height: 384
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
anchors.verticalCenterOffset: -40
columns: 3
rows: 3
Repeater {
model: 4
GridRect {
DarkIcon {
anchors.centerIn: parent
source: root.icons[index]
}
}
}
GridRect {
DarkIcon {
anchors.centerIn: parent
source: root.imageSource
}
}
Repeater {
model: 4
GridRect {
DarkIcon {
anchors.centerIn: parent
source: root.icons[index+4]
}
}
}
}
Rectangle {
color: root.rightColor
height: 400/3
width: 384
anchors.top: rgrid.bottom
anchors.horizontalCenter: rgrid.horizontalCenter
Grid {
height: 400/3
width: 384
anchors.top: parent.top
anchors.horizontalCenter: parent.horizontalCenter
columns: 4
rows: 2
Repeater {
model: sizesModel
SmallGridRect {
DarkIcon {
anchors.bottomMargin: -Kirigami.Units.largeSpacing
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
source: root.imageSource
size: model["size"]
}
}
}
Repeater {
model: sizesModel
SmallGridRect {
Label {
anchors.centerIn: parent
color: root.leftColor
text: model["size"]
}
}
}
}
Behavior on color {
ColorAnimation {
duration: Kirigami.Units.longDuration
}
}
}
}
}
}
\ No newline at end of file
This diff is collapsed.
<RCC>
<qresource prefix="/">
<file>main.qml</file>
<file>BreezePalette.qml</file>
<file>HUD.qml</file>
<file>RegularView.qml</file>
<file>MonochromeView.qml</file>