Skip to content
Snippets Groups Projects
Commit 9581fd7e authored by littletux89@gmail.com's avatar littletux89@gmail.com
Browse files

[+] Improved frontend structure.

parent 08caf2a3
No related branches found
No related tags found
No related merge requests found
Pipeline #1575 passed with stage
in 20 minutes and 31 seconds
......@@ -178,5 +178,7 @@
<file>screen/mobile/VPN/DapUiQmlWidgetSettingsVpnComboBoxForm.ui.qml</file>
<file>screen/mobile/VPN/DapUiQmlWidgetSettingsVpnForm.ui.qml</file>
<file>Device.qml</file>
<file>screen/DapAbstractMenuTabWidget.qml</file>
<file>screen/DapAbstractMenuTabWidgetForm.ui.qml</file>
</qresource>
</RCC>
import QtQuick 2.4
DapAbstractMenuTabWidgetForm
{
///@detalis Width of the main menu bar item.
property int widthItemMenu: dapMenuWidget.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: dapMenuWidget.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:
{
dapMenuWidget.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);
}
}
}
}
import QtQuick 2.4
import QtQuick.Controls 2.0
import "qrc:/"
DapMenuTabWidget
{
dapMenuWidget:
ListView
{
id: menuTab
anchors.fill: parent
delegate: itemMenuTabDelegate
spacing: 3 * pt
clip: true
interactive: false
}
}
......@@ -2,8 +2,11 @@ import QtQuick 2.4
DapMainApplicationWindowForm
{
///@detalis Path to the dashboard tab.
readonly property string dashboardScreen: "qrc:/screen/" + device + "/Dashboard/DapDashboardTab.qml"
///@detalis Path to the exchange tab.
readonly property string exchangeScreen: "qrc:/screen/" + device + "/Exchange/DapExchangeTab.qml"
///@detalis Path to the history tab.
readonly property string historyScreen: "qrc:/screen/" + device + "/History/DapHistoryTab.qml"
// Menu bar tab model
......
......@@ -56,7 +56,7 @@ DapMainWindow
dapMenuWidget:
// Menu bar
DapMenuTabWidget
DapAbstractMenuTabWidget
{
id: menuTabWidget
anchors.fill: parent
......@@ -66,7 +66,7 @@ DapMainWindow
selectColorItemMenu: "#D51F5D"
widthIconItemMenu: 18 * pt
heightIconItemMenu: 18 * pt
dapMenuTab.model: modelMenuTab
dapMenuWidget.model: modelMenuTab
}
dabScreensWidget:
......
Subproject commit 1c0614797a3a2a2f4c179630025600e177637a65
Subproject commit ee6e8617e1f589b45f15e327ed18cddfa87915f8
Subproject commit c81202ba5d48e5d77afcc8aea9962a10560527f3
Subproject commit 16a16e71b9cfae4fd8df530ed8cd6146010ae7e0
Subproject commit 5f661c223be1ccd39f0dfa104a44de0d9f9dfb35
Subproject commit 7129934993bef42104cffbef8f983cde724afce2
Subproject commit 61d53c51899dc48bc864568090d253e9f988ecef
Subproject commit 2d8909dbf9e709f9a4c5877ce594f30be924515e
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment