Exchanges view updates

This commit is contained in:
Andre Jochems
2015-11-30 11:21:55 +01:00
parent 239fd6afaf
commit b091799d44
17 changed files with 195 additions and 209 deletions

View File

@@ -29,17 +29,36 @@
<property name="horizontalSpacing"> <property name="horizontalSpacing">
<number>15</number> <number>15</number>
</property> </property>
<item row="0" column="1"> <item row="1" column="0">
<widget class="QFrame" name="newsItemsBox"> <widget class="QFrame" name="exchangeInfoBox">
<property name="frameShape"> <property name="frameShape">
<enum>QFrame::StyledPanel</enum> <enum>QFrame::StyledPanel</enum>
</property> </property>
<property name="frameShadow"> <property name="frameShadow">
<enum>QFrame::Sunken</enum> <enum>QFrame::Sunken</enum>
</property> </property>
<layout class="QGridLayout" name="gridLayout_3"> <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">
<layout class="QVBoxLayout" name="verticalLayoutExchanges"/>
</item>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="lblNewsHeader"> <widget class="QLabel" name="lblExchangesHeader">
<property name="font"> <property name="font">
<font> <font>
<pointsize>10</pointsize> <pointsize>10</pointsize>
@@ -51,70 +70,24 @@
<string notr="true">color: rgb(166, 27, 31);</string> <string notr="true">color: rgb(166, 27, 31);</string>
</property> </property>
<property name="text"> <property name="text">
<string>News</string> <string>Exchanges</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="1" column="1">
<widget class="QFrame" name="casinoInfoBox">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0">
<widget class="QLabel" name="lblCasinosHeader">
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(166, 27, 31);</string>
</property>
<property name="text">
<string>Casinos</string>
</property>
</widget>
</item>
<item row="1" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QFrame" name="coinInfoBox"> <widget class="QFrame" name="coinInfoBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="autoFillBackground"> <property name="autoFillBackground">
<bool>false</bool> <bool>false</bool>
</property> </property>
@@ -126,7 +99,7 @@
</property> </property>
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="lblCasinosHeader_2"> <widget class="QLabel" name="lblInformationHeader">
<property name="font"> <property name="font">
<font> <font>
<pointsize>10</pointsize> <pointsize>10</pointsize>
@@ -138,14 +111,14 @@
<string notr="true">color: rgb(166, 27, 31);</string> <string notr="true">color: rgb(166, 27, 31);</string>
</property> </property>
<property name="text"> <property name="text">
<string>Casinos</string> <string>Information</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<layout class="QFormLayout" name="formCoinDetails"> <layout class="QFormLayout" name="formCoinDetails">
<property name="fieldGrowthPolicy"> <property name="fieldGrowthPolicy">
<enum>QFormLayout::AllNonFixedFieldsGrow</enum> <enum>QFormLayout::ExpandingFieldsGrow</enum>
</property> </property>
<property name="horizontalSpacing"> <property name="horizontalSpacing">
<number>15</number> <number>15</number>
@@ -167,14 +140,22 @@
</property> </property>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="lblBlockHeight"> <widget class="QLabel" name="lblBlockHeight">
<property name="font">
<font>
<kerning>true</kerning>
</font>
</property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true"/> <string notr="true"/>
</property> </property>
<property name="text"> <property name="text">
<string>Current number of blocks</string> <string>Current number of blocks</string>
</property> </property>
<property name="textFormat">
<enum>Qt::AutoText</enum>
</property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
@@ -206,7 +187,7 @@
<string>Last block time</string> <string>Last block time</string>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
@@ -238,7 +219,7 @@
<string>Coin Supply</string> <string>Coin Supply</string>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
@@ -442,7 +423,7 @@
<string>Number of connections</string> <string>Number of connections</string>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
@@ -474,7 +455,7 @@
<string>Difficulty</string> <string>Difficulty</string>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
@@ -506,7 +487,7 @@
<string>Network Hashrate</string> <string>Network Hashrate</string>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
@@ -563,64 +544,6 @@
</item> </item>
</layout> </layout>
</item> </item>
<item row="2" column="0">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item row="1" column="0">
<widget class="QFrame" name="exchangeInfoBox">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<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="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<layout class="QVBoxLayout" name="verticalLayoutExchanges"/>
</item>
<item row="0" column="0">
<widget class="QLabel" name="lblExchangesHeader">
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(166, 27, 31);</string>
</property>
<property name="text">
<string>Exchanges</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>

View File

@@ -17,8 +17,8 @@ InfoPage::InfoPage(QWidget *parent) :
ui(new Ui::InfoPage) ui(new Ui::InfoPage)
{ {
ui->setupUi(this); ui->setupUi(this);
ui->casinoInfoBox->setVisible(false); // ui->casinoInfoBox->setVisible(false);
ui->newsItemsBox->setVisible(false); // ui->newsItemsBox->setVisible(false);
createExchangesWidget(); createExchangesWidget();
} }

View File

@@ -35,7 +35,7 @@ void GUIBannerControl::slotPopulateListView( JsonActivePromotionsParser* a_pActi
if ( m_pAdvertsView ) if ( m_pAdvertsView )
{ {
QmlBannerListModel* pAdvertsModel = new QmlBannerListModel( *a_pActivePromotions ); QmlBannerListModel* pAdvertsModel = new QmlBannerListModel( *a_pActivePromotions );
m_pAdvertsView->SetModel( pAdvertsModel ); m_pAdvertsView->setModel( pAdvertsModel );
} }
} }

View File

@@ -13,7 +13,7 @@ GUIBannerListView::GUIBannerListView( QQuickItem* a_pParent )
{ {
} }
void GUIBannerListView::Clear() void GUIBannerListView::clear()
{ {
if ( m_pModel ) if ( m_pModel )
{ {
@@ -21,7 +21,7 @@ void GUIBannerListView::Clear()
} }
} }
void GUIBannerListView::OnClicked( int a_iItemIndex ) void GUIBannerListView::onClicked( int a_iItemIndex )
{ {
if ( m_pModel ) if ( m_pModel )
{ {
@@ -39,7 +39,7 @@ GUIBannerListView::~GUIBannerListView()
} }
} }
void GUIBannerListView::SetModel( QmlBannerListModel* a_pModel ) void GUIBannerListView::setModel( QmlBannerListModel* a_pModel )
{ {
if ( m_pModel ) if ( m_pModel )
{ {

View File

@@ -16,12 +16,12 @@ public:
explicit GUIBannerListView( QQuickItem *a_pParent = 0 ); explicit GUIBannerListView( QQuickItem *a_pParent = 0 );
virtual ~GUIBannerListView(); /** Destructor **/ virtual ~GUIBannerListView(); /** Destructor **/
void SetModel( QmlBannerListModel* a_pModel ); void setModel( QmlBannerListModel* a_pModel );
QmlBannerListModel* GetModel() const { return m_pModel; } QmlBannerListModel* setModel() const { return m_pModel; }
void Clear(); void clear();
Q_INVOKABLE void OnClicked( int a_iItemIndex ); Q_INVOKABLE void onClicked( int a_iItemIndex );
signals: signals:
void signalModelChanged(); void signalModelChanged();

View File

@@ -18,7 +18,7 @@ GUIExchangesControl::~GUIExchangesControl()
} }
} }
void GUIExchangesControl::InitializeExchangesView( GUIExchangesListView* a_pView ) void GUIExchangesControl::initializeExchangesView( GUIExchangesListView* a_pView )
{ {
if ( a_pView ) if ( a_pView )
{ {
@@ -35,7 +35,7 @@ void GUIExchangesControl::slotPopulateListView( JsonActiveExchangesParser* a_pAc
if ( m_pExchangesView ) if ( m_pExchangesView )
{ {
QmlExchangesListModel* pExchangesModel = new QmlExchangesListModel( *a_pActiveExchanges ); QmlExchangesListModel* pExchangesModel = new QmlExchangesListModel( *a_pActiveExchanges );
m_pExchangesView->SetModel( pExchangesModel ); m_pExchangesView->setModel( pExchangesModel );
} }
} }

View File

@@ -14,8 +14,8 @@ public:
GUIExchangesControl( QQuickItem* a_pParent = 0 ); GUIExchangesControl( QQuickItem* a_pParent = 0 );
virtual ~GUIExchangesControl(); virtual ~GUIExchangesControl();
Q_INVOKABLE void InitializeExchangesView( GUIExchangesListView* a_pView ); Q_INVOKABLE void initializeExchangesView( GUIExchangesListView* a_pView );
GUIExchangesListView* GetExchangesView() const { return m_pExchangesView; } GUIExchangesListView* getExchangesView() const { return m_pExchangesView; }
public slots: public slots:
void slotPopulateListView( JsonActiveExchangesParser* a_pActiveExchanges ); void slotPopulateListView( JsonActiveExchangesParser* a_pActiveExchanges );

View File

@@ -13,7 +13,7 @@ GUIExchangesListView::GUIExchangesListView( QQuickItem* a_pParent )
{ {
} }
void GUIExchangesListView::Clear() void GUIExchangesListView::clear()
{ {
if ( m_pModel ) if ( m_pModel )
{ {
@@ -21,7 +21,7 @@ void GUIExchangesListView::Clear()
} }
} }
void GUIExchangesListView::OnClicked( int a_iItemIndex ) void GUIExchangesListView::onClicked( int a_iItemIndex )
{ {
if ( m_pModel ) if ( m_pModel )
{ {
@@ -39,7 +39,7 @@ GUIExchangesListView::~GUIExchangesListView()
} }
} }
void GUIExchangesListView::SetModel( QmlExchangesListModel* a_pModel ) void GUIExchangesListView::setModel( QmlExchangesListModel* a_pModel )
{ {
if ( m_pModel ) if ( m_pModel )
{ {

View File

@@ -16,12 +16,13 @@ public:
explicit GUIExchangesListView( QQuickItem *a_pParent = 0 ); explicit GUIExchangesListView( QQuickItem *a_pParent = 0 );
virtual ~GUIExchangesListView(); /** Destructor **/ virtual ~GUIExchangesListView(); /** Destructor **/
void SetModel( QmlExchangesListModel* a_pModel ); void setModel( QmlExchangesListModel* a_pModel );
QmlExchangesListModel* GetModel() const { return m_pModel; } QmlExchangesListModel* getModel() const { return m_pModel; }
void Clear(); void clear();
Q_INVOKABLE void onClicked( int a_iItemIndex );
Q_INVOKABLE void OnClicked( int a_iItemIndex );
signals: signals:
void signalModelChanged(); void signalModelChanged();

View File

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

View File

@@ -1,15 +1,27 @@
#include "qmlexchangeslistitem.h" #include "qmlexchangeslistitem.h"
#include <QDebug> #include <QDebug>
#include <QDateTime>
QmlExchangesListItem::QmlExchangesListItem(QString a_strImageSource, QString a_strDestinationUrl, QString a_strExchangesName, double a_dBidPrice, double a_dAskPrice, double a_dLastPrice, QString a_strDescription, QObject* a_pParent ) QmlExchangesListItem::QmlExchangesListItem(QString a_strImageSource,
QString a_strDestinationUrl,
QString a_strExchangesName,
double a_dBidPrice,
double a_dAskPrice,
double a_dLastPrice,
QString a_strDescription,
double a_dVolume24H,
QString a_strLastUpdateTime,
QObject* a_pParent )
: QmlListItem ( QVariant( a_strImageSource ) : QmlListItem ( QVariant( a_strImageSource )
, QVariant( a_strDestinationUrl ) , QVariant( a_strDestinationUrl )
, QVariant( a_strExchangesName ) , QVariant( a_strExchangesName )
, QVariant( GetFormattedPrice( a_dBidPrice ) ) , QVariant( getFormattedPrice( a_dBidPrice ) )
, QVariant( GetFormattedPrice( a_dAskPrice ) ) , QVariant( getFormattedPrice( a_dAskPrice ) )
, QVariant( GetFormattedPrice( a_dLastPrice ) ) , QVariant( getFormattedPrice( a_dLastPrice ) )
, QVariant( a_strDescription ) , QVariant( a_strDescription )
, QVariant( QString::number(a_dVolume24H) )
, QVariant( getFormattedDateTime(a_strLastUpdateTime) )
, a_pParent , a_pParent
) )
{ {
@@ -19,17 +31,19 @@ QmlExchangesListItem::QmlExchangesListItem( const JsonSingleActiveExchange& a_rE
: QmlListItem ( QVariant( a_rExchangeDescription.getImageName() ) : QmlListItem ( QVariant( a_rExchangeDescription.getImageName() )
, QVariant( a_rExchangeDescription.getAccessUrl() ) , QVariant( a_rExchangeDescription.getAccessUrl() )
, QVariant( a_rExchangeDescription.getExchangeName() ) , QVariant( a_rExchangeDescription.getExchangeName() )
, QVariant( GetFormattedPrice( a_rExchangeDescription.getLastBidPriceBTC() ) ) , QVariant( getFormattedPrice( a_rExchangeDescription.getLastBidPriceBTC() ) )
, QVariant( GetFormattedPrice( a_rExchangeDescription.getLastAskPriceBTC() ) ) , QVariant( getFormattedPrice( a_rExchangeDescription.getLastAskPriceBTC() ) )
, QVariant( GetFormattedPrice( a_rExchangeDescription.getLastPriceBTC() ) ) , QVariant( getFormattedPrice( a_rExchangeDescription.getLastPriceBTC() ) )
, QVariant( a_rExchangeDescription.getDescription() ) , QVariant( a_rExchangeDescription.getDescription() )
, QVariant( QString::number(a_rExchangeDescription.getVolume24H()) )
, QVariant( getFormattedDateTime( a_rExchangeDescription.getLastUpdateTime() ) )
, a_pParent , a_pParent
) )
{ {
} }
QmlExchangesListItem::QmlExchangesListItem( QObject* a_pParent ) QmlExchangesListItem::QmlExchangesListItem( QObject* a_pParent )
: QmlListItem( QVariant( "" ), QVariant( "" ), QVariant( "" ), QVariant( "" ), QVariant( "" ), QVariant( "" ), QVariant( "" ), a_pParent ) : QmlListItem( QVariant( "" ), QVariant( "" ), QVariant( "" ), QVariant( "" ), QVariant( "" ), QVariant( "" ), QVariant( "" ), QVariant( "" ), QVariant( "" ), a_pParent )
{ {
} }
@@ -48,10 +62,18 @@ QHash<int, QByteArray> QmlExchangesListItem::RoleNames() const
aRoleNames[ROLE_ASK_PRICE] = "m_askPrice"; aRoleNames[ROLE_ASK_PRICE] = "m_askPrice";
aRoleNames[ROLE_LAST_PRICE] = "m_lastPrice"; aRoleNames[ROLE_LAST_PRICE] = "m_lastPrice";
aRoleNames[ROLE_DESCRIPTION] = "m_description"; aRoleNames[ROLE_DESCRIPTION] = "m_description";
aRoleNames[ROLE_VOLUME24H] = "m_volume24H";
aRoleNames[ROLE_LAST_UPDATE_TIME] = "m_lastUpdateTime";
return aRoleNames; return aRoleNames;
} }
QString QmlExchangesListItem::GetFormattedPrice(double a_dPrice) QString QmlExchangesListItem::getFormattedPrice(double a_dPrice)
{ {
return QString::number( a_dPrice, 'f', 8 ); return QString::number( a_dPrice, 'f', 8 );
} }
QString QmlExchangesListItem::getFormattedDateTime( QString isoDateTime)
{
QDateTime datetime = QDateTime::fromString(isoDateTime, Qt::ISODate);
return datetime.toString("dd-MM-yyyy HH:mm:ss");
}

View File

@@ -16,6 +16,8 @@ public:
, ROLE_ASK_PRICE = ROLE_5 , ROLE_ASK_PRICE = ROLE_5
, ROLE_LAST_PRICE = ROLE_6 , ROLE_LAST_PRICE = ROLE_6
, ROLE_DESCRIPTION = ROLE_7 , ROLE_DESCRIPTION = ROLE_7
, ROLE_VOLUME24H = ROLE_8
, ROLE_LAST_UPDATE_TIME = ROLE_9
}; };
explicit QmlExchangesListItem explicit QmlExchangesListItem
@@ -26,6 +28,8 @@ public:
, double a_dAskPrice , double a_dAskPrice
, double a_dLastPrice , double a_dLastPrice
, QString a_strDescription , QString a_strDescription
, double a_dVolume24H
, QString a_strLastUpdateTime
, QObject *a_pParent = 0 , QObject *a_pParent = 0
); );
explicit QmlExchangesListItem ( const JsonSingleActiveExchange& a_rExchangeDescription explicit QmlExchangesListItem ( const JsonSingleActiveExchange& a_rExchangeDescription
@@ -41,7 +45,8 @@ signals:
public slots: public slots:
private: private:
QString GetFormattedPrice( double a_dPrice ); QString getFormattedPrice( double a_dPrice );
QString getFormattedDateTime( QString isoDateTime);
}; };
#endif // QMLEXCHANGESLISTITEM_H #endif // QMLEXCHANGESLISTITEM_H

View File

@@ -191,6 +191,7 @@ QHash<int, QByteArray> QmlListItem::RoleNames() const
aRoleNames[ROLE_6] = "m_role6"; aRoleNames[ROLE_6] = "m_role6";
aRoleNames[ROLE_7] = "m_role7"; aRoleNames[ROLE_7] = "m_role7";
aRoleNames[ROLE_8] = "m_role8"; aRoleNames[ROLE_8] = "m_role8";
aRoleNames[ROLE_9] = "m_role9";
return aRoleNames; return aRoleNames;
} }

View File

@@ -57,7 +57,7 @@ GUIBannerListView
anchors.fill: id_listElement anchors.fill: id_listElement
onClicked: onClicked:
{ {
id_bannerView.OnClicked( index ) id_bannerView.onClicked( index )
} }
} }
} }

View File

@@ -24,7 +24,7 @@ GUIExchangesControl
anchors.fill: id_ExchangessArea anchors.fill: id_ExchangessArea
Component.onCompleted: Component.onCompleted:
{ {
id_ExchangesControl.InitializeExchangesView( id_ExchangesListView ) id_ExchangesControl.initializeExchangesView( id_ExchangesListView )
} }
} }
} }

View File

@@ -1,5 +1,6 @@
import QtQuick 2.0 import QtQuick 2.2
import CasinoCoinControls 1.0 import CasinoCoinControls 1.0
import QtQuick.Controls 1.4
GUIExchangesListView GUIExchangesListView
{ {
@@ -10,11 +11,17 @@ GUIExchangesListView
property alias m_ListModel: id_listView.model property alias m_ListModel: id_listView.model
property alias m_PathView: id_listView property alias m_PathView: id_listView
ScrollView
{
id: id_ExchangesScrollView
anchors.fill: parent
ListView ListView
{ {
id: id_listView id: id_listView
anchors.fill: id_ExchangesView 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
@@ -22,6 +29,7 @@ GUIExchangesListView
model: id_ExchangesView.p_pListModel model: id_ExchangesView.p_pListModel
delegate: id_elementDelegate delegate: id_elementDelegate
} }
}
Component Component
{ {
@@ -31,8 +39,8 @@ GUIExchangesListView
id: id_listElement id: id_listElement
objectName: id_ExchangesView.objectName + "_Element" + index objectName: id_ExchangesView.objectName + "_Element" + index
width: 400 width: 750
height: 100 height: 125
Row Row
{ {
id: id_row id: id_row
@@ -41,8 +49,8 @@ GUIExchangesListView
{ {
id: id_imageRectangle id: id_imageRectangle
width: id_listElement.width / 3 width: id_listElement.width / 5
height: 80 height: 100
anchors.verticalCenter: id_row.verticalCenter anchors.verticalCenter: id_row.verticalCenter
Image Image
{ {
@@ -58,7 +66,7 @@ GUIExchangesListView
anchors.fill: id_imageRectangle anchors.fill: id_imageRectangle
onClicked: onClicked:
{ {
id_ExchangesView.OnClicked( index ) id_ExchangesView.onClicked( index )
} }
} }
} }
@@ -67,7 +75,7 @@ GUIExchangesListView
id: id_otherInfoRectangle id: id_otherInfoRectangle
width: id_listElement.width - id_imageRectangle.width width: id_listElement.width - id_imageRectangle.width
height: 90 height: 100
anchors.verticalCenter: id_row.verticalCenter anchors.verticalCenter: id_row.verticalCenter
Column Column
{ {
@@ -77,7 +85,7 @@ GUIExchangesListView
{ {
id: id_exchangeNameRectangle id: id_exchangeNameRectangle
width: id_otherInfoRectangle.width width: id_otherInfoRectangle.width
height: id_otherInfoRectangle.height / 3 height: id_otherInfoRectangle.height / 4
Text Text
{ {
id: id_exchangeNameText id: id_exchangeNameText
@@ -89,7 +97,7 @@ GUIExchangesListView
{ {
id: id_pricesRectangle id: id_pricesRectangle
width: id_otherInfoRectangle.width width: id_otherInfoRectangle.width
height: id_otherInfoRectangle.height / 3 height: id_otherInfoRectangle.height / 4
Row Row
{ {
id: id_pricesRow id: id_pricesRow
@@ -97,46 +105,70 @@ GUIExchangesListView
Rectangle Rectangle
{ {
id: id_priceBid id: id_priceBid
width: id_pricesRectangle.width / 3 width: id_pricesRectangle.width / 4
height: id_pricesRectangle.height height: id_pricesRectangle.height
Text Text
{ {
id: id_priceBidText id: id_priceBidText
anchors.fill: id_priceBid anchors.fill: id_priceBid
text: qsTr( m_bidPrice ) text: qsTr("Bid: %1").arg(m_bidPrice)
} }
} }
Rectangle Rectangle
{ {
id: id_priceAsk id: id_priceAsk
width: id_pricesRectangle.width / 3 width: id_pricesRectangle.width / 4
height: id_pricesRectangle.height height: id_pricesRectangle.height
Text Text
{ {
id: id_priceAskText id: id_priceAskText
anchors.fill: id_priceAsk anchors.fill: id_priceAsk
text: qsTr( m_askPrice ) text: qsTr("Ask: %1").arg(m_askPrice)
} }
} }
Rectangle Rectangle
{ {
id: id_priceLast id: id_priceLast
width: id_pricesRectangle.width / 3 width: id_pricesRectangle.width / 4
height: id_pricesRectangle.height height: id_pricesRectangle.height
Text Text
{ {
id: id_priceLastText id: id_priceLastText
anchors.fill: id_priceLast anchors.fill: id_priceLast
text: qsTr( m_lastPrice ) text: qsTr("Last: %1").arg(m_lastPrice)
} }
} }
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
{
id: id_exchangeLastUpdateTime
width: id_otherInfoRectangle.width
height: id_otherInfoRectangle.height / 4
Text
{
id: id_exchangeTime
anchors.fill: id_exchangeLastUpdateTime
text: qsTr( m_lastUpdateTime )
} }
} }
Rectangle Rectangle
{ {
id: id_exchangeLink id: id_exchangeLink
width: id_otherInfoRectangle.width width: id_otherInfoRectangle.width
height: id_otherInfoRectangle.height / 3 height: id_otherInfoRectangle.height / 4
Text Text
{ {
id: id_exchangeLinkText id: id_exchangeLinkText
@@ -148,7 +180,7 @@ GUIExchangesListView
anchors.fill: id_exchangeLinkText anchors.fill: id_exchangeLinkText
onClicked: onClicked:
{ {
id_ExchangesView.OnClicked( index ) id_ExchangesView.onClicked( index )
} }
} }
} }

View File

@@ -3,12 +3,14 @@ import QtQuick 2.2
Rectangle Rectangle
{ {
id: id_root id: id_root
QmlGUIExchangesControl QmlGUIExchangesControl
{ {
id: id_ExchangesControlMain id: id_ExchangesControlMain
} }
width: 500
height: 250
color: GUI20Skin.colorFrameBackground color: GUI20Skin.colorFrameBackground
width: id_ExchangesControlMain.width
height: id_ExchangesControlMain.height
} }