From 441d695fa344d624c9fd025d68ddfa017bcea9c7 Mon Sep 17 00:00:00 2001
From: "konstantin.kukharenko" <konstantin.kukharenko@demlabs.net>
Date: Tue, 17 Dec 2019 05:42:45 +0000
Subject: [PATCH] Feature 2798

---
 DapButtonForm.ui.qml    | 11 ++++++++++-
 DapComboBoxDelegate.qml | 31 +++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+), 1 deletion(-)
 create mode 100644 DapComboBoxDelegate.qml

diff --git a/DapButtonForm.ui.qml b/DapButtonForm.ui.qml
index 2ad9e8f..4428f92 100644
--- a/DapButtonForm.ui.qml
+++ b/DapButtonForm.ui.qml
@@ -34,6 +34,14 @@ Button {
     property bool existenceImage:true
     ///@detalis horizontalAligmentText Horizontal alignment.
     property alias horizontalAligmentText:templateText.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: templateText.color
+    ///@detalis borderColorButton Sets the color of the border.
+    property string borderColorButton: "#000000"
+    ///@detalis borderWidthButton Sets the width of the border.
+    property int borderWidthButton: 0
 
     id: dapButton
 
@@ -43,7 +51,8 @@ Button {
         color: dapButton.hovered ? colorBackgroundHover : colorBackgroundNormal
         implicitWidth: widthButton
         implicitHeight: heightButton
-
+        border.color: borderColorButton
+        border.width: borderWidthButton
         ///button text
         Text {
             id: templateText
diff --git a/DapComboBoxDelegate.qml b/DapComboBoxDelegate.qml
new file mode 100644
index 0000000..55db1e5
--- /dev/null
+++ b/DapComboBoxDelegate.qml
@@ -0,0 +1,31 @@
+import QtQuick 2.0
+import QtQuick.Controls 2.5
+
+ItemDelegate {
+    property string delegateContentText: ""
+    width: parent.width
+    height:{
+        if(index == currentIndex) return 0
+        else return 42*pt
+    }
+    contentItem: Text {
+        id:textDelegateComboBox
+        anchors.fill: parent
+        anchors.topMargin: 8 * pt
+        anchors.leftMargin: popup.visible ? sidePaddingActive : sidePaddingNormal
+        verticalAlignment: Qt.AlignTop
+        font.family: fontRobotoRegular.name
+            font.pixelSize: fontSizeComboBox
+            text: {if(index != currentIndex) return delegateContentText;}
+            color: hovered ? hilightColorText : normalColorText
+    }
+
+    background: Rectangle {
+        anchors.fill: parent
+        anchors.bottomMargin: 10 * pt
+        color: hovered ? hilightColor : normalColor
+    }
+
+    highlighted: parent.highlightedIndex === index
+
+}
-- 
GitLab