mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Merge pull request #2637 from defnax/fixbwgraph
fix storing graph style
This commit is contained in:
commit
9009326970
@ -42,7 +42,7 @@
|
||||
#define DEFAULT_ALWAYS_ON_TOP false
|
||||
#define DEFAULT_OPACITY 100
|
||||
#define DEFAULT_STYLE LineGraph
|
||||
#define DEFAULT_GRAPHCOLOR DefaultColor
|
||||
#define DEFAULT_GRAPHCOLOR false
|
||||
#define DEFAULT_DIRECTION DefaultDirection
|
||||
|
||||
#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()
|
||||
{
|
||||
if(ui.frmGraph->getFlags() & RSGraphWidget::RSGRAPH_FLAGS_DARK_STYLE)
|
||||
{
|
||||
ui.frmGraph->resetFlags(RSGraphWidget::RSGRAPH_FLAGS_DARK_STYLE);
|
||||
ui.btnGraphColor->setIcon(FilesDefs::getIconFromQtResourcePath(IMG_GRAPH_LIGHT));
|
||||
}
|
||||
else
|
||||
if(ui.btnGraphColor->isChecked())
|
||||
{
|
||||
ui.frmGraph->setFlags(RSGraphWidget::RSGRAPH_FLAGS_DARK_STYLE);
|
||||
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();
|
||||
}
|
||||
@ -158,9 +158,9 @@ BandwidthGraph::loadSettings()
|
||||
setOpacity(ui.sldrOpacity->value());
|
||||
|
||||
/* 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.btnGraphColor->setIcon(FilesDefs::getIconFromQtResourcePath(IMG_GRAPH_DARK));
|
||||
|
@ -61,7 +61,7 @@
|
||||
<string>PushButton</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -180,7 +180,15 @@
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</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">
|
||||
<property name="spacing">
|
||||
<number>1</number>
|
||||
|
Loading…
Reference in New Issue
Block a user