mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-03 01:33:19 +00:00
Change default theme to OneDark like
This commit is contained in:
parent
437ea16d7c
commit
b1ed3c26c0
19 changed files with 94 additions and 28 deletions
|
@ -41,6 +41,10 @@ set_source_files_properties(src/qml/styles/CatppuccinFrappe.qml PROPERTIES
|
||||||
QT_QML_SINGLETON_TYPE TRUE
|
QT_QML_SINGLETON_TYPE TRUE
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set_source_files_properties(src/qml/styles/OneDark.qml PROPERTIES
|
||||||
|
QT_QML_SINGLETON_TYPE TRUE
|
||||||
|
)
|
||||||
|
|
||||||
set_source_files_properties(src/qml/styles/MiraiColorPalette.qml PROPERTIES
|
set_source_files_properties(src/qml/styles/MiraiColorPalette.qml PROPERTIES
|
||||||
QT_QML_SINGLETON_TYPE TRUE
|
QT_QML_SINGLETON_TYPE TRUE
|
||||||
)
|
)
|
||||||
|
@ -70,6 +74,7 @@ qt_add_qml_module(mirai
|
||||||
src/qml/components/Modal.qml
|
src/qml/components/Modal.qml
|
||||||
src/qml/styles/MiraiColorPalette.qml
|
src/qml/styles/MiraiColorPalette.qml
|
||||||
src/qml/styles/CatppuccinFrappe.qml
|
src/qml/styles/CatppuccinFrappe.qml
|
||||||
|
src/qml/styles/OneDark.qml
|
||||||
src/qml/views/ListView.qml
|
src/qml/views/ListView.qml
|
||||||
src/qml/views/CalendarView.qml
|
src/qml/views/CalendarView.qml
|
||||||
SOURCES
|
SOURCES
|
||||||
|
|
|
@ -30,7 +30,7 @@ int main(int argc, char *argv[])
|
||||||
auto m_ratioFont =
|
auto m_ratioFont =
|
||||||
qMin(height * refDpi / (dpi * refHeight), width * refDpi / (dpi * refWidth));
|
qMin(height * refDpi / (dpi * refHeight), width * refDpi / (dpi * refWidth));
|
||||||
|
|
||||||
QFont font("Helvetica", m_ratioFont);
|
QFont font("Helvetica");
|
||||||
app.setFont(font);
|
app.setFont(font);
|
||||||
|
|
||||||
QQmlApplicationEngine engine;
|
QQmlApplicationEngine engine;
|
||||||
|
|
|
@ -13,7 +13,7 @@ Button {
|
||||||
id: control
|
id: control
|
||||||
property bool noBackgroundColor: false
|
property bool noBackgroundColor: false
|
||||||
|
|
||||||
icon.color: MiraiColorPalette.buttonIcon
|
icon.color: colorPalette.selected.buttonIcon
|
||||||
|
|
||||||
// I have a different behavior when setting padding for Android
|
// I have a different behavior when setting padding for Android
|
||||||
padding: root.isPhone ? undefined : 8
|
padding: root.isPhone ? undefined : 8
|
||||||
|
@ -26,7 +26,7 @@ Button {
|
||||||
icon: control.icon
|
icon: control.icon
|
||||||
text: control.text
|
text: control.text
|
||||||
font: control.font
|
font: control.font
|
||||||
color: MiraiColorPalette.text
|
color: colorPalette.selected.text
|
||||||
}
|
}
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
|
|
|
@ -15,7 +15,7 @@ CheckBox {
|
||||||
contentItem: Text {
|
contentItem: Text {
|
||||||
id: text
|
id: text
|
||||||
text: control.text
|
text: control.text
|
||||||
color: MiraiColorPalette.text
|
color: colorPalette.selected.text
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
leftPadding: control.indicator.width + control.spacing
|
leftPadding: control.indicator.width + control.spacing
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ CheckBox {
|
||||||
implicitWidth: 12
|
implicitWidth: 12
|
||||||
implicitHeight: 12
|
implicitHeight: 12
|
||||||
radius: 999
|
radius: 999
|
||||||
color: control.checked ? colorPalette.selected.palette.green : colorPalette.selected.text
|
color: control.checked ? colorPalette.selected.green : colorPalette.selected.text
|
||||||
|
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
@ -35,7 +35,7 @@ CheckBox {
|
||||||
implicitWidth: 10
|
implicitWidth: 10
|
||||||
implicitHeight: 10
|
implicitHeight: 10
|
||||||
radius: 999
|
radius: 999
|
||||||
color: control.checked ? colorPalette.selected.palette.green : colorPalette.selected.fieldBackground
|
color: control.checked ? colorPalette.selected.green : colorPalette.selected.fieldBackground
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ ComboBox {
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
implicitWidth: 200
|
implicitWidth: 200
|
||||||
implicitHeight: 32
|
implicitHeight: 32
|
||||||
color: MiraiColorPalette.fieldBackground
|
color: colorPalette.selected.fieldBackground
|
||||||
radius: 4
|
radius: 4
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import QtQuick.Controls
|
||||||
import Mirai
|
import Mirai
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
icon.color: MiraiColorPalette.buttonIcon
|
icon.color: colorPalette.selected.buttonIcon
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|
|
@ -10,13 +10,13 @@ import QtQuick.Controls
|
||||||
import Mirai
|
import Mirai
|
||||||
|
|
||||||
TextField {
|
TextField {
|
||||||
color: MiraiColorPalette.text
|
color: colorPalette.selected.text
|
||||||
placeholderTextColor: MiraiColorPalette.textPlaceholder
|
placeholderTextColor: colorPalette.selected.textPlaceholder
|
||||||
leftPadding: 10
|
leftPadding: 10
|
||||||
implicitHeight: 32
|
implicitHeight: 32
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
color: MiraiColorPalette.fieldBackground
|
color: colorPalette.selected.fieldBackground
|
||||||
radius: 4
|
radius: 4
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,5 +9,5 @@ import QtQuick.Controls
|
||||||
import Mirai
|
import Mirai
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
color: MiraiColorPalette.text
|
color: colorPalette.selected.text
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ Rectangle {
|
||||||
id: datePickerRoot
|
id: datePickerRoot
|
||||||
property alias text: newTodoDate.text
|
property alias text: newTodoDate.text
|
||||||
property alias textFieldComponent: newTodoDate
|
property alias textFieldComponent: newTodoDate
|
||||||
color: MiraiColorPalette.fieldBackground
|
color: colorPalette.selected.fieldBackground
|
||||||
radius: 4
|
radius: 4
|
||||||
implicitHeight: 32
|
implicitHeight: 32
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,12 @@ Window {
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: colorPalette
|
id: colorPalette
|
||||||
property QtObject selected: MiraiColorPalette
|
property QtObject selected: OneDark
|
||||||
|
|
||||||
|
function selectStyle(styleName) {
|
||||||
|
// TODO
|
||||||
|
selected = OneDark;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function capitalize(str) {
|
function capitalize(str) {
|
||||||
|
@ -50,6 +55,8 @@ Window {
|
||||||
taskFormPopup.open()
|
taskFormPopup.open()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
id: sideMenuComponent
|
id: sideMenuComponent
|
||||||
SideMenu {
|
SideMenu {
|
||||||
|
|
|
@ -47,7 +47,7 @@ Rectangle {
|
||||||
|
|
||||||
AppButton {
|
AppButton {
|
||||||
icon.source: "qrc:/qt/qml/Mirai/src/images/add.png"
|
icon.source: "qrc:/qt/qml/Mirai/src/images/add.png"
|
||||||
icon.color: colorPalette.selected.palette.green
|
icon.color: colorPalette.selected.green
|
||||||
text: "Add task"
|
text: "Add task"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
root.newTask()
|
root.newTask()
|
||||||
|
|
|
@ -12,7 +12,7 @@ import Mirai
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|
||||||
color: MiraiColorPalette.pane
|
color: colorPalette.selected.pane
|
||||||
implicitWidth: childrenRect.width + 20 + 30
|
implicitWidth: childrenRect.width + 20 + 30
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
|
@ -44,7 +44,7 @@ Rectangle {
|
||||||
Rectangle {
|
Rectangle {
|
||||||
Layout.preferredHeight: childrenRect.height
|
Layout.preferredHeight: childrenRect.height
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
color: backend.activeResourcesFilter.includes(modelData.name) ? MiraiColorPalette.filterSelected : mouse.hovered ? MiraiColorPalette.filterHovered : "transparent"
|
color: backend.activeResourcesFilter.includes(modelData.name) ? colorPalette.selected.filterSelected : mouse.hovered ? MiraiColorPalette.filterHovered : "transparent"
|
||||||
radius: 4
|
radius: 4
|
||||||
AppText {
|
AppText {
|
||||||
text: modelData.name
|
text: modelData.name
|
||||||
|
@ -94,7 +94,7 @@ Rectangle {
|
||||||
Rectangle {
|
Rectangle {
|
||||||
Layout.preferredHeight: childrenRect.height
|
Layout.preferredHeight: childrenRect.height
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
color: backend.activeTagsFilter.includes(modelData.name) ? MiraiColorPalette.filterSelected : mouse.hovered ? MiraiColorPalette.filterHovered : "transparent"
|
color: backend.activeTagsFilter.includes(modelData.name) ? colorPalette.selected.filterSelected : mouse.hovered ? MiraiColorPalette.filterHovered : "transparent"
|
||||||
radius: 4
|
radius: 4
|
||||||
QtObject {
|
QtObject {
|
||||||
id: internal
|
id: internal
|
||||||
|
|
|
@ -15,7 +15,7 @@ RowLayout {
|
||||||
|
|
||||||
function getFormatedText() {
|
function getFormatedText() {
|
||||||
if (task?.time && task.time != "") {
|
if (task?.time && task.time != "") {
|
||||||
return `<font color=\"${colorPalette.selected.palette.overlay1}\">${task.time} \></font> ${task.text}`
|
return `<font color=\"${"blue"}\">${task.time} \></font> ${task.text}`
|
||||||
}
|
}
|
||||||
return task.text
|
return task.text
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,8 @@ RowLayout {
|
||||||
id: checkbox
|
id: checkbox
|
||||||
text: control.getFormatedText()
|
text: control.getFormatedText()
|
||||||
checked: task.state === 'DONE'
|
checked: task.state === 'DONE'
|
||||||
textComponent.color: task.date < internal.todayDate ? colorPalette.selected.palette.pink
|
textComponent.font.pointSize: 14
|
||||||
|
textComponent.color: task.date < internal.todayDate ? colorPalette.selected.red
|
||||||
// : task.date === internal.todayDate ? colorPalette.selected.palette.sapphire
|
// : task.date === internal.todayDate ? colorPalette.selected.palette.sapphire
|
||||||
: colorPalette.selected.text
|
: colorPalette.selected.text
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
@ -38,9 +39,7 @@ RowLayout {
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
text: modelData
|
text: modelData
|
||||||
backgroundColor: colorPalette.selected.fieldBackground
|
backgroundColor: colorPalette.selected.fieldBackground
|
||||||
textColor: colorPalette.selected.palette.sapphire
|
textColor: colorPalette.selected.accent
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -139,7 +139,7 @@ ColumnLayout {
|
||||||
property string name: modelData.text
|
property string name: modelData.text
|
||||||
property int startTime: parseInt(modelData.startTime)
|
property int startTime: parseInt(modelData.startTime)
|
||||||
property int endTime: parseInt(modelData.endTime)
|
property int endTime: parseInt(modelData.endTime)
|
||||||
color: colorPalette.selected.palette.surface0
|
color: colorPalette.selected.calendarEvent
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.rightMargin: 2
|
anchors.rightMargin: 2
|
||||||
|
|
|
@ -32,7 +32,7 @@ RowLayout {
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
color: modelData.selected ? "white" : mouse.hovered ? MiraiColorPalette.filterHovered : "transparent"
|
color: modelData.selected ? "white" : mouse.hovered ? colorPalette.selected.filterHovered : "transparent"
|
||||||
implicitHeight: 2
|
implicitHeight: 2
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@ ColumnLayout {
|
||||||
AppButton {
|
AppButton {
|
||||||
text: "Add"
|
text: "Add"
|
||||||
icon.source: "qrc:/qt/qml/Mirai/src/images/add.png"
|
icon.source: "qrc:/qt/qml/Mirai/src/images/add.png"
|
||||||
icon.color: colorPalette.selected.palette.green
|
icon.color: colorPalette.selected.green
|
||||||
onClicked: {
|
onClicked: {
|
||||||
fileDialog.open()
|
fileDialog.open()
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import QtQuick 2.5
|
||||||
import Mirai
|
import Mirai
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
property QtObject palette: CatppuccinFrappe
|
property QtObject palette: OneDark
|
||||||
property string background: CatppuccinFrappe.base
|
property string background: CatppuccinFrappe.base
|
||||||
property string pane: CatppuccinFrappe.mantle
|
property string pane: CatppuccinFrappe.mantle
|
||||||
property string text: CatppuccinFrappe.text
|
property string text: CatppuccinFrappe.text
|
||||||
|
|
55
src/qml/styles/OneDark.qml
Normal file
55
src/qml/styles/OneDark.qml
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
/*
|
||||||
|
* Mirai. Copyright (C) 2024 Vyn
|
||||||
|
* This file is licensed under version 3 of the GNU General Public License (GPL-3.0-only)
|
||||||
|
* The license can be found in the LICENSE file or at https://www.gnu.org/licenses/gpl-3.0.txt
|
||||||
|
*/
|
||||||
|
|
||||||
|
pragma Singleton
|
||||||
|
import QtQuick 2.5
|
||||||
|
|
||||||
|
//black = "#181a1f",
|
||||||
|
//bg0 = "#282c34",
|
||||||
|
//bg1 = "#31353f",
|
||||||
|
//bg2 = "#393f4a",
|
||||||
|
//bg3 = "#3b3f4c",
|
||||||
|
//bg_d = "#21252b",
|
||||||
|
//bg_blue = "#73b8f1",
|
||||||
|
//bg_yellow = "#ebd09c",
|
||||||
|
//fg = "#abb2bf",
|
||||||
|
//purple = "#c678dd",
|
||||||
|
//green = "#98c379",
|
||||||
|
//orange = "#d19a66",
|
||||||
|
//blue = "#61afef",
|
||||||
|
//yellow = "#e5c07b",
|
||||||
|
//cyan = "#56b6c2",
|
||||||
|
//red = "#e86671",
|
||||||
|
//grey = "#5c6370",
|
||||||
|
//light_grey = "#848b98",
|
||||||
|
//dark_cyan = "#2b6f77",
|
||||||
|
//dark_red = "#993939",
|
||||||
|
//dark_yellow = "#93691d",
|
||||||
|
//dark_purple = "#8a3fa0",
|
||||||
|
//diff_add = "#31392b",
|
||||||
|
//diff_delete = "#382b2c",
|
||||||
|
//diff_change = "#1c3448",
|
||||||
|
//diff_text = "#2c5372",
|
||||||
|
|
||||||
|
QtObject {
|
||||||
|
property string background: "#282c34"
|
||||||
|
property string pane: "#21252b"
|
||||||
|
property string text: "#abb2bf"
|
||||||
|
property string textPlaceholder: "#5c6370"
|
||||||
|
property string accent: "#2b6f77"
|
||||||
|
property string fieldBackground: "#393f4a"
|
||||||
|
property string buttonIcon: "#2b6f77"
|
||||||
|
property string buttonBackground: "#31353f"
|
||||||
|
property string buttonHovered: "#3b3f4c"
|
||||||
|
property string filterHovered: "#5c6370"
|
||||||
|
property string filterSelected: "#3b3f4c"
|
||||||
|
property string modalBorder: "#8a3fa0"
|
||||||
|
property string calendarLines: "#3b3f4c"
|
||||||
|
property string calendarCurrentTime: "#e86671"
|
||||||
|
property string calendarEvent: "#3b3f4c"
|
||||||
|
property string green: "#98c379"
|
||||||
|
property string red: "#e86671"
|
||||||
|
}
|
|
@ -53,7 +53,7 @@ ScrollView {
|
||||||
text: task.modelData.date === internal.todayDate ? "Today"
|
text: task.modelData.date === internal.todayDate ? "Today"
|
||||||
: task.modelData.date === internal.tomorrowDate ? "Tomorrow"
|
: task.modelData.date === internal.tomorrowDate ? "Tomorrow"
|
||||||
: task.modelData.date
|
: task.modelData.date
|
||||||
color: task.modelData.date < internal.todayDate ? colorPalette.selected.palette.pink
|
color: task.modelData.date < internal.todayDate ? colorPalette.selected.red
|
||||||
// : task.modelData.date === internal.todayDate ? colorPalette.selected.palette.sapphire
|
// : task.modelData.date === internal.todayDate ? colorPalette.selected.palette.sapphire
|
||||||
: colorPalette.selected.text
|
: colorPalette.selected.text
|
||||||
font.pointSize: 24
|
font.pointSize: 24
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue