Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
38 changes: 26 additions & 12 deletions Editor/Qml/EButton.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Controls.Basic
import QtQuick.Layouts
import QtQuick.Effects

Item {
enum Style {
Expand All @@ -20,6 +22,7 @@ Item {
}

property string text: ''
property string icon: ''
property bool disabled: false
property int style: EButton.Style.Primary
property int size: EButton.Size.Middle
Expand All @@ -40,28 +43,39 @@ Item {
bottomPadding: 5 + 2 * (root.size - 1)
width: root.width

contentItem: Text {
text: root.text
font.pixelSize: ETheme.contentFontSize
font.family: ETheme.fontFamily
color: ETheme.fontColor
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
elide: Text.ElideNone
contentItem: RowLayout {
spacing: 6

EIcon {
name: root.icon
visible: root.icon !== ''
}

Text {
Layout.fillWidth: true
text: root.text
font.pixelSize: ETheme.contentFontSize
font.family: ETheme.fontFamily
color: ETheme.fontColor
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
elide: Text.ElideNone
visible: root.text !== ''
}
}

background: Rectangle {
function getBackgroundColor(style, focus, disabled)
function getBackgroundColor(style, focus, hovered, disabled)
{
if (disabled) {
return ETheme.disabledColor;
} else if (style === EButton.Style.Secondary) {
return focus ? ETheme.secondaryFocusColor : ETheme.secondaryColor;
return focus ? ETheme.secondaryFocusColor : (hovered ? ETheme.secondaryHoverColor : ETheme.secondaryColor);
}
return focus ? ETheme.primaryFocusColor : ETheme.primaryColor;
return focus ? ETheme.primaryFocusColor : (hovered ? ETheme.primaryHoverColor : ETheme.primaryColor);
}

color: getBackgroundColor(root.style, parent.down, root.disabled)
color: getBackgroundColor(root.style, parent.down, parent.hovered, root.disabled)
radius: 5 + root.shape * 8
}
}
Expand Down
26 changes: 26 additions & 0 deletions Editor/Qml/EIcon.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Controls.Basic
import QtQuick.Effects

Item {
property string name: ''
property int size: ETheme.iconFontSize

id: 'root'
implicitWidth: imageWidget.implicitWidth
implicitHeight: imageWidget.implicitHeight

Image {
id: 'imageWidget'
source: root.name === '' ? '' : 'Resource/Icon/%1.svg'.arg(root.name)
sourceSize.width: root.size
sourceSize.height: root.size
layer.enabled: true
layer.effect: MultiEffect {
brightness: 1
colorization: 1
colorizationColor: ETheme.fontColor;
}
}
}
3 changes: 3 additions & 0 deletions Editor/Qml/ETheme.qml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ import QtQuick
QtObject {
property color bgColor: Qt.color('#212121')
property color primaryColor: Qt.color('#e74c3c')
property color primaryHoverColor: Qt.color('#ce4d40')
property color primaryFocusColor: Qt.color('#c0392b')
property color secondaryColor: Qt.color('#d58845')
property color secondaryHoverColor: Qt.color('#d58845')
property color secondaryFocusColor: Qt.color('#9b6a40')
property color disabledColor: Qt.color('#676563')
property color fontColor: Qt.color('#ecf0f1')
Expand All @@ -18,5 +20,6 @@ QtObject {
property int title2FontSize: 18
property int title3FontSize: 16
property int contentFontSize: 14
property int iconFontSize: 18
property string fontFamily: 'MiSans'
}
117 changes: 116 additions & 1 deletion Editor/Qml/EWidgetSamples.qml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,41 @@ Rectangle {
}
}

RowLayout {
Layout.margins: 5

EButton {
text: 'Icon Button 1'
icon: 'home'
onClicked: {
console.log('icon button clicked')
}
}

EButton {
text: 'Icon Button 2'
icon: 'anchor'
onClicked: {
console.log('icon button clicked')
}
}

EButton {
icon: 'alarm'
onClicked: {
console.log('icon button clicked')
}
}

EButton {
icon: 'api'
shape: EButton.Shape.Round
onClicked: {
console.log('icon button clicked')
}
}
}

RowLayout {
Layout.margins: 5

Expand All @@ -111,7 +146,7 @@ Rectangle {

RowLayout {
Layout.leftMargin: 5
Layout.topMargin: 10
Layout.topMargin: 15

EText {
text: 'Texts'
Expand Down Expand Up @@ -157,6 +192,86 @@ Rectangle {
style: EText.Style.Italic
}
}

RowLayout {
Layout.leftMargin: 5
Layout.topMargin: 15

EText {
text: 'Icons'
style: EText.Style.Title1
}
}

RowLayout {
Layout.leftMargin: 5

EIcon { name: 'arrow-left' }
EIcon { name: 'arrow-left-up' }
EIcon { name: 'arrow-up' }
EIcon { name: 'arrow-right-up' }
EIcon { name: 'arrow-right' }
EIcon { name: 'arrow-right-down' }
EIcon { name: 'arrow-down' }
EIcon { name: 'arrow-left-down' }

EIcon { name: 'arrow-left-circle' }
EIcon { name: 'arrow-left-up-circle' }
EIcon { name: 'arrow-up-circle' }
EIcon { name: 'arrow-right-up-circle' }
EIcon { name: 'arrow-right-circle' }
EIcon { name: 'arrow-right-down-circle' }
EIcon { name: 'arrow-down-circle' }
EIcon { name: 'arrow-left-down-circle' }

EIcon { name: 'caret-left' }
EIcon { name: 'caret-up' }
EIcon { name: 'caret-right' }
EIcon { name: 'caret-down' }

EIcon { name: 'chevron-left' }
EIcon { name: 'chevron-up' }
EIcon { name: 'chevron-right' }
EIcon { name: 'chevron-down' }

EIcon { name: 'chevron-left-double' }
EIcon { name: 'chevron-up-double' }
EIcon { name: 'chevron-right-double' }
EIcon { name: 'chevron-down-double' }
}

RowLayout {
Layout.leftMargin: 5

EIcon { name: 'download' }
EIcon { name: 'login' }
EIcon { name: 'logout' }
EIcon { name: 'fullscreen-1' }
EIcon { name: 'fullscreen-exit-1' }
EIcon { name: 'load' }
EIcon { name: 'filter' }
EIcon { name: 'dashboard' }
EIcon { name: 'add-rectangle' }
EIcon { name: 'app' }
EIcon { name: 'hard-disk-storage' }
EIcon { name: 'share' }
EIcon { name: 'system-log' }
EIcon { name: 'system-code' }
EIcon { name: 'system-setting' }
EIcon { name: 'hourglass' }
EIcon { name: 'more' }
EIcon { name: 'service' }
EIcon { name: 'drag-move' }
EIcon { name: 'focus' }
EIcon { name: 'fill-color' }
EIcon { name: 'sip' }
EIcon { name: 'slice' }
EIcon { name: 'copy' }
EIcon { name: 'file-add' }
EIcon { name: 'folder-add' }
EIcon { name: 'folder' }
EIcon { name: 'folder-import' }
}
}
}
}
4 changes: 4 additions & 0 deletions Editor/Qml/Resource/Icon/accessibility-filled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Editor/Qml/Resource/Icon/accessibility.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions Editor/Qml/Resource/Icon/activity-filled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Editor/Qml/Resource/Icon/activity.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Editor/Qml/Resource/Icon/add-and-subtract.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions Editor/Qml/Resource/Icon/add-circle-filled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Editor/Qml/Resource/Icon/add-circle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Editor/Qml/Resource/Icon/add-rectangle-filled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Editor/Qml/Resource/Icon/add-rectangle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Editor/Qml/Resource/Icon/add.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions Editor/Qml/Resource/Icon/address-book-filled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Editor/Qml/Resource/Icon/address-book.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions Editor/Qml/Resource/Icon/adjustment-filled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Editor/Qml/Resource/Icon/adjustment.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions Editor/Qml/Resource/Icon/airplay-wave-filled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Editor/Qml/Resource/Icon/airplay-wave.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions Editor/Qml/Resource/Icon/alarm-add-filled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Editor/Qml/Resource/Icon/alarm-add.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions Editor/Qml/Resource/Icon/alarm-filled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions Editor/Qml/Resource/Icon/alarm-off-filled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading