Merge pull request #2230 from defnax/graphframe-darkmode-v2

Added Dark theme for the graphframe
This commit is contained in:
csoler 2021-01-18 21:57:53 +01:00 committed by GitHub
commit 8a506fad9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 409 additions and 173 deletions

View File

@ -378,6 +378,7 @@ MainWindow::~MainWindow()
delete trayIcon;
delete notifyMenu;//notifyMenu belongs to trayMenu
delete trayMenu;
StatisticsWindow::releaseInstance();
#ifdef MESSENGER_WINDOW
MessengerWindow::releaseInstance();
#endif

View File

@ -345,7 +345,11 @@ void RSGraphWidget::paintEvent(QPaintEvent *)
_painter->setRenderHint(QPainter::TextAntialiasing);
/* Fill in the background */
_painter->fillRect(_rec, QBrush(BACK_COLOR));
if (_flags & RSGRAPH_FLAGS_DARK_STYLE){
_painter->fillRect(_rec, QBrush(BACK_COLOR_DARK));
}else {
_painter->fillRect(_rec, QBrush(BACK_COLOR));
}
_painter->drawRect(_rec);
/* Paint the scale */
@ -649,10 +653,17 @@ void RSGraphWidget::paintScale1()
QString text = _source->displayValue(scale) ;
_painter->setPen(SCALE_COLOR);
_painter->drawText(QPointF(SCALE_WIDTH*fact - QFontMetricsF(font()).width(text) - 4*fact, pos+0.4*FS), text);
_painter->setPen(GRID_COLOR);
_painter->drawLine(QPointF(SCALE_WIDTH*fact, pos), QPointF(_rec.width(), pos));
if (_flags & RSGRAPH_FLAGS_DARK_STYLE){
_painter->setPen(SCALE_COLOR_DARK);
_painter->drawText(QPointF(SCALE_WIDTH*fact - QFontMetricsF(font()).width(text) - 4*fact, pos+0.4*FS), text);
_painter->setPen(GRID_COLOR_DARK);
_painter->drawLine(QPointF(SCALE_WIDTH*fact, pos), QPointF(_rec.width(), pos));
}else{
_painter->setPen(SCALE_COLOR);
_painter->drawText(QPointF(SCALE_WIDTH*fact - QFontMetricsF(font()).width(text) - 4*fact, pos+0.4*FS), text);
_painter->setPen(GRID_COLOR);
_painter->drawLine(QPointF(SCALE_WIDTH*fact, pos), QPointF(_rec.width(), pos));
}
}
/* Draw vertical separator */
@ -675,8 +686,10 @@ void RSGraphWidget::paintScale2()
int seconds = (_rec.width()-i)/_time_scale ; // pixels / (pixels per second) => seconds
QString text = QString::number(seconds)+ " secs";
_painter->setPen(SCALE_COLOR);
if (_flags & RSGRAPH_FLAGS_DARK_STYLE)
_painter->setPen(SCALE_COLOR_DARK);
else
_painter->setPen(SCALE_COLOR);
_painter->drawText(QPointF(i, _rec.height()-0.5*FS), text);
}
}
@ -743,8 +756,10 @@ void RSGraphWidget::paintLegend()
_painter->setPen(pen);
_painter->drawLine(QPointF(SCALE_WIDTH*fact+10.0*fact, pos+FS/3), QPointF(SCALE_WIDTH*fact+30.0*fact, pos+FS/3));
_painter->setPen(oldPen);
_painter->setPen(SCALE_COLOR);
if (_flags & RSGRAPH_FLAGS_DARK_STYLE)
_painter->setPen(SCALE_COLOR_DARK);
else
_painter->setPen(SCALE_COLOR);
_painter->drawText(QPointF(SCALE_WIDTH *fact+ 40*fact,pos + 0.5*FS), text) ;
++j ;

View File

@ -36,11 +36,14 @@
#define MINUSER_SCALE 2000 /** 2000 users is the minimum scale */
#define SCROLL_STEP 4 /** Horizontal change on graph update */
#define BACK_COLOR Qt::white
#define SCALE_COLOR Qt::black
#define GRID_COLOR Qt::lightGray
#define RSDHT_COLOR Qt::magenta
#define ALLDHT_COLOR Qt::yellow
#define BACK_COLOR Qt::white
#define SCALE_COLOR Qt::black
#define GRID_COLOR Qt::lightGray
#define BACK_COLOR_DARK Qt::black
#define SCALE_COLOR_DARK Qt::green
#define GRID_COLOR_DARK Qt::darkGreen
#define RSDHT_COLOR Qt::magenta
#define ALLDHT_COLOR Qt::yellow
struct ZeroInitFloat
{
@ -145,6 +148,7 @@ public:
static const uint32_t RSGRAPH_FLAGS_LEGEND_CUMULATED = 0x0040 ;// show the total in the legend rather than current values
static const uint32_t RSGRAPH_FLAGS_PAINT_STYLE_DOTS = 0x0080 ;// use dots
static const uint32_t RSGRAPH_FLAGS_LEGEND_INTEGER = 0x0100 ;// use integer number in the legend, and move the lines to match integers
static const uint32_t RSGRAPH_FLAGS_DARK_STYLE = 0x0200 ;// darkstyle graph
/** Bandwidth graph style. */
enum GraphStyle

View File

@ -53,6 +53,7 @@
<file>icons/gmail.png</file>
<file>icons/help_128.png</file>
<file>icons/help_64.png</file>
<file>icons/identities.png</file>
<file>icons/information_128.png</file>
<file>icons/internet_128.png</file>
<file>icons/invite64.png</file>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@ -602,6 +602,6 @@ BWGraph::BWGraph(QWidget *parent) : RSGraphWidget(parent)
BWGraph::~BWGraph()
{
delete _local_source ;
//delete _local_source ;//Will be deleted by RSGraphWidget destructor
}

View File

@ -34,10 +34,12 @@
#define SETTING_OPACITY "Opacity"
#define SETTING_ALWAYS_ON_TOP "AlwaysOnTop"
#define SETTING_STYLE "GraphStyle"
#define SETTING_GRAPHCOLOR "GraphColor"
#define DEFAULT_FILTER (BWGRAPH_LINE_SEND|BWGRAPH_LINE_RECV)
#define DEFAULT_ALWAYS_ON_TOP false
#define DEFAULT_OPACITY 100
#define DEFAULT_STYLE LineGraph
#define DEFAULT_GRAPHCOLOR DefaultColor
#define ADD_TO_FILTER(f,v,b) (f = ((b) ? ((f) | (v)) : ((f) & ~(v))))
@ -132,6 +134,19 @@ BandwidthGraph::loadSettings()
ui.frmGraph->resetFlags(RSGraphWidget::RSGRAPH_FLAGS_PAINT_STYLE_PLAIN);
else
ui.frmGraph->setFlags(RSGraphWidget::RSGRAPH_FLAGS_PAINT_STYLE_PLAIN);
/* Set whether we are plotting bandwidth as area graphs or not */
int graphColor = getSetting(SETTING_GRAPHCOLOR, DEFAULT_GRAPHCOLOR).toInt();
if (graphColor < 0 || graphColor >= ui.cmbGraphColor->count()) {
graphColor = DEFAULT_GRAPHCOLOR;
}
ui.cmbGraphColor->setCurrentIndex(graphColor);
if(graphColor==0)
ui.frmGraph->resetFlags(RSGraphWidget::RSGRAPH_FLAGS_DARK_STYLE);
else
ui.frmGraph->setFlags(RSGraphWidget::RSGRAPH_FLAGS_DARK_STYLE);
/* Set graph frame settings */
ui.frmGraph->setShowEntry(0,ui.chkReceiveRate->isChecked()) ;
@ -158,6 +173,7 @@ void BandwidthGraph::saveChanges()
/* Save the opacity and graph style */
saveSetting(SETTING_OPACITY, ui.sldrOpacity->value());
saveSetting(SETTING_STYLE, ui.cmbGraphStyle->currentIndex());
saveSetting(SETTING_GRAPHCOLOR, ui.cmbGraphColor->currentIndex());
/* Save the Always On Top setting */
saveSetting(SETTING_ALWAYS_ON_TOP, ui.chkAlwaysOnTop->isChecked());
@ -184,6 +200,11 @@ void BandwidthGraph::saveChanges()
else
ui.frmGraph->setFlags(RSGraphWidget::RSGRAPH_FLAGS_PAINT_STYLE_PLAIN);
if(ui.cmbGraphColor->currentIndex()==0)
ui.frmGraph->resetFlags(RSGraphWidget::RSGRAPH_FLAGS_DARK_STYLE);
else
ui.frmGraph->setFlags(RSGraphWidget::RSGRAPH_FLAGS_DARK_STYLE);
/* A change in window flags causes the window to disappear, so make sure
* it's still visible. */
showNormal();

View File

@ -40,6 +40,7 @@ class BandwidthGraph : public RWindow
public:
enum { AreaGraph=0,LineGraph=1 } ;
enum { DefaultColor=0,DarkColor=1 } ;
/** Default constructor */
BandwidthGraph(QWidget *parent = 0, Qt::WindowFlags flags = 0);

View File

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>414</width>
<width>418</width>
<height>305</height>
</rect>
</property>
@ -24,7 +24,16 @@
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
@ -69,13 +78,13 @@
</property>
<property name="minimumSize">
<size>
<width>355</width>
<width>400</width>
<height>82</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>355</width>
<width>400</width>
<height>82</height>
</size>
</property>
@ -88,19 +97,34 @@
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<layout class="QGridLayout" name="gridLayout_2">
<property name="leftMargin">
<number>9</number>
</property>
<item>
<property name="topMargin">
<number>9</number>
</property>
<property name="rightMargin">
<number>9</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<item row="0" column="0" rowspan="2">
<layout class="QVBoxLayout" name="_2">
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>3</number>
</property>
<property name="topMargin">
<number>3</number>
</property>
<property name="rightMargin">
<number>3</number>
</property>
<property name="bottomMargin">
<number>3</number>
</property>
<item>
@ -166,12 +190,21 @@
</item>
</layout>
</item>
<item>
<item row="0" column="1" rowspan="2">
<layout class="QVBoxLayout" name="_3">
<property name="spacing">
<number>1</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
@ -179,7 +212,16 @@
<property name="spacing">
<number>6</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
@ -224,6 +266,20 @@
</item>
</widget>
</item>
<item>
<widget class="QComboBox" name="cmbGraphColor">
<item>
<property name="text">
<string>Default</string>
</property>
</item>
<item>
<property name="text">
<string>Dark</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
@ -241,7 +297,16 @@
<property name="spacing">
<number>3</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
@ -299,7 +364,16 @@
<property name="spacing">
<number>0</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
@ -377,25 +451,21 @@
</item>
</layout>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>21</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<item row="0" column="4" rowspan="2">
<layout class="QVBoxLayout" name="_7">
<property name="spacing">
<number>1</number>
</property>
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
@ -414,6 +484,19 @@
</item>
</layout>
</item>
<item row="0" column="3">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>21</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>

View File

@ -24,6 +24,7 @@
#include "retroshare/rspeers.h"
#include "retroshare/rsservicecontrol.h"
#include "retroshare-gui/RsAutoUpdatePage.h"
#include "gui/settings/rsharesettings.h"
#include "BandwidthStatsWidget.h"
BandwidthStatsWidget::BandwidthStatsWidget(QWidget *parent)
@ -31,6 +32,8 @@ BandwidthStatsWidget::BandwidthStatsWidget(QWidget *parent)
{
ui.setupUi(this) ;
m_bProcessSettings = false;
// now add one button per service
ui.friend_CB->addItem(tr("Sum")) ;
@ -51,6 +54,8 @@ BandwidthStatsWidget::BandwidthStatsWidget(QWidget *parent)
updateUnitSelection(0);
toggleLogScale(ui.logScale_CB->checkState() == Qt::Checked);//Update bwgraph_BW with default logScale_CB state defined in ui file.
// Setup connections
QObject::connect(ui.friend_CB ,SIGNAL(currentIndexChanged(int )),this, SLOT( updateFriendSelection(int ))) ;
@ -59,6 +64,7 @@ BandwidthStatsWidget::BandwidthStatsWidget(QWidget *parent)
QObject::connect(ui.service_CB ,SIGNAL(currentIndexChanged(int )),this, SLOT(updateServiceSelection(int ))) ;
QObject::connect(ui.legend_CB ,SIGNAL(currentIndexChanged(int )),this, SLOT( updateLegendType(int ))) ;
QObject::connect(ui.logScale_CB,SIGNAL( toggled(bool)),this, SLOT( toggleLogScale(bool))) ;
QObject::connect(ui.cmbGraphColor,SIGNAL(currentIndexChanged(int )),this, SLOT( updateGraphSelection(int))) ;
// setup one timer for auto-update
@ -66,6 +72,45 @@ BandwidthStatsWidget::BandwidthStatsWidget(QWidget *parent)
connect(mTimer, SIGNAL(timeout()), this, SLOT(updateComboBoxes())) ;
mTimer->setSingleShot(false) ;
mTimer->start(2000) ;
// load settings
processSettings(true);
int graphColor = ui.cmbGraphColor->currentIndex();
if(graphColor==0)
ui.bwgraph_BW->resetFlags(RSGraphWidget::RSGRAPH_FLAGS_DARK_STYLE);
else
ui.bwgraph_BW->setFlags(RSGraphWidget::RSGRAPH_FLAGS_DARK_STYLE);
}
BandwidthStatsWidget::~BandwidthStatsWidget ()
{
// save settings
processSettings(false);
}
void BandwidthStatsWidget::processSettings(bool bLoad)
{
m_bProcessSettings = true;
Settings->beginGroup(QString("BandwidthStatsWidget"));
if (bLoad) {
// load settings
// state of Graph Color combobox
int index = Settings->value("cmbGraphColor", 0).toInt();
ui.cmbGraphColor->setCurrentIndex(index);
} else {
// save settings
// state of Graph Color combobox
Settings->setValue("cmbGraphColor", ui.cmbGraphColor->currentIndex());
}
Settings->endGroup();
m_bProcessSettings = false;
}
void BandwidthStatsWidget::toggleLogScale(bool b)
@ -75,6 +120,7 @@ void BandwidthStatsWidget::toggleLogScale(bool b)
else
ui.bwgraph_BW->resetFlags(RSGraphWidget::RSGRAPH_FLAGS_LOG_SCALE_Y) ;
}
void BandwidthStatsWidget::updateComboBoxes()
{
if(!isVisible())
@ -234,3 +280,11 @@ void BandwidthStatsWidget::updateUnitSelection(int n)
ui.legend_CB->setItemText(1,tr("Total"));
}
}
void BandwidthStatsWidget::updateGraphSelection(int n)
{
if(n==0)
ui.bwgraph_BW->resetFlags(RSGraphWidget::RSGRAPH_FLAGS_DARK_STYLE);
else
ui.bwgraph_BW->setFlags(RSGraphWidget::RSGRAPH_FLAGS_DARK_STYLE);
}

View File

@ -26,7 +26,10 @@ class BandwidthStatsWidget: public QWidget
Q_OBJECT
public:
/** Default Constructor */
BandwidthStatsWidget(QWidget *parent) ;
/** Default Destructor */
~BandwidthStatsWidget ();
protected slots:
void updateFriendSelection(int n);
@ -36,8 +39,12 @@ protected slots:
void updateUnitSelection(int n);
void toggleLogScale(bool b);
void updateLegendType(int n);
void updateGraphSelection(int n);
private:
void processSettings(bool bLoad);
bool m_bProcessSettings;
Ui::BwStatsWidget ui;
QTimer *mTimer ;

View File

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>1148</width>
<width>800</width>
<height>385</height>
</rect>
</property>
@ -140,6 +140,20 @@
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="cmbGraphColor">
<item>
<property name="text">
<string>Default</string>
</property>
</item>
<item>
<property name="text">
<string>Dark</string>
</property>
</item>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>760</width>
<height>603</height>
<height>500</height>
</rect>
</property>
<property name="windowTitle">

View File

@ -84,6 +84,9 @@ GlobalRouterStatistics::GlobalRouterStatistics(QWidget *parent)
connect(treeWidget, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(CustomPopupMenu(QPoint)));
/* Set initial size the splitter */
splitter->setStretchFactor(1, 1);
splitter->setStretchFactor(0, 0);
// load settings
processSettings(true);
@ -106,12 +109,12 @@ void GlobalRouterStatistics::processSettings(bool bLoad)
// load settings
// state of splitter
//splitter->restoreState(Settings->value("Splitter").toByteArray());
splitter->restoreState(Settings->value("Splitter").toByteArray());
} else {
// save settings
// state of splitter
//Settings->setValue("Splitter", splitter->saveState());
Settings->setValue("Splitter", splitter->saveState());
}

View File

@ -6,19 +6,96 @@
<rect>
<x>0</x>
<y>0</y>
<width>1468</width>
<height>659</height>
<width>800</width>
<height>429</height>
</rect>
</property>
<property name="windowTitle">
<string>Router Statistics</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0">
<item row="0" column="0">
<widget class="QSplitter" name="splitter">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>GroupBox</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QTreeWidget" name="treeWidget">
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
<column>
<property name="text">
<string>ID</string>
</property>
</column>
<column>
<property name="text">
<string>Identity Name</string>
</property>
</column>
<column>
<property name="text">
<string>Destinaton</string>
</property>
</column>
<column>
<property name="text">
<string>Data status</string>
</property>
</column>
<column>
<property name="text">
<string>Tunnel status</string>
</property>
</column>
<column>
<property name="text">
<string>Stored data size</string>
</property>
</column>
<column>
<property name="text">
<string>Data hash</string>
</property>
</column>
<column>
<property name="text">
<string>Receive time</string>
</property>
</column>
<column>
<property name="text">
<string>Sending time</string>
</property>
</column>
<column>
<property name="text">
<string>Branching factor</string>
</property>
</column>
<column>
<property name="text">
<string>Receive time (secs ago)</string>
</property>
</column>
<column>
<property name="text">
<string>Sending time (secs ago)</string>
</property>
</column>
</widget>
</item>
</layout>
</widget>
<widget class="QScrollArea" name="_router_F">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
@ -34,93 +111,14 @@
<rect>
<x>0</x>
<y>0</y>
<width>1450</width>
<height>317</height>
<width>782</width>
<height>69</height>
</rect>
</property>
</widget>
</widget>
</widget>
</item>
<item row="0" column="0">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>GroupBox</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QTreeWidget" name="treeWidget">
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
<column>
<property name="text">
<string>ID</string>
</property>
</column>
<column>
<property name="text">
<string>Identity Name</string>
</property>
</column>
<column>
<property name="text">
<string>Destinaton</string>
</property>
</column>
<column>
<property name="text">
<string>Data status</string>
</property>
</column>
<column>
<property name="text">
<string>Tunnel status</string>
</property>
</column>
<column>
<property name="text">
<string>Stored data size</string>
</property>
</column>
<column>
<property name="text">
<string>Data hash</string>
</property>
</column>
<column>
<property name="text">
<string>Receive time</string>
</property>
</column>
<column>
<property name="text">
<string>Sending time</string>
</property>
</column>
<column>
<property name="text">
<string>Branching factor</string>
</property>
</column>
<column>
<property name="text">
<string>Receive time (secs ago)</string>
</property>
</column>
<column>
<property name="text">
<string>Sending time (secs ago)</string>
</property>
</column>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources/>

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>1468</width>
<height>779</height>
<width>800</width>
<height>500</height>
</rect>
</property>
<property name="windowTitle">

View File

@ -131,4 +131,11 @@ RttStatisticsGraph::RttStatisticsGraph(QWidget *parent)
resetFlags(RSGRAPH_FLAGS_LOG_SCALE_Y) ;
resetFlags(RSGRAPH_FLAGS_PAINT_STYLE_PLAIN) ;
setFlags(RSGRAPH_FLAGS_SHOW_LEGEND) ;
int graphColor = Settings->valueFromGroup("BandwidthStatsWidget", "cmbGraphColor", 0).toInt();
if(graphColor==0)
resetFlags(RSGraphWidget::RSGraphWidget::RSGRAPH_FLAGS_DARK_STYLE);
else
setFlags(RSGraphWidget::RSGraphWidget::RSGRAPH_FLAGS_DARK_STYLE);
}

View File

@ -54,7 +54,7 @@
#define IMAGE_DHT ":/icons/DHT128.png"
#define IMAGE_TURTLE ":/icons/turtle128.png"
#define IMAGE_IDENTITIES ":/icons/avatar_128.png"
#define IMAGE_IDENTITIES ":/icons/identities.png"
#define IMAGE_BWGRAPH ":/icons/bandwidth128.png"
#define IMAGE_GLOBALROUTER ":/icons/GRouter128.png"
#define IMAGE_GXSTRANSPORT ":/icons/transport128.png"

View File

@ -15,7 +15,16 @@
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QGridLayout" name="gridLayout">
<property name="margin">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item row="0" column="0">
@ -45,7 +54,6 @@
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
<addaction name="separator"/>
</widget>
<action name="actionAdd_Friend">
<property name="icon">
@ -61,7 +69,7 @@
</action>
<action name="actionAdd_Share">
<property name="icon">
<iconset resource="../images.qrc">
<iconset>
<normaloff>:/images/add-share24.png</normaloff>:/images/add-share24.png</iconset>
</property>
<property name="text">
@ -79,7 +87,7 @@
</action>
<action name="actionMessenger">
<property name="icon">
<iconset resource="../images.qrc">
<iconset>
<normaloff>:/images/messenger.png</normaloff>:/images/messenger.png</iconset>
</property>
<property name="text">
@ -105,7 +113,7 @@
</action>
<action name="actionQuit">
<property name="icon">
<iconset resource="../images.qrc">
<iconset>
<normaloff>:/images/exit_24x24.png</normaloff>:/images/exit_24x24.png</iconset>
</property>
<property name="text">

View File

@ -202,7 +202,14 @@ TurtleRouterStatistics::TurtleRouterStatistics(QWidget *parent)
float fact = fontHeight/14.0;
frmGraph->setMinimumHeight(200*fact);
int graphColor = Settings->valueFromGroup("BandwidthStatsWidget", "cmbGraphColor", 0).toInt();
if(graphColor==0)
frmGraph->resetFlags(RSGraphWidget::RSGRAPH_FLAGS_DARK_STYLE);
else
frmGraph->setFlags(RSGraphWidget::RSGRAPH_FLAGS_DARK_STYLE);
// load settings
processSettings(true);
}
@ -224,12 +231,12 @@ void TurtleRouterStatistics::processSettings(bool bLoad)
// load settings
// state of splitter
//splitter->restoreState(Settings->value("Splitter").toByteArray());
splitter->restoreState(Settings->value("Splitter").toByteArray());
} else {
// save settings
// state of splitter
//Settings->setValue("Splitter", splitter->saveState());
Settings->setValue("Splitter", splitter->saveState());
}

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>680</width>
<height>523</height>
<height>500</height>
</rect>
</property>
<property name="windowTitle">
@ -29,15 +29,15 @@
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="handleWidth">
<number>5</number>
</property>
<widget class="QScrollArea" name="_tunnel_statistics_F">
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
<property name="minimumSize">
<size>
<width>0</width>
<height>200</height>
</size>
</property>
<property name="widgetResizable">
<bool>true</bool>
@ -47,28 +47,23 @@
<rect>
<x>0</x>
<y>0</y>
<width>640</width>
<height>248</height>
<width>636</width>
<height>198</height>
</rect>
</property>
<property name="autoFillBackground">
<bool>true</bool>
</property>
</widget>
</widget>
</widget>
</item>
<item row="1" column="0">
<widget class="TurtleGraph" name="frmGraph" native="true">
<property name="minimumSize">
<size>
<width>120</width>
<height>200</height>
</size>
</property>
<property name="contextMenuPolicy">
<enum>Qt::NoContextMenu</enum>
</property>
<widget class="TurtleGraph" name="frmGraph" native="true">
<property name="minimumSize">
<size>
<width>120</width>
<height>200</height>
</size>
</property>
<property name="contextMenuPolicy">
<enum>Qt::NoContextMenu</enum>
</property>
</widget>
</widget>
</item>
</layout>

View File

@ -26,6 +26,7 @@
#include <QApplication>
#include <gui/common/RSGraphWidget.h>
#include "gui/settings/rsharesettings.h"
#include <retroshare/rsdht.h>
#include <retroshare/rsconfig.h>
@ -74,5 +75,12 @@ class DhtGraph : public RSGraphWidget
resetFlags(RSGRAPH_FLAGS_LOG_SCALE_Y) ;
setFlags(RSGRAPH_FLAGS_PAINT_STYLE_PLAIN) ;
int graphColor = Settings->valueFromGroup("BandwidthStatsWidget", "cmbGraphColor", 0).toInt();
if(graphColor==0)
resetFlags(RSGraphWidget::RSGraphWidget::RSGRAPH_FLAGS_DARK_STYLE);
else
setFlags(RSGraphWidget::RSGraphWidget::RSGRAPH_FLAGS_DARK_STYLE);
}
};

View File

@ -20,6 +20,8 @@
#pragma once
#include "gui/settings/rsharesettings.h"
#include "retroshare/rsturtle.h"
#include <gui/common/RSGraphWidget.h>
@ -68,7 +70,14 @@ class TurtleGraph: public RSGraphWidget
resetFlags(RSGRAPH_FLAGS_LOG_SCALE_Y) ;
resetFlags(RSGRAPH_FLAGS_PAINT_STYLE_PLAIN) ;
setFlags(RSGRAPH_FLAGS_SHOW_LEGEND) ;
setFlags(RSGRAPH_FLAGS_SHOW_LEGEND) ;
int graphColor = Settings->valueFromGroup("BandwidthStatsWidget", "cmbGraphColor", 0).toInt();
if(graphColor==0)
resetFlags(RSGraphWidget::RSGRAPH_FLAGS_DARK_STYLE);
else
setFlags(RSGraphWidget::RSGRAPH_FLAGS_DARK_STYLE);
}
};