Add border colors & begin working on dataset selection in JSON editor window

This commit is contained in:
Alex Spataru 2022-01-01 16:27:16 -05:00
parent adc629077b
commit 002e9f4c92
17 changed files with 132 additions and 182 deletions

View File

@ -28,88 +28,70 @@ import Qt.labs.settings 1.1
import "../Widgets" as Widgets
Item {
Rectangle {
id: root
radius: 5
//
// Signals & settings for console button
//
property alias consoleChecked: consoleBt.checked
Settings {
property alias consoleVisible: root.consoleChecked
}
//
// Window shadow (must go before window declaration
// to avoid blurry artifacts & glitches).
//
Widgets.Shadow {
anchors.fill: window
}
//
// Window
//
Rectangle {
id: window
radius: 5
anchors.fill: parent
gradient: Gradient {
GradientStop {
position: 0
color: Cpp_ThemeManager.windowGradient1
}
GradientStop {
position: 1
color: Cpp_ThemeManager.windowGradient2
}
gradient: Gradient {
GradientStop {
position: 0
color: Cpp_ThemeManager.windowGradient1
}
RowLayout {
spacing: app.spacing
GradientStop {
position: 1
color: Cpp_ThemeManager.windowGradient2
}
}
anchors {
margins: 0
left: parent.left
right: parent.right
leftMargin: app.spacing
rightMargin: app.spacing
verticalCenter: parent.verticalCenter
}
RowLayout {
spacing: app.spacing
Widgets.Icon {
Layout.alignment: Qt.AlignVCenter
source: "qrc:/icons/arrow-right.svg"
}
anchors {
margins: 0
left: parent.left
right: parent.right
leftMargin: app.spacing
rightMargin: app.spacing
verticalCenter: parent.verticalCenter
}
Label {
font.bold: true
font.pixelSize: 16
color: palette.brightText
font.family: app.monoFont
text: Cpp_UI_Dashboard.title
Layout.alignment: Qt.AlignVCenter
}
Widgets.Icon {
Layout.alignment: Qt.AlignVCenter
source: "qrc:/icons/arrow-right.svg"
}
Item {
Layout.fillWidth: true
}
Label {
font.bold: true
font.pixelSize: 16
color: palette.brightText
font.family: app.monoFont
text: Cpp_UI_Dashboard.title
Layout.alignment: Qt.AlignVCenter
}
Button {
flat: true
id: consoleBt
checkable: true
font.bold: true
text: qsTr("Console")
Layout.alignment: Qt.AlignVCenter
icon.source: "qrc:/icons/code.svg"
icon.color: Cpp_ThemeManager.menubarText
palette.buttonText: Cpp_ThemeManager.menubarText
palette.button: Cpp_ThemeManager.windowGradient1
palette.window: Cpp_ThemeManager.windowGradient1
}
Item {
Layout.fillWidth: true
}
Button {
flat: true
id: consoleBt
checkable: true
font.bold: true
text: qsTr("Console")
Layout.alignment: Qt.AlignVCenter
icon.source: "qrc:/icons/code.svg"
icon.color: Cpp_ThemeManager.menubarText
palette.buttonText: Cpp_ThemeManager.menubarText
palette.button: Cpp_ThemeManager.windowGradient1
palette.window: Cpp_ThemeManager.windowGradient1
}
}
}

View File

@ -88,16 +88,6 @@ ColumnLayout {
height: group.height + app.spacing
width: parent.width - 4 * app.spacing
//
// Window shadow
//
Widgets.Shadow {
anchors.fill: group
}
//
// Group window
//
JsonGroupDelegate {
id: group
group: index

View File

@ -130,10 +130,16 @@ Widgets.Window {
}
Label {
id: label
Layout.fillWidth: true
elide: Label.ElideRight
Layout.alignment: Qt.AlignVCenter
text: Cpp_JSON_Editor.datasetTitle(groupDelegate.groupId, index)
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
}
}
Label {

View File

@ -65,14 +65,6 @@ Item {
}
}
//
// Window shadow (must go before window declaration
// to avoid blurry artifacts & glitches).
//
Widgets.Shadow {
anchors.fill: window
}
//
// Console window
//

View File

@ -47,21 +47,12 @@ Item {
Layout.fillHeight: true
//
// View options window + shadow
// View options window
//
Item {
DashboardItems.ViewOptions {
Layout.fillHeight: true
Layout.minimumWidth: 280
Widgets.Shadow {
anchors.fill: viewOptions
}
DashboardItems.ViewOptions {
id: viewOptions
anchors.fill: parent
onWidgetSizeChanged: (maxSize) => widgetGrid.maxSize = maxSize
}
onWidgetSizeChanged: (maxSize) => widgetGrid.maxSize = maxSize
}
//
@ -70,21 +61,14 @@ Item {
ColumnLayout {
spacing: terminalView.enabled ? app.spacing : 0
Item {
DashboardItems.WidgetGrid {
id: widgetGrid
Layout.fillWidth: true
Layout.fillHeight: true
Layout.minimumWidth: 240
Widgets.Shadow {
anchors.fill: widgetGrid
}
DashboardItems.WidgetGrid {
id: widgetGrid
anchors.fill: parent
}
}
Item {
enabled: false
id: terminalView
@ -97,10 +81,6 @@ Item {
Behavior on Layout.bottomMargin { NumberAnimation{} }
Widgets.Shadow {
anchors.fill: terminal
}
Widgets.Window {
id: terminal
gradient: true

View File

@ -124,19 +124,10 @@ Item {
}
}
//
// Window shadow (must go before window declaration
// to avoid blurry artifacts & glitches).
//
Widgets.Shadow {
anchors.fill: window
}
//
// Window
//
Widgets.Window {
id: window
gradient: true
title: qsTr("Setup")
anchors.fill: parent

View File

@ -81,9 +81,9 @@ Page {
border.width: 1
color: "transparent"
anchors.fill: parent
border.color: "#a7a7a7"
anchors.topMargin: header.height
anchors.margins: root.borderWidth
border.color: Cpp_ThemeManager.border
}
}

View File

@ -153,22 +153,14 @@ FramelessWindow.CustomWindow {
//
// JSON structure tree
//
Item {
TreeView {
id: jsonTree
Layout.fillHeight: true
Layout.minimumWidth: 240
Layout.maximumWidth: 240
Layout.topMargin: app.spacing * 2
Layout.bottomMargin: app.spacing * 2
visible: Cpp_JSON_Editor.groupCount !== 0
Widgets.Shadow {
anchors.fill: jsonTree
}
TreeView {
id: jsonTree
anchors.fill: parent
}
}
//

View File

@ -8,6 +8,7 @@
"button":"#eaeaea",
"window":"#eaeaea",
"text":"#000000",
"border":"#a7a7a7",
"midlight":"#eaeaea",
"highlight":"#4287ba",
"brightText":"#ffffff",

View File

@ -8,6 +8,7 @@
"button":"#21373f",
"window":"#21373f",
"text":"#ffffff",
"border":"#14272e",
"midlight":"#0e1419",
"highlight":"#409da0",
"brightText":"#ffffff",

View File

@ -8,6 +8,7 @@
"button":"#21373f",
"window":"#21373f",
"text":"#ffffff",
"border":"#14272e",
"midlight":"#0e1419",
"highlight":"#409da0",
"brightText":"#ffffff",

View File

@ -8,6 +8,7 @@
"button":"#686f82",
"window":"#686f82",
"text":"#ffffff",
"border":"#494f5e",
"midlight":"#a8988f",
"highlight":"#4992a6",
"brightText":"#ffffff",

View File

@ -8,6 +8,7 @@
"button":"#fafafa",
"window":"#fafafa",
"text":"#000000",
"border":"#b3b3b3",
"midlight":"#2c2c2c",
"highlight":"#1e7cf3",
"brightText":"#ffffff",

View File

@ -8,6 +8,7 @@
"button":"#d8d8d8",
"window":"#d8d8d8",
"text":"#000000",
"border":"#9a9a9a",
"midlight":"#d9d9d9",
"highlight":"#53ab27",
"brightText":"#ffffff",

View File

@ -90,8 +90,8 @@ Misc::ModuleManager::ModuleManager()
else
pixmap.load(":/images/splash@1x.png");
// Disable splash screen shadow on macOS
#ifdef Q_OS_MAC
// Disable splash screen shadow on macOS
m_splash.setWindowFlags(Qt::SplashScreen | Qt::NoDropShadowWindowHint);
#endif

View File

@ -149,6 +149,7 @@ void Misc::ThemeManager::loadTheme(const int id)
m_button = QColor(colors.value("button").toString());
m_window = QColor(colors.value("window").toString());
m_text = QColor(colors.value("text").toString());
m_border = QColor(colors.value("border").toString());
m_midlight = QColor(colors.value("midlight").toString());
m_highlight = QColor(colors.value("highlight").toString());
m_brightText = QColor(colors.value("brightText").toString());
@ -294,6 +295,11 @@ QColor Misc::ThemeManager::text() const
return m_text;
}
QColor Misc::ThemeManager::border() const
{
return m_border;
}
QColor Misc::ThemeManager::midlight() const
{
return m_midlight;

View File

@ -48,148 +48,151 @@ class ThemeManager : public QObject
NOTIFY themeChanged)
Q_PROPERTY(bool titlebarSeparator
READ titlebarSeparator
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor base
READ base
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor link
READ link
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor button
READ button
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor window
READ window
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor text
READ text
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor border
READ border
CONSTANT)
Q_PROPERTY(QColor midlight
READ midlight
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor highlight
READ highlight
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor brightText
READ brightText
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor buttonText
READ buttonText
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor windowText
READ windowText
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor tooltipText
READ tooltipText
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor tooltipBase
READ tooltipBase
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor highlightedText
READ highlightedText
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor highlightedTextAlternative
READ highlightedTextAlternative
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor placeholderText
READ placeholderText
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor toolbarGradient1
READ toolbarGradient1
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor toolbarGradient2
READ toolbarGradient2
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor consoleText
READ consoleText
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor consoleBase
READ consoleBase
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor consoleButton
READ consoleButton
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor consoleWindow
READ consoleWindow
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor consoleHighlight
READ consoleHighlight
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor consoleHighlightedText
READ consoleHighlightedText
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor consolePlaceholderText
READ consolePlaceholderText
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor windowBackground
READ windowBackground
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor windowGradient1
READ windowGradient1
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor windowGradient2
READ windowGradient2
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor menubarText
READ menubarText
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor dialogBackground
READ dialogBackground
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor alternativeHighlight
READ alternativeHighlight
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor setupPanelBackground
READ setupPanelBackground
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor widgetTextPrimary
READ widgetTextPrimary
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor widgetTextSecondary
READ widgetTextSecondary
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor widgetWindowBackground
READ widgetWindowBackground
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor widgetWindowBorder
READ widgetWindowBorder
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor paneWindowBackground
READ paneWindowBackground
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor ledEnabled
READ ledEnabled
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor ledDisabled
READ ledDisabled
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor csvCheckbox
READ csvCheckbox
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor widgetForegroundPrimary
READ widgetForegroundPrimary
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor widgetForegroundSecondary
READ widgetForegroundSecondary
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor widgetIndicator
READ widgetIndicator
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor widgetControlBackground
READ widgetControlBackground
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor connectButtonChecked
READ connectButtonChecked
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor connectButtonUnchecked
READ connectButtonUnchecked
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(QColor mqttButton
READ mqttButton
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(StringList widgetColors
READ widgetColors
NOTIFY themeChanged)
CONSTANT)
Q_PROPERTY(StringList availableThemes
READ availableThemes
NOTIFY availableThemesChanged)
@ -201,8 +204,8 @@ class ThemeManager : public QObject
Q_SIGNALS:
void themeChanged();
void customWindowDecorationsChanged();
void availableThemesChanged();
void customWindowDecorationsChanged();
private:
explicit ThemeManager();
@ -223,6 +226,7 @@ public:
QColor button() const;
QColor window() const;
QColor text() const;
QColor border() const;
QColor midlight() const;
QColor highlight() const;
QColor brightText() const;
@ -290,6 +294,7 @@ private:
QColor m_button;
QColor m_window;
QColor m_text;
QColor m_border;
QColor m_midlight;
QColor m_highlight;
QColor m_brightText;