diff --git a/DapMenuTabWidget.qml b/DapMenuTabWidget.qml index f1d1cbef35a8e29b882bd840f98d6758af0b0a6b..8c99320d4f3f297f6537d78f9536f42607e70fab 100644 --- a/DapMenuTabWidget.qml +++ b/DapMenuTabWidget.qml @@ -3,96 +3,7 @@ import QtQuick.Controls 1.4 DapMenuTabWidgetForm { - ///@detalis Width of the main menu bar item. - property int widthItemMenu: dapMenuTab.width - ///@detalis Height of the main menu bar item. - property int heightItemMenu: 60 * pt - ///@detalis Width of the main menu bar item icon. - property int widthIconItemMenu: 18 * pt - ///@detalis Height of the main menu bar item icon. - property int heightIconItemMenu: 18 * pt - ///@detalis Сolor of the main menu bar item in normal condition. - property string normalColorItemMenu: "transparent" - ///@detalis Сolor of the main menu bar item in the selected state. - property string selectColorItemMenu: "#D51F5D" - // Widget of the main menu bar item - Component - { - id: itemMenuTabDelegate - - Rectangle - { - id: frameItemMenu - - property bool isPushed: dapMenuTab.currentIndex === index - - width: widthItemMenu - height: heightItemMenu - color: normalColorItemMenu - - Image - { - id: iconItem - anchors.left: parent.left - anchors.leftMargin: 24 * pt - anchors.verticalCenter: parent.verticalCenter - height: heightIconItemMenu - width: widthIconItemMenu - source: normalIcon - } - - Text - { - id: textItem - anchors.verticalCenter: parent.verticalCenter - anchors.left: iconItem.right - anchors.leftMargin: 18 * pt - font.family: dapFontRobotoLight.name - font.pixelSize: 16 * pt - color: "#FFFFFF" - text: name - } - - MouseArea - { - id: handler - anchors.fill: parent - hoverEnabled: true - - onEntered: - { - if(!frameItemMenu.isPushed) - { - iconItem.source = hoverIcon; - textItem.font.family = dapFontRobotoRegular.name; - } - } - - onExited: - { - if(!frameItemMenu.isPushed) - { - iconItem.source = normalIcon - textItem.font.family = dapFontRobotoLight.name; - } - } - - onClicked: - { - dapMenuTab.currentIndex = index; - pathScreen = page; - } - } - - onIsPushedChanged: - { - frameItemMenu.color = (isPushed ? selectColorItemMenu : normalColorItemMenu); - iconItem.source = isPushed ? model.hoverIcon : model.normalIcon; - textItem.font.family = (isPushed ? dapFontRobotoRegular.name : dapFontRobotoLight.name); - } - } - } } /*##^## Designer { diff --git a/DapMenuTabWidgetForm.ui.qml b/DapMenuTabWidgetForm.ui.qml index 8833e1048ba906f8dcb67fe7c03c7560739071c9..614ce06fc7071ab8764ab29705d0329dd42c8ff4 100644 --- a/DapMenuTabWidgetForm.ui.qml +++ b/DapMenuTabWidgetForm.ui.qml @@ -12,7 +12,7 @@ Rectangle ///@detalis Main menu panel widget frame. property alias dapFrameMenuTab: frameMenuTab ///@detalis Main menu bar widget. - property alias dapMenuTab: menuTab + property ListView dapMenuWidget ///@detalis Path to the selected tab. property string pathScreen @@ -20,13 +20,10 @@ Rectangle focus: true // Install the widget of the main menu panel - ListView + Item { id: menuTab + data: dapMenuWidget anchors.fill: parent - delegate: itemMenuTabDelegate - spacing: 3 * pt - clip: true - interactive: false } }