Add datetime module

pull/26/head
reionwong 4 years ago
parent 4686831caf
commit bdfb797c41

@ -45,6 +45,9 @@ set(SRCS
src/cursor/cursorthememodel.cpp
src/cursor/cursortheme.cpp
src/cursor/mouse.cpp
src/datetime/timezonedata.h
src/datetime/timezonemap.cpp
src/datetime/timedated_interface.cpp
)
set(RESOURCES
@ -56,6 +59,8 @@ qt5_add_dbus_adaptor(DBUS_SOURCES
src/application.h Application)
set_source_files_properties(${DBUS_SOURCES} PROPERTIES SKIP_AUTOGEN ON)
# qt5_add_dbus_interface(DBUS_SOURCES src/datetime/org.freedesktop.timedate1.xml timedated_interface)
add_executable(${PROJECT_NAME} ${DBUS_SOURCES} ${SRCS} ${RESOURCES})
target_link_libraries(${PROJECT_NAME}
Qt5::Core

@ -20,6 +20,8 @@
#include "cursor/cursorthememodel.h"
#include "cursor/mouse.h"
#include "datetime/timezonemap.h"
static QObject *passwordSingleton(QQmlEngine *engine, QJSEngine *scriptEngine)
{
Q_UNUSED(engine);
@ -69,6 +71,7 @@ Application::Application(int &argc, char **argv)
qmlRegisterType<Fonts>(uri, 1, 0, "Fonts");
qmlRegisterType<PowerManager>(uri, 1, 0, "PowerManager");
qmlRegisterType<Mouse>(uri, 1, 0, "Mouse");
qmlRegisterType<TimeZoneMap>(uri, 1, 0, "TimeZoneMap");
qmlRegisterSingletonType<Password>(uri, 1, 0, "Password", passwordSingleton);
qmlRegisterType<QAbstractItemModel>();

@ -0,0 +1,42 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.freedesktop.timedate1">
<property name="Timezone" type="s" access="read">
</property>
<property name="LocalRTC" type="b" access="read">
</property>
<property name="CanNTP" type="b" access="read">
<annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/>
</property>
<property name="NTP" type="b" access="read">
</property>
<property name="NTPSynchronized" type="b" access="read">
<annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/>
</property>
<property name="TimeUSec" type="t" access="read">
<annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/>
</property>
<property name="RTCTimeUSec" type="t" access="read">
<annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="false"/>
</property>
<method name="SetTime">
<arg type="x" direction="in"/>
<arg type="b" direction="in"/>
<arg type="b" direction="in"/>
</method>
<method name="SetTimezone">
<arg type="s" direction="in"/>
<arg type="b" direction="in"/>
</method>
<method name="SetLocalRTC">
<arg type="b" direction="in"/>
<arg type="b" direction="in"/>
<arg type="b" direction="in"/>
</method>
<method name="SetNTP">
<arg type="b" direction="in"/>
<arg type="b" direction="in"/>
</method>
</interface>
</node>

@ -0,0 +1,25 @@
/*
* This file was generated by qdbusxml2cpp version 0.8
* Command line was: qdbusxml2cpp -m -p timedated_interface /home/cutefish/CutefishOS/settings/src/datetime/org.freedesktop.timedate1.xml
*
* qdbusxml2cpp is Copyright (C) 2020 The Qt Company Ltd.
*
* This is an auto-generated file.
* This file may have been hand-edited. Look for HAND-EDIT comments
* before re-generating it.
*/
#include "timedated_interface.h"
/*
* Implementation of interface class OrgFreedesktopTimedate1Interface
*/
OrgFreedesktopTimedate1Interface::OrgFreedesktopTimedate1Interface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
: QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
{
}
OrgFreedesktopTimedate1Interface::~OrgFreedesktopTimedate1Interface()
{
}

@ -0,0 +1,103 @@
/*
* This file was generated by qdbusxml2cpp version 0.8
* Command line was: qdbusxml2cpp -m -p timedated_interface /home/cutefish/CutefishOS/settings/src/datetime/org.freedesktop.timedate1.xml
*
* qdbusxml2cpp is Copyright (C) 2020 The Qt Company Ltd.
*
* This is an auto-generated file.
* Do not edit! All changes made to it will be lost.
*/
#ifndef TIMEDATED_INTERFACE_H
#define TIMEDATED_INTERFACE_H
#include <QtCore/QObject>
#include <QtCore/QByteArray>
#include <QtCore/QList>
#include <QtCore/QMap>
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtCore/QVariant>
#include <QtDBus/QtDBus>
/*
* Proxy class for interface org.freedesktop.timedate1
*/
class OrgFreedesktopTimedate1Interface: public QDBusAbstractInterface
{
Q_OBJECT
public:
static inline const char *staticInterfaceName()
{ return "org.freedesktop.timedate1"; }
public:
OrgFreedesktopTimedate1Interface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = nullptr);
~OrgFreedesktopTimedate1Interface();
Q_PROPERTY(bool CanNTP READ canNTP)
inline bool canNTP() const
{ return qvariant_cast< bool >(property("CanNTP")); }
Q_PROPERTY(bool LocalRTC READ localRTC)
inline bool localRTC() const
{ return qvariant_cast< bool >(property("LocalRTC")); }
Q_PROPERTY(bool NTP READ nTP)
inline bool nTP() const
{ return qvariant_cast< bool >(property("NTP")); }
Q_PROPERTY(bool NTPSynchronized READ nTPSynchronized)
inline bool nTPSynchronized() const
{ return qvariant_cast< bool >(property("NTPSynchronized")); }
Q_PROPERTY(qulonglong RTCTimeUSec READ rTCTimeUSec)
inline qulonglong rTCTimeUSec() const
{ return qvariant_cast< qulonglong >(property("RTCTimeUSec")); }
Q_PROPERTY(qulonglong TimeUSec READ timeUSec)
inline qulonglong timeUSec() const
{ return qvariant_cast< qulonglong >(property("TimeUSec")); }
Q_PROPERTY(QString Timezone READ timezone)
inline QString timezone() const
{ return qvariant_cast< QString >(property("Timezone")); }
public Q_SLOTS: // METHODS
inline QDBusPendingReply<> SetLocalRTC(bool in0, bool in1, bool in2)
{
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2);
return asyncCallWithArgumentList(QStringLiteral("SetLocalRTC"), argumentList);
}
inline QDBusPendingReply<> SetNTP(bool in0, bool in1)
{
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1);
return asyncCallWithArgumentList(QStringLiteral("SetNTP"), argumentList);
}
inline QDBusPendingReply<> SetTime(qlonglong in0, bool in1, bool in2)
{
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2);
return asyncCallWithArgumentList(QStringLiteral("SetTime"), argumentList);
}
inline QDBusPendingReply<> SetTimezone(const QString &in0, bool in1)
{
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1);
return asyncCallWithArgumentList(QStringLiteral("SetTimezone"), argumentList);
}
Q_SIGNALS: // SIGNALS
};
namespace org {
namespace freedesktop {
typedef ::OrgFreedesktopTimedate1Interface timedate1;
}
}
#endif

@ -0,0 +1,17 @@
#ifndef TIMEZONEDATA_H
#define TIMEZONEDATA_H
#include <QString>
class TimeZoneData
{
public:
QString id;
QString region;
QString city;
QString comment;
bool checked;
int offsetFromUtc;
};
#endif // TIMEZONEDATA_H

@ -0,0 +1,179 @@
/*
* Copyright (C) 2021 CutefishOS Team.
*
* Author: Reion Wong <reionwong@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "timezonemap.h"
#include "timedated_interface.h"
#include <QFile>
#include <QDebug>
#include <QTimeZone>
#include <math.h>
// gnome-control-center: cc-timezone-map.c
static double radians(double degrees) {
return (degrees / 360.0) * M_PI * 2;
}
static double convert_latitude_to_y(double latitude) {
const double bottom_lat = -59;
const double top_lat = 81;
const double full_range = 4.6068250867599998;
double top_per, y, top_offset, map_range;
top_per = top_lat / 180.0;
y = 1.25 * log(tan(M_PI_4 + 0.4 * radians(latitude)));
top_offset = full_range * top_per;
map_range = fabs(1.25 * log(tan(M_PI_4 + 0.4 * radians(bottom_lat))) - top_offset);
y = fabs(y - top_offset);
y = y / map_range;
return y;
}
static double convert_longitude_to_x(double longitude) {
const double xdeg_offset = -6;
return ((180.0 + longitude) / 360.0 + xdeg_offset / 180.0);
}
// Parse latitude and longitude of the zone's principal location.
// See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
// |pos| is in ISO 6709 sign-degrees-minutes-seconds format,
// either +-DDMM+-DDDMM or +-DDMMSS+-DDDMMSS.
// |digits| 2 for latitude, 3 for longitude.
double convert_pos(const QString &pos, int digits) {
if (pos.length() < 4 || digits > 9) {
return 0.0;
}
const QString integer = pos.left(digits + 1);
const QString fraction = pos.mid(digits + 1);
const double t1 = integer.toDouble();
const double t2 = fraction.toDouble();
if (t1 > 0.0) {
return t1 + t2 / pow(10.0, fraction.length());
} else {
return t1 - t2 / pow(10.0, fraction.length());
}
}
TimeZoneMap::TimeZoneMap(QObject *parent)
: QObject(parent)
{
initDatas();
}
void TimeZoneMap::clicked(int x, int y, int width, int height)
{
double minimum_distance = width * width + height * height;
int nearest_zone_index = -1;
QList<TimeZoneItem *> items;
for (int i = 0; i < m_list.size(); ++i) {
TimeZoneItem *item = m_list.at(i);
const double point_x = convert_longitude_to_x(item->longitude) * width;
const double point_y = convert_latitude_to_y(item->latitude) * height;
const double dx = point_x - x;
const double dy = point_y - y;
const double distance = dx * dx + dy * dy;
if (distance < minimum_distance) {
minimum_distance = distance;
nearest_zone_index = i;
}
if (distance <= 20) {
items << item;
}
}
if (items.isEmpty() && nearest_zone_index != -1) {
items.append(m_list.at(nearest_zone_index));
}
m_currentList.clear();
for (TimeZoneItem *item : items) {
m_currentList.append(item->timeZone);
}
std::sort(m_currentList.begin(), m_currentList.end());
emit availableListChanged();
}
void TimeZoneMap::setTimeZone(QString value)
{
OrgFreedesktopTimedate1Interface timedateIface(QStringLiteral("org.freedesktop.timedate1"),
QStringLiteral("/org/freedesktop/timedate1"),
QDBusConnection::systemBus());
timedateIface.SetTimezone(value, true);
m_currentTimeZone = QTimeZone(value.toLatin1()).id();
emit currentTimeZoneChanged();
}
QString TimeZoneMap::currentTimeZone() const
{
return m_currentTimeZone;
}
QStringList TimeZoneMap::availableList()
{
return m_currentList;
}
void TimeZoneMap::initDatas()
{
QFile zoneTab("/usr/share/zoneinfo/zone.tab");
if (!zoneTab.open(QIODevice::ReadOnly)) {
return;
}
const auto lines = QString::fromUtf8(zoneTab.readAll()).split(QLatin1Char('\n'));
for (const QString &line : lines) {
if (line.startsWith('#'))
continue;
const QStringList parts = line.split('\t');
if (parts.size() < 3)
continue;
const QString coordinates = parts.at(1);
int index = coordinates.indexOf('+', 3);
if (index == -1) {
index = coordinates.indexOf('-', 3);
}
const double latitude = convert_pos(coordinates.left(index), 2);
const double longitude = convert_pos(coordinates.mid(index), 3);
TimeZoneItem *item = new TimeZoneItem;
item->country = parts.at(0);
item->timeZone = parts.at(2);
item->latitude = latitude;
item->longitude = longitude;
m_list.append(item);
}
std::sort(m_list.begin(), m_list.end());
// currentTimeZoneChanged
m_currentTimeZone = QTimeZone(QTimeZone::systemTimeZoneId()).id();
emit currentTimeZoneChanged();
}

@ -0,0 +1,61 @@
/*
* Copyright (C) 2021 CutefishOS Team.
*
* Author: revenmartin <revenmartin@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TIMEZONEMAP_H
#define TIMEZONEMAP_H
#include <QObject>
class TimeZoneItem {
public:
QString country;
QString timeZone;
double latitude;
double longitude;
};
class TimeZoneMap : public QObject
{
Q_OBJECT
Q_PROPERTY(QStringList availableList READ availableList NOTIFY availableListChanged)
Q_PROPERTY(QString currentTimeZone READ currentTimeZone NOTIFY currentTimeZoneChanged)
public:
explicit TimeZoneMap(QObject *parent = nullptr);
Q_INVOKABLE void clicked(int x, int y, int width, int height);
Q_INVOKABLE void setTimeZone(QString value);
QString currentTimeZone() const;
QStringList availableList();
signals:
void availableListChanged();
void currentTimeZoneChanged();
private:
void initDatas();
private:
QList<TimeZoneItem *> m_list;
QString m_currentTimeZone;
QStringList m_currentList;
};
#endif // TIMEZONEMAP_H

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 149 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 149 KiB

@ -0,0 +1,9 @@
<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
<defs>
<style id="current-color-scheme" type="text/css">.ColorScheme-Text { color:#363636; }</style>
</defs>
<g transform="scale(.036093)" fill="#fff">
<path d="m221.65 0c-122.21 0-221.65 99.433-221.65 221.65s99.433 221.65 221.65 221.65 221.65-99.433 221.65-221.65-99.433-221.65-221.65-221.65zm0 415.59c-106.94 0-193.94-87-193.94-193.94s87-193.94 193.94-193.94 193.94 87 193.94 193.94-87 193.94-193.94 193.94z"/>
<path d="m235.5 83.118h-27.706v144.26l87.176 87.176 19.589-19.589-79.059-79.059z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 617 B

@ -68,6 +68,8 @@ ItemPage {
}
}
HorizontalDivider {}
RowLayout {
spacing: FishUI.Units.largeSpacing

@ -150,14 +150,17 @@ ItemPage {
interactive: false
visible: _view.count > 0
leftMargin: 0
rightMargin: 0
cellHeight: itemHeight
cellWidth: calcExtraSpacing(itemWidth, _view.width) + itemWidth
currentIndex: cursorModel.themeIndex(cursorModel.currentTheme)
property int rowCount: _view.width / itemWidth
property int itemWidth: 250
property int itemHeight: 170
property int itemWidth: 150
property int itemHeight: 150
function calcExtraSpacing(cellSize, containerSize) {
var availableColumns = Math.floor(containerSize / cellSize)
@ -186,7 +189,7 @@ ItemPage {
MouseArea {
id: _mouseArea
anchors.fill: parent
anchors.margins: FishUI.Units.largeSpacing
anchors.margins: FishUI.Units.smallSpacing
onClicked: {
_view.currentIndex = index
cursorModel.currentTheme = model.id
@ -196,8 +199,8 @@ ItemPage {
Rectangle {
anchors.fill: parent
anchors.margins: FishUI.Units.largeSpacing + FishUI.Units.smallSpacing
color: FishUI.Theme.darkMode ? "" : "#FAFAFA"
anchors.margins: FishUI.Units.smallSpacing
color: FishUI.Theme.darkMode ? "#3C3C3C" : "#FAFAFA"
radius: FishUI.Theme.mediumRadius
z: -1
@ -207,7 +210,15 @@ ItemPage {
ColumnLayout {
anchors.fill: parent
anchors.margins: FishUI.Units.largeSpacing
anchors.margins: FishUI.Units.smallSpacing
Item {
Layout.fillHeight: true
}
Item {
height: FishUI.Units.largeSpacing
}
FishUI.IconItem {
width: 24
@ -217,11 +228,19 @@ ItemPage {
Layout.alignment: Qt.AlignHCenter
}
Item {
Layout.fillHeight: true
}
Label {
text: model.name
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
bottomPadding: FishUI.Units.largeSpacing
}
Item {
Layout.fillHeight: true
}
}
}
}

@ -0,0 +1,71 @@
/*
* Copyright (C) 2021 CutefishOS Team.
*
* Author: revenmartin <revenmartin@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
import FishUI 1.0 as FishUI
import Cutefish.Settings 1.0
import "../"
ItemPage {
headerTitle: qsTr("Date & Time")
TimeZoneDialog {
id: timeZoneDialog
}
TimeZoneMap {
id: timeZoneMap
}
Scrollable {
anchors.fill: parent
contentHeight: layout.implicitHeight
ColumnLayout {
id: layout
anchors.fill: parent
StandardButton {
Layout.fillWidth: true
text: ""
onClicked: timeZoneDialog.visibility = "Maximized"
RowLayout {
anchors.fill: parent
anchors.leftMargin: FishUI.Units.largeSpacing
anchors.rightMargin: FishUI.Units.largeSpacing
Label {
text: qsTr("Time Zone")
}
Item {
Layout.fillWidth: true
}
Label {
text: timeZoneMap.currentTimeZone
}
}
}
}
}
}

@ -0,0 +1,179 @@
/*
* Copyright (C) 2021 CutefishOS Team.
*
* Author: Reion Wong <reionwong@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.0
import QtQuick.Controls 2.12
import QtQuick.Window 2.12
import QtQuick.Layouts 1.12
import FishUI 1.0 as FishUI
FishUI.Window {
id: control
title: "Hello World"
width: 900
height: 600
visible: false
background.opacity: 0.5
contentTopMargin: 0
onWidthChanged: control.reset()
onHeightChanged: control.reset()
function reset() {
_popupItem.opacity = 0
dot.visible = false
}
onVisibleChanged: {
if (!visible)
control.reset()
}
FishUI.WindowBlur {
view: control
geometry: Qt.rect(control.x, control.y, control.width, control.height)
windowRadius: control.background.radius
enabled: true
}
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.LeftButton | Qt.RightButton
onPressed: {
if (_popupItem.opacity === 1) {
control.reset()
return
}
timeZoneMap.clicked(mouse.x, mouse.y, control.width, control.height)
_popupItem.x = mouse.x
_popupItem.y = mouse.y
_popupItem.opacity = 1
dot.show(mouse.x, mouse.y)
}
}
Image {
anchors.fill: parent
source: FishUI.Theme.darkMode ? "qrc:/images/dark/world.svg" : "qrc:/images/light/world.svg"
sourceSize: Qt.size(width, height)
fillMode: Image.PreserveAspectFit
}
Rectangle {
id: dot
width: 20
height: 20
radius: height / 2
color: FishUI.Theme.highlightColor
z: 99
visible: false
border.width: 5
border.color: Qt.rgba(FishUI.Theme.highlightColor.r,
FishUI.Theme.highlightColor.g,
FishUI.Theme.highlightColor.b, 0.5)
function show(x, y) {
dot.x = x - dot.width / 2
dot.y = y - dot.height / 2
dot.visible = true
}
}
Item {
id: _popupItem
width: 200
height: _popupLayout.implicitHeight + FishUI.Units.largeSpacing
z: 100
opacity: _view.count > 0 ? 1.0 : 0.0
Behavior on opacity {
NumberAnimation { duration: 200 }
}
Rectangle {
anchors.fill: parent
color: FishUI.Theme.secondBackgroundColor
radius: FishUI.Theme.mediumRadius
border.width: 1
border.color: Qt.rgba(FishUI.Theme.textColor.r,
FishUI.Theme.textColor.g,
FishUI.Theme.textColor.b, 0.2)
}
ColumnLayout {
id: _popupLayout
anchors.fill: parent
anchors.margins: FishUI.Units.smallSpacing
ListView {
id: _view
clip: true
Layout.fillWidth: true
Layout.preferredHeight: itemSize * _view.count
model: timeZoneMap.availableList
property int itemSize: 30
delegate: Item {
id: _item
width: ListView.view.width
height: _view.itemSize
Rectangle {
anchors.fill: parent
radius: FishUI.Theme.mediumRadius
color: FishUI.Theme.highlightColor
visible: index === _view.currentIndex
opacity: 0.8
}
MouseArea {
anchors.fill: parent
anchors.margins: 2
onClicked: _view.currentIndex = index
}
RowLayout {
anchors.fill: parent
Label {
Layout.alignment: Qt.AlignCenter
elide: Label.ElideRight
text: modelData
color: index === _view.currentIndex ? FishUI.Theme.highlightedTextColor : FishUI.Theme.textColor
}
}
}
}
Button {
Layout.preferredHeight: _view.itemSize
Layout.fillWidth: true
text: qsTr("Set")
onClicked: {
_popupItem.opacity = 0
timeZoneMap.setTimeZone(timeZoneMap.availableList[_view.currentIndex])
}
}
}
}
}

@ -35,10 +35,10 @@ Page {
height: rootWindow.header.height
Label {
anchors.horizontalCenter: parent.horizontalCenter
// anchors.horizontalCenter: parent.horizontalCenter
// anchors.fill: parent
// leftPadding: FishUI.Units.largeSpacing * 2
anchors.fill: parent
leftPadding: FishUI.Units.largeSpacing * 3
topPadding: FishUI.Units.largeSpacing
bottomPadding: 0
font.pointSize: 12

@ -38,8 +38,8 @@ Rectangle {
ColumnLayout {
id: _mainLayout
anchors.fill: parent
anchors.leftMargin: FishUI.Units.largeSpacing
anchors.rightMargin: FishUI.Units.largeSpacing
anchors.leftMargin: FishUI.Units.largeSpacing * 1.5
anchors.rightMargin: FishUI.Units.largeSpacing * 1.5
anchors.topMargin: FishUI.Units.largeSpacing
anchors.bottomMargin: FishUI.Units.largeSpacing
spacing: FishUI.Units.largeSpacing

@ -139,10 +139,10 @@ Item {
ListElement {
title: qsTr("Mouse")
name: "cursor"
name: "mouse"
page: "qrc:/qml/Cursor/Main.qml"
iconSource: "cursor.svg"
iconColor: "#0D9BF1"
iconColor: "#3385FF"
category: qsTr("System")
}
@ -155,6 +155,15 @@ Item {
// category: qsTr("System")
// }
ListElement {
title: qsTr("Date & Time")
name: "datetime"
page: "qrc:/qml/DateTime/Main.qml"
iconSource: "datetime.svg"
iconColor: "#418CFF"
category: qsTr("System")
}
ListElement {
title: qsTr("Language")
name: "language"
@ -309,7 +318,7 @@ Item {
source: "qrc:/images/sidebar/dark/" + model.iconSource
sourceSize: Qt.size(width, height)
Layout.alignment: Qt.AlignVCenter
antialiasing: true
antialiasing: false
smooth: false
}
}

@ -110,5 +110,10 @@
<file>qml/Application/Main.qml</file>
<file>qml/Cursor/Main.qml</file>
<file>images/sidebar/dark/cursor.svg</file>
<file>qml/DateTime/Main.qml</file>
<file>qml/DateTime/TimeZoneDialog.qml</file>
<file>images/light/world.svg</file>
<file>images/dark/world.svg</file>
<file>images/sidebar/dark/datetime.svg</file>
</qresource>
</RCC>

@ -0,0 +1,4 @@
#ifndef TIMEZONEDATA_H
#define TIMEZONEDATA_H
#endif // TIMEZONEDATA_H

@ -132,12 +132,12 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qml/Appearance/Main.qml" line="76"/>
<location filename="../src/qml/Appearance/Main.qml" line="78"/>
<source>Dim the wallpaper in dark theme</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qml/Appearance/Main.qml" line="96"/>
<location filename="../src/qml/Appearance/Main.qml" line="98"/>
<source>Accent color</source>
<translation type="unfinished"></translation>
</message>
@ -518,6 +518,16 @@
<source>Pointer speed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qml/DateTime/Main.qml" line="28"/>
<source>Date &amp; Time</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qml/DateTime/Main.qml" line="57"/>
<source>Time Zone</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QObject</name>
@ -616,30 +626,44 @@
<location filename="../src/qml/SideBar.qml" line="173"/>
<location filename="../src/qml/SideBar.qml" line="182"/>
<location filename="../src/qml/SideBar.qml" line="191"/>
<location filename="../src/qml/SideBar.qml" line="200"/>
<source>System</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qml/SideBar.qml" line="159"/>
<source>Language</source>
<source>Date &amp; Time</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qml/SideBar.qml" line="168"/>
<source>Battery</source>
<source>Language</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qml/SideBar.qml" line="177"/>
<source>Power</source>
<source>Battery</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qml/SideBar.qml" line="186"/>
<source>Power</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qml/SideBar.qml" line="195"/>
<source>About</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>TimeZoneDialog</name>
<message>
<location filename="../src/qml/DateTime/TimeZoneDialog.qml" line="171"/>
<source>Set</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>UserDelegateItem</name>
<message>

@ -132,12 +132,12 @@
<translation></translation>
</message>
<message>
<location filename="../src/qml/Appearance/Main.qml" line="76"/>
<location filename="../src/qml/Appearance/Main.qml" line="78"/>
<source>Dim the wallpaper in dark theme</source>
<translation></translation>
</message>
<message>
<location filename="../src/qml/Appearance/Main.qml" line="96"/>
<location filename="../src/qml/Appearance/Main.qml" line="98"/>
<source>Accent color</source>
<translation></translation>
</message>
@ -390,10 +390,6 @@
<source>Power Save</source>
<translation></translation>
</message>
<message>
<source>Balance</source>
<translation type="vanished"></translation>
</message>
<message>
<location filename="../src/qml/Power/Main.qml" line="70"/>
<source>Performance</source>
@ -523,8 +519,14 @@
<translation></translation>
</message>
<message>
<source>Speed</source>
<translation type="vanished"></translation>
<location filename="../src/qml/DateTime/Main.qml" line="28"/>
<source>Date &amp; Time</source>
<translation></translation>
</message>
<message>
<location filename="../src/qml/DateTime/Main.qml" line="57"/>
<source>Time Zone</source>
<translation></translation>
</message>
</context>
<context>
@ -624,30 +626,44 @@
<location filename="../src/qml/SideBar.qml" line="173"/>
<location filename="../src/qml/SideBar.qml" line="182"/>
<location filename="../src/qml/SideBar.qml" line="191"/>
<location filename="../src/qml/SideBar.qml" line="200"/>
<source>System</source>
<translation></translation>
</message>
<message>
<location filename="../src/qml/SideBar.qml" line="159"/>
<source>Date &amp; Time</source>
<translation></translation>
</message>
<message>
<location filename="../src/qml/SideBar.qml" line="168"/>
<source>Language</source>
<translation></translation>
</message>
<message>
<location filename="../src/qml/SideBar.qml" line="168"/>
<location filename="../src/qml/SideBar.qml" line="177"/>
<source>Battery</source>
<translation></translation>
</message>
<message>
<location filename="../src/qml/SideBar.qml" line="177"/>
<location filename="../src/qml/SideBar.qml" line="186"/>
<source>Power</source>
<translation></translation>
</message>
<message>
<location filename="../src/qml/SideBar.qml" line="186"/>
<location filename="../src/qml/SideBar.qml" line="195"/>
<source>About</source>
<translation></translation>
</message>
</context>
<context>
<name>TimeZoneDialog</name>
<message>
<location filename="../src/qml/DateTime/TimeZoneDialog.qml" line="171"/>
<source>Set</source>
<translation></translation>
</message>
</context>
<context>
<name>UserDelegateItem</name>
<message>

Loading…
Cancel
Save