diff --git a/qml/libdap-qt-ui-qml.qrc b/qml/libdap-qt-ui-qml.qrc index 94bf4ebfe643477f9a589ac0bafa1caf5302a96c..db18ebff837efc11a39f45c033c42e17eda19325 100644 --- a/qml/libdap-qt-ui-qml.qrc +++ b/qml/libdap-qt-ui-qml.qrc @@ -1,7 +1,6 @@ <RCC> <qresource prefix="/"> <file>widgets/DapButton.qml</file> - <file>widgets/DapButtonForm.ui.qml</file> <file>widgets/DapComboBox.qml</file> <file>widgets/DapComboBoxForm.ui.qml</file> <file>widgets/DapMenuTabWidget.qml</file> @@ -12,7 +11,6 @@ <file>widgets/DapScreen.qml</file> <file>widgets/DapScreenForm.ui.qml</file> <file>widgets/DapTab.qml</file> - <file>widgets/DapTabForm.ui.qml</file> <file>widgets/DapTopPanel.qml</file> <file>Device.qml</file> <file>widgets/DapRadioButton.qml</file> @@ -31,5 +29,6 @@ <file>widgets/DapCalendarForm.ui.qml</file> <file>widgets/DapComboBoxCustomRange.qml</file> <file>widgets/DapComboBoxCustomRangeForm.ui.qml</file> + <file>widgets/DapButton_New.qml</file> </qresource> </RCC> diff --git a/qml/widgets/DapButton.qml b/qml/widgets/DapButton.qml index f728aabf91bfe8f1648c322267a3eb9b8a282a7e..e392a7229fd6e5ac4f801b70dfbb44a055c72a9c 100644 --- a/qml/widgets/DapButton.qml +++ b/qml/widgets/DapButton.qml @@ -1,6 +1,91 @@ -import QtQuick 2.4 +import QtQuick 2.0 +import QtQuick.Controls 2.0 -DapButtonForm +Button { + ///@detalis heightButton Button height. + property int heightButton + ///@detalis widthButton Button width. + property int widthButton + ///@detalis normalImageButton The picture on the Button is in normal state. + property string normalImageButton + ///@detalis hoverImageButton The image on the Button is in the mouseover state. + property string hoverImageButton + ///@detalis widthImageButton Image width. + property int widthImageButton: 0 * pt + ///@detalis heightImageButton Image height. + property int heightImageButton: 0 * pt + ///@detalis indentImageLeftButton: Indentation of the image from the left edge. + property int indentImageLeftButton + ///@detalis colorBackgroundNormal Button background color in normal state. + property string colorBackgroundNormal + ///@detalis colorBackgroundHover Button background color in hover state. + property string colorBackgroundHover + ///@detalis textButton Text button. + property string textButton + ///@detalis colorButtonTextNormal Button text color in normal state. + property string colorButtonTextNormal + ///@detalis colorButtonTextHover Button text color in hover state. + property string colorButtonTextHover + ///@detalis indentTextRight: Indentation of the text from the right edge. + property int indentTextRight + ///@detalis fontButton Font setting. + property alias fontButton: buttonText.font + ///@detalis horizontalAligmentText Horizontal alignment. + property alias horizontalAligmentText:buttonText.horizontalAlignment + ///@detalis colorBackgroundButton This property overrides the background color. + property alias colorBackgroundButton: dapBackgroundButton.color + ///@detalis colorTextButton This property overrides the color of the text. + property alias colorTextButton: buttonText.color + ///@detalis borderColorButton Sets the color of the border. + property string borderColorButton + ///@detalis borderWidthButton Sets the width of the border. + property int borderWidthButton + ///@detalis dapHorizontalAlignment Horizontal text alignment. + property alias dapHorizontalAlignment: buttonText.horizontalAlignment + ///@details button background radius + property alias radius: dapBackgroundButton.radius + + id: dapButton + + ///@details empty default background + background: Item { } + + contentItem: + Rectangle + { + id: dapBackgroundButton + anchors.fill: parent + color: dapButton.hovered ? colorBackgroundHover : colorBackgroundNormal + implicitWidth: widthButton + implicitHeight: heightButton + border.color: borderColorButton + border.width: borderWidthButton + radius: 0 + + ///button text + Text + { + id: buttonText + anchors.fill: parent + verticalAlignment: Qt.AlignVCenter + horizontalAlignment: Qt.AlignRight + anchors.rightMargin: indentTextRight + color: dapButton.hovered ? colorButtonTextHover : colorButtonTextNormal + text: qsTr(textButton) + } + + ///button picture + Image + { + id: iconNewWallet + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + anchors.leftMargin: indentImageLeftButton + source: dapButton.hovered ? hoverImageButton : normalImageButton + width: widthImageButton + height: heightImageButton + } + } } diff --git a/qml/widgets/DapButtonForm.ui.qml b/qml/widgets/DapButtonForm.ui.qml deleted file mode 100644 index b15715968d5d8a50843b0a00f5c3455255d01998..0000000000000000000000000000000000000000 --- a/qml/widgets/DapButtonForm.ui.qml +++ /dev/null @@ -1,91 +0,0 @@ -import QtQuick 2.0 -import QtQuick.Controls 2.0 - -Button -{ - ///@detalis heightButton Button height. - property int heightButton - ///@detalis widthButton Button width. - property int widthButton - ///@detalis normalImageButton The picture on the Button is in normal state. - property string normalImageButton - ///@detalis hoverImageButton The image on the Button is in the mouseover state. - property string hoverImageButton - ///@detalis widthImageButton Image width. - property int widthImageButton: 0 * pt - ///@detalis heightImageButton Image height. - property int heightImageButton: 0 * pt - ///@detalis indentImageLeftButton: Indentation of the image from the left edge. - property int indentImageLeftButton - ///@detalis colorBackgroundNormal Button background color in normal state. - property string colorBackgroundNormal - ///@detalis colorBackgroundHover Button background color in hover state. - property string colorBackgroundHover - ///@detalis textButton Text button. - property string textButton - ///@detalis colorButtonTextNormal Button text color in normal state. - property string colorButtonTextNormal - ///@detalis colorButtonTextHover Button text color in hover state. - property string colorButtonTextHover - ///@detalis indentTextRight: Indentation of the text from the right edge. - property int indentTextRight - ///@detalis fontButton Font setting. - property alias fontButton: buttonText.font - ///@detalis horizontalAligmentText Horizontal alignment. - property alias horizontalAligmentText:buttonText.horizontalAlignment - ///@detalis colorBackgroundButton This property overrides the background color. - property alias colorBackgroundButton: dapBackgroundButton.color - ///@detalis colorTextButton This property overrides the color of the text. - property alias colorTextButton: buttonText.color - ///@detalis borderColorButton Sets the color of the border. - property string borderColorButton - ///@detalis borderWidthButton Sets the width of the border. - property int borderWidthButton - ///@detalis dapHorizontalAlignment Horizontal text alignment. - property alias dapHorizontalAlignment: buttonText.horizontalAlignment - ///@details button background radius - property alias radius: dapBackgroundButton.radius - - - id: dapButton - - ///@details empty default background - background: Item { } - - contentItem: - Rectangle - { - id: dapBackgroundButton - anchors.fill: parent - color: dapButton.hovered ? colorBackgroundHover : colorBackgroundNormal - implicitWidth: widthButton - implicitHeight: heightButton - border.color: borderColorButton - border.width: borderWidthButton - radius: 0 - - ///button text - Text - { - id: buttonText - anchors.fill: parent - verticalAlignment: Qt.AlignVCenter - horizontalAlignment: Qt.AlignRight - anchors.rightMargin: indentTextRight - color: dapButton.hovered ? colorButtonTextHover : colorButtonTextNormal - text: qsTr(textButton) - } - - ///button picture - Image - { - id: iconNewWallet - anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left - anchors.leftMargin: indentImageLeftButton - source: dapButton.hovered ? hoverImageButton : normalImageButton - width: widthImageButton - height: heightImageButton - } - } -} diff --git a/qml/widgets/DapButton_New.qml b/qml/widgets/DapButton_New.qml new file mode 100644 index 0000000000000000000000000000000000000000..71abb3c6fe9e30dc49c65ca51cff486e992bd5dc --- /dev/null +++ b/qml/widgets/DapButton_New.qml @@ -0,0 +1,43 @@ +import QtQuick 2.0 +import QtQuick.Controls 2.0 + +Button +{ + id: root + + property alias backgroundSubcontroll: background + property alias iconSubcontroll: iconSubcontroll + property alias textSubcontroll: textSubcontroll + property string iconSource + property string hoverIconSource + + + property bool isHovered: false + + background: Item { + } + + contentItem: + Rectangle + { + id: background + anchors.fill: parent + + Text + { + id: textSubcontroll + anchors.fill: parent + verticalAlignment: Qt.AlignVCenter + horizontalAlignment: Qt.AlignRight + text: qsTr(root.text) + } + + Image + { + id: iconSubcontroll + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + source: root.hovered ? hoverIconSource : iconSource + } + } +} diff --git a/qml/widgets/DapTab.qml b/qml/widgets/DapTab.qml index 4d4c6ec69f2a533107b3b0b64f685145755ba1bc..a5d6ee609a43b4d2569c57d5bcc8ca2292267196 100644 --- a/qml/widgets/DapTab.qml +++ b/qml/widgets/DapTab.qml @@ -1,6 +1,69 @@ +//**************************************************************************** +// Implements a general view of the tab. +//**************************************************************************** + import QtQuick 2.4 +import QtQuick.Controls 2.0 -DapTabForm +Rectangle { + id: frameTab + + ///@detalis Top panel widget. + property Item dapTopPanel + ///@detalis Screen widget. + property Item dapScreen + ///@detalis Separator widget. + property alias dapSeparator: separator + ///@detalis Right pane widget. + property Item dapRightPanel + ///@detalis Tab frame. + property alias dapFrame: frameTab + + property alias rightPanel: rightPanel + + anchors.fill: parent + + // Install the top panel widget + Item + { + id: topPanel + data: dapTopPanel + height: dapTopPanel.height + width: parent.width + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + } + // Install the screen widget and the right panel + Row + { + anchors.top: topPanel.bottom + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + // Screen widget + Item + { + id: screen + data: dapScreen + height: parent.height + width: parent.width - separator.width - rightPanel.width + } + // Separator widget + Rectangle + { + id: separator + height: parent.height + } + // Right pane widget + Item + { + id: rightPanel + data: dapRightPanel + height: parent.height + width: dapRightPanel.width + } + } } diff --git a/qml/widgets/DapTabForm.ui.qml b/qml/widgets/DapTabForm.ui.qml deleted file mode 100644 index a5d6ee609a43b4d2569c57d5bcc8ca2292267196..0000000000000000000000000000000000000000 --- a/qml/widgets/DapTabForm.ui.qml +++ /dev/null @@ -1,69 +0,0 @@ -//**************************************************************************** -// Implements a general view of the tab. -//**************************************************************************** - -import QtQuick 2.4 -import QtQuick.Controls 2.0 - -Rectangle -{ - id: frameTab - - ///@detalis Top panel widget. - property Item dapTopPanel - ///@detalis Screen widget. - property Item dapScreen - ///@detalis Separator widget. - property alias dapSeparator: separator - ///@detalis Right pane widget. - property Item dapRightPanel - ///@detalis Tab frame. - property alias dapFrame: frameTab - - property alias rightPanel: rightPanel - - anchors.fill: parent - - // Install the top panel widget - Item - { - id: topPanel - data: dapTopPanel - height: dapTopPanel.height - width: parent.width - anchors.top: parent.top - anchors.left: parent.left - anchors.right: parent.right - } - // Install the screen widget and the right panel - Row - { - anchors.top: topPanel.bottom - anchors.left: parent.left - anchors.right: parent.right - anchors.bottom: parent.bottom - - // Screen widget - Item - { - id: screen - data: dapScreen - height: parent.height - width: parent.width - separator.width - rightPanel.width - } - // Separator widget - Rectangle - { - id: separator - height: parent.height - } - // Right pane widget - Item - { - id: rightPanel - data: dapRightPanel - height: parent.height - width: dapRightPanel.width - } - } -} diff --git a/qml/widgets/DapTopPanel.qml b/qml/widgets/DapTopPanel.qml index fbeb77b73e230f54becb2c01076ee699f03abe2f..81b7188f726e79097f4d65d45500205f6cfe07ba 100644 --- a/qml/widgets/DapTopPanel.qml +++ b/qml/widgets/DapTopPanel.qml @@ -2,11 +2,17 @@ import QtQuick 2.4 Rectangle { - id: frameTopPanel + radius: 8 * pt + height: 60 * pt + width: parent.width color: "#070023" - anchors.fill: parent - ///@detalis Top panel frame. - property alias dapFrame: frameTopPanel + + Rectangle { + color: parent.color + height: parent.height + width: parent.radius + x: parent.width - width + } }