Commit 5205aab9 authored by Denis Khachko's avatar Denis Khachko Committed by Victor Yacovlev

Draw settings

parent e1629d6e
...@@ -73,17 +73,17 @@ ...@@ -73,17 +73,17 @@
"settings": { "settings": {
"BackColor": { "BackColor": {
"type": "color", "type": "color",
"default": "#FFFFFF", "default": "#99FF99",
"title": {"ascii": "Background color", "ru_RU": "Цвет фона"} "title": {"ascii": "Background color", "ru_RU": "Цвет фона"}
}, },
"LineColor": { "LineColor": {
"type": "color", "type": "color",
"default": "#C8C800", "default": "#669966",
"title": {"ascii": "Grid color", "ru_RU": "Цвет сетки"} "title": {"ascii": "Grid color", "ru_RU": "Цвет сетки"}
}, },
"AxisColor": { "AxisColor": {
"type": "color", "type": "color",
"default": "#C8C800", "default": "#999900",
"title": {"ascii": "Axis color", "ru_RU": "Цвет осей"} "title": {"ascii": "Axis color", "ru_RU": "Цвет осей"}
}, },
"AxisWidth": { "AxisWidth": {
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
}, },
"LineWidth": { "LineWidth": {
"type": "int", "type": "int",
"default": "1", "default": "4",
"title": {"ascii": "Line width", "ru_RU": "Толщина линий"} "title": {"ascii": "Line width", "ru_RU": "Толщина линий"}
} }
......
...@@ -782,7 +782,7 @@ void DrawModule::createGui() ...@@ -782,7 +782,7 @@ void DrawModule::createGui()
netStepX=1; netStepX=1;
netStepY=1; netStepY=1;
autoNet=true; autoNet=true;
netColor=QColor("999999"); netColor=QColor("#669966");
penIsDrawing=false; penIsDrawing=false;
CurScene=new DrawScene(CurView); CurScene=new DrawScene(CurView);
navigator=new DrawNavigator(CurView); navigator=new DrawNavigator(CurView);
...@@ -829,7 +829,7 @@ void DrawModule::createGui() ...@@ -829,7 +829,7 @@ void DrawModule::createGui()
CurView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); CurView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
CurView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); CurView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
QBrush curBackground=QBrush(QColor(DrawSettings()->value("Draw/BackColor","lightgreen").toString())); QBrush curBackground=QBrush(QColor(DrawSettings()->value("Draw/BackColor","#99FF99").toString()));
CurScene->setBackgroundBrush (curBackground); CurScene->setBackgroundBrush (curBackground);
Color Black; Color Black;
...@@ -965,10 +965,10 @@ void DrawModule::showNavigator(bool state) ...@@ -965,10 +965,10 @@ void DrawModule::showNavigator(bool state)
// Updates setting on module load, workspace change or appliyng settings dialog. // Updates setting on module load, workspace change or appliyng settings dialog.
// If @param keys is empty -- should reload all settings, otherwise load only setting specified by @param keys // If @param keys is empty -- should reload all settings, otherwise load only setting specified by @param keys
// TODO implement me // TODO implement me
QBrush curBackground=QBrush(QColor(settings->value("BackColor","lightgreen").toString())); QBrush curBackground=QBrush(QColor(settings->value("BackColor","#99FF99").toString()));
CurScene->setBackgroundBrush (curBackground); CurScene->setBackgroundBrush (curBackground);
netColor=QColor(settings->value("LineColor","gray").toString()); netColor=QColor(settings->value("LineColor","#669966").toString());
drawNet(); drawNet();
Q_UNUSED(keys); Q_UNUSED(keys);
} }
...@@ -1044,7 +1044,7 @@ void DrawModule::showNavigator(bool state) ...@@ -1044,7 +1044,7 @@ void DrawModule::showNavigator(bool state)
mPen->setPos(x, -y); mPen->setPos(x, -y);
if(penIsDrawing) if(penIsDrawing)
{ {
CurScene->addDrawLine(QLineF(start,mPen->pos()), QColor(penColor.r, penColor.g, penColor.b, penColor.a),mySettings()->value("LineWidth",1).toFloat()); CurScene->addDrawLine(QLineF(start,mPen->pos()), QColor(penColor.r, penColor.g, penColor.b, penColor.a),mySettings()->value("LineWidth",4).toFloat());
} }
CurView->resetCachedContent(); CurView->resetCachedContent();
CurView->update(); CurView->update();
...@@ -1061,7 +1061,7 @@ void DrawModule::showNavigator(bool state) ...@@ -1061,7 +1061,7 @@ void DrawModule::showNavigator(bool state)
mPen->moveBy(dX, -dY); mPen->moveBy(dX, -dY);
if(penIsDrawing) if(penIsDrawing)
{ {
CurScene->addDrawLine(QLineF(start,mPen->pos()), QColor(penColor.r, penColor.g, penColor.b, penColor.a),mySettings()->value("LineWidth",1).toFloat()); CurScene->addDrawLine(QLineF(start,mPen->pos()), QColor(penColor.r, penColor.g, penColor.b, penColor.a),mySettings()->value("LineWidth",4).toFloat());
} }
CurView->update(); CurView->update();
if(animate)redrawPicture(); if(animate)redrawPicture();
......
...@@ -187,7 +187,7 @@ public /* methods */: ...@@ -187,7 +187,7 @@ public /* methods */:
static ExtensionSystem::SettingsPtr DrawSettings(); static ExtensionSystem::SettingsPtr DrawSettings();
QColor axisColor() QColor axisColor()
{ {
return QColor(DrawSettings()->value("AxisColor","blue").toString()); return QColor(DrawSettings()->value("AxisColor","#999900").toString());
} }
void redrawPicture() void redrawPicture()
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment