From e69bbf5460dffcf10d2b04f91e3b1058242e3c46 Mon Sep 17 00:00:00 2001 From: Leonardo Zide Date: Wed, 16 Oct 2024 18:17:00 -0700 Subject: [PATCH] Removed action icons in the parts widget edits. --- common/lc_findreplacewidget.cpp | 2 +- common/lc_partselectionwidget.cpp | 36 +++++++++++++------ leocad.qrc | 2 -- resources/parts_cancel.png | Bin 867 -> 0 bytes resources/parts_search.png | Bin 2086 -> 0 bytes resources/stylesheet/close.png | Bin 254 -> 0 bytes resources/stylesheet/close.svg | 54 ++++++++++++++++++++++++++++ resources/stylesheet/stylesheet.qrc | 2 +- resources/stylesheet/stylesheet.qss | 4 +-- 9 files changed, 83 insertions(+), 17 deletions(-) delete mode 100644 resources/parts_cancel.png delete mode 100644 resources/parts_search.png delete mode 100644 resources/stylesheet/close.png create mode 100644 resources/stylesheet/close.svg diff --git a/common/lc_findreplacewidget.cpp b/common/lc_findreplacewidget.cpp index e49cf958..8e4cefc6 100644 --- a/common/lc_findreplacewidget.cpp +++ b/common/lc_findreplacewidget.cpp @@ -84,7 +84,7 @@ lcFindReplaceWidget::lcFindReplaceWidget(QWidget* Parent, lcModel* Model, bool R QToolButton* CloseButton = new QToolButton(this); CloseButton->setAutoRaise(true); - CloseButton->setIcon(QIcon(":/stylesheet/close.png")); + CloseButton->setIcon(QIcon(":/stylesheet/close.svg")); CloseButton->setToolTip(tr("Close")); Layout->addWidget(CloseButton, 0, 5); diff --git a/common/lc_partselectionwidget.cpp b/common/lc_partselectionwidget.cpp index 7393316e..ae8599c4 100644 --- a/common/lc_partselectionwidget.cpp +++ b/common/lc_partselectionwidget.cpp @@ -627,7 +627,7 @@ void lcPartSelectionListView::startDrag(Qt::DropActions SupportedActions) } lcPartSelectionWidget::lcPartSelectionWidget(QWidget* Parent) - : QWidget(Parent), mFilterAction(nullptr) + : QWidget(Parent) { mSplitter = new QSplitter(this); mSplitter->setOrientation(Qt::Vertical); @@ -645,8 +645,6 @@ lcPartSelectionWidget::lcPartSelectionWidget(QWidget* Parent) mFilterCategoriesWidget = new QLineEdit(CategoriesGroupWidget); mFilterCategoriesWidget->setPlaceholderText(tr("Filter Categories")); - mFilterCategoriesAction = mFilterCategoriesWidget->addAction(QIcon(":/resources/filter.png"), QLineEdit::TrailingPosition); - connect(mFilterCategoriesAction, SIGNAL(triggered()), this, SLOT(FilterCategoriesTriggered())); FilterCategoriesLayout->addWidget(mFilterCategoriesWidget); mFilterCaseAction = new QAction(); @@ -679,8 +677,6 @@ lcPartSelectionWidget::lcPartSelectionWidget(QWidget* Parent) mFilterWidget = new QLineEdit(PartsGroupWidget); mFilterWidget->setPlaceholderText(tr("Search Parts")); - mFilterAction = mFilterWidget->addAction(QIcon(":/resources/parts_search.png"), QLineEdit::TrailingPosition); - connect(mFilterAction, SIGNAL(triggered()), this, SLOT(FilterTriggered())); SearchLayout->addWidget(mFilterWidget); QToolButton* OptionsButton = new QToolButton(); @@ -814,9 +810,18 @@ void lcPartSelectionWidget::FilterCategoriesChanged(const QString& Text) if (mFilterCategoriesAction) { if (Text.isEmpty()) - mFilterCategoriesAction->setIcon(QIcon(":/resources/filter.png")); - else - mFilterCategoriesAction->setIcon(QIcon(":/resources/parts_cancel.png")); + { + delete mFilterCategoriesAction; + mFilterCategoriesAction = nullptr; + } + } + else + { + if (!Text.isEmpty()) + { + mFilterCategoriesAction = mFilterCategoriesWidget->addAction(QIcon(":/stylesheet/close.svg"), QLineEdit::TrailingPosition); + connect(mFilterCategoriesAction, &QAction::triggered, this, &lcPartSelectionWidget::FilterCategoriesTriggered); + } } bool Hide = true; @@ -839,9 +844,18 @@ void lcPartSelectionWidget::FilterChanged(const QString& Text) if (mFilterAction) { if (Text.isEmpty()) - mFilterAction->setIcon(QIcon(":/resources/parts_search.png")); - else - mFilterAction->setIcon(QIcon(":/resources/parts_cancel.png")); + { + delete mFilterAction; + mFilterAction = nullptr; + } + } + else + { + if (!Text.isEmpty()) + { + mFilterAction = mFilterWidget->addAction(QIcon(":/stylesheet/close.svg"), QLineEdit::TrailingPosition); + connect(mFilterAction, &QAction::triggered, this, &lcPartSelectionWidget::FilterTriggered); + } } mPartsWidget->GetListModel()->SetFilter(Text); diff --git a/leocad.qrc b/leocad.qrc index b510eba2..cd75d207 100644 --- a/leocad.qrc +++ b/leocad.qrc @@ -110,8 +110,6 @@ resources/piece_show_earlier.png resources/piece_show_later.png resources/time_add_keys.png - resources/parts_search.png - resources/parts_cancel.png resources/archive.png resources/library.zip resources/studlogo1.zip diff --git a/resources/parts_cancel.png b/resources/parts_cancel.png deleted file mode 100644 index 8e01c8ccb2e425111149f9fad0ba3dc3cec9d9ca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 867 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyEa{HEjtmSN`?>!lvVtU&J%W50 z7^>757#dm_7=8hT8eT9klo~KFyh>nTu$sZZAYL$MSD+10;$eVKh%1l=f<8Uv4jn}Z z8&0b6a01y{d>{uPgChaP6|1uvYF(ftW0JSKi59fW18{U$v#itcX=K zt!?HC-ywHp{X{E|lYR5FQ*N~%*7A|3&t-g!R zO^tSc~jeSU+37C ziA^V~n@(-?awZt`|BqgyV)hf9t6-Y4{ z85mmX8W`ysS%erGS{Yhe85w9B7+M(^GzjgOj-nwqKP5A*61Rqr{tVhc4U!-mg7ec# o$`gxH85~pclTsBta}(23gHjVyDhp4hf>J(%r>mdKI;Vst04CyCe*gdg diff --git a/resources/parts_search.png b/resources/parts_search.png deleted file mode 100644 index 45ed87e66f7ddbd67c65f64ebf269092e42a6baa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2086 zcmV+>2-)|EP)004R>004l5008;`004mK004C`008P>0026e000+ooVrmw00006 zVoOIv0RI600RN!9r;`8x2N+32K~z}7#g=Pq6xSJspEEN%v%aj?R}96**w{F3h=7=D z1hyflO+s;^HfbA0DMCU`rB+oHdZ9%Slm^jAZB?m1npUVNsQr;htq25{6og|iU@mHb zKvhVJ4Fnv#z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zbY(hYa%Ew3WdJfTF*z+TGA%MV zR539+F*!OiFe@-IIxsMR61bND001R)MObuXVRU6WZEs|0W_bWIFflnTFfuJNI8-q) zIx#sqGB7JJF*-0X@lOCN0000PbVXQnQ*UN;cVTj606}DLVr3vnZDD6+Qe|Oed2z{Q QJOBUy07*qoM6N<$f&pH&2><{9 diff --git a/resources/stylesheet/close.png b/resources/stylesheet/close.png deleted file mode 100644 index 3e6b9d837722057d5ec7a52992f42cfb9b42be64..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 254 zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh1|;P@bT0xawj^(N7a$D;Kb?2i11Zh|kH}&M z25w;xW@MN(M*=9wUgGKN%6^}XliN_}iK}`xP)Ig2B%;JQKQ}iuuLQ_tU~n!ODIBFOg9y45L zTRwlqU8XzrGgcho+N^Vi#kl%nu*3(~6Gv=J*jU3_yv`^UcpZCl>2LR9D;Bm5uYVSn nU4MM$VT{oyudK6rzw7t%H#A%R-Nbqz1mp})S3j3^P6 + + + + + + S Close 18 N + + + diff --git a/resources/stylesheet/stylesheet.qrc b/resources/stylesheet/stylesheet.qrc index 63e20a16..0d4c75f4 100644 --- a/resources/stylesheet/stylesheet.qrc +++ b/resources/stylesheet/stylesheet.qrc @@ -6,7 +6,7 @@ branch_more.png branch_open.png branch_vline.png - close.png + close.svg undock.png diff --git a/resources/stylesheet/stylesheet.qss b/resources/stylesheet/stylesheet.qss index bfde827e..842de794 100644 --- a/resources/stylesheet/stylesheet.qss +++ b/resources/stylesheet/stylesheet.qss @@ -48,7 +48,7 @@ QTreeView::branch:open:has-children:!has-siblings { } QDockWidget { - titlebar-close-icon: url(:/stylesheet/close.png); + titlebar-close-icon: url(:/stylesheet/close.svg); titlebar-normal-icon: url(:/stylesheet/undock.png); } @@ -85,7 +85,7 @@ QDockWidget::float-button:pressed { } QTabBar::close-button { - background-image: url(:/stylesheet/close.png); + background-image: url(:/stylesheet/close.svg); background-position: center center; background-repeat: none; }