Change default theme to OneDark like

This commit is contained in:
Vyn 2024-08-09 21:12:35 +02:00
parent 437ea16d7c
commit b1ed3c26c0
19 changed files with 94 additions and 28 deletions

View file

@ -41,6 +41,10 @@ set_source_files_properties(src/qml/styles/CatppuccinFrappe.qml PROPERTIES
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
QT_QML_SINGLETON_TYPE TRUE
)
@ -70,6 +74,7 @@ qt_add_qml_module(mirai
src/qml/components/Modal.qml
src/qml/styles/MiraiColorPalette.qml
src/qml/styles/CatppuccinFrappe.qml
src/qml/styles/OneDark.qml
src/qml/views/ListView.qml
src/qml/views/CalendarView.qml
SOURCES

View file

@ -30,7 +30,7 @@ int main(int argc, char *argv[])
auto m_ratioFont =
qMin(height * refDpi / (dpi * refHeight), width * refDpi / (dpi * refWidth));
QFont font("Helvetica", m_ratioFont);
QFont font("Helvetica");
app.setFont(font);
QQmlApplicationEngine engine;

View file

@ -13,7 +13,7 @@ Button {
id: control
property bool noBackgroundColor: false
icon.color: MiraiColorPalette.buttonIcon
icon.color: colorPalette.selected.buttonIcon
// I have a different behavior when setting padding for Android
padding: root.isPhone ? undefined : 8
@ -26,7 +26,7 @@ Button {
icon: control.icon
text: control.text
font: control.font
color: MiraiColorPalette.text
color: colorPalette.selected.text
}
background: Rectangle {

View file

@ -15,7 +15,7 @@ CheckBox {
contentItem: Text {
id: text
text: control.text
color: MiraiColorPalette.text
color: colorPalette.selected.text
verticalAlignment: Text.AlignVCenter
leftPadding: control.indicator.width + control.spacing
}
@ -26,7 +26,7 @@ CheckBox {
implicitWidth: 12
implicitHeight: 12
radius: 999
color: control.checked ? colorPalette.selected.palette.green : colorPalette.selected.text
color: control.checked ? colorPalette.selected.green : colorPalette.selected.text
Rectangle {
@ -35,7 +35,7 @@ CheckBox {
implicitWidth: 10
implicitHeight: 10
radius: 999
color: control.checked ? colorPalette.selected.palette.green : colorPalette.selected.fieldBackground
color: control.checked ? colorPalette.selected.green : colorPalette.selected.fieldBackground
}
}
}

View file

@ -21,7 +21,7 @@ ComboBox {
background: Rectangle {
implicitWidth: 200
implicitHeight: 32
color: MiraiColorPalette.fieldBackground
color: colorPalette.selected.fieldBackground
radius: 4
}
}

View file

@ -9,7 +9,7 @@ import QtQuick.Controls
import Mirai
Button {
icon.color: MiraiColorPalette.buttonIcon
icon.color: colorPalette.selected.buttonIcon
background: Rectangle {
color: "transparent"

View file

@ -10,13 +10,13 @@ import QtQuick.Controls
import Mirai
TextField {
color: MiraiColorPalette.text
placeholderTextColor: MiraiColorPalette.textPlaceholder
color: colorPalette.selected.text
placeholderTextColor: colorPalette.selected.textPlaceholder
leftPadding: 10
implicitHeight: 32
background: Rectangle {
color: MiraiColorPalette.fieldBackground
color: colorPalette.selected.fieldBackground
radius: 4
}
}

View file

@ -9,5 +9,5 @@ import QtQuick.Controls
import Mirai
Text {
color: MiraiColorPalette.text
color: colorPalette.selected.text
}

View file

@ -15,7 +15,7 @@ Rectangle {
id: datePickerRoot
property alias text: newTodoDate.text
property alias textFieldComponent: newTodoDate
color: MiraiColorPalette.fieldBackground
color: colorPalette.selected.fieldBackground
radius: 4
implicitHeight: 32

View file

@ -26,7 +26,12 @@ Window {
Item {
id: colorPalette
property QtObject selected: MiraiColorPalette
property QtObject selected: OneDark
function selectStyle(styleName) {
// TODO
selected = OneDark;
}
}
function capitalize(str) {
@ -50,6 +55,8 @@ Window {
taskFormPopup.open()
}
Component {
id: sideMenuComponent
SideMenu {

View file

@ -47,7 +47,7 @@ Rectangle {
AppButton {
icon.source: "qrc:/qt/qml/Mirai/src/images/add.png"
icon.color: colorPalette.selected.palette.green
icon.color: colorPalette.selected.green
text: "Add task"
onClicked: {
root.newTask()

View file

@ -12,7 +12,7 @@ import Mirai
Rectangle {
color: MiraiColorPalette.pane
color: colorPalette.selected.pane
implicitWidth: childrenRect.width + 20 + 30
ColumnLayout {
@ -44,7 +44,7 @@ Rectangle {
Rectangle {
Layout.preferredHeight: childrenRect.height
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
AppText {
text: modelData.name
@ -94,7 +94,7 @@ Rectangle {
Rectangle {
Layout.preferredHeight: childrenRect.height
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
QtObject {
id: internal

View file

@ -15,7 +15,7 @@ RowLayout {
function getFormatedText() {
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
}
@ -24,7 +24,8 @@ RowLayout {
id: checkbox
text: control.getFormatedText()
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
: colorPalette.selected.text
onClicked: {
@ -38,9 +39,7 @@ RowLayout {
Layout.alignment: Qt.AlignVCenter
text: modelData
backgroundColor: colorPalette.selected.fieldBackground
textColor: colorPalette.selected.palette.sapphire
textColor: colorPalette.selected.accent
}
}
}

View file

@ -139,7 +139,7 @@ ColumnLayout {
property string name: modelData.text
property int startTime: parseInt(modelData.startTime)
property int endTime: parseInt(modelData.endTime)
color: colorPalette.selected.palette.surface0
color: colorPalette.selected.calendarEvent
anchors.right: parent.right
anchors.left: parent.left
anchors.rightMargin: 2

View file

@ -32,7 +32,7 @@ RowLayout {
Rectangle {
Layout.fillWidth: true
color: modelData.selected ? "white" : mouse.hovered ? MiraiColorPalette.filterHovered : "transparent"
color: modelData.selected ? "white" : mouse.hovered ? colorPalette.selected.filterHovered : "transparent"
implicitHeight: 2
}
}

View file

@ -52,7 +52,7 @@ ColumnLayout {
AppButton {
text: "Add"
icon.source: "qrc:/qt/qml/Mirai/src/images/add.png"
icon.color: colorPalette.selected.palette.green
icon.color: colorPalette.selected.green
onClicked: {
fileDialog.open()
}

View file

@ -9,7 +9,7 @@ import QtQuick 2.5
import Mirai
QtObject {
property QtObject palette: CatppuccinFrappe
property QtObject palette: OneDark
property string background: CatppuccinFrappe.base
property string pane: CatppuccinFrappe.mantle
property string text: CatppuccinFrappe.text

View 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"
}

View file

@ -53,7 +53,7 @@ ScrollView {
text: task.modelData.date === internal.todayDate ? "Today"
: task.modelData.date === internal.tomorrowDate ? "Tomorrow"
: 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
: colorPalette.selected.text
font.pointSize: 24