Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions gridcoinresearch.pro
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@ HEADERS += src/qt/bitcoingui.h \
src/backup.h \
src/appcache.h \
src/grcrestarter.h \
src/qt/clicklabel.h
src/qt/clicklabel.h \
src/qt/noresult.h


SOURCES += src/qt/bitcoin.cpp src/qt/bitcoingui.cpp \
Expand Down Expand Up @@ -368,7 +369,8 @@ SOURCES += src/qt/bitcoin.cpp src/qt/bitcoingui.cpp \
src/backup.cpp \
src/appcache.cpp \
src/grcrestarter.cpp \
src/qt/clicklabel.cpp
src/qt/clicklabel.cpp \
src/qt/noresult.cpp

##
#RC_FILE = qaxserver.rc
Expand All @@ -379,6 +381,7 @@ RESOURCES += \

FORMS += \
src/qt/forms/coincontroldialog.ui \
src/qt/forms/noresult.ui \
src/qt/forms/researcherwizard.ui \
src/qt/forms/researcherwizardauthpage.ui \
src/qt/forms/researcherwizardbeaconpage.ui \
Expand Down
5 changes: 5 additions & 0 deletions src/Makefile.qt.include
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ QT_FORMS_UI = \
qt/forms/signverifymessagedialog.ui \
qt/forms/addressbookpage.ui \
qt/forms/editaddressdialog.ui \
qt/forms/noresult.ui \
qt/forms/overviewpage.ui \
qt/forms/receivecoinspage.ui \
qt/forms/researcherwizard.ui \
Expand Down Expand Up @@ -130,6 +131,7 @@ QT_MOC_CPP = \
qt/moc_macdockiconhandler.cpp \
qt/moc_macnotificationhandler.cpp \
qt/moc_monitoreddatamapper.cpp \
qt/moc_noresult.cpp \
qt/moc_notificator.cpp \
qt/moc_optionsdialog.cpp \
qt/moc_optionsmodel.cpp \
Expand Down Expand Up @@ -209,6 +211,7 @@ GRIDCOINRESEARCH_QT_H = \
qt/macnotificationhandler.h \
qt/macos_appnap.h \
qt/monitoreddatamapper.h \
qt/noresult.h \
qt/notificator.h \
qt/optionsdialog.h \
qt/optionsmodel.h \
Expand Down Expand Up @@ -273,6 +276,7 @@ GRIDCOINRESEARCH_QT_CPP = \
qt/guiutil.cpp \
qt/intro.cpp \
qt/monitoreddatamapper.cpp \
qt/noresult.cpp \
qt/notificator.cpp \
qt/optionsdialog.cpp \
qt/optionsmodel.cpp \
Expand Down Expand Up @@ -343,6 +347,7 @@ RES_ICONS = \
qt/res/icons/menu.svg \
qt/res/icons/menu_active.svg \
qt/res/icons/message.svg \
qt/res/icons/no_result.svg \
qt/res/icons/qrcode.png \
qt/res/icons/quit.png \
qt/res/icons/remove.png \
Expand Down
1 change: 1 addition & 0 deletions src/qt/bitcoin.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@
<file alias="dark_mode_active">res/icons/dark_mode_active.svg</file>
<file alias="light_mode">res/icons/light_mode.svg</file>
<file alias="light_mode_active">res/icons/light_mode_active.svg</file>
<file alias="no_result">res/icons/no_result.svg</file>

</qresource>
<qresource prefix="/images">
Expand Down
66 changes: 66 additions & 0 deletions src/qt/forms/noresult.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>NoResult</class>
<widget class="QWidget" name="NoResult">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout" stretch="50,0,0,100">
<property name="spacing">
<number>16</number>
</property>
<item>
<spacer name="topSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item alignment="Qt::AlignHCenter">
<widget class="QLabel" name="iconLabel"/>
</item>
<item alignment="Qt::AlignHCenter">
<widget class="QLabel" name="titleLabel">
<property name="text">
<string>Nothing here yet...</string>
</property>
</widget>
</item>
<item>
<spacer name="bottomSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
16 changes: 16 additions & 0 deletions src/qt/forms/overviewpage.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,16 @@
</property>
</widget>
</item>
<item>
<widget class="NoResult" name="recentTransactionsNoResult" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>100</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QListView" name="listTransactions">
<property name="sizePolicy">
Expand Down Expand Up @@ -1077,6 +1087,12 @@
<extends>QLabel</extends>
<header>clicklabel.h</header>
</customwidget>
<customwidget>
<class>NoResult</class>
<extends>QWidget</extends>
<header>noresult.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
Expand Down
47 changes: 47 additions & 0 deletions src/qt/noresult.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Copyright (c) 2014-2021 The Gridcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "qt/decoration.h"
#include "qt/forms/ui_noresult.h"
#include "qt/noresult.h"

NoResult::NoResult(QWidget *parent)
: QWidget(parent)
, ui(new Ui::NoResult)
, m_content_widget(nullptr)
{
ui->setupUi(this);

GRC::ScaleFontPointSize(ui->titleLabel, 13);
}

NoResult::~NoResult()
{
delete ui;
}

QWidget* NoResult::contentWidget()
{
return m_content_widget;
}

void NoResult::setTitle(const QString& title)
{
ui->titleLabel->setText(title);
}

void NoResult::setContentWidget(QWidget* widget)
{
if (m_content_widget != nullptr) {
ui->verticalLayout->removeWidget(m_content_widget);
}

m_content_widget = widget;

if (widget != nullptr) {
// Insert the widget above the bottom spacer:
const int index = ui->verticalLayout->count() - 1;
ui->verticalLayout->insertWidget(index, widget, 0, Qt::AlignHCenter);
}
}
33 changes: 33 additions & 0 deletions src/qt/noresult.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright (c) 2014-2021 The Gridcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifndef NORESULT_H
#define NORESULT_H

#include <QWidget>

namespace Ui {
class NoResult;
}

class NoResult : public QWidget
{
Q_OBJECT

public:
explicit NoResult(QWidget *parent = nullptr);
~NoResult();

QWidget* contentWidget();

public slots:
void setTitle(const QString& title);
void setContentWidget(QWidget* widget);

private:
Ui::NoResult *ui;
QWidget* m_content_widget;
};

#endif // NORESULT_H
10 changes: 10 additions & 0 deletions src/qt/overviewpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,16 @@ void OverviewPage::updateTransactions()
{
int numItems = getNumTransactionsForView();

// When we receive our first transaction, we can free the memory used
// for the "nothing here yet" placeholder in the transaction list. It
// will never appear again:
//
if (numItems > 0)
{
delete ui->recentTransactionsNoResult;
ui->recentTransactionsNoResult = nullptr;
}

LogPrint(BCLog::LogFlags::QT, "OverviewPage::updateTransactions(): numItems = %d, getLimit() = %d", numItems, filter->getLimit());

// This is a "stairstep" approach, using x3 to x6 factors to size the setLimit.
Expand Down
3 changes: 3 additions & 0 deletions src/qt/res/icons/no_result.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions src/qt/res/stylesheets/dark_stylesheet.qss
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,19 @@ QStatusBar QToolTip {
max-height:9.225em;
}

NoResult #iconLabel {
image: url(:/icons/no_result);
min-width: 2em;
max-width: 2em;
min-height: 2em;
max-height: 2em;
}

NoResult #titleLabel {
color: rgba(204, 208, 209, 0.6);
font-weight: 500;
}

#headerFrame {
background: none;
border-bottom: 0.065em solid rgb(18, 26, 34);
Expand Down
13 changes: 13 additions & 0 deletions src/qt/res/stylesheets/light_stylesheet.qss
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,19 @@ QStatusBar .QFrame QLabel {
max-height:9.225em;
}

NoResult #iconLabel {
image: url(:/icons/no_result);
min-width: 2em;
max-width: 2em;
min-height: 2em;
max-height: 2em;
}

NoResult #titleLabel {
color: rgba(58, 70, 93, 0.6);
font-weight: 500;
}

#headerFrame {
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 rgb(240, 240, 240), stop: 0.1 rgb(255, 255, 255));
border-bottom: 0.065em solid rgb(230, 230, 230);
Expand Down