[TD]fix DetailView alignment

This commit is contained in:
Wanderer Fan
2022-03-13 20:57:12 -04:00
committed by WandererFan
parent bb3e637e9e
commit cd663b9efd
8 changed files with 59 additions and 46 deletions

View File

@@ -183,17 +183,6 @@ Qt::PenStyle PreferencesGui::sectionLineStyle()
}
int PreferencesGui::mattingStyle()
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter().
GetGroup("BaseApp")->GetGroup("Preferences")->
GetGroup("Mod/TechDraw/Decorations");
int style = hGrp->GetInt("MattingStyle", 0);
return style;
}
//lightgray #D3D3D3
QString PreferencesGui::weldingDirectory()
{
std::string defaultDir = App::Application::getResourceDir() + "Mod/TechDraw/Symbols/Welding/AWS/";

View File

@@ -23,6 +23,8 @@
#ifndef _PreferencesGui_h_
#define _PreferencesGui_h_
#include <Mod/TechDraw/TechDrawGlobal.h>
class QFont;
class QString;
class QColor;
@@ -59,7 +61,6 @@ static double dimArrowSize();
static double edgeFuzz();
static Qt::PenStyle sectionLineStyle();
static int mattingStyle();
static QString weldingDirectory();

View File

@@ -152,7 +152,7 @@ Qt::PenStyle QGIHighlight::getHighlightStyle()
int QGIHighlight::getHoleStyle()
{
return PreferencesGui::mattingStyle();
return TechDraw::Preferences::mattingStyle();
}
void QGIHighlight::paint ( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget) {

View File

@@ -81,7 +81,7 @@ QGIMatting::QGIMatting() :
void QGIMatting::draw()
{
prepareGeometryChange();
double radiusFudge = 1.15; //keep slightly larger than fudge in App/DVDetail (1.1) to prevent bleed through
double radiusFudge = 1.2; //keep slightly larger than fudge in App/DVDetail (1.1) to prevent bleed through
m_width = m_radius * radiusFudge;
m_height = m_radius * radiusFudge;
QRectF outline(-m_width,-m_height,2.0 * m_width,2.0 * m_height);
@@ -92,7 +92,7 @@ void QGIMatting::draw()
QRectF roundCutout (-m_radius,-m_radius,2.0 * m_radius,2.0 * m_radius);
ppCut.addEllipse(roundCutout);
} else {
double squareSize = m_radius/ 1.4142; //fit just within radius
double squareSize = m_radius;
QRectF squareCutout (-squareSize,-squareSize,2.0 * squareSize,2.0 * squareSize);
ppCut.addRect(squareCutout);
}
@@ -105,7 +105,7 @@ void QGIMatting::draw()
int QGIMatting::getHoleStyle()
{
return PreferencesGui::mattingStyle();
return TechDraw::Preferences::mattingStyle();
}
//need this because QQGIG only updates BR when items added/deleted.

View File

@@ -23,6 +23,8 @@
#ifndef DRAWINGGUI_QGIMATTING_H
#define DRAWINGGUI_QGIMATTING_H
#include <Mod/TechDraw/TechDrawGlobal.h>
#include <QGraphicsItem>
#include <QGraphicsItemGroup>
#include <QGraphicsRectItem>