Custom CSCFusionStyle (WIP)
@@ -278,7 +278,8 @@ HEADERS += src/qt/bitcoingui.h \
|
||||
src/qt/qtquick_controls/cpp/guimenutoolbarwidget.h \
|
||||
src/qt/qtquick_controls/cpp/guimenutoolbarlistview.h \
|
||||
src/qt/qtquick_controls/cpp/guimenutoolbarcontrol.h \
|
||||
src/qt/gui20_skin.h
|
||||
src/qt/gui20_skin.h \
|
||||
src/qt/cscfusionstyle.h
|
||||
|
||||
SOURCES += src/qt/bitcoin.cpp \
|
||||
src/qt/bitcoingui.cpp \
|
||||
@@ -367,7 +368,8 @@ SOURCES += src/qt/bitcoin.cpp \
|
||||
src/qt/qtquick_controls/cpp/guimenutoolbarwidget.cpp \
|
||||
src/qt/qtquick_controls/cpp/guimenutoolbarlistview.cpp \
|
||||
src/qt/qtquick_controls/cpp/guimenutoolbarcontrol.cpp \
|
||||
src/qt/gui20_skin.cpp
|
||||
src/qt/gui20_skin.cpp \
|
||||
src/qt/cscfusionstyle.cpp
|
||||
|
||||
RESOURCES += src/qt/bitcoin.qrc
|
||||
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
#include "ui_interface.h"
|
||||
#include "wallet.h"
|
||||
#include "init.h"
|
||||
#include "cscfusionstyle.h"
|
||||
#include "gui20_skin.h"
|
||||
|
||||
#include "qtquick_controls/cpp/guimenutoolbarwidget.h"
|
||||
|
||||
@@ -54,6 +56,7 @@
|
||||
#include <QSettings>
|
||||
#include <QDesktopWidget>
|
||||
#include <QListWidget>
|
||||
#include <QToolTip>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
@@ -163,6 +166,8 @@ BitcoinGUI::BitcoinGUI(QWidget *parent) :
|
||||
|
||||
// Initially wallet actions should be disabled
|
||||
setWalletActionsEnabled(false);
|
||||
|
||||
QApplication::setStyle(new CSCFusionStyle);
|
||||
}
|
||||
|
||||
BitcoinGUI::~BitcoinGUI()
|
||||
|
||||
362
src/qt/cscfusionstyle.cpp
Normal file
@@ -0,0 +1,362 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the examples of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:BSD$
|
||||
** You may use this file under the terms of the BSD license as follows:
|
||||
**
|
||||
** "Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions are
|
||||
** met:
|
||||
** * Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
** * Redistributions in binary form must reproduce the above copyright
|
||||
** notice, this list of conditions and the following disclaimer in
|
||||
** the documentation and/or other materials provided with the
|
||||
** distribution.
|
||||
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
|
||||
** of its contributors may be used to endorse or promote products derived
|
||||
** from this software without specific prior written permission.
|
||||
**
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include <QtWidgets>
|
||||
|
||||
#include "cscfusionstyle.h"
|
||||
#include "gui20_skin.h"
|
||||
|
||||
CSCFusionStyle::CSCFusionStyle() :
|
||||
QProxyStyle(QStyleFactory::create("fusion"))
|
||||
{
|
||||
}
|
||||
|
||||
void CSCFusionStyle::polish(QPalette &palette)
|
||||
{
|
||||
GUI20Skin& skin = GUI20Skin::Instance();
|
||||
QLinearGradient buttonGradient;
|
||||
buttonGradient.setColorAt( 0, skin.GetColorButtonTopGradient() );
|
||||
buttonGradient.setColorAt( 1, skin.GetColorButtonBottomGradient() );
|
||||
|
||||
QLinearGradient toolTipGradient;
|
||||
toolTipGradient.setColorAt( 0, skin.GetColorToolbarMainGradientBegin() );
|
||||
toolTipGradient.setColorAt( 1, skin.GetColorToolbarMainGradientEnd() );
|
||||
|
||||
palette = QPalette();
|
||||
|
||||
|
||||
palette.setBrush( QPalette::Active, QPalette::Text, skin.GetColorTextActive() );
|
||||
palette.setBrush( QPalette::Active, QPalette::BrightText, skin.GetColorTextActiveAutocomplete() );
|
||||
palette.setBrush( QPalette::Active, QPalette::Base, skin.GetColorFrameBackground() );
|
||||
palette.setBrush( QPalette::Active, QPalette::AlternateBase, skin.GetColorListValueAlternative() );
|
||||
palette.setBrush( QPalette::Active, QPalette::Highlight, skin.GetColorListCurrent() );
|
||||
palette.setBrush( QPalette::Active, QPalette::HighlightedText, skin.GetColorTextActive() );
|
||||
palette.setBrush( QPalette::Active, QPalette::Button, skin.GetColorButtonBottomGradient() );
|
||||
palette.setBrush( QPalette::Active, QPalette::ButtonText, skin.GetColorTextActive() );
|
||||
palette.setBrush( QPalette::Active, QPalette::Mid, skin.GetColorButtonMid() );
|
||||
palette.setBrush( QPalette::Active, QPalette::Dark, skin.GetColorButtonDark() );
|
||||
palette.setBrush( QPalette::Active, QPalette::Light, skin.GetColorButtonLight() );
|
||||
palette.setBrush( QPalette::Active, QPalette::Window, skin.GetColorWindowBackground() );
|
||||
|
||||
palette.setBrush( QPalette::Inactive, QPalette::Text, skin.GetColorTextDisabled() );
|
||||
palette.setBrush( QPalette::Inactive, QPalette::BrightText, skin.GetColorTextDisabledAutocomplete() );
|
||||
palette.setBrush( QPalette::Inactive, QPalette::Base, skin.GetColorFrameBackground() );
|
||||
palette.setBrush( QPalette::Inactive, QPalette::AlternateBase, skin.GetColorListValueAlternative() );
|
||||
palette.setBrush( QPalette::Inactive, QPalette::Highlight, skin.GetColorListCurrent() );
|
||||
palette.setBrush( QPalette::Inactive, QPalette::HighlightedText, skin.GetColorTextDisabled() );
|
||||
palette.setBrush( QPalette::Inactive, QPalette::Button, skin.GetColorButtonBottomGradient() );
|
||||
palette.setBrush( QPalette::Inactive, QPalette::ButtonText, skin.GetColorTextDisabled() );
|
||||
palette.setBrush( QPalette::Inactive, QPalette::Mid, skin.GetColorButtonMid() );
|
||||
palette.setBrush( QPalette::Inactive, QPalette::Dark, skin.GetColorButtonDark() );
|
||||
palette.setBrush( QPalette::Inactive, QPalette::Light, skin.GetColorButtonLight() );
|
||||
palette.setBrush( QPalette::Inactive, QPalette::Window, skin.GetColorWindowBackground() );
|
||||
palette.setBrush( QPalette::Inactive, QPalette::ToolTipBase, toolTipGradient );
|
||||
palette.setBrush( QPalette::Inactive, QPalette::ToolTipText, skin.GetColorToolbarMainTextCurrent() );
|
||||
|
||||
palette.setBrush( QPalette::Disabled, QPalette::Text, skin.GetColorTextDisabled() );
|
||||
palette.setBrush( QPalette::Disabled, QPalette::BrightText, skin.GetColorTextDisabledAutocomplete() );
|
||||
palette.setBrush( QPalette::Disabled, QPalette::Base, skin.GetColorFrameBackground() );
|
||||
palette.setBrush( QPalette::Disabled, QPalette::AlternateBase, skin.GetColorListValueAlternative() );
|
||||
palette.setBrush( QPalette::Disabled, QPalette::Highlight, skin.GetColorListCurrent() );
|
||||
palette.setBrush( QPalette::Disabled, QPalette::HighlightedText, skin.GetColorTextDisabled() );
|
||||
palette.setBrush( QPalette::Disabled, QPalette::Button, skin.GetColorButtonBottomGradient() );
|
||||
palette.setBrush( QPalette::Disabled, QPalette::ButtonText, skin.GetColorTextDisabled() );
|
||||
palette.setBrush( QPalette::Disabled, QPalette::Mid, skin.GetColorButtonMid() );
|
||||
palette.setBrush( QPalette::Disabled, QPalette::Dark, skin.GetColorButtonDark() );
|
||||
palette.setBrush( QPalette::Disabled, QPalette::Light, skin.GetColorButtonLight() );
|
||||
palette.setBrush( QPalette::Disabled, QPalette::Window, skin.GetColorWindowBackground() );
|
||||
|
||||
}
|
||||
|
||||
void CSCFusionStyle::polish(QWidget *widget)
|
||||
{
|
||||
if ( qobject_cast<QPushButton *>(widget)
|
||||
|| qobject_cast<QComboBox *>(widget)
|
||||
)
|
||||
{
|
||||
widget->setAttribute(Qt::WA_Hover, true);
|
||||
}
|
||||
}
|
||||
|
||||
void CSCFusionStyle::unpolish(QWidget *widget)
|
||||
{
|
||||
if ( qobject_cast<QPushButton *>(widget)
|
||||
|| qobject_cast<QComboBox *>(widget)
|
||||
)
|
||||
{
|
||||
widget->setAttribute(Qt::WA_Hover, false);
|
||||
}
|
||||
}
|
||||
|
||||
int CSCFusionStyle::pixelMetric(PixelMetric metric,
|
||||
const QStyleOption *option,
|
||||
const QWidget *widget) const
|
||||
{
|
||||
switch (metric)
|
||||
{
|
||||
case PM_DefaultFrameWidth:
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
case PM_ComboBoxFrameWidth:
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
case PM_ScrollBarExtent:
|
||||
{
|
||||
return QProxyStyle::pixelMetric(metric, option, widget) + 4;
|
||||
}
|
||||
case PM_ToolTipLabelFrameWidth:
|
||||
{
|
||||
return 6;
|
||||
}
|
||||
default:
|
||||
{
|
||||
return QProxyStyle::pixelMetric(metric, option, widget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int CSCFusionStyle::styleHint(StyleHint hint, const QStyleOption *option,
|
||||
const QWidget *widget,
|
||||
QStyleHintReturn *returnData) const
|
||||
{
|
||||
switch (hint)
|
||||
{
|
||||
case SH_DitherDisabledText:
|
||||
{
|
||||
return int(false);
|
||||
}
|
||||
case SH_EtchDisabledText:
|
||||
{
|
||||
return int(true);
|
||||
}
|
||||
default:
|
||||
{
|
||||
return QProxyStyle::styleHint(hint, option, widget, returnData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CSCFusionStyle::drawPrimitive(PrimitiveElement element,
|
||||
const QStyleOption *option,
|
||||
QPainter *painter,
|
||||
const QWidget *widget) const
|
||||
{
|
||||
switch (element)
|
||||
{
|
||||
case PE_FrameDefaultButton:
|
||||
{
|
||||
return;
|
||||
}
|
||||
case PE_FrameFocusRect:
|
||||
{
|
||||
return;
|
||||
}
|
||||
case PE_FrameGroupBox:
|
||||
case PE_FrameWindow:
|
||||
case PE_Frame:
|
||||
{
|
||||
int x, y, width, height;
|
||||
option->rect.getRect(&x, &y, &width, &height);
|
||||
|
||||
QPainterPath roundRect = roundRectPath(option->rect, 5);
|
||||
|
||||
QBrush brush = option->palette.base();
|
||||
painter->save();
|
||||
painter->setRenderHint(QPainter::Antialiasing, true);
|
||||
painter->fillPath(roundRect, brush);
|
||||
painter->restore();
|
||||
break;
|
||||
}
|
||||
case PE_PanelButtonCommand:
|
||||
{
|
||||
GUI20Skin& skin = GUI20Skin::Instance();
|
||||
int delta = (option->state & State_MouseOver) ? 64 : 0;
|
||||
QColor semiTransparentWhite = skin.GetColorButtonLight();
|
||||
semiTransparentWhite.setAlpha(127 + delta);
|
||||
QColor semiTransparentBlack = skin.GetColorButtonDark();
|
||||
semiTransparentBlack.setAlpha(127 - delta);
|
||||
|
||||
int x, y, width, height;
|
||||
option->rect.getRect(&x, &y, &width, &height);
|
||||
|
||||
QPainterPath roundRect = roundRectPath(option->rect, 5 );
|
||||
|
||||
int radius = 5;
|
||||
|
||||
QBrush brush;
|
||||
|
||||
if (option->state & (State_Sunken | State_On))
|
||||
{
|
||||
brush = option->palette.mid();
|
||||
}
|
||||
else
|
||||
{
|
||||
brush = option->palette.button();
|
||||
}
|
||||
|
||||
painter->save();
|
||||
painter->setRenderHint(QPainter::Antialiasing, true);
|
||||
painter->fillPath(roundRect, brush);
|
||||
|
||||
int penWidth;
|
||||
if (radius < 10)
|
||||
{
|
||||
penWidth = 3;
|
||||
}
|
||||
else if (radius < 20)
|
||||
{
|
||||
penWidth = 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
penWidth = 7;
|
||||
}
|
||||
|
||||
QPen topPen(semiTransparentWhite, penWidth);
|
||||
QPen bottomPen(semiTransparentBlack, penWidth);
|
||||
|
||||
if (option->state & (State_Sunken | State_On))
|
||||
{
|
||||
qSwap(topPen, bottomPen);
|
||||
}
|
||||
|
||||
int x1 = x;
|
||||
int x2 = x + radius;
|
||||
int x3 = x + width - radius;
|
||||
int x4 = x + width;
|
||||
|
||||
if (option->direction == Qt::RightToLeft)
|
||||
{
|
||||
qSwap(x1, x4);
|
||||
qSwap(x2, x3);
|
||||
}
|
||||
|
||||
QPolygon topHalf;
|
||||
topHalf << QPoint(x1, y)
|
||||
<< QPoint(x4, y)
|
||||
<< QPoint(x3, y + radius)
|
||||
<< QPoint(x2, y + height - radius)
|
||||
<< QPoint(x1, y + height);
|
||||
|
||||
painter->setClipPath(roundRect);
|
||||
painter->setClipRegion(topHalf, Qt::IntersectClip);
|
||||
painter->setPen(topPen);
|
||||
painter->drawPath(roundRect);
|
||||
|
||||
QPolygon bottomHalf = topHalf;
|
||||
bottomHalf[0] = QPoint(x4, y + height);
|
||||
|
||||
painter->setClipPath(roundRect);
|
||||
painter->setClipRegion(bottomHalf, Qt::IntersectClip);
|
||||
painter->setPen(bottomPen);
|
||||
painter->drawPath(roundRect);
|
||||
|
||||
painter->setPen(option->palette.foreground().color());
|
||||
painter->setClipping(false);
|
||||
painter->drawPath(roundRect);
|
||||
|
||||
painter->restore();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
QProxyStyle::drawPrimitive(element, option, painter, widget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CSCFusionStyle::drawControl(ControlElement element,
|
||||
const QStyleOption *option,
|
||||
QPainter *painter,
|
||||
const QWidget *widget) const
|
||||
{
|
||||
switch (element)
|
||||
{
|
||||
case CE_PushButtonLabel:
|
||||
{
|
||||
QStyleOptionButton myButtonOption;
|
||||
const QStyleOptionButton *buttonOption =
|
||||
qstyleoption_cast<const QStyleOptionButton *>(option);
|
||||
if (buttonOption)
|
||||
{
|
||||
myButtonOption = *buttonOption;
|
||||
if (myButtonOption.palette.currentColorGroup() != QPalette::Disabled)
|
||||
{
|
||||
if (myButtonOption.state & (State_Sunken | State_On))
|
||||
{
|
||||
myButtonOption.palette.setBrush(QPalette::ButtonText,
|
||||
myButtonOption.palette.brightText());
|
||||
}
|
||||
}
|
||||
}
|
||||
QProxyStyle::drawControl(element, &myButtonOption, painter, widget);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
QProxyStyle::drawControl(element, option, painter, widget);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QPainterPath CSCFusionStyle::roundRectPath(const QRect &rect, int radius)
|
||||
{
|
||||
int diam = 2 * radius;
|
||||
|
||||
int x1, y1, x2, y2;
|
||||
rect.getCoords(&x1, &y1, &x2, &y2);
|
||||
|
||||
QPainterPath path;
|
||||
path.moveTo(x2, y1 + radius);
|
||||
path.arcTo(QRect(x2 - diam, y1, diam, diam), 0.0, +90.0);
|
||||
path.lineTo(x1 + radius, y1);
|
||||
path.arcTo(QRect(x1, y1, diam, diam), 90.0, +90.0);
|
||||
path.lineTo(x1, y2 - radius);
|
||||
path.arcTo(QRect(x1, y2 - diam, diam, diam), 180.0, +90.0);
|
||||
path.lineTo(x1 + radius, y2);
|
||||
path.arcTo(QRect(x2 - diam, y2 - diam, diam, diam), 270.0, +90.0);
|
||||
path.closeSubpath();
|
||||
return path;
|
||||
}
|
||||
//! [40]
|
||||
|
||||
77
src/qt/cscfusionstyle.h
Normal file
@@ -0,0 +1,77 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the examples of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:BSD$
|
||||
** You may use this file under the terms of the BSD license as follows:
|
||||
**
|
||||
** "Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions are
|
||||
** met:
|
||||
** * Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
** * Redistributions in binary form must reproduce the above copyright
|
||||
** notice, this list of conditions and the following disclaimer in
|
||||
** the documentation and/or other materials provided with the
|
||||
** distribution.
|
||||
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
|
||||
** of its contributors may be used to endorse or promote products derived
|
||||
** from this software without specific prior written permission.
|
||||
**
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef CSCFUSIONSTYLE_H
|
||||
#define CSCFUSIONSTYLE_H
|
||||
|
||||
#include <QProxyStyle>
|
||||
#include <QPalette>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QPainterPath;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
//! [0]
|
||||
class CSCFusionStyle : public QProxyStyle
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CSCFusionStyle();
|
||||
|
||||
void polish(QPalette &palette) Q_DECL_OVERRIDE;
|
||||
void polish(QWidget *widget) Q_DECL_OVERRIDE;
|
||||
void unpolish(QWidget *widget) Q_DECL_OVERRIDE;
|
||||
int pixelMetric(PixelMetric metric, const QStyleOption *option,
|
||||
const QWidget *widget) const Q_DECL_OVERRIDE;
|
||||
int styleHint(StyleHint hint, const QStyleOption *option,
|
||||
const QWidget *widget, QStyleHintReturn *returnData) const Q_DECL_OVERRIDE;
|
||||
void drawPrimitive(PrimitiveElement element, const QStyleOption *option,
|
||||
QPainter *painter, const QWidget *widget) const Q_DECL_OVERRIDE;
|
||||
void drawControl(ControlElement control, const QStyleOption *option,
|
||||
QPainter *painter, const QWidget *widget) const Q_DECL_OVERRIDE;
|
||||
|
||||
private:
|
||||
static QPainterPath roundRectPath(const QRect &rect, int radius);
|
||||
|
||||
};
|
||||
//! [0]
|
||||
|
||||
#endif
|
||||
@@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>760</width>
|
||||
<width>993</width>
|
||||
<height>380</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -24,34 +24,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTableView" name="tableView">
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Double-click to edit address or label</string>
|
||||
</property>
|
||||
<property name="tabKeyNavigation">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::SingleSelection</enum>
|
||||
</property>
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
</property>
|
||||
<property name="sortingEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="verticalHeaderVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
@@ -177,6 +149,34 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTableView" name="tableView">
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Double-click to edit address or label</string>
|
||||
</property>
|
||||
<property name="tabKeyNavigation">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::SingleSelection</enum>
|
||||
</property>
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
</property>
|
||||
<property name="sortingEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="verticalHeaderVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
|
||||
@@ -31,11 +31,11 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,0">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QFrame" name="frame">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>470</width>
|
||||
@@ -48,59 +48,7 @@
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Wallet</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="labelWalletStatus">
|
||||
<property name="toolTip">
|
||||
<string>The displayed information may be out of date. Your wallet automatically synchronizes with the CasinoCoin network after a connection is established, but this process has not completed yet.</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QLabel { color: red; }</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">(out of sync)</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QFormLayout" name="formLayout_2">
|
||||
<property name="fieldGrowthPolicy">
|
||||
@@ -112,17 +60,18 @@
|
||||
<property name="verticalSpacing">
|
||||
<number>12</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="labelBalanceText">
|
||||
<property name="text">
|
||||
<string>Balance:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="labelBalance">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>14</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
@@ -144,14 +93,14 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="labelUnconfirmedText">
|
||||
<property name="text">
|
||||
<string>Unconfirmed:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<item row="2" column="1">
|
||||
<widget class="QLabel" name="labelUnconfirmed">
|
||||
<property name="font">
|
||||
<font>
|
||||
@@ -176,14 +125,14 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="labelImmatureText">
|
||||
<property name="text">
|
||||
<string>Immature:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<item row="3" column="1">
|
||||
<widget class="QLabel" name="labelImmature">
|
||||
<property name="font">
|
||||
<font>
|
||||
@@ -205,7 +154,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="QWidget" name="widgetBuyCSCButton" native="true">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
@@ -215,7 +164,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<item row="5" column="0" colspan="2">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
@@ -228,13 +177,13 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<item row="6" column="0" colspan="2">
|
||||
<widget class="QPushButton" name="pushButtonToggleAdverts">
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Hide all advertisements (temporary)</string>
|
||||
<string>Hide all advertisements</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>false</bool>
|
||||
@@ -247,9 +196,59 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0" colspan="2">
|
||||
<item row="7" column="0" colspan="2">
|
||||
<layout class="QVBoxLayout" name="verticalLayoutAdvertWidget"/>
|
||||
</item>
|
||||
<item row="0" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>14</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>Wallet</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="labelWalletStatus">
|
||||
<property name="toolTip">
|
||||
<string>The displayed information may be out of date. Your wallet automatically synchronizes with the CasinoCoin network after a connection is established, but this process has not completed yet.</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: rgb(166, 27, 31);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">(out of sync)</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
@@ -260,42 +259,28 @@
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QFrame" name="frame_2">
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>150</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Plain</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string><b>Recent transactions</b></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="labelTransactionsStatus">
|
||||
<property name="toolTip">
|
||||
<string>The displayed information may be out of date. Your wallet automatically synchronizes with the CasinoCoin network after a connection is established, but this process has not completed yet.</string>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>14</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QLabel { color: red; }</string>
|
||||
<string notr="true">color: rgb(166, 27, 31);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">(out of sync)</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
<string><b>Recent transactions</b></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -312,6 +297,22 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="labelTransactionsStatus">
|
||||
<property name="toolTip">
|
||||
<string>The displayed information may be out of date. Your wallet automatically synchronizes with the CasinoCoin network after a connection is established, but this process has not completed yet.</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">color: rgb(166, 27, 31);</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">(out of sync)</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
@@ -336,19 +337,6 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<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>
|
||||
</item>
|
||||
</layout>
|
||||
|
||||
@@ -13,8 +13,20 @@ GUI20Skin::GUI20Skin( QObject* a_pParent )
|
||||
, colorToolbarMainTextVisitWebsite( "#ffffaf" )
|
||||
|
||||
, colorToolbarMainTextShadow( "#c72427" )
|
||||
, colorMainWindowBackground( "#afafaf" )
|
||||
, colorMainWindowFrameBackground( "#ffffff" )
|
||||
, colorWindowBackground( "#f0f0f0" )
|
||||
, colorFrameBackground( "#ffffff" )
|
||||
, colorButtonTopGradient( colorFrameBackground )
|
||||
, colorButtonBottomGradient( "#F2F2F2" )
|
||||
, colorButtonMid( "#F8F8F8" )
|
||||
, colorButtonDark( colorButtonBottomGradient )
|
||||
, colorButtonLight( colorFrameBackground )
|
||||
, colorListCurrent( "#F5E5E5" )
|
||||
, colorListValue( colorFrameBackground )
|
||||
, colorListValueAlternative( "#F5F5F5" )
|
||||
, colorTextActive( "#404040" )
|
||||
, colorTextActiveAutocomplete( "#6B3D3D" )
|
||||
, colorTextDisabled( "#707070" )
|
||||
, colorTextDisabledAutocomplete( "#8B5D5D" )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -23,6 +23,23 @@ class GUI20Skin : public QObject
|
||||
Q_PROPERTY( QColor colorToolbarMainTextWebsiteURL READ GetColorToolbarMainTextWebsiteURL CONSTANT )
|
||||
Q_PROPERTY( QColor colorToolbarMainTextVisitWebsite READ GetColorToolbarMainTextVisitWebsite CONSTANT )
|
||||
|
||||
Q_PROPERTY( QColor colorWindowBackground READ GetColorWindowBackground CONSTANT )
|
||||
Q_PROPERTY( QColor colorFrameBackground READ GetColorFrameBackground CONSTANT )
|
||||
|
||||
Q_PROPERTY( QColor colorButtonTopGradient READ GetColorButtonTopGradient CONSTANT )
|
||||
Q_PROPERTY( QColor colorButtonBottomGradient READ GetColorButtonBottomGradient CONSTANT )
|
||||
Q_PROPERTY( QColor colorButtonMid READ GetColorButtonMid CONSTANT )
|
||||
Q_PROPERTY( QColor colorButtonDark READ GetColorButtonDark CONSTANT )
|
||||
Q_PROPERTY( QColor colorButtonLight READ GetColorButtonLight CONSTANT )
|
||||
|
||||
Q_PROPERTY( QColor colorListCurrent READ GetColorListCurrent CONSTANT )
|
||||
Q_PROPERTY( QColor colorListValue READ GetColorListValue CONSTANT )
|
||||
Q_PROPERTY( QColor colorListValueAlternative READ GetColorListValueAlternative CONSTANT )
|
||||
|
||||
Q_PROPERTY( QColor colorTextActive READ GetColorTextActive CONSTANT )
|
||||
Q_PROPERTY( QColor colorTextActiveAutocomplete READ GetColorTextActiveAutocomplete CONSTANT )
|
||||
Q_PROPERTY( QColor colorTextDisabled READ GetColorTextDisabled CONSTANT )
|
||||
Q_PROPERTY( QColor colorTextDisabledAutocomplete READ GetColorTextDisabledAutocomplete CONSTANT )
|
||||
|
||||
Q_ENUMS( ESizeConstants )
|
||||
|
||||
@@ -45,6 +62,22 @@ public:
|
||||
const QColor GetColorToolbarMainTextShadow() const {return colorToolbarMainTextShadow;}
|
||||
const QColor GetColorToolbarMainTextWebsiteURL() const {return colorToolbarMainTextWebsiteURL;}
|
||||
const QColor GetColorToolbarMainTextVisitWebsite() const {return colorToolbarMainTextVisitWebsite;}
|
||||
|
||||
const QColor GetColorButtonTopGradient() const {return colorButtonTopGradient;}
|
||||
const QColor GetColorButtonBottomGradient() const {return colorButtonBottomGradient;}
|
||||
const QColor GetColorButtonMid() const {return colorButtonMid;}
|
||||
const QColor GetColorButtonDark() const {return colorButtonDark;}
|
||||
const QColor GetColorButtonLight() const {return colorButtonLight;}
|
||||
|
||||
const QColor GetColorListCurrent() const {return colorListCurrent;}
|
||||
const QColor GetColorListValue() const {return colorListValue;}
|
||||
const QColor GetColorListValueAlternative() const {return colorListValueAlternative;}
|
||||
|
||||
const QColor GetColorTextActive() const {return colorTextActive;}
|
||||
const QColor GetColorTextActiveAutocomplete() const {return colorTextActiveAutocomplete;}
|
||||
const QColor GetColorTextDisabled() const {return colorTextDisabled;}
|
||||
const QColor GetColorTextDisabledAutocomplete() const {return colorTextDisabledAutocomplete;}
|
||||
|
||||
private:
|
||||
const QColor colorToolbarMainGradientBegin;
|
||||
const QColor colorToolbarMainGradientEnd;
|
||||
@@ -58,8 +91,23 @@ private:
|
||||
const QColor colorToolbarMainTextWebsiteURL;
|
||||
const QColor colorToolbarMainTextVisitWebsite;
|
||||
|
||||
const QColor colorMainWindowBackground;
|
||||
const QColor colorMainWindowFrameBackground;
|
||||
const QColor colorWindowBackground;
|
||||
const QColor colorFrameBackground;
|
||||
|
||||
const QColor colorButtonTopGradient;
|
||||
const QColor colorButtonBottomGradient;
|
||||
const QColor colorButtonMid;
|
||||
const QColor colorButtonDark;
|
||||
const QColor colorButtonLight;
|
||||
|
||||
const QColor colorListCurrent;
|
||||
const QColor colorListValue;
|
||||
const QColor colorListValueAlternative;
|
||||
|
||||
const QColor colorTextActive;
|
||||
const QColor colorTextActiveAutocomplete;
|
||||
const QColor colorTextDisabled;
|
||||
const QColor colorTextDisabledAutocomplete;
|
||||
|
||||
public:
|
||||
static GUI20Skin& Instance();
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
|
||||
#include <QHBoxLayout>
|
||||
#include <QCheckBox>
|
||||
#include <QtQuick/QQuickView>
|
||||
#include <QQuickView>
|
||||
#include <QQmlContext>
|
||||
|
||||
#include "gui20_skin.h"
|
||||
|
||||
// qml
|
||||
#include "guibannercontrol.h"
|
||||
@@ -43,8 +46,7 @@ void GUIBannerWidget::registerCustomQmlTypes()
|
||||
QWidget* GUIBannerWidget::dockQmlToWidget()
|
||||
{
|
||||
QQuickView* pBannerWindow = new QQuickView;
|
||||
QWidget* pPlaceHolder = 0;
|
||||
if ( pBannerWindow )
|
||||
QQmlContext* pContext = pBannerWindow->rootContext();
|
||||
{
|
||||
pBannerWindow->setSource( QUrl( QStringLiteral( "qrc:/qml/qtquick_controls/qml/QmlGUIBannerWindow.qml" ) ) );
|
||||
QQmlEngine* pEngine = pBannerWindow->engine();
|
||||
|
||||
@@ -5,7 +5,7 @@ GUIBannerControl
|
||||
{
|
||||
id: id_bannerControl
|
||||
|
||||
property color colorBackgroundInWidget: "#FFFFFF"
|
||||
property color colorBackgroundInWidget: GUI20Skin.colorWindowBackground
|
||||
Rectangle
|
||||
{
|
||||
id: id_leftArrow
|
||||
|
||||
BIN
src/qt/res/icons/_0001_Remove-user-icon.png
Normal file
|
After Width: | Height: | Size: 463 B |
BIN
src/qt/res/icons/_0001_sign-icon.png
Normal file
|
After Width: | Height: | Size: 322 B |
BIN
src/qt/res/icons/_0002_logo bottom.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 179 B |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 207 B |
BIN
src/qt/res/icons/buy-casinocoins-btn.png
Normal file
|
After Width: | Height: | Size: 521 B |
|
Before Width: | Height: | Size: 702 B After Width: | Height: | Size: 338 B |
|
Before Width: | Height: | Size: 673 B After Width: | Height: | Size: 312 B |
|
Before Width: | Height: | Size: 879 B After Width: | Height: | Size: 232 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 245 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 286 B |
|
Before Width: | Height: | Size: 237 B After Width: | Height: | Size: 256 B |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 134 B |
|
Before Width: | Height: | Size: 413 B After Width: | Height: | Size: 343 B |
@@ -72,7 +72,7 @@ WalletView::WalletView(QWidget *parent, BitcoinGUI *_gui):
|
||||
addWidget(sendCoinsPage);
|
||||
|
||||
// Clicking on a transaction on the overview page simply sends you to transaction history page
|
||||
connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), this, SLOT(gotoHistoryPage()));
|
||||
connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), gui->getHistoryAction(), SIGNAL(triggered()));
|
||||
connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex)));
|
||||
|
||||
// Double-clicking on a transaction on the transaction history page shows details
|
||||
|
||||