From 266a632511b8c1d91d2b34fc5fe8658fe2d0fe1a Mon Sep 17 00:00:00 2001
From: Konstantin <djtv01@gmail.com>
Date: Fri, 3 Jan 2020 09:16:25 +0300
Subject: [PATCH] [*]edit combobox

---
 widgets/DapComboBox.qml        | 10 ++++++----
 widgets/DapComboBoxForm.ui.qml |  7 +++++--
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/widgets/DapComboBox.qml b/widgets/DapComboBox.qml
index 82ef89d..1765c09 100644
--- a/widgets/DapComboBox.qml
+++ b/widgets/DapComboBox.qml
@@ -11,12 +11,12 @@ DapComboBoxForm
         height:{
             if(index != currentIndex)
             {
-                if(index == customComboBox.count - 2)
+                if(index == (count - 2))
                 {
                     if(index+1 == currentIndex) return heightListElement + bottomIntervalListElement
                     else return heightListElement + intervalListElement
                 }
-                if (index == customComboBox.count - 1) return heightListElement + bottomIntervalListElement
+                if (index == count - 1) return heightListElement + bottomIntervalListElement
                 return heightListElement + intervalListElement
             }
             else return 0
@@ -27,9 +27,11 @@ DapComboBoxForm
             anchors.fill: parent
             anchors.topMargin: paddingTopItemDelegate
             anchors.leftMargin: popup.visible ? sidePaddingActive : sidePaddingNormal
-            font.family: fontRobotoRegular.name
+            font.family: "Roboto"
             font.pixelSize: fontSizeComboBox
-            text: {if(index != currentIndex) return modelData;}
+            text: if(index != currentIndex)
+                      return modelData;
+                  else return ""
             color: hovered ? hilightColorText : normalColorText
         }
 
diff --git a/widgets/DapComboBoxForm.ui.qml b/widgets/DapComboBoxForm.ui.qml
index 7a219d8..7943c81 100644
--- a/widgets/DapComboBoxForm.ui.qml
+++ b/widgets/DapComboBoxForm.ui.qml
@@ -97,7 +97,7 @@ ComboBox {
         anchors.fill: parent
         anchors.leftMargin: popup.visible ? sidePaddingActive : sidePaddingNormal
         text: parent.displayText
-        font.family: fontRobotoRegular.name
+        font.family: "Roboto"
         font.pixelSize: fontSizeComboBox
         color: popup.visible ? hilightColorTopText : normalColorTopText
         verticalAlignment: Text.AlignVCenter
@@ -117,7 +117,7 @@ ComboBox {
 
         background: Rectangle {
             width: customComboBox.background.width
-            color: parent.color
+            color: normalColor
             Rectangle {
                 id: contentCorner
                 anchors.fill: parent
@@ -141,9 +141,12 @@ ComboBox {
                     background
         verticalOffset: if (topEffect)
                             9 * pt
+                        else 0
         samples: if (topEffect)
                      13 * pt
+                    else 0
         color: if (topEffect)
                    customComboBox.popup.visible ? colorDropShadow : colorTopNormalDropShadow
+                else "#00000000"
     }
 }
-- 
GitLab