mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-26 07:59:35 -05:00
fix storing graph style
This commit is contained in:
parent
0eda08f881
commit
2702edab30
@ -42,7 +42,7 @@
|
|||||||
#define DEFAULT_ALWAYS_ON_TOP false
|
#define DEFAULT_ALWAYS_ON_TOP false
|
||||||
#define DEFAULT_OPACITY 100
|
#define DEFAULT_OPACITY 100
|
||||||
#define DEFAULT_STYLE LineGraph
|
#define DEFAULT_STYLE LineGraph
|
||||||
#define DEFAULT_GRAPHCOLOR DefaultColor
|
#define DEFAULT_GRAPHCOLOR false
|
||||||
#define DEFAULT_DIRECTION DefaultDirection
|
#define DEFAULT_DIRECTION DefaultDirection
|
||||||
|
|
||||||
#define ADD_TO_FILTER(f,v,b) (f = ((b) ? ((f) | (v)) : ((f) & ~(v))))
|
#define ADD_TO_FILTER(f,v,b) (f = ((b) ? ((f) | (v)) : ((f) & ~(v))))
|
||||||
@ -135,16 +135,16 @@ void BandwidthGraph::toggleReceiveRate(bool b)
|
|||||||
|
|
||||||
void BandwidthGraph::switchGraphColor()
|
void BandwidthGraph::switchGraphColor()
|
||||||
{
|
{
|
||||||
if(ui.frmGraph->getFlags() & RSGraphWidget::RSGRAPH_FLAGS_DARK_STYLE)
|
if(ui.btnGraphColor->isChecked())
|
||||||
{
|
|
||||||
ui.frmGraph->resetFlags(RSGraphWidget::RSGRAPH_FLAGS_DARK_STYLE);
|
|
||||||
ui.btnGraphColor->setIcon(FilesDefs::getIconFromQtResourcePath(IMG_GRAPH_LIGHT));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
ui.frmGraph->setFlags(RSGraphWidget::RSGRAPH_FLAGS_DARK_STYLE);
|
ui.frmGraph->setFlags(RSGraphWidget::RSGRAPH_FLAGS_DARK_STYLE);
|
||||||
ui.btnGraphColor->setIcon(FilesDefs::getIconFromQtResourcePath(IMG_GRAPH_DARK));
|
ui.btnGraphColor->setIcon(FilesDefs::getIconFromQtResourcePath(IMG_GRAPH_DARK));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ui.frmGraph->resetFlags(RSGraphWidget::RSGRAPH_FLAGS_DARK_STYLE);
|
||||||
|
ui.btnGraphColor->setIcon(FilesDefs::getIconFromQtResourcePath(IMG_GRAPH_LIGHT));
|
||||||
|
}
|
||||||
|
|
||||||
saveSettings();
|
saveSettings();
|
||||||
}
|
}
|
||||||
@ -158,9 +158,9 @@ BandwidthGraph::loadSettings()
|
|||||||
setOpacity(ui.sldrOpacity->value());
|
setOpacity(ui.sldrOpacity->value());
|
||||||
|
|
||||||
/* Set whether we are plotting bandwidth as area graphs or not */
|
/* Set whether we are plotting bandwidth as area graphs or not */
|
||||||
int graphColor = getSetting(SETTING_GRAPHCOLOR, DEFAULT_GRAPHCOLOR).toInt();
|
ui.btnGraphColor->setChecked(getSetting(SETTING_GRAPHCOLOR, DEFAULT_GRAPHCOLOR).toBool());
|
||||||
|
|
||||||
if(graphColor>0)
|
if(ui.btnGraphColor->isChecked())
|
||||||
{
|
{
|
||||||
ui.frmGraph->setFlags(RSGraphWidget::RSGRAPH_FLAGS_DARK_STYLE);
|
ui.frmGraph->setFlags(RSGraphWidget::RSGRAPH_FLAGS_DARK_STYLE);
|
||||||
ui.btnGraphColor->setIcon(FilesDefs::getIconFromQtResourcePath(IMG_GRAPH_DARK));
|
ui.btnGraphColor->setIcon(FilesDefs::getIconFromQtResourcePath(IMG_GRAPH_DARK));
|
||||||
|
@ -61,7 +61,7 @@
|
|||||||
<string>PushButton</string>
|
<string>PushButton</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
<bool>false</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -180,7 +180,15 @@
|
|||||||
<property name="frameShadow">
|
<property name="frameShadow">
|
||||||
<enum>QFrame::Raised</enum>
|
<enum>QFrame::Raised</enum>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="">
|
<widget class="QWidget" name="layoutWidget">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>218</width>
|
||||||
|
<height>88</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
<layout class="QVBoxLayout" name="_3">
|
<layout class="QVBoxLayout" name="_3">
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>1</number>
|
<number>1</number>
|
||||||
|
Loading…
Reference in New Issue
Block a user