Compare commits
25 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7b5e18a075 | |||
| ed87d3aceb | |||
| 133ef7173d | |||
| 8e7a8b1e7b | |||
| b3abe32683 | |||
| 53b4eb0b2e | |||
| 51855e5341 | |||
| 12055a22d8 | |||
| 6f67fbc425 | |||
| 83e308c8eb | |||
| de1d0acaea | |||
| e239684102 | |||
| aedd1f96e4 | |||
| e7c796edb4 | |||
| 6858586642 | |||
| a88db11e0a | |||
| f4574cf02d | |||
| 159a71bba7 | |||
| dfc3e2b9a6 | |||
| 27b568e4e4 | |||
| a266852510 | |||
| 408128838c | |||
| fc0c1069d2 | |||
| 5ea583466d | |||
| b2ca86d8d7 |
@@ -1937,6 +1937,9 @@ void Application::runApplication(void)
|
||||
else {
|
||||
// Enable automatic scaling based on pixel density of display (added in Qt 5.6)
|
||||
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5,14,0)
|
||||
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
|
||||
#endif
|
||||
}
|
||||
#endif // QT_VERSION >= 0x050600
|
||||
|
||||
@@ -1954,6 +1957,20 @@ void Application::runApplication(void)
|
||||
}
|
||||
#endif // QT_VERSION >= 0x050400
|
||||
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
|
||||
// By default (on platforms that support it, see docs for
|
||||
// Qt::AA_CompressHighFrequencyEvents) QT applies compression
|
||||
// for high frequency events (mouse move, touch, window resizes)
|
||||
// to keep things smooth even when handling the event takes a
|
||||
// while (e.g. to calculate snapping).
|
||||
// However, tablet pen move events (and mouse move events
|
||||
// synthesised from those) are not compressed by default (to
|
||||
// allow maximum precision when e.g. hand-drawing curves),
|
||||
// leading to unacceptable slowdowns using a tablet pen. Enable
|
||||
// compression for tablet events here to solve that.
|
||||
QCoreApplication::setAttribute(Qt::AA_CompressTabletEvents);
|
||||
#endif
|
||||
|
||||
// A new QApplication
|
||||
Base::Console().Log("Init: Creating Gui::Application and QApplication\n");
|
||||
|
||||
|
||||
@@ -59,6 +59,13 @@ bool ExpressionBinding::isBound() const
|
||||
return path.getDocumentObject() != 0;
|
||||
}
|
||||
|
||||
void ExpressionBinding::unbind()
|
||||
{
|
||||
expressionchanged.disconnect();
|
||||
objectdeleted.disconnect();
|
||||
path = App::ObjectIdentifier();
|
||||
}
|
||||
|
||||
void Gui::ExpressionBinding::setExpression(boost::shared_ptr<Expression> expr)
|
||||
{
|
||||
DocumentObject * docObj = path.getDocumentObject();
|
||||
@@ -100,7 +107,11 @@ void ExpressionBinding::bind(const App::ObjectIdentifier &_path)
|
||||
|
||||
//connect to be informed about changes
|
||||
DocumentObject * docObj = path.getDocumentObject();
|
||||
connection = docObj->ExpressionEngine.expressionChanged.connect(boost::bind(&ExpressionBinding::expressionChange, this, bp::_1));
|
||||
if (docObj) {
|
||||
expressionchanged = docObj->ExpressionEngine.expressionChanged.connect(boost::bind(&ExpressionBinding::expressionChange, this, bp::_1));
|
||||
App::Document* doc = docObj->getDocument();
|
||||
objectdeleted = doc->signalDeletedObject.connect(boost::bind(&ExpressionBinding::objectDeleted, this, bp::_1));
|
||||
}
|
||||
}
|
||||
|
||||
void ExpressionBinding::bind(const Property &prop)
|
||||
@@ -247,3 +258,11 @@ void ExpressionBinding::expressionChange(const ObjectIdentifier& id) {
|
||||
if(id==path)
|
||||
onChange();
|
||||
}
|
||||
|
||||
void ExpressionBinding::objectDeleted(const App::DocumentObject& obj)
|
||||
{
|
||||
DocumentObject * docObj = path.getDocumentObject();
|
||||
if (docObj == &obj) {
|
||||
unbind();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ public:
|
||||
virtual void bind(const App::ObjectIdentifier & _path);
|
||||
virtual void bind(const App::Property & prop);
|
||||
bool isBound() const;
|
||||
void unbind();
|
||||
virtual bool apply(const std::string &propName);
|
||||
virtual bool apply();
|
||||
bool hasExpression() const;
|
||||
@@ -52,8 +53,8 @@ public:
|
||||
|
||||
//auto apply means that the python code is issued not only on apply() but
|
||||
//also on setExpression
|
||||
bool autoApply() const {return m_autoApply;};
|
||||
void setAutoApply(bool value) {m_autoApply = value;};
|
||||
bool autoApply() const {return m_autoApply;}
|
||||
void setAutoApply(bool value) {m_autoApply = value;}
|
||||
|
||||
protected:
|
||||
const App::ObjectIdentifier & getPath() const { return path; }
|
||||
@@ -63,7 +64,7 @@ protected:
|
||||
virtual void setExpression(boost::shared_ptr<App::Expression> expr);
|
||||
|
||||
//gets called when the bound expression is changed, either by this binding or any external action
|
||||
virtual void onChange() {};
|
||||
virtual void onChange() {}
|
||||
|
||||
private:
|
||||
App::ObjectIdentifier path;
|
||||
@@ -75,7 +76,9 @@ protected:
|
||||
int iconHeight;
|
||||
|
||||
void expressionChange(const App::ObjectIdentifier& id);
|
||||
boost::signals2::scoped_connection connection;
|
||||
void objectDeleted(const App::DocumentObject&);
|
||||
boost::signals2::scoped_connection expressionchanged;
|
||||
boost::signals2::scoped_connection objectdeleted;
|
||||
bool m_autoApply;
|
||||
};
|
||||
|
||||
|
||||
@@ -33,8 +33,10 @@
|
||||
# include <QSvgRenderer>
|
||||
# include <QGraphicsSvgItem>
|
||||
# include <QMessageBox>
|
||||
# include <QMouseEvent>
|
||||
# include <QGraphicsScene>
|
||||
# include <QGraphicsView>
|
||||
# include <QScrollBar>
|
||||
# include <QThread>
|
||||
# include <QProcess>
|
||||
# include <boost_bind_bind.hpp>
|
||||
@@ -146,6 +148,92 @@ private:
|
||||
QByteArray str, flatStr;
|
||||
};
|
||||
|
||||
// Simple wrapper around QGraphicsView to make panning possible
|
||||
class GraphvizGraphicsView final : public QGraphicsView
|
||||
{
|
||||
public:
|
||||
GraphvizGraphicsView(QGraphicsScene* scene, QWidget* parent);
|
||||
~GraphvizGraphicsView() = default;
|
||||
|
||||
GraphvizGraphicsView(const GraphvizGraphicsView&) = delete;
|
||||
GraphvizGraphicsView(GraphvizGraphicsView&&) = delete;
|
||||
GraphvizGraphicsView& operator=(const GraphvizGraphicsView&) = delete;
|
||||
GraphvizGraphicsView& operator=(GraphvizGraphicsView&&) = delete;
|
||||
|
||||
protected:
|
||||
void mousePressEvent(QMouseEvent *event) override;
|
||||
void mouseMoveEvent(QMouseEvent *event) override;
|
||||
void mouseReleaseEvent(QMouseEvent *event) override;
|
||||
|
||||
private:
|
||||
bool isPanning;
|
||||
QPoint panStart;
|
||||
};
|
||||
|
||||
GraphvizGraphicsView::GraphvizGraphicsView(QGraphicsScene* scene, QWidget* parent) : QGraphicsView(scene, parent),
|
||||
isPanning(false)
|
||||
{
|
||||
}
|
||||
|
||||
void GraphvizGraphicsView::mousePressEvent(QMouseEvent* e)
|
||||
{
|
||||
if(e && e->button() == Qt::LeftButton)
|
||||
{
|
||||
isPanning = true;
|
||||
panStart = e->pos();
|
||||
e->accept();
|
||||
QApplication::setOverrideCursor(Qt::ClosedHandCursor);
|
||||
}
|
||||
|
||||
QGraphicsView::mousePressEvent(e);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void GraphvizGraphicsView::mouseMoveEvent(QMouseEvent *e)
|
||||
{
|
||||
if(e == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(isPanning)
|
||||
{
|
||||
auto* horizontalScrollbar = horizontalScrollBar();
|
||||
auto* verticalScrollbar = verticalScrollBar();
|
||||
if(horizontalScrollbar == nullptr ||
|
||||
verticalScrollbar == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
auto direction = e->pos() - panStart;
|
||||
horizontalScrollbar->setValue(horizontalScrollbar->value() - direction.x());
|
||||
verticalScrollbar->setValue(verticalScrollbar->value() - direction.y());
|
||||
|
||||
panStart = e->pos();
|
||||
e->accept();
|
||||
}
|
||||
|
||||
QGraphicsView::mouseMoveEvent(e);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void GraphvizGraphicsView::mouseReleaseEvent(QMouseEvent* e)
|
||||
{
|
||||
if(e && e->button() & Qt::LeftButton)
|
||||
{
|
||||
isPanning = false;
|
||||
QApplication::restoreOverrideCursor();
|
||||
e->accept();
|
||||
}
|
||||
|
||||
QGraphicsView::mouseReleaseEvent(e);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* TRANSLATOR Gui::GraphvizView */
|
||||
@@ -165,7 +253,7 @@ GraphvizView::GraphvizView(App::Document & _doc, QWidget* parent)
|
||||
scene->addItem(svgItem);
|
||||
|
||||
// Create view and zoomer object
|
||||
view = new QGraphicsView(scene, this);
|
||||
view = new GraphvizGraphicsView(scene, this);
|
||||
zoomer = new GraphicsViewZoom(view);
|
||||
zoomer->set_modifiers(Qt::NoModifier);
|
||||
view->show();
|
||||
|
||||
@@ -89,9 +89,6 @@ PropertyView::PropertyView(QWidget *parent)
|
||||
tabs = new QTabWidget (this);
|
||||
tabs->setObjectName(QString::fromUtf8("propertyTab"));
|
||||
tabs->setTabPosition(QTabWidget::South);
|
||||
#if defined(Q_OS_WIN32)
|
||||
tabs->setTabShape(QTabWidget::Triangular);
|
||||
#endif
|
||||
pLayout->addWidget(tabs, 0, 0);
|
||||
|
||||
propertyEditorView = new Gui::PropertyEditor::PropertyEditor();
|
||||
|
||||
@@ -1552,6 +1552,18 @@ QPushButton:checked {
|
||||
border-color: #65A2E5;
|
||||
}
|
||||
|
||||
/*==================================================================================================
|
||||
Tool button Icon fix in save dialogs
|
||||
==================================================================================================*/
|
||||
/* found under Tools -> Save Picture */ /* Draft -> ShapeString -> Font file */
|
||||
|
||||
QFileDialog#QFileDialog QToolButton {
|
||||
background-color: transparent;
|
||||
padding: 1px;
|
||||
border: 1px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
|
||||
/*==================================================================================================
|
||||
Tool button inside QDialogs that works as QPushButtons
|
||||
|
||||
@@ -1519,6 +1519,18 @@ QPushButton:checked {
|
||||
border-color: #3874f2;
|
||||
}
|
||||
|
||||
/*==================================================================================================
|
||||
Tool button Icon fix in save dialogs
|
||||
==================================================================================================*/
|
||||
/* found under Tools -> Save Picture */ /* Draft -> ShapeString -> Font file */
|
||||
|
||||
QFileDialog#QFileDialog QToolButton {
|
||||
background-color: transparent;
|
||||
padding: 1px;
|
||||
border: 1px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
|
||||
/*==================================================================================================
|
||||
Tool button inside QDialogs that works as QPushButtons
|
||||
|
||||
@@ -1519,6 +1519,18 @@ QPushButton:checked {
|
||||
border-color: #2053c0;
|
||||
}
|
||||
|
||||
/*==================================================================================================
|
||||
Tool button Icon fix in save dialogs
|
||||
==================================================================================================*/
|
||||
/* found under Tools -> Save Picture */ /* Draft -> ShapeString -> Font file */
|
||||
|
||||
QFileDialog#QFileDialog QToolButton {
|
||||
background-color: transparent;
|
||||
padding: 1px;
|
||||
border: 1px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
|
||||
/*==================================================================================================
|
||||
Tool button inside QDialogs that works as QPushButtons
|
||||
|
||||
@@ -1519,6 +1519,17 @@ QPushButton:checked {
|
||||
border-color: #819c0c;
|
||||
}
|
||||
|
||||
/*==================================================================================================
|
||||
Tool button Icon fix in save dialogs
|
||||
==================================================================================================*/
|
||||
/* found under Tools -> Save Picture */ /* Draft -> ShapeString -> Font file */
|
||||
|
||||
QFileDialog#QFileDialog QToolButton {
|
||||
background-color: transparent;
|
||||
padding: 1px;
|
||||
border: 1px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
/*==================================================================================================
|
||||
Tool button inside QDialogs that works as QPushButtons
|
||||
|
||||
@@ -1519,6 +1519,18 @@ QPushButton:checked {
|
||||
border-color: #d0970c;
|
||||
}
|
||||
|
||||
/*==================================================================================================
|
||||
Tool button Icon fix in save dialogs
|
||||
==================================================================================================*/
|
||||
/* found under Tools -> Save Picture */ /* Draft -> ShapeString -> Font file */
|
||||
|
||||
QFileDialog#QFileDialog QToolButton {
|
||||
background-color: transparent;
|
||||
padding: 1px;
|
||||
border: 1px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
|
||||
/*==================================================================================================
|
||||
Tool button inside QDialogs that works as QPushButtons
|
||||
|
||||
@@ -1519,6 +1519,18 @@ QPushButton:checked {
|
||||
border-color: #2053c0;
|
||||
}
|
||||
|
||||
/*==================================================================================================
|
||||
Tool button Icon fix in save dialogs
|
||||
==================================================================================================*/
|
||||
/* found under Tools -> Save Picture */ /* Draft -> ShapeString -> Font file */
|
||||
|
||||
QFileDialog#QFileDialog QToolButton {
|
||||
background-color: transparent;
|
||||
padding: 1px;
|
||||
border: 1px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
|
||||
/*==================================================================================================
|
||||
Tool button inside QDialogs that works as QPushButtons
|
||||
|
||||
@@ -1519,6 +1519,18 @@ QPushButton:checked {
|
||||
border-color: #74831d;
|
||||
}
|
||||
|
||||
/*==================================================================================================
|
||||
Tool button Icon fix in save dialogs
|
||||
==================================================================================================*/
|
||||
/* found under Tools -> Save Picture */ /* Draft -> ShapeString -> Font file */
|
||||
|
||||
QFileDialog#QFileDialog QToolButton {
|
||||
background-color: transparent;
|
||||
padding: 1px;
|
||||
border: 1px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
|
||||
/*==================================================================================================
|
||||
Tool button inside QDialogs that works as QPushButtons
|
||||
|
||||
@@ -1519,6 +1519,18 @@ QPushButton:checked {
|
||||
border-color: #b28416;
|
||||
}
|
||||
|
||||
/*==================================================================================================
|
||||
Tool button Icon fix in save dialogs
|
||||
==================================================================================================*/
|
||||
/* found under Tools -> Save Picture */ /* Draft -> ShapeString -> Font file */
|
||||
|
||||
QFileDialog#QFileDialog QToolButton {
|
||||
background-color: transparent;
|
||||
padding: 1px;
|
||||
border: 1px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
|
||||
/*==================================================================================================
|
||||
Tool button inside QDialogs that works as QPushButtons
|
||||
|
||||
@@ -1516,6 +1516,18 @@ QPushButton:checked {
|
||||
border-color: #3874f2;
|
||||
}
|
||||
|
||||
/*==================================================================================================
|
||||
Tool button Icon fix in save dialogs
|
||||
==================================================================================================*/
|
||||
/* found under Tools -> Save Picture */ /* Draft -> ShapeString -> Font file */
|
||||
|
||||
QFileDialog#QFileDialog QToolButton {
|
||||
background-color: transparent;
|
||||
padding: 1px;
|
||||
border: 1px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
|
||||
/*==================================================================================================
|
||||
Tool button inside QDialogs that works as QPushButtons
|
||||
|
||||
@@ -1516,6 +1516,18 @@ QPushButton:checked {
|
||||
border-color: #819c0c;
|
||||
}
|
||||
|
||||
/*==================================================================================================
|
||||
Tool button Icon fix in save dialogs
|
||||
==================================================================================================*/
|
||||
/* found under Tools -> Save Picture */ /* Draft -> ShapeString -> Font file */
|
||||
|
||||
QFileDialog#QFileDialog QToolButton {
|
||||
background-color: transparent;
|
||||
padding: 1px;
|
||||
border: 1px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
|
||||
/*==================================================================================================
|
||||
Tool button inside QDialogs that works as QPushButtons
|
||||
|
||||
@@ -1516,6 +1516,18 @@ QPushButton:checked {
|
||||
border-color: #d0970c;
|
||||
}
|
||||
|
||||
/*==================================================================================================
|
||||
Tool button Icon fix in save dialogs
|
||||
==================================================================================================*/
|
||||
/* found under Tools -> Save Picture */ /* Draft -> ShapeString -> Font file */
|
||||
|
||||
QFileDialog#QFileDialog QToolButton {
|
||||
background-color: transparent;
|
||||
padding: 1px;
|
||||
border: 1px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
|
||||
/*==================================================================================================
|
||||
Tool button inside QDialogs that works as QPushButtons
|
||||
|
||||
+329
-130
@@ -24,7 +24,9 @@ INSTALLATION
|
||||
WINDOWS = C:/[INSTALLATION_PATH]/FreeCAD/data/Gui/Stylesheets/
|
||||
LINUX = /home/[YOUR_USER_NAME]/.FreeCAD/Gui/Stylesheets/
|
||||
|
||||
============================================================================================================
|
||||
============================================================================================================
|
||||
THESE COLOURS WERE USED AS TEMP SCRATCHPAD FOR DESIGNING. PLEASE DISREGARD!
|
||||
|
||||
BACKGROUND (darker to lighter)
|
||||
black
|
||||
#1e1e1e
|
||||
@@ -74,10 +76,23 @@ QToolBar * {
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
/*==================================================================================================
|
||||
Style Links
|
||||
==================================================================================================*/
|
||||
QLabel[haslink="true"] {
|
||||
color: #55aaff;
|
||||
}
|
||||
|
||||
Gui--UrlLabel {
|
||||
color: #55aaff;
|
||||
}
|
||||
|
||||
/*==================================================================================================
|
||||
Main window
|
||||
==================================================================================================*/
|
||||
QWidget {
|
||||
background-color: #333333;
|
||||
}
|
||||
QMainWindow,
|
||||
QDialog,
|
||||
QDockWidget,
|
||||
@@ -130,6 +145,10 @@ QToolBox::tab:hover
|
||||
/*==================================================================================================
|
||||
QStatusBar
|
||||
==================================================================================================*/
|
||||
QStatusBar > QLabel {
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
|
||||
QStatusBar::item {
|
||||
border: 1px solid #333333;
|
||||
@@ -207,7 +226,7 @@ QMenu QToolButton:pressed,
|
||||
QMenu QPushButton:selected,
|
||||
QMenu QToolButton:selected {
|
||||
color: white;
|
||||
background-color: #696969; /* same as QMenu::item:selected and QMenu::item:pressed */
|
||||
background-color: #557bb6; /* same as QMenu::item:selected and QMenu::item:pressed */
|
||||
}
|
||||
|
||||
QMenu QRadioButton:disabled,
|
||||
@@ -271,9 +290,9 @@ QToolBar::separator:vertical {
|
||||
Group box
|
||||
==================================================================================================*/
|
||||
QGroupBox {
|
||||
color: rgba(255,255,255,120);
|
||||
color: #bcbcbc;
|
||||
border:1px solid rgba(255,255,255,20); /* lighter than its own border-color */;
|
||||
border-radius: 2px;
|
||||
border-radius: 1px;
|
||||
margin-top: 10px;
|
||||
padding: 6px;
|
||||
background-color: rgba(255,255,255,0);
|
||||
@@ -300,10 +319,10 @@ Tooltip
|
||||
==================================================================================================*/
|
||||
QToolTip {
|
||||
color: #ffffff;
|
||||
background-color: #1e1e1e;
|
||||
background-color: #2a2a2a;
|
||||
/*opacity: 90%; doesn't correctly work */
|
||||
padding: 4px;
|
||||
border-radius: 2px; /* has no effect */
|
||||
border-radius: 1px; /* has no effect */
|
||||
}
|
||||
|
||||
|
||||
@@ -319,17 +338,17 @@ QDockWidget {
|
||||
|
||||
QDockWidget::title {
|
||||
text-align: center;
|
||||
background-color: rgba(0,0,0,40);
|
||||
border: 4px solid #333333; /* fix to simulate margin between this :title and tabs */ /* same as main background color */
|
||||
border-radius: 6px; /* bigger than normal due to previous border fix */
|
||||
padding: 4px 0px; /* also needed because of previous border fix */
|
||||
background-color: #2a2a2a;
|
||||
border-bottom: 4px solid #333333; /* fix to simulate margin between this :title and tabs */ /* same as main background color */
|
||||
margin-left: 6px;
|
||||
margin-right: 6px;
|
||||
}
|
||||
|
||||
QDockWidget::close-button,
|
||||
QDockWidget::float-button {
|
||||
border: none;
|
||||
background: transparent;
|
||||
border-radius: 2px;
|
||||
border-radius: 1px;
|
||||
subcontrol-origin: padding;
|
||||
subcontrol-position: right center;
|
||||
}
|
||||
@@ -344,18 +363,18 @@ QDockWidget::float-button {
|
||||
|
||||
QDockWidget::close-button:hover,
|
||||
QDockWidget::float-button:hover {
|
||||
background-color: rgba(0,0,0,60);
|
||||
background-color: #557bb6;
|
||||
}
|
||||
|
||||
QDockWidget::close-button:pressed,
|
||||
QDockWidget::float-button:pressed {
|
||||
background-color: rgba(0,0,0,120);
|
||||
background-color: #42608d;
|
||||
border: 2px solid #76acfd
|
||||
}
|
||||
|
||||
/* fix for Python Console (probably there is a smarter way to arrive to it) */
|
||||
QDockWidget > QFrame {
|
||||
background-color: #3C3C3C;
|
||||
|
||||
background-color: #3c3c3c;
|
||||
border: 6px solid #333333;
|
||||
}
|
||||
|
||||
@@ -366,16 +385,17 @@ Progress bar
|
||||
QProgressBar,
|
||||
QProgressBar:horizontal {
|
||||
color: white;
|
||||
min-height: 24px;
|
||||
background-color: rgba(0,0,0,70);
|
||||
text-align: center;
|
||||
border: 1px solid rgba(0,0,0,140);
|
||||
padding: 1px;
|
||||
border-radius: 2px;
|
||||
border-radius: 1px;
|
||||
}
|
||||
QProgressBar::chunk,
|
||||
QProgressBar::chunk:horizontal {
|
||||
background-color: qlineargradient(spread:pad, x1:1, y1:0.545, x2:1, y2:0, stop:0 #3874f2, stop:1 #557BB6);
|
||||
border-radius: 2px;
|
||||
background-color: #557BB6;
|
||||
border-radius: 1px;
|
||||
}
|
||||
|
||||
|
||||
@@ -383,7 +403,7 @@ QProgressBar::chunk:horizontal {
|
||||
Scroll
|
||||
==================================================================================================*/
|
||||
QAbstractScrollArea {
|
||||
border-radius: 2px;
|
||||
border-radius: 1px;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
@@ -410,7 +430,7 @@ QScrollBar::handle:horizontal:hover {
|
||||
|
||||
QScrollBar::handle:horizontal {
|
||||
min-width: 5px;
|
||||
border-radius: 2px;
|
||||
border-radius: 1px;
|
||||
margin: 4px 15px;
|
||||
}
|
||||
|
||||
@@ -435,11 +455,13 @@ QScrollBar::add-line:horizontal {
|
||||
QScrollBar::sub-line:horizontal:hover,
|
||||
QScrollBar::sub-line:horizontal:on {
|
||||
border-image: url(qss:images_dark-light/left_arrow_lighter.svg);
|
||||
background-color: #557BB6;
|
||||
}
|
||||
|
||||
QScrollBar::add-line:horizontal:hover,
|
||||
QScrollBar::add-line:horizontal:on {
|
||||
border-image: url(qss:images_dark-light/right_arrow_lighter.svg);
|
||||
background-color: #557BB6;
|
||||
}
|
||||
|
||||
QScrollBar::up-arrow:horizontal,
|
||||
@@ -460,7 +482,7 @@ QScrollBar:vertical {
|
||||
|
||||
QScrollBar::handle:vertical {
|
||||
min-height: 24px;
|
||||
border-radius: 2px;
|
||||
border-radius: 1px;
|
||||
margin: 15px 4px;
|
||||
}
|
||||
|
||||
@@ -485,11 +507,13 @@ QScrollBar::add-line:vertical {
|
||||
QScrollBar::sub-line:vertical:hover,
|
||||
QScrollBar::sub-line:vertical:on {
|
||||
border-image: url(qss:images_dark-light/up_arrow_lighter.svg);
|
||||
background-color: #557BB6;
|
||||
}
|
||||
|
||||
QScrollBar::add-line:vertical:hover,
|
||||
QScrollBar::add-line:vertical:on {
|
||||
border-image: url(qss:images_dark-light/down_arrow_lighter.svg);
|
||||
background-color: #557BB6;
|
||||
}
|
||||
|
||||
QScrollBar::up-arrow:vertical,
|
||||
@@ -507,7 +531,7 @@ QScrollBar::sub-page:vertical {
|
||||
Tab bar
|
||||
==================================================================================================*/
|
||||
QTabWidget::pane {
|
||||
background-color: #333333; /* temporal (transparent background) */ /* tab content background color */ /* was transparent. fixes no color undocked Combo View */
|
||||
background-color: transparent; /* temporal (transparent background) */ /* tab content background color */ /* was transparent. fixes no color undocked Combo View */
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
@@ -543,7 +567,7 @@ QTabWidget::tab-bar:right {
|
||||
|
||||
QTabBar {
|
||||
qproperty-drawBase: 0; /* important */
|
||||
background-color: #333333; /* Hack for Undocked white background - was transparent*/
|
||||
background-color: transparent; /* Hack for Undocked white background - was transparent*/
|
||||
}
|
||||
|
||||
/* Workaround for QTabBars created from docked QDockWidgets which don't draw the border if not set and reset as follows: */
|
||||
@@ -642,12 +666,13 @@ QDialog#Gui__Dialog__DlgPreferences QTabWidget::pane {
|
||||
|
||||
/* hack to correctly align Preferences icon list on OSX */
|
||||
QDialog#Gui__Dialog__DlgPreferences > QListView {
|
||||
min-width: 130px;
|
||||
min-width: 108px; /* narrowed for new smaller icons - was 130px*/
|
||||
max-width: 108px;
|
||||
}
|
||||
|
||||
/* unique styles for sections inside Preferences */
|
||||
QDialog#Gui__Dialog__DlgPreferences > QListView::item {
|
||||
border-radius: 2px;
|
||||
border-radius: 1px;
|
||||
}
|
||||
|
||||
QDialog#Gui__Dialog__DlgPreferences > QListView::item:hover { /* Preference left icons*/
|
||||
@@ -667,7 +692,7 @@ Tab bar buttons
|
||||
QTabBar::close-button {
|
||||
subcontrol-origin: margin;
|
||||
subcontrol-position: center right; /* only works for Qt 4.6 and newer */;
|
||||
border-radius: 2px;
|
||||
border-radius: 1px;
|
||||
background-image: url(qss:images_dark-light/close_light.svg);
|
||||
background-position: center center;
|
||||
background-repeat: none;
|
||||
@@ -770,7 +795,7 @@ QTableView {
|
||||
selection-color: #ffffff;
|
||||
selection-background-color: #557BB6; /* should be similar to QListView::item selected background-color */
|
||||
show-decoration-selected: 1; /* make the selection span the entire width of the view */
|
||||
border-radius: 2px;
|
||||
border-radius: 1px;
|
||||
}
|
||||
|
||||
QListView::item:hover,
|
||||
@@ -801,7 +826,7 @@ Gui--PropertyEditor--PropertyEditor > QWidget > QWidget > QLabel:disabled {
|
||||
color: transparent;
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
border-radius: 2px;
|
||||
border-radius: 1px;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
@@ -820,8 +845,8 @@ Gui--PropertyEditor--PropertyEditor QAbstractSpinBox:disabled {
|
||||
|
||||
/* hack to hide weird redundant information inside cells with links and no editable data (but editable via "..." button) */
|
||||
Gui--PropertyEditor--PropertyEditor > QWidget > QWidget > QLabel {
|
||||
color: #557BB6;
|
||||
background-color: #696969; /* same as focused background color */
|
||||
color: #949494;
|
||||
background-color: #2a2a2a; /* same as focused background color */
|
||||
}
|
||||
|
||||
/* hack to disable margin inside Property values to following elements */
|
||||
@@ -874,7 +899,7 @@ QTreeView > QWidget > QTimeEdit:down-button,
|
||||
QTreeView > QWidget > QDateEdit:down-button,
|
||||
QTreeView > QWidget > QDateTimeEdit:down-button,
|
||||
QTreeView > QWidget > Gui--ColorButton {
|
||||
border-radius: 2px;
|
||||
border-radius: 1px;
|
||||
}
|
||||
|
||||
/* set focus colors to best viewing the editable fields */
|
||||
@@ -907,7 +932,7 @@ QTreeView > QWidget > QDateTimeEdit:read-only {
|
||||
/* Fix to correctly (not totally) draw QTextEdit on OSX at Page properties: "Page result", "Template" and "Editable Texts" */
|
||||
Gui--PropertyEditor--PropertyEditor > QWidget > QWidget > QWidget {
|
||||
min-height: 14px;
|
||||
border-radius: 2px; /* reset */
|
||||
border-radius: 1px; /* reset */
|
||||
}
|
||||
|
||||
|
||||
@@ -917,8 +942,8 @@ Header of tree and list views
|
||||
QHeaderView {
|
||||
color: #d2d2d2;
|
||||
background-color: #2a2a2a;
|
||||
border-top-left-radius: 2px; /* 1px less than its container */
|
||||
border-top-right-radius: 2px; /* 1px less than its container */
|
||||
border-top-left-radius: 1px; /* 1px less than its container */
|
||||
border-top-right-radius: 1px; /* 1px less than its container */
|
||||
border-bottom-left-radius: 0px;
|
||||
border-bottom-right-radius: 0px;
|
||||
}
|
||||
@@ -1057,7 +1082,7 @@ Text/Python editor (macros, etc...)
|
||||
==================================================================================================*/
|
||||
QPlainTextEdit,
|
||||
QPlainTextEdit:focus {
|
||||
background-color: #3C3C3C; /* Python Console */
|
||||
background-color: #3c3c3c; /* Python Console */
|
||||
selection-color: #f5f5f5;
|
||||
selection-background-color: #557BB6;
|
||||
border: 6px solid #333333;
|
||||
@@ -1181,12 +1206,12 @@ QSint--ActionGroup QFrame[class="content"] > QWidget > QPushButton {
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
/* Fix for lists inside task panels */
|
||||
/* Fix for lists inside task panels */ /* sketcher constraints list */
|
||||
QSint--ActionGroup QFrame[class="content"] QTreeView,
|
||||
QSint--ActionGroup QFrame[class="content"] QListView,
|
||||
QSint--ActionGroup QFrame[class="content"] QTableView {
|
||||
color: #f5f5f5;
|
||||
background-color: #3C3C3C;
|
||||
background-color: #494949;
|
||||
}
|
||||
|
||||
|
||||
@@ -1194,6 +1219,24 @@ QSint--ActionGroup QFrame[class="content"] QTableView {
|
||||
Buttons
|
||||
==================================================================================================*/
|
||||
/* Common */
|
||||
QToolBar > Gui--WorkbenchComboBox {
|
||||
color: #f5f5f5;
|
||||
background-color: #2a2a2a; /* workbench picker and drop-down */
|
||||
selection-color: #ffffff;
|
||||
selection-background-color: #2a2a2a;
|
||||
border: 1px solid #2a2a2a;
|
||||
border-radius: 1px;
|
||||
min-width: 50px; /* it ensures the default value is correctly displayed */
|
||||
min-height: 16px; /* important to be a pair number in order to up/down buttons to be divisible by two (if not set could create a blank line in Ubuntu. Its downside is that it's needed to reset it (min-width: 0px) on following elements that can't have it such as fields inside QToolBar and inside QTreeView (Property editor) */
|
||||
padding: 1px 2px; /* temporal: could don't be compatible with elements inside Tree/List view */
|
||||
}
|
||||
|
||||
QToolBar > Gui--WorkbenchComboBox:!editable {
|
||||
color: #f5f5f5;
|
||||
font-weight: bold;
|
||||
background-color: #557bb6; /* workbench disabled color */
|
||||
}
|
||||
|
||||
QComboBox,
|
||||
QAbstractSpinBox,
|
||||
QSpinBox,
|
||||
@@ -1204,13 +1247,13 @@ QTimeEdit,
|
||||
QDateEdit,
|
||||
QDateTimeEdit {
|
||||
color: #f5f5f5;
|
||||
background-color: #696969;
|
||||
background-color: #494949; /* lineedits and drop-downs */
|
||||
selection-color: #ffffff;
|
||||
selection-background-color: #557BB6;
|
||||
selection-background-color: #557bb6;
|
||||
border: 0px solid #2a2a2a;
|
||||
border-radius: 2px;
|
||||
border-radius: 1px;
|
||||
min-width: 50px; /* it ensures the default value is correctly displayed */
|
||||
min-height: 20px; /* important to be a pair number in order to up/down buttons to be divisible by two (if not set could create a blank line in Ubuntu. Its downside is that it's needed to reset it (min-width: 0px) on following elements that can't have it such as fields inside QToolBar and inside QTreeView (Property editor) */
|
||||
min-height: 16px; /* important to be a pair number in order to up/down buttons to be divisible by two (if not set could create a blank line in Ubuntu. Its downside is that it's needed to reset it (min-width: 0px) on following elements that can't have it such as fields inside QToolBar and inside QTreeView (Property editor) */
|
||||
padding: 1px 2px; /* temporal: could don't be compatible with elements inside Tree/List view */
|
||||
}
|
||||
|
||||
@@ -1234,7 +1277,7 @@ QDateTimeEdit {
|
||||
QTextEdit:!editable,
|
||||
QTextEdit:!editable:focus {
|
||||
color: #f5f5f5;
|
||||
background-color: #3C3C3C;
|
||||
background-color: #3c3c3c;
|
||||
border: 6px solid #333333;
|
||||
border-radius: 0px;
|
||||
margin: 0px;
|
||||
@@ -1252,10 +1295,10 @@ QDateEdit:focus,
|
||||
QDateTimeEdit:focus {
|
||||
font-weight: bold;
|
||||
color: #f5f5f5;
|
||||
border-color: #3c3c3c;
|
||||
border-color: #333333;
|
||||
border: 1px;
|
||||
border-right-color: #557BB6; /* same as up/down or drop-down button color */
|
||||
background-color: #696969;
|
||||
background-color: #494949;
|
||||
}
|
||||
|
||||
QComboBox:disabled,
|
||||
@@ -1267,8 +1310,8 @@ QTextEdit:disabled,
|
||||
QTimeEdit:disabled,
|
||||
QDateEdit:disabled,
|
||||
QDateTimeEdit:disabled {
|
||||
color: #f5f5f5;
|
||||
background-color: #696969; /* same as enabled color */
|
||||
color: #696969;
|
||||
background-color: #494949; /* same as enabled color */
|
||||
border-color: #2a2a2a; /* same as enabled color */
|
||||
}
|
||||
|
||||
@@ -1315,7 +1358,7 @@ QDoubleSpinBox:up-button:focus,
|
||||
QTimeEdit:up-button:focus,
|
||||
QDateEdit:up-button:focus,
|
||||
QDateTimeEdit:up-button:focus {
|
||||
background-color: #557BB6;
|
||||
background-color: #2a2a2a;
|
||||
}
|
||||
|
||||
QAbstractSpinBox:down-button:focus,
|
||||
@@ -1324,7 +1367,7 @@ QDoubleSpinBox:down-button:focus,
|
||||
QTimeEdit:down-button:focus,
|
||||
QDateEdit:down-button:focus,
|
||||
QDateTimeEdit:down-button:focus {
|
||||
background-color: #557BB6;
|
||||
background-color: #2a2a2a;
|
||||
}
|
||||
|
||||
QAbstractSpinBox:up-button:disabled,
|
||||
@@ -1423,13 +1466,13 @@ QComboBox::drop-down {
|
||||
subcontrol-origin: border; /* important */
|
||||
subcontrol-position: top right;
|
||||
width: 20px;
|
||||
border-top-right-radius: 2px;
|
||||
border-bottom-right-radius: 2px;
|
||||
border-top-right-radius: 1px;
|
||||
border-bottom-right-radius: 1px;
|
||||
}
|
||||
|
||||
QComboBox::drop-down:on,
|
||||
QComboBox::drop-down:focus {
|
||||
background-color: #557BB6;
|
||||
background-color: #2a2a2a;
|
||||
}
|
||||
|
||||
QComboBox::down-arrow {
|
||||
@@ -1454,7 +1497,7 @@ QComboBox {
|
||||
|
||||
QComboBox QAbstractItemView {
|
||||
color: #bebebe; /* same as regular QComboBox color */
|
||||
background-color: #2a2a2a; /* was transparent */
|
||||
background-color: transparent; /* was transparent */
|
||||
selection-color: #f5f5f5;
|
||||
selection-background-color: #557BB6;
|
||||
border-width: 5px 0px 5px 0px;
|
||||
@@ -1470,38 +1513,153 @@ Push button
|
||||
QPushButton {
|
||||
color: #e0e0e0;
|
||||
text-align: center;
|
||||
background-color: qlineargradient(spread:pad, x1:0, y1:0.3, x2:0, y2:1, stop:0 #696969, stop:1 #696961); /* Middle Mouse Navigation Button and Ok Cancel Apply Help Preferences Buttons */
|
||||
border: 2px;
|
||||
border-color: #2a2a2a;
|
||||
background-color: #2a2a2a;
|
||||
padding: 4px 20px;
|
||||
margin: 2px 2px;
|
||||
margin-right: 5px;
|
||||
min-height: 20px; /* same as QTabBar QPushButton min-width */
|
||||
border-radius: 2px;
|
||||
|
||||
border: 1px solid #494949;
|
||||
margin: 4px 4px;
|
||||
border-radius: 1px;
|
||||
}
|
||||
|
||||
QPushButton:hover,
|
||||
QPushButton:focus {
|
||||
color: #cbd8e6;
|
||||
border-color: #2a2a2a;
|
||||
background-color: #557BB6;
|
||||
color: #ffffff;
|
||||
background-color: #557bb6;
|
||||
border: 1px solid #f5f5f5;
|
||||
}
|
||||
|
||||
QPushButton:disabled,
|
||||
QPushButton:disabled:checked {
|
||||
color: #2a2a2a;
|
||||
background-color: #696969; /* same as enabled color */
|
||||
border-color: #2a2a2a; /* same as enabled color */
|
||||
color: #f5f5f5;
|
||||
background-color: #2a2a2a; /* same as enabled color */
|
||||
border: 1px solid #2a2a2a; /* same as enabled color */
|
||||
}
|
||||
|
||||
QPushButton:pressed {
|
||||
background-color: #557BB6;
|
||||
color: #ffffff;
|
||||
background-color: #48699a;
|
||||
border: 1px solid #3c3c3c;
|
||||
}
|
||||
|
||||
QPushButton:checked {
|
||||
background-color: #696969;
|
||||
border-color: #557BB6;
|
||||
background-color: #557BB6;
|
||||
border: 1px solid #557BB6;
|
||||
}
|
||||
|
||||
/* Inspect Widgets Addon */
|
||||
|
||||
QDockWidget#InspectWidgets QPushButton {
|
||||
background-color: #2a2a2a;
|
||||
border: 1px solid #3c3c3c;
|
||||
min-height: 16px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
QDockWidget#InspectWidgets QPushButton:hover {
|
||||
color: #ffffff;
|
||||
background-color: #557bb6;
|
||||
border: 1px solid #f5f5f5;
|
||||
border-bottom: 1px solid #f5f5f5;
|
||||
}
|
||||
|
||||
QDockWidget#InspectWidgets QPushButton:checked,
|
||||
QDockWidget#InspectWidgets QPushButton:pressed {
|
||||
background-color: #557bb6;
|
||||
border: 1px solid #557bb6;
|
||||
}
|
||||
|
||||
/* CAD Navigation Style */
|
||||
|
||||
QPushButton#NavigationIndicator {
|
||||
background-color: #557bb6;
|
||||
padding: 2px;
|
||||
margin: 0px;
|
||||
border: 1px solid #333333;
|
||||
border-radius: 1px;
|
||||
min-width: 90px;
|
||||
min-height: 24px;
|
||||
}
|
||||
|
||||
QPushButton:hover#NavigationIndicator {
|
||||
color: #ffffff;
|
||||
border: 1px solid #f5f5f5;
|
||||
}
|
||||
|
||||
QPushButton:pressed#NavigationIndicator {
|
||||
color: #ffffff;
|
||||
background-color: #557bb6;
|
||||
border: 1px solid #557bb6;
|
||||
}
|
||||
|
||||
/* BIM Views Manager */
|
||||
|
||||
QWidget#Form QPushButton {
|
||||
background-color: #333333;
|
||||
padding: 4px 2px;
|
||||
border: 1px solid #3c3c3c;
|
||||
border-radius: 1px;
|
||||
margin: 2px;
|
||||
margin-bottom: 8px;
|
||||
max-width: 100%;
|
||||
min-width: 16px;
|
||||
min-height: 24px;
|
||||
}
|
||||
|
||||
QWidget#Form QPushButton:hover {
|
||||
border: 1px solid #f5f5f5;
|
||||
background-color: #557BB6;
|
||||
}
|
||||
|
||||
QWidget#Form QPushButton:pressed {
|
||||
border: 1px solid #557bb6;
|
||||
background-color: #557BB6;
|
||||
}
|
||||
|
||||
/* Sketcher Manual Update Button */
|
||||
|
||||
QPushButton#manualUpdate {
|
||||
padding: 4px;
|
||||
margin: 0px;
|
||||
border: 1px solid #494949;
|
||||
}
|
||||
|
||||
QPushButton:pressed#manualUpdate {
|
||||
color: #ffffff;
|
||||
border: 1px solid #3c3c3c;
|
||||
background-color: #48699a;
|
||||
}
|
||||
|
||||
/* Addon Manager */
|
||||
|
||||
QDialog#Dialog QPushButton {
|
||||
padding: 4px;
|
||||
margin: 0px;
|
||||
border: 1px solid #494949;
|
||||
}
|
||||
|
||||
QDialog#Dialog QPushButton:hover {
|
||||
color: #ffffff;
|
||||
border: 1px solid #3c3c3c;
|
||||
background-color: #48699a;
|
||||
}
|
||||
|
||||
QPushButton#buttonUninstall {
|
||||
margin-left: 16px;
|
||||
}
|
||||
|
||||
QPushButton#buttonClose {
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
/* Ok Cancel Apply Help Preferences Buttons */ /* Hack to move Help button left */
|
||||
|
||||
QDialogButtonBox > QPushButton {
|
||||
color: #e0e0e0;
|
||||
text-align: center;
|
||||
background-color: #2a2a2a;
|
||||
border: 1px solid #494949;
|
||||
padding: 4px;
|
||||
margin-right: 8px;
|
||||
min-width: 60px;
|
||||
}
|
||||
|
||||
/* Color Buttons */
|
||||
@@ -1538,7 +1696,7 @@ Gui--PropertyEditor--PropertyEditor > QWidget > QWidget > QPushButton {
|
||||
background-color: #2a2a2a;
|
||||
border: 1px solid #1e1e1e;
|
||||
min-width: 16px; /* reset it due to larger value on regular QPushButton, same or bigger value as regular QPushButton min-height */
|
||||
border-radius: 2px;
|
||||
border-radius: 1px;
|
||||
margin: 0px; /* reset */
|
||||
padding: 0px; /* reset */
|
||||
}
|
||||
@@ -1547,48 +1705,63 @@ Gui--PropertyEditor--PropertyEditor > QWidget > QWidget > QPushButton {
|
||||
Gui--PropertyEditor--PropertyEditor > QWidget > QWidget > QWidget > QWidget > QFrame {
|
||||
background-color: #333333; /* main background color */
|
||||
border: 1px solid #333333;
|
||||
border-radius: 2px;
|
||||
border-radius: 1px;
|
||||
padding: 2px 6px;
|
||||
}
|
||||
|
||||
QPushButton:checked {
|
||||
background-color: #696969;
|
||||
border-color: #696969;
|
||||
/*==================================================================================================
|
||||
Tool button Icon fix in save dialogs
|
||||
==================================================================================================*/
|
||||
/* found under Tools -> Save Picture */ /* Draft -> ShapeString -> Font file */
|
||||
|
||||
QFileDialog#QFileDialog QToolButton {
|
||||
background-color: transparent;
|
||||
padding: 1px;
|
||||
border: 1px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
QFileDialog#QFileDialog QToolButton:hover,
|
||||
QFileDialog#QFileDialog QToolButton:focus {
|
||||
color: #ffffff;
|
||||
background-color: #557bb6;
|
||||
border: 1px solid #f5f5f5;
|
||||
}
|
||||
|
||||
/*==================================================================================================
|
||||
Tool button inside QDialogs that works as QPushButtons
|
||||
==================================================================================================*/
|
||||
/* found under Tools -> Customize -> Macros -> Pixmap "..." button */
|
||||
|
||||
QDialog QToolButton {
|
||||
color: #e0e0e0;
|
||||
text-align: center;
|
||||
background-color: qlineargradient(spread:pad, x1:0, y1:0.3, x2:0, y2:1, stop:0 #2a2a2a, stop:1 #1e1e1e);
|
||||
border: 1px solid #1e1e1e;
|
||||
border-bottom-color: black; /* simulates shadow under the button */
|
||||
background-color: #2a2a2a;
|
||||
border: 1px solid #494949;
|
||||
padding: 0px; /* different than regular QPushButton */
|
||||
margin: 2px; /* different than regular QPushButton */
|
||||
margin: 2px;
|
||||
min-height: 16px; /* same as QTabBar QPushButton min-width */
|
||||
border-radius: 2px;
|
||||
border-radius: 1px;
|
||||
}
|
||||
|
||||
QDialog QToolButton:hover,
|
||||
QDialog QToolButton:focus {
|
||||
color: #cbd8e6;
|
||||
border-color: #557BB6;
|
||||
background-color: #557BB6;
|
||||
color: #ffffff;
|
||||
background-color: #557bb6;
|
||||
border: 1px solid #f5f5f5;
|
||||
}
|
||||
|
||||
QDialog QToolButton:disabled,
|
||||
QDialog QToolButton:disabled:checked {
|
||||
color: #333333;
|
||||
border-color: #424242;
|
||||
background-color: #424242;
|
||||
color: #f5f5f5;
|
||||
background-color: #2a2a2a;
|
||||
border: 1px solid #2a2a2a;
|
||||
}
|
||||
|
||||
QDialog QToolButton:pressed {
|
||||
background-color: #557BB6;
|
||||
color: #ffffff;
|
||||
background-color: #48699a;
|
||||
border: 1px solid #3c3c3c;
|
||||
}
|
||||
|
||||
|
||||
@@ -1599,26 +1772,26 @@ Tool button inside Task Panel content that works as QPushButtons
|
||||
QSint--ActionGroup QFrame[class="content"] QToolButton {
|
||||
color: #e0e0e0;
|
||||
text-align: center;
|
||||
background-color: qlineargradient(spread:pad, x1:0, y1:0.3, x2:0, y2:1, stop:0 #2a2a2a, stop:1 #1e1e1e);
|
||||
border: 1px solid #1e1e1e;
|
||||
background-color: #2a2a2a;
|
||||
border: 1px solid #494949;
|
||||
border-bottom-color: black; /* simulates shadow under the button */
|
||||
padding: 2px 6px; /* different than regular QPushButton */
|
||||
margin: 2px; /* different than regular QPushButton */
|
||||
min-height: 16px; /* same as QTabBar QPushButton min-width */
|
||||
border-radius: 2px;
|
||||
border-radius: 1px;
|
||||
}
|
||||
|
||||
QSint--ActionGroup QFrame[class="content"] QToolButton:hover,
|
||||
QSint--ActionGroup QFrame[class="content"] QToolButton:focus {
|
||||
color: white;
|
||||
border-color: #557BB6;
|
||||
border-color: solid #f5f5f5;
|
||||
background-color: #557BB6;
|
||||
}
|
||||
|
||||
QSint--ActionGroup QFrame[class="content"] QToolButton:disabled,
|
||||
QSint--ActionGroup QFrame[class="content"] QToolButton:disabled:checked {
|
||||
color: #333333;
|
||||
border-color: #424242;
|
||||
color: #f5f5f5;
|
||||
border-color: #494949;
|
||||
background-color: #424242;
|
||||
}
|
||||
|
||||
@@ -1639,7 +1812,7 @@ QSint--ActionGroup QFrame[class="content"] QMenu::item {
|
||||
}
|
||||
|
||||
QSint--ActionGroup QFrame[class="content"] QComboBox QAbstractItemView {
|
||||
background-color: #696969;
|
||||
background-color: #333333;
|
||||
}
|
||||
|
||||
|
||||
@@ -1673,7 +1846,7 @@ QRadioButton:disabled {
|
||||
QRadioButton::indicator {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border-radius: 2px;
|
||||
border-radius: 1px;
|
||||
}
|
||||
|
||||
QRadioButton::indicator:pressed {
|
||||
@@ -1838,7 +2011,7 @@ QSlider:vertical {
|
||||
QSlider::groove {
|
||||
background-color: #2a2a2a;
|
||||
border: 2px solid #3c3c3c;
|
||||
border-radius: 2px;
|
||||
border-radius: 1px;
|
||||
margin: 4px 0px;
|
||||
}
|
||||
|
||||
@@ -1862,7 +2035,7 @@ QSlider::handle:vertical {
|
||||
border: 1px solid #2a2a2a;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
border-radius: 2px;
|
||||
border-radius: 1px;
|
||||
}
|
||||
|
||||
QSlider::handle:horizontal {
|
||||
@@ -1918,39 +2091,48 @@ QToolBar > QDateTimeEdit {
|
||||
}
|
||||
|
||||
QToolBar > QPushButton {
|
||||
padding: 4px;
|
||||
padding: 2px;
|
||||
margin: 0px; /* doesn't work with :left, :right:, :top or :bottom sub-controls */
|
||||
min-width: 24px; /* could not be larger due to switchable Preferences "Size of toolbar icons" */
|
||||
min-height: 20px; /* could not be larger due to switchable Preferences "Size of toolbar icons" */
|
||||
border-radius: 2px; /* same as regular QPushButton */
|
||||
min-height: 24px; /* could not be larger due to switchable Preferences "Size of toolbar icons" */
|
||||
border-radius: 1px; /* same as regular QPushButton */
|
||||
}
|
||||
|
||||
QToolBar > QPushButton:checked {
|
||||
border: 1px solid #333333;
|
||||
border: 1px solid #3c3c3c;
|
||||
background-color: #557BB6;
|
||||
}
|
||||
|
||||
/* Hack to avoid QPushButton text partially hidden under menu-indicator */
|
||||
QToolBar > QPushButton::menu-indicator:!checked {
|
||||
image: none;
|
||||
width: 0px;
|
||||
}
|
||||
|
||||
QToolBar > QPushButton:!checked {
|
||||
background-color: #333333; /* Current Working Plane and Nudge */
|
||||
border: 1px solid #333333;
|
||||
text-align: left;
|
||||
padding: 2px 4px;
|
||||
border: 1px solid #3c3c3c;
|
||||
margin: 0px 2px;
|
||||
}
|
||||
|
||||
QToolBar > QPushButton:checked:hover {
|
||||
border-color: #557BB6;
|
||||
border: 1px solid #f5f5f5;
|
||||
}
|
||||
|
||||
QToolBar > QPushButton:!checked:hover {
|
||||
color: #ffffff;
|
||||
background-color: #557BB6;
|
||||
border-color: #557BB6;
|
||||
border: 1px solid #f5f5f5;
|
||||
}
|
||||
|
||||
QToolBar > QPushButton:checked:pressed {
|
||||
border: 1px solid #557bb6;
|
||||
background-color: solid #557BB6;
|
||||
}
|
||||
|
||||
QToolBar > QPushButton:!checked:pressed {
|
||||
border: 1px solid #557bb6;
|
||||
background-color: #557BB6;
|
||||
}
|
||||
|
||||
@@ -1963,43 +2145,60 @@ QToolBar > QPushButton:!checked:disabled {
|
||||
QToolBar > QToolButton {
|
||||
margin: 2px;
|
||||
padding: 2px;
|
||||
border-radius: 2px;
|
||||
border-radius: 1px;
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
|
||||
QToolBar > QToolButton:hover {
|
||||
background-color: #557BB6;
|
||||
border: 1px solid #f5f5f5;
|
||||
}
|
||||
|
||||
QToolBar > QToolButton:pressed {
|
||||
background-color: #557BB6;
|
||||
border: 1px solid #557bb6;
|
||||
}
|
||||
|
||||
/* ToolBar menu buttons (buttons with drop-down menu) */
|
||||
QToolBar > QToolButton#qt_toolbutton_menubutton {
|
||||
padding-right: 20px; /* Hack to add more width to buttons with menu */
|
||||
border: 1px solid transparent;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
QToolBar > QToolButton#qt_toolbutton_menubutton:hover,
|
||||
QToolBar > QToolButton#qt_toolbutton_menubutton:pressed,
|
||||
QToolBar > QToolButton#qt_toolbutton_menubutton:open {
|
||||
border: 1px solid #557BB6;
|
||||
border: 1px solid #333333;
|
||||
border-radius: 1px;
|
||||
}
|
||||
|
||||
QToolBar QToolButton::menu-button,
|
||||
QToolBar > QToolButton#qt_toolbutton_menubutton::menu-button {
|
||||
border: none;
|
||||
border-top-right-radius: 3px;
|
||||
border-bottom-right-radius: 3px;
|
||||
border-top-right-radius: 1px;
|
||||
border-bottom-right-radius: 1px;
|
||||
width: 16px; /* 16px width + 4px for border = 20px allocated above */
|
||||
outline: none;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
QToolBar > QToolButton#qt_toolbutton_menubutton::menu-button:hover,
|
||||
QToolBar > QToolButton#qt_toolbutton_menubutton::menu-button:hover {
|
||||
border-top: 1px solid #f5f5f5;
|
||||
border-bottom: 1px solid #f5f5f5;
|
||||
border-right: 1px solid #f5f5f5;
|
||||
background-color: #557BB6;
|
||||
}
|
||||
|
||||
QToolBar > QToolButton#qt_toolbutton_menubutton:pressed,
|
||||
QToolBar > QToolButton#qt_toolbutton_menubutton:open {
|
||||
background-color: #557BB6;
|
||||
border: 1px solid #557BB6;
|
||||
}
|
||||
|
||||
QToolBar > QToolButton#qt_toolbutton_menubutton:hover {
|
||||
background-color: #557BB6;
|
||||
border: 1px solid #f5f5f5;
|
||||
}
|
||||
|
||||
QToolBar > QToolButton#qt_toolbutton_menubutton::menu-button:pressed,
|
||||
QToolBar > QToolButton#qt_toolbutton_menubutton::menu-button:open {
|
||||
border-top: 1px solid #557bb6;
|
||||
border-bottom: 1px solid #557bb6;
|
||||
border-right: 1px solid #557bb6;
|
||||
background-color: #557BB6;
|
||||
}
|
||||
|
||||
@@ -2058,14 +2257,14 @@ QToolBar QToolButton#qt_toolbar_ext_button:on {
|
||||
Tables (spreadsheets)
|
||||
==================================================================================================*/
|
||||
QTableView {
|
||||
gridline-color: #696969;
|
||||
gridline-color: #a8a8a8;
|
||||
selection-color: #ffffff;
|
||||
selection-background-color: #2D5C9A; /* Default Spreadsheet cell selection background color */
|
||||
background-color: #a0a0a0; /* Default Spreadsheet cell background color */
|
||||
selection-background-color: #557bb6; /* Default Spreadsheet cell selection background color */
|
||||
background-color: #cecece; /* Default Spreadsheet cell background color */
|
||||
}
|
||||
|
||||
QTableView::item:hover {
|
||||
background-color: rgba(0,0,0,10); /* temporal: is it displayed in Linux or Windows? on OSX it isn't */
|
||||
background-color: #557bb6; /* temporal: is it displayed in Linux or Windows? on OSX it isn't */
|
||||
}
|
||||
|
||||
QTableView::item:disabled {
|
||||
@@ -2074,7 +2273,7 @@ QTableView::item:disabled {
|
||||
|
||||
QTableView::item:selected {
|
||||
color: #a0a0a0;
|
||||
border-color: #cbd8e6; /* same as focused background color */
|
||||
border-color: #cecece; /* same as focused background color */
|
||||
border-bottom-color: #557BB6; /* same as focused border color */
|
||||
}
|
||||
|
||||
@@ -2102,7 +2301,7 @@ QTableView > QWidget > QTimeEdit:down-button,
|
||||
QTableView > QWidget > QDateEdit:down-button,
|
||||
QTableView > QWidget > QDateTimeEdit:down-button,
|
||||
QTableView > QWidget > Gui--ColorButton {
|
||||
border-radius: 2px;
|
||||
border-radius: 1px;
|
||||
}
|
||||
|
||||
QTableView > QWidget > QComboBox,
|
||||
@@ -2114,7 +2313,7 @@ QTableView > QWidget > QTextEdit,
|
||||
QTableView > QWidget > QTimeEdit,
|
||||
QTableView > QWidget > QDateEdit,
|
||||
QTableView > QWidget > QDateTimeEdit {
|
||||
color: black;
|
||||
color: #f5f5f5;
|
||||
background-color: transparent;
|
||||
border-color: transparent;
|
||||
}
|
||||
@@ -2145,11 +2344,11 @@ QTableView > QWidget > QTextEdit:focus,
|
||||
QTableView > QWidget > QTimeEdit:focus,
|
||||
QTableView > QWidget > QDateEdit:focus,
|
||||
QTableView > QWidget > QDateTimeEdit:focus {
|
||||
color: #2a2a2a;
|
||||
selection-color: white;
|
||||
color: #000000;
|
||||
selection-color: #f5f5f5;
|
||||
selection-background-color: #557BB6;
|
||||
border-color: #cbd8e6;
|
||||
background-color: #cbd8e6;
|
||||
border-color: #3c3c3c;
|
||||
background-color: #cecece;
|
||||
}
|
||||
|
||||
QTableView > QWidget > QComboBox:disabled,
|
||||
@@ -2161,7 +2360,7 @@ QTableView > QWidget > QTextEdit:disabled,
|
||||
QTableView > QWidget > QTimeEdit:disabled,
|
||||
QTableView > QWidget > QDateEdit:disabled,
|
||||
QTableView > QWidget > QDateTimeEdit:disabled {
|
||||
color: rgba(0,0,0,120);
|
||||
color: #f5f5f5;
|
||||
background-color: transparent;
|
||||
border-color: transparent;
|
||||
}
|
||||
@@ -2175,7 +2374,7 @@ QTableView > QWidget > QTextEdit:read-only,
|
||||
QTableView > QWidget > QTimeEdit:read-only,
|
||||
QTableView > QWidget > QDateEdit:read-only,
|
||||
QTableView > QWidget > QDateTimeEdit:read-only {
|
||||
color: black;
|
||||
color: #f5f5f5;
|
||||
background-color: transparent;
|
||||
border-color: transparent;
|
||||
}
|
||||
@@ -2228,7 +2427,7 @@ QToolBar#Selector QToolButton {
|
||||
border: none;
|
||||
margin: 0px;
|
||||
padding: 2px 6px;
|
||||
border-radius: 2px;
|
||||
border-radius: 1px;
|
||||
}
|
||||
|
||||
/* Active tab */
|
||||
|
||||
@@ -146,6 +146,10 @@ int main( int argc, char ** argv )
|
||||
#endif
|
||||
|
||||
#if defined (FC_OS_WIN32)
|
||||
// we need to force Coin not to use Freetype in order to find installed fonts on Windows
|
||||
// see https://forum.freecadweb.org/viewtopic.php?p=485142#p485016
|
||||
_putenv("COIN_FORCE_FREETYPE_OFF=1");
|
||||
|
||||
int argc_ = argc;
|
||||
QVector<QByteArray> data;
|
||||
QVector<char *> argv_;
|
||||
|
||||
@@ -211,11 +211,11 @@ def getCutShapes(objs,cutplane,onlySolids,clip,joinArch,showHidden,groupSshapesB
|
||||
|
||||
cutface,cutvolume,invcutvolume = ArchCommands.getCutVolume(cutplane,shapes,clip)
|
||||
shapes = []
|
||||
if cutvolume:
|
||||
for o, shapeList in objectShapes:
|
||||
tmpSshapes = []
|
||||
for sh in shapeList:
|
||||
for sol in sh.Solids:
|
||||
for o, shapeList in objectShapes:
|
||||
tmpSshapes = []
|
||||
for sh in shapeList:
|
||||
for sol in sh.Solids:
|
||||
if cutvolume:
|
||||
if sol.Volume < 0:
|
||||
sol.reverse()
|
||||
c = sol.cut(cutvolume)
|
||||
@@ -235,6 +235,8 @@ def getCutShapes(objs,cutplane,onlySolids,clip,joinArch,showHidden,groupSshapesB
|
||||
if showHidden:
|
||||
c = sol.cut(invcutvolume)
|
||||
hshapes.append(c)
|
||||
else:
|
||||
shapes.extend(sol.Solids)
|
||||
|
||||
if len(tmpSshapes) > 0:
|
||||
sshapes.extend(tmpSshapes)
|
||||
|
||||
@@ -55,7 +55,7 @@ import six
|
||||
import FreeCAD
|
||||
import Part, Draft, Mesh
|
||||
import DraftVecUtils, DraftGeomUtils, WorkingPlane
|
||||
from Draft import _Dimension, _ViewProviderDimension
|
||||
from Draft import _Dimension
|
||||
from FreeCAD import Vector
|
||||
from FreeCAD import Console as FCC
|
||||
|
||||
@@ -2573,7 +2573,9 @@ def processdxf(document, filename, getShapes=False, reComputeFlag=True):
|
||||
newob = doc.addObject("App::FeaturePython", "Dimension")
|
||||
lay.addObject(newob)
|
||||
_Dimension(newob)
|
||||
_ViewProviderDimension(newob.ViewObject)
|
||||
if FreeCAD.GuiUp:
|
||||
from Draft import _ViewProviderDimension
|
||||
_ViewProviderDimension(newob.ViewObject)
|
||||
newob.Start = p1
|
||||
newob.End = p2
|
||||
newob.Dimline = pt
|
||||
|
||||
@@ -432,6 +432,10 @@ Base::Vector3d Constraint::getBasePoint(const Base::Vector3d& base, const Base::
|
||||
const Base::Vector3d Constraint::getDirection(const App::PropertyLinkSub &direction)
|
||||
{
|
||||
App::DocumentObject* obj = direction.getValue();
|
||||
if (!obj) {
|
||||
return Base::Vector3d(0,0,0);
|
||||
}
|
||||
|
||||
if (obj->getTypeId().isDerivedFrom(App::Line::getClassTypeId())) {
|
||||
Base::Vector3d vec(1.0, 0.0, 0.0);
|
||||
static_cast<App::Line*>(obj)->Placement.getValue().multVec(vec, vec);
|
||||
|
||||
@@ -30,6 +30,12 @@ __url__ = "https://www.freecadweb.org"
|
||||
# \ingroup FEM
|
||||
# \brief task panel for mechanical ResultObjectPython
|
||||
|
||||
try:
|
||||
import matplotlib
|
||||
matplotlib.use("Qt5Agg")
|
||||
except Exception:
|
||||
print("Failed to set matplotlib backend to Qt5Agg")
|
||||
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
|
||||
|
||||
@@ -82,6 +82,8 @@
|
||||
|
||||
#include "ImpExpDxf.h"
|
||||
|
||||
namespace Import {
|
||||
|
||||
class ImportOCAFExt : public Import::ImportOCAF2
|
||||
{
|
||||
public:
|
||||
@@ -98,7 +100,6 @@ private:
|
||||
}
|
||||
};
|
||||
|
||||
namespace Import {
|
||||
class Module : public Py::ExtensionModule<Module>
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -138,6 +138,7 @@
|
||||
|
||||
FC_LOG_LEVEL_INIT("Import", true, true)
|
||||
|
||||
namespace ImportGui {
|
||||
class OCAFBrowser
|
||||
{
|
||||
public:
|
||||
@@ -382,7 +383,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
namespace ImportGui {
|
||||
class Module : public Py::ExtensionModule<Module>
|
||||
{
|
||||
public:
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
[General]
|
||||
Name = Air
|
||||
Description = Standard air properties at 20 Degrees Celsius and 1 atm
|
||||
Description = Dry air properties at 20 Degrees Celsius and 1 atm
|
||||
MolarMass = 28.965
|
||||
Father = Gas
|
||||
|
||||
[Fluidic]
|
||||
Density = 1.20 kg/m^3
|
||||
Density = 1.204 kg/m^3
|
||||
DynamicViscosity = 1.80e-5 kg/m/s
|
||||
KinematicViscosity = 1.511e-5 m^2/s
|
||||
; PrandtlNumber is a nondimension number for CFD simulation
|
||||
PrandtlNumber = 0.7
|
||||
|
||||
[Thermal]
|
||||
SpecificHeat = 1.005 J/kg/K
|
||||
ThermalConductivity = 0.0257 W/m/K
|
||||
SpecificHeat = 1.01 kJ/kg/K
|
||||
ThermalConductivity = 0.02587 W/m/K
|
||||
; volumetric expansion coeff of ideal gas depends on temperature and pressure
|
||||
VolumetricThermalExpansionCoefficient = 3.43e-3 m/m/K
|
||||
|
||||
|
||||
@@ -977,13 +977,14 @@ Py::Object TopoShapeFacePy::getWire(void) const
|
||||
|
||||
Py::Object TopoShapeFacePy::getOuterWire(void) const
|
||||
{
|
||||
const TopoDS_Shape& clSh = getTopoShapePtr()->getShape();
|
||||
if (clSh.IsNull())
|
||||
const TopoDS_Shape& shape = getTopoShapePtr()->getShape();
|
||||
if (shape.IsNull())
|
||||
throw Py::RuntimeError("Null shape");
|
||||
if (clSh.ShapeType() == TopAbs_FACE) {
|
||||
TopoDS_Face clFace = (TopoDS_Face&)clSh;
|
||||
TopoDS_Wire clWire = ShapeAnalysis::OuterWire(clFace);
|
||||
return Py::Object(new TopoShapeWirePy(new TopoShape(clWire)),true);
|
||||
if (shape.ShapeType() == TopAbs_FACE) {
|
||||
TopoDS_Wire wire = ShapeAnalysis::OuterWire(TopoDS::Face(shape));
|
||||
Base::PyObjectBase* wirepy = new TopoShapeWirePy(new TopoShape(wire));
|
||||
wirepy->setNotTracking();
|
||||
return Py::asObject(wirepy);
|
||||
}
|
||||
else {
|
||||
throw Py::TypeError("Internal error, TopoDS_Shape is not a face!");
|
||||
|
||||
@@ -194,7 +194,9 @@ Py::Object TopoShapeVertexPy::getPoint(void) const
|
||||
try {
|
||||
const TopoDS_Vertex& v = TopoDS::Vertex(getTopoShapePtr()->getShape());
|
||||
gp_Pnt p = BRep_Tool::Pnt(v);
|
||||
return Py::asObject(new Base::VectorPy(new Base::Vector3d(p.X(),p.Y(),p.Z())));
|
||||
Base::PyObjectBase* pnt = new Base::VectorPy(new Base::Vector3d(p.X(),p.Y(),p.Z()));
|
||||
pnt->setNotTracking();
|
||||
return Py::asObject(pnt);
|
||||
}
|
||||
catch (Standard_Failure& e) {
|
||||
|
||||
|
||||
@@ -111,6 +111,7 @@ App::DocumentObjectExecReturn *Helix::execute(void)
|
||||
return new App::DocumentObjectExecReturn("Error: Pitch too small");
|
||||
if (Height.getValue() < Precision::Confusion())
|
||||
return new App::DocumentObjectExecReturn("Error: height too small!");
|
||||
Turns.setValue(Height.getValue()/Pitch.getValue());
|
||||
break;
|
||||
case 1: // pitch - turns
|
||||
if (Pitch.getValue() < Precision::Confusion())
|
||||
|
||||
@@ -229,7 +229,8 @@ void TaskMultiTransformParameters::closeSubTask()
|
||||
|
||||
void TaskMultiTransformParameters::onTransformDelete()
|
||||
{
|
||||
if (editHint) return; // Can't delete the hint...
|
||||
if (editHint)
|
||||
return; // Can't delete the hint...
|
||||
int row = ui->listTransformFeatures->currentIndex().row();
|
||||
PartDesign::MultiTransform* pcMultiTransform = static_cast<PartDesign::MultiTransform*>(TransformedView->getObject());
|
||||
std::vector<App::DocumentObject*> transformFeatures = pcMultiTransform->Transformations.getValues();
|
||||
@@ -254,7 +255,8 @@ void TaskMultiTransformParameters::onTransformDelete()
|
||||
|
||||
void TaskMultiTransformParameters::onTransformEdit()
|
||||
{
|
||||
if (editHint) return; // Can't edit the hint...
|
||||
if (editHint)
|
||||
return; // Can't edit the hint...
|
||||
closeSubTask(); // For example if user is editing one subTask and then double-clicks on another without OK'ing first
|
||||
ui->listTransformFeatures->currentItem()->setSelected(true);
|
||||
int row = ui->listTransformFeatures->currentIndex().row();
|
||||
@@ -288,17 +290,23 @@ void TaskMultiTransformParameters::onTransformAddMirrored()
|
||||
closeSubTask();
|
||||
std::string newFeatName = TransformedView->getObject()->getDocument()->getUniqueObjectName("Mirrored");
|
||||
auto pcActiveBody = PartDesignGui::getBody(false);
|
||||
if(!pcActiveBody) return;
|
||||
if (!pcActiveBody)
|
||||
return;
|
||||
|
||||
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Mirrored"));
|
||||
FCMD_OBJ_CMD(pcActiveBody,"newObject('PartDesign::Mirrored','"<<newFeatName<<"')");
|
||||
FCMD_OBJ_CMD(pcActiveBody, "newObject('PartDesign::Mirrored','"<<newFeatName<<"')");
|
||||
auto Feat = pcActiveBody->getDocument()->getObject(newFeatName.c_str());
|
||||
if (!Feat)
|
||||
return;
|
||||
//Gui::Command::updateActive();
|
||||
App::DocumentObject* sketch = getSketchObject();
|
||||
if (sketch)
|
||||
FCMD_OBJ_CMD(Feat,"MirrorPlane = ("<<Gui::Command::getObjectCmd(sketch)<<",['V_Axis'])");
|
||||
FCMD_OBJ_CMD(Feat, "MirrorPlane = ("<<Gui::Command::getObjectCmd(sketch)<<",['V_Axis'])");
|
||||
|
||||
finishAdd(newFeatName);
|
||||
// show the new view when no error
|
||||
if (!Feat->isError())
|
||||
TransformedView->getObject()->Visibility.setValue(true);
|
||||
}
|
||||
|
||||
void TaskMultiTransformParameters::onTransformAddLinearPattern()
|
||||
@@ -308,29 +316,35 @@ void TaskMultiTransformParameters::onTransformAddLinearPattern()
|
||||
closeSubTask();
|
||||
std::string newFeatName = TransformedView->getObject()->getDocument()->getUniqueObjectName("LinearPattern");
|
||||
auto pcActiveBody = PartDesignGui::getBody(false);
|
||||
if(!pcActiveBody) return;
|
||||
if (!pcActiveBody)
|
||||
return;
|
||||
|
||||
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Make LinearPattern"));
|
||||
FCMD_OBJ_CMD(pcActiveBody,"newObject('PartDesign::LinearPattern','"<<newFeatName<<"')");
|
||||
FCMD_OBJ_CMD(pcActiveBody, "newObject('PartDesign::LinearPattern','"<<newFeatName<<"')");
|
||||
auto Feat = pcActiveBody->getDocument()->getObject(newFeatName.c_str());
|
||||
if (!Feat)
|
||||
return;
|
||||
//Gui::Command::updateActive();
|
||||
App::DocumentObject* sketch = getSketchObject();
|
||||
if (sketch) {
|
||||
FCMD_OBJ_CMD(Feat,"Direction = ("<<Gui::Command::getObjectCmd(sketch)<<",['H_Axis'])");
|
||||
FCMD_OBJ_CMD(Feat, "Direction = ("<<Gui::Command::getObjectCmd(sketch)<<",['H_Axis'])");
|
||||
}
|
||||
else {
|
||||
// set Direction value before filling up the combo box to avoid creating an empty item
|
||||
// inside updateUI()
|
||||
PartDesign::Body* body = static_cast<PartDesign::Body*>(Part::BodyBase::findBodyOf(getObject()));
|
||||
if (body) {
|
||||
FCMD_OBJ_CMD(Feat,"Direction = ("<<Gui::Command::getObjectCmd(body->getOrigin()->getX())<<",[''])");
|
||||
FCMD_OBJ_CMD(Feat, "Direction = ("<<Gui::Command::getObjectCmd(body->getOrigin()->getX())<<",[''])");
|
||||
}
|
||||
}
|
||||
|
||||
FCMD_OBJ_CMD(Feat,"Length = 100");
|
||||
FCMD_OBJ_CMD(Feat,"Occurrences = 2");
|
||||
FCMD_OBJ_CMD(Feat, "Length = 100");
|
||||
FCMD_OBJ_CMD(Feat, "Occurrences = 2");
|
||||
|
||||
finishAdd(newFeatName);
|
||||
// show the new view when no error
|
||||
if (!Feat->isError())
|
||||
TransformedView->getObject()->Visibility.setValue(true);
|
||||
}
|
||||
|
||||
void TaskMultiTransformParameters::onTransformAddPolarPattern()
|
||||
@@ -338,19 +352,25 @@ void TaskMultiTransformParameters::onTransformAddPolarPattern()
|
||||
closeSubTask();
|
||||
std::string newFeatName = TransformedView->getObject()->getDocument()->getUniqueObjectName("PolarPattern");
|
||||
auto pcActiveBody = PartDesignGui::getBody(false);
|
||||
if(!pcActiveBody) return;
|
||||
if (!pcActiveBody)
|
||||
return;
|
||||
|
||||
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "PolarPattern"));
|
||||
FCMD_OBJ_CMD(pcActiveBody,"newObject('PartDesign::PolarPattern','"<<newFeatName<<"')");
|
||||
FCMD_OBJ_CMD(pcActiveBody, "newObject('PartDesign::PolarPattern','"<<newFeatName<<"')");
|
||||
auto Feat = pcActiveBody->getDocument()->getObject(newFeatName.c_str());
|
||||
if (!Feat)
|
||||
return;
|
||||
//Gui::Command::updateActive();
|
||||
App::DocumentObject* sketch = getSketchObject();
|
||||
if (sketch)
|
||||
FCMD_OBJ_CMD(Feat, "Axis = ("<<Gui::Command::getObjectCmd(sketch)<<",['N_Axis'])");
|
||||
FCMD_OBJ_CMD(Feat,"Angle = 360");
|
||||
FCMD_OBJ_CMD(Feat,"Occurrences = 2");
|
||||
FCMD_OBJ_CMD(Feat, "Angle = 360");
|
||||
FCMD_OBJ_CMD(Feat, "Occurrences = 2");
|
||||
|
||||
finishAdd(newFeatName);
|
||||
// show the new view when no error
|
||||
if (!Feat->isError())
|
||||
TransformedView->getObject()->Visibility.setValue(true);
|
||||
}
|
||||
|
||||
void TaskMultiTransformParameters::onTransformAddScaled()
|
||||
@@ -358,16 +378,22 @@ void TaskMultiTransformParameters::onTransformAddScaled()
|
||||
closeSubTask();
|
||||
std::string newFeatName = TransformedView->getObject()->getDocument()->getUniqueObjectName("Scaled");
|
||||
auto pcActiveBody = PartDesignGui::getBody(false);
|
||||
if(!pcActiveBody) return;
|
||||
if (!pcActiveBody)
|
||||
return;
|
||||
|
||||
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Scaled"));
|
||||
FCMD_OBJ_CMD(pcActiveBody,"newObject('PartDesign::Scaled','"<<newFeatName<<"')");
|
||||
FCMD_OBJ_CMD(pcActiveBody, "newObject('PartDesign::Scaled','"<<newFeatName<<"')");
|
||||
auto Feat = pcActiveBody->getDocument()->getObject(newFeatName.c_str());
|
||||
if (!Feat)
|
||||
return;
|
||||
//Gui::Command::updateActive();
|
||||
FCMD_OBJ_CMD(Feat,"Factor = 2");
|
||||
FCMD_OBJ_CMD(Feat,"Occurrences = 2");
|
||||
FCMD_OBJ_CMD(Feat, "Factor = 2");
|
||||
FCMD_OBJ_CMD(Feat, "Occurrences = 2");
|
||||
|
||||
finishAdd(newFeatName);
|
||||
// show the new view when no error
|
||||
if (!Feat->isError())
|
||||
TransformedView->getObject()->Visibility.setValue(true);
|
||||
}
|
||||
|
||||
void TaskMultiTransformParameters::finishAdd(std::string &newFeatName)
|
||||
|
||||
@@ -264,6 +264,7 @@ bool TaskDlgSketchBasedParameters::accept() {
|
||||
bool TaskDlgSketchBasedParameters::reject()
|
||||
{
|
||||
PartDesign::ProfileBased* pcSketchBased = static_cast<PartDesign::ProfileBased*>(vp->getObject());
|
||||
App::DocumentObjectWeakPtrT weakptr(pcSketchBased);
|
||||
// get the Sketch
|
||||
Sketcher::SketchObject *pcSketch = static_cast<Sketcher::SketchObject*>(pcSketchBased->Profile.getValue());
|
||||
bool rv;
|
||||
@@ -273,7 +274,7 @@ bool TaskDlgSketchBasedParameters::reject()
|
||||
|
||||
// if abort command deleted the object the sketch is visible again.
|
||||
// The previous one feature already should be made visible
|
||||
if (!Gui::Application::Instance->getViewProvider(pcSketchBased)) {
|
||||
if (weakptr.expired()) {
|
||||
// Make the sketch visible
|
||||
if (pcSketch && Gui::Application::Instance->getViewProvider(pcSketch))
|
||||
Gui::Application::Instance->getViewProvider(pcSketch)->show();
|
||||
|
||||
@@ -47,5 +47,5 @@ INSTALL(
|
||||
FILES
|
||||
${Start_Tests}
|
||||
DESTINATION
|
||||
Mod/Start/testStart
|
||||
Mod/Start/TestStart
|
||||
)
|
||||
|
||||
@@ -191,6 +191,10 @@ bool ViewProviderTemplate::onDelete(const std::vector<std::string> &)
|
||||
// get the page
|
||||
auto page = getTemplate()->getParentPage();
|
||||
|
||||
// If no parent page is given then just go ahead
|
||||
if (!page)
|
||||
return true;
|
||||
|
||||
// generate dialog
|
||||
QString bodyMessage;
|
||||
QTextStream bodyMessageStream(&bodyMessage);
|
||||
|
||||
@@ -239,6 +239,7 @@ Py::Object BrowserViewPy::setHtml(const Py::Tuple& args)
|
||||
WebView::WebView(QWidget *parent)
|
||||
: QWEBVIEW(parent)
|
||||
{
|
||||
#ifdef QTWEBKIT
|
||||
// Increase html font size for high DPI displays
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||
QRect mainScreenSize = QApplication::primaryScreen()->geometry();
|
||||
@@ -248,6 +249,7 @@ WebView::WebView(QWidget *parent)
|
||||
if (mainScreenSize.width() > 1920){
|
||||
setTextSizeMultiplier (mainScreenSize.width()/1920.0);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef QTWEBENGINE
|
||||
|
||||
@@ -20,14 +20,14 @@ To build the installer you can do the following:
|
||||
(You can alternatively get nsProcess from https://nsis.sourceforge.io/NsProcess_plugin)
|
||||
7. Copy all FreeCAD files to the folder "~\FreeCAD"
|
||||
e.g. "C:\FreeCAD\Installer\FreeCAD"
|
||||
8. If you use a version of FreeCAD that was compiled using another MSVC version than MSVC 2017,
|
||||
8. If you use a version of FreeCAD that was compiled using another MSVC version than MSVC 2019,
|
||||
copy its distributable DLLs to the folder FILES_DEPS (see step 3).
|
||||
9. Right-click on the file FreeCAD-installer.nsi and choose "Compile NSIS script"
|
||||
to compile the installer.
|
||||
10. The folder ~\MSVCRedist contains already all MSVC 2017 x64 redistributable DLLs necessary
|
||||
for FreeCAD 0.19dev. If another MSVC version was used to compile FreeCAD, replace the DLLs by
|
||||
10. The folder ~\MSVCRedist contains already all MSVC 2019 x64 redistributable DLLs necessary
|
||||
for FreeCAD 0.19. If another MSVC version was used to compile FreeCAD, replace the DLLs by
|
||||
the ones of the used MSVC. (They are usually available in the folder
|
||||
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Redist\MSVC)
|
||||
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC)
|
||||
|
||||
For test builds of the installer you can turn off the compression. This speeds up
|
||||
the build time for the installer a lot but increases its file size. The compression
|
||||
|
||||
@@ -18,14 +18,14 @@ SetCompressor /SOLID lzma
|
||||
!define APP_VERSION_MAJOR 0
|
||||
!define APP_VERSION_MINOR 19
|
||||
!define APP_VERSION_REVISION 0
|
||||
!define APP_VERSION_EMERGENCY "rev18731" # use "1" for an emergency release of FreeCAD otherwise ""
|
||||
!define APP_VERSION_EMERGENCY "" # use "1" for an emergency release of FreeCAD otherwise ""
|
||||
# alternatively you can use APP_VERSION_EMERGENCY for a custom suffix of the version number
|
||||
!define APP_EMERGENCY_DOT "" # use "." for an emergency release of FreeCAD otherwise ""
|
||||
!define APP_VERSION_BUILD 1 # Start with 1 for the installer releases of each version
|
||||
|
||||
!define APP_VERSION "${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}.${APP_VERSION_REVISION}${APP_EMERGENCY_DOT}${APP_VERSION_EMERGENCY}" # Version to display
|
||||
|
||||
!define COPYRIGHT_YEAR 2020
|
||||
!define COPYRIGHT_YEAR 2021
|
||||
|
||||
#--------------------------------
|
||||
# Installer file name
|
||||
@@ -43,6 +43,6 @@ SetCompressor /SOLID lzma
|
||||
# File locations
|
||||
# !!! you need to adjust them to the folders in your Windows system !!!
|
||||
|
||||
!define FILES_FREECAD "D:\usti\FreeCAD\Installer\FreeCAD"
|
||||
!define FILES_DEPS "D:\usti\FreeCAD\Installer\MSVCRedist"
|
||||
!define FILES_THUMBS "D:\usti\FreeCAD\Installer\thumbnail"
|
||||
!define FILES_FREECAD "G:\FreeCADInst\Installer\FreeCAD"
|
||||
!define FILES_DEPS "G:\FreeCADInst\Installer\MSVCRedist"
|
||||
!define FILES_THUMBS "G:\FreeCADInst\Installer\thumbnail"
|
||||
|
||||
@@ -42,8 +42,14 @@ Configuration and variables of FreeCAD installer
|
||||
!define APP_REGNAME_DOC "${APP_NAME}.Document"
|
||||
|
||||
!define APP_EXT ".FCStd"
|
||||
!define APP_EXT1 ".FCStd1"
|
||||
!define APP_MIME_TYPE "application/x-zip-compressed"
|
||||
|
||||
!define APP_EXT_BAK ".FCBak"
|
||||
!define APP_EXT_MACRO ".FCMacro"
|
||||
!define APP_EXT_MAT ".FCMat"
|
||||
!define APP_EXT_SCRIPT ".FCScript"
|
||||
|
||||
!define APP_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${SETUP_UNINSTALLER_KEY}"
|
||||
|
||||
#--------------------------------
|
||||
|
||||
@@ -24,10 +24,23 @@ Section "un.FreeCAD" un.SecUnProgramFiles
|
||||
ReadRegStr $R0 SHCTX "Software\Classes\${APP_EXT}" ""
|
||||
${if} $R0 == "${APP_REGNAME_DOC}"
|
||||
DeleteRegKey SHCTX "Software\Classes\${APP_EXT}"
|
||||
#DeleteRegKey SHCTX "Software\Classes\${APP_REGNAME_DOC}"
|
||||
${endif}
|
||||
DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\${APP_EXT}"
|
||||
|
||||
# remove further FC-specific file extension
|
||||
DeleteRegKey SHCTX "Software\Classes\${APP_EXT1}" # .FCStd1
|
||||
DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\${APP_EXT1}"
|
||||
DeleteRegKey SHCTX "Software\Classes\${APP_EXT_BAK}" # .FCBak
|
||||
DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\${APP_EXT_BAK}"
|
||||
DeleteRegKey SHCTX "Software\Classes\${APP_EXT_MACRO}" # .FCMacro
|
||||
DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\${APP_EXT_MACRO}"
|
||||
DeleteRegKey SHCTX "Software\Classes\${APP_EXT_MAT}" # .FCMat
|
||||
DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\${APP_EXT_MAT}"
|
||||
DeleteRegKey SHCTX "Software\Classes\${APP_EXT_SCRIPT}" # .FCScript
|
||||
DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\${APP_EXT_SCRIPT}"
|
||||
|
||||
${if} $MultiUser.Privileges == "Admin"
|
||||
DeleteRegKey HKCR "${APP_NAME}.Document"
|
||||
DeleteRegKey HKCR "${APP_REGNAME_DOC}"
|
||||
# see https://nsis.sourceforge.io/Docs/AppendixB.html#library_install for a description of UnInstallLib
|
||||
!insertmacro UnInstallLib REGDLL NOTSHARED NOREBOOT_NOTPROTECTED $SYSDIR\FCStdThumbnail.dll
|
||||
${endif}
|
||||
|
||||
Reference in New Issue
Block a user