Skip to content
Snippets Groups Projects

Feature 2798

Merged konstantin.kukharenko requested to merge feature-2798 into master
2 files
+ 53
15
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 53
14
@@ -3,11 +3,13 @@ import QtQuick.Controls 2.2
@@ -3,11 +3,13 @@ import QtQuick.Controls 2.2
import QtQuick.Controls.Styles 1.4
import QtQuick.Controls.Styles 1.4
import QtGraphicalEffects 1.0
import QtGraphicalEffects 1.0
///This file will be moved to libdap and removed from here.
///this comboBox used int top panel exchange and statusBar will be deleted in the future
///About property
///About property
///@hilightColor - color of the selected item
///@hilightColor - color of the selected item
///@fontSizeComboBox - font size for the entire widget
///@normalColor - color of item
 
///@normalColorText and @hilightColorText - normal and selected text color
 
///@normalColorTopText and @hilightColorTopText - text color in the main line in normal and active state
 
///@fontSizeComboBox - font size for the entire widget (px).
///@widthPopupComboBoxActive and @widthPopupComboBoxNormal - width of the combo box
///@widthPopupComboBoxActive and @widthPopupComboBoxNormal - width of the combo box
/// in the active state and in the normal state
/// in the active state and in the normal state
///@sidePaddingActive and @sidePaddingNormal - padding width of the combo box in the active state
///@sidePaddingActive and @sidePaddingNormal - padding width of the combo box in the active state
@@ -17,38 +19,75 @@ import QtGraphicalEffects 1.0
@@ -17,38 +19,75 @@ import QtGraphicalEffects 1.0
///@topIndentActive and @topIndentNormal
///@topIndentActive and @topIndentNormal
///@bottomIndentActive and @bottomIndentNormal
///@bottomIndentActive and @bottomIndentNormal
/// - sets the indent from the edge of the upper and lower edges of the parent in the active and normal state
/// - sets the indent from the edge of the upper and lower edges of the parent in the active and normal state
 
///@indicatorImageNormal and @indicatorImageActive - indicator picture address for active and normal state
 
///@indicatorWidth and @indicatorHeight - indicator width and height
 
ComboBox {
ComboBox {
property string normalColorText: "#070023"
property string normalColorTopText:normalColorText
property string hilightColorText: "#FFFFFF"
property string hilightColorTopText:normalColorText
 
property string normalColor: "#FFFFFF"
property string normalColor: "#FFFFFF"
property string hilightColor: "#330F54"
property string hilightColor: "#330F54"
property int fontSizeComboBox: 16*pt
property int fontSizeComboBox: 16*pt
property int widthPopupComboBoxActive: parent.width
property int widthPopupComboBoxNormal: parent.width
property int widthPopupComboBoxNormal: parent.width
 
property int widthPopupComboBoxActive: widthPopupComboBoxNormal
property int sidePaddingActive:16 * pt
property int sidePaddingNormal:16 * pt
property int sidePaddingNormal:16 * pt
 
property int sidePaddingActive:sidePaddingNormal
property int topIndentActive:12 * pt
property int topIndentNormal:12 * pt
property int topIndentNormal:12 * pt
 
property int topIndentActive:topIndentNormal
property int bottomIndentActive:14 * pt
property int bottomIndentNormal:14 * pt
property int bottomIndentNormal:14 * pt
 
property int bottomIndentActive:bottomIndentNormal
 
 
property string indicatorImageNormal: "qrc:/res/icons/ic_arrow_drop_down_dark_blue.png"
 
property string indicatorImageActive: "qrc:/res/icons/ic_arrow_drop_up_dark_blue.png"
 
property int indicatorWidth: 24*pt
 
property int indicatorHeight: indicatorWidth
id: customComboBox
id: customComboBox
width: popup.visible ? widthPopupComboBoxActive : widthPopupComboBoxNormal
width: popup.visible ? widthPopupComboBoxActive : widthPopupComboBoxNormal
height: parent.height
height: parent.height
delegate:DapComboBoxDelegate{delegateContentText: modelData;}
 
delegate:ItemDelegate {
 
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 modelData;}
 
color: hovered ? hilightColorText : normalColorText
 
}
 
 
background: Rectangle {
 
anchors.fill: parent
 
anchors.bottomMargin: 10 * pt
 
color: hovered ? hilightColor : normalColor
 
}
 
 
highlighted: parent.highlightedIndex === index
 
 
}
 
indicator: Image {
indicator: Image {
source: parent.popup.visible ? "qrc:/res/icons/ic_arrow_drop_up_dark_blue.png" : "qrc:/res/icons/ic_arrow_drop_down_dark_blue.png"
source: parent.popup.visible ? indicatorImageActive : indicatorImageNormal
width: 24 * pt
width: indicatorWidth
height: 24 * pt
height: indicatorHeight
anchors.verticalCenter: parent.verticalCenter
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
anchors.right: parent.right
anchors.rightMargin: popup.visible ? sidePaddingActive : sidePaddingNormal
anchors.rightMargin: popup.visible ? sidePaddingActive : sidePaddingNormal
@@ -69,7 +108,7 @@ ComboBox {
@@ -69,7 +108,7 @@ ComboBox {
text: parent.displayText
text: parent.displayText
font.family: fontRobotoRegular.name
font.family: fontRobotoRegular.name
font.pixelSize: fontSizeComboBox
font.pixelSize: fontSizeComboBox
color: normalColorText
color: popup.visible ? hilightColorTopText : normalColorTopText
verticalAlignment: Text.AlignTop
verticalAlignment: Text.AlignTop
}
}
Loading