Skip to content

Commit

Permalink
Removed action icons in the parts widget edits.
Browse files Browse the repository at this point in the history
  • Loading branch information
leozide committed Oct 17, 2024
1 parent 9edd8f9 commit e69bbf5
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 17 deletions.
2 changes: 1 addition & 1 deletion common/lc_findreplacewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
36 changes: 25 additions & 11 deletions common/lc_partselectionwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions leocad.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@
<file>resources/piece_show_earlier.png</file>
<file>resources/piece_show_later.png</file>
<file>resources/time_add_keys.png</file>
<file>resources/parts_search.png</file>
<file>resources/parts_cancel.png</file>
<file>resources/archive.png</file>
<file>resources/library.zip</file>
<file>resources/studlogo1.zip</file>
Expand Down
Binary file removed resources/parts_cancel.png
Binary file not shown.
Binary file removed resources/parts_search.png
Binary file not shown.
Binary file removed resources/stylesheet/close.png
Binary file not shown.
54 changes: 54 additions & 0 deletions resources/stylesheet/close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion resources/stylesheet/stylesheet.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<file>branch_more.png</file>
<file>branch_open.png</file>
<file>branch_vline.png</file>
<file>close.png</file>
<file>close.svg</file>
<file>undock.png</file>
</qresource>
</RCC>
4 changes: 2 additions & 2 deletions resources/stylesheet/stylesheet.qss
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit e69bbf5

Please sign in to comment.