Exchanges widget tuning

This commit is contained in:
felixrojauro
2015-11-30 14:01:23 +01:00
parent b091799d44
commit 9e2c8f331a
5 changed files with 135 additions and 84 deletions

View File

@@ -10,6 +10,12 @@
<height>600</height> <height>600</height>
</rect> </rect>
</property> </property>
<property name="minimumSize">
<size>
<width>800</width>
<height>480</height>
</size>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>Dialog</string> <string>Dialog</string>
</property> </property>
@@ -38,27 +44,17 @@
<enum>QFrame::Sunken</enum> <enum>QFrame::Sunken</enum>
</property> </property>
<layout class="QGridLayout" name="gridLayout_4"> <layout class="QGridLayout" name="gridLayout_4">
<item row="2" column="0">
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0"> <item row="1" column="0">
<layout class="QVBoxLayout" name="verticalLayoutExchanges"/> <layout class="QVBoxLayout" name="verticalLayoutExchanges"/>
</item> </item>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="lblExchangesHeader"> <widget class="QLabel" name="lblExchangesHeader">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font"> <property name="font">
<font> <font>
<pointsize>10</pointsize> <pointsize>10</pointsize>

View File

@@ -68,14 +68,13 @@ QWidget* GUIExchangesWidget::dockQmlToWidget()
m_pExchangesControl = pRootObject->findChild<GUIExchangesControl*>(); m_pExchangesControl = pRootObject->findChild<GUIExchangesControl*>();
if ( m_pExchangesControl ) if ( m_pExchangesControl )
{ {
m_pExchangesControl->setWidth( 500 );
m_pExchangesControl->setHeight( 200 );
} }
} }
pPlaceHolder = QWidget::createWindowContainer( pExchangesWindow, this ); pPlaceHolder = QWidget::createWindowContainer( pExchangesWindow, this );
if ( pPlaceHolder ) if ( pPlaceHolder )
{ {
pPlaceHolder->setMinimumSize( 500, 200 ); pPlaceHolder->setMinimumSize( 500, 200 );
pPlaceHolder->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
} }
} }

View File

@@ -6,27 +6,15 @@ GUIExchangesControl
id: id_ExchangesControl id: id_ExchangesControl
property color colorBackgroundInWidget: GUI20Skin.colorFrameBackground property color colorBackgroundInWidget: GUI20Skin.colorFrameBackground
Rectangle
{
id: id_ExchangessArea
height: id_ExchangesControl.height
width: id_ExchangesControl.width
color: colorBackgroundInWidget
z: -1
anchors.fill: id_ExchangesControl
// anchors.horizontalCenter: id_ExchangesControl.horizontalCenter
// anchors.left: id_leftArrow.left
QmlGUIExchangesListView QmlGUIExchangesListView
{ {
id: id_ExchangesListView id: id_ExchangesListView
anchors.fill: id_ExchangessArea anchors.fill: id_ExchangesControl
Component.onCompleted: Component.onCompleted:
{ {
id_ExchangesControl.initializeExchangesView( id_ExchangesListView ) id_ExchangesControl.initializeExchangesView( id_ExchangesListView )
} }
} }
}
} }

View File

@@ -14,14 +14,12 @@ GUIExchangesListView
ScrollView ScrollView
{ {
id: id_ExchangesScrollView id: id_ExchangesScrollView
anchors.fill: parent anchors.fill: id_ExchangesView
ListView ListView
{ {
id: id_listView id: id_listView
anchors.fill: id_ExchangesScrollView anchors.fill: id_ExchangesScrollView
height: 250
width: 500
clip: true clip: true
visible: true visible: true
interactive: contentHeight > id_listView.height ? true : false interactive: contentHeight > id_listView.height ? true : false
@@ -39,8 +37,8 @@ GUIExchangesListView
id: id_listElement id: id_listElement
objectName: id_ExchangesView.objectName + "_Element" + index objectName: id_ExchangesView.objectName + "_Element" + index
width: 750 width: id_ExchangesView.width
height: 125 height: 125
Row Row
{ {
id: id_row id: id_row
@@ -49,7 +47,7 @@ GUIExchangesListView
{ {
id: id_imageRectangle id: id_imageRectangle
width: id_listElement.width / 5 width: id_listElement.width / 5
height: 100 height: 100
anchors.verticalCenter: id_row.verticalCenter anchors.verticalCenter: id_row.verticalCenter
Image Image
@@ -91,6 +89,7 @@ GUIExchangesListView
id: id_exchangeNameText id: id_exchangeNameText
anchors.fill: id_exchangeNameRectangle anchors.fill: id_exchangeNameRectangle
text: qsTr( m_exchangeName ) text: qsTr( m_exchangeName )
color: GUI20Skin.colorToolbarMainGradientEnd
} }
} }
Rectangle Rectangle
@@ -105,65 +104,123 @@ GUIExchangesListView
Rectangle Rectangle
{ {
id: id_priceBid id: id_priceBid
width: id_pricesRectangle.width / 4 width: id_pricesRectangle.width / 4
height: id_pricesRectangle.height height: id_pricesRectangle.height
Text Text
{ {
id: id_priceBidText id: id_priceBidTextDescription
anchors.fill: id_priceBid anchors.left: id_priceBid.left
text: qsTr("Bid: %1").arg(m_bidPrice) text: qsTr("Bid:")
width: id_priceBid.width / 3
color: GUI20Skin.colorToolbarMainGradientEnd
}
Text
{
id: id_priceBidTextValue
anchors.left: id_priceBidTextDescription.right
text: qsTr( m_bidPrice )
color: GUI20Skin.colorTextActive
} }
} }
Rectangle Rectangle
{ {
id: id_priceAsk id: id_priceAsk
width: id_pricesRectangle.width / 4 width: id_pricesRectangle.width / 4
height: id_pricesRectangle.height height: id_pricesRectangle.height
Text Text
{ {
id: id_priceAskText id: id_priceAskTextDescription
anchors.fill: id_priceAsk anchors.left: id_priceAsk.left
text: qsTr("Ask: %1").arg(m_askPrice) text: qsTr("Ask:")
color: GUI20Skin.colorToolbarMainGradientEnd
width: id_priceAsk.width / 3
}
Text
{
id: id_priceAskTextValue
anchors.left: id_priceAskTextDescription.right
text: qsTr( m_askPrice )
color: GUI20Skin.colorTextActive
} }
} }
Rectangle Rectangle
{ {
id: id_priceLast id: id_volume24h
width: id_pricesRectangle.width / 4 width: id_pricesRectangle.width / 2
height: id_pricesRectangle.height height: id_pricesRectangle.height
Text Text
{ {
id: id_priceLastText id: id_volume24hTextDescription
anchors.fill: id_priceLast anchors.left: id_volume24h.left
text: qsTr("Last: %1").arg(m_lastPrice) text: qsTr("24h Volume:")
color: GUI20Skin.colorToolbarMainGradientEnd
width: id_volume24h.width / 3
}
Text
{
id: id_volume24hTextValue
anchors.left: id_volume24hTextDescription.right
text: qsTr( m_volume24H )
color: GUI20Skin.colorTextActive
} }
} }
Rectangle
{
id: id_volume24h
width: id_pricesRectangle.width / 4
height: id_pricesRectangle.height
Text
{
id: id_volume24hText
anchors.fill: id_volume24h
text: qsTr("Volume: %1").arg(m_volume24H)
}
}
} }
} }
Rectangle Rectangle
{ {
id: id_exchangeLastUpdateTime id: id_volumeTimeRectangle
width: id_otherInfoRectangle.width width: id_otherInfoRectangle.width
height: id_otherInfoRectangle.height / 4 height: id_otherInfoRectangle.height / 4
Text Row
{ {
id: id_exchangeTime id: id_volumeTimeRow
anchors.fill: id_exchangeLastUpdateTime anchors.fill: id_volumeTimeRectangle
text: qsTr( m_lastUpdateTime ) Rectangle
{
id: id_priceLast
width: id_pricesRectangle.width / 4
height: id_pricesRectangle.height
Text
{
id: id_priceLastTextDescription
anchors.left: id_priceLast.left
text: qsTr("Last:")
color: GUI20Skin.colorToolbarMainGradientEnd
width: id_priceLast.width / 3
}
Text
{
id: id_priceLastTextValue
anchors.left: id_priceLastTextDescription.right
text: qsTr( m_lastPrice )
color: GUI20Skin.colorTextActive
}
}
Rectangle
{
id: id_exchangeLastUpdateTime
width: id_volumeTimeRectangle.width / 4
height: id_volumeTimeRectangle.height
Text
{
id: id_exchangeTimeDescription
anchors.left: id_exchangeLastUpdateTime.left
text: qsTr( "Time:" )
color: GUI20Skin.colorToolbarMainGradientEnd
width: id_exchangeLastUpdateTime.width / 3
}
Text
{
id: id_exchangeTimeValue
anchors.left: id_exchangeTimeDescription.right
text: qsTr( m_lastUpdateTime )
color: GUI20Skin.colorTextActive
}
}
} }
} }
Rectangle Rectangle
{ {
id: id_exchangeLink id: id_exchangeLink
@@ -174,15 +231,26 @@ GUIExchangesListView
id: id_exchangeLinkText id: id_exchangeLinkText
anchors.fill: id_exchangeLink anchors.fill: id_exchangeLink
text: qsTr( "Go to site" ) text: qsTr( "Go to site" )
MouseArea font.underline: true
{ color: GUI20Skin.colorToolbarMainGradientEnd
id: id_linkMouseArea MouseArea
anchors.fill: id_exchangeLinkText {
onClicked: id: id_linkMouseArea
{ anchors.fill: id_exchangeLinkText
id_ExchangesView.onClicked( index ) hoverEnabled: true
} onClicked:
} {
id_ExchangesView.onClicked( index )
}
onEntered:
{
id_exchangeLinkText.color = GUI20Skin.colorTextActive
}
onExited:
{
id_exchangeLinkText.color = GUI20Skin.colorToolbarMainGradientEnd
}
}
} }
} }
} }

View File

@@ -2,15 +2,15 @@ import QtQuick 2.2
Rectangle Rectangle
{ {
id: id_root id: id_ExchangesRoot
width: parent ? parent.width : 0
height: parent ? parent.height : 0
color: GUI20Skin.colorFrameBackground
QmlGUIExchangesControl QmlGUIExchangesControl
{ {
id: id_ExchangesControlMain id: id_ExchangesControlMain
anchors.fill: id_ExchangesRoot
} }
width: 500
height: 250
color: GUI20Skin.colorFrameBackground
} }