Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ColorPaletteEditor: use theme's list-add and list-remove icons #2630

Merged
merged 3 commits into from
Apr 5, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/preferences/colorpaletteeditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ ColorPaletteEditor::ColorPaletteEditor(QWidget* parent, bool showHotcueNumbers)
QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred));
pColorButtonLayout->addWidget(pExpander);

m_pRemoveColorButton = new QPushButton("-", this);
QIcon removeIcon = QIcon::fromTheme("list-remove", QIcon());
if (!removeIcon.isNull()) {
m_pRemoveColorButton = new QPushButton(removeIcon, "", this);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Holzhaus can you use a debugger to check if this or line 38 is executing?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

38

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's bizarre. Line 38 is identical to the line in master that was removed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I also have no idea what causes that but it happens every time.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can just keep the old code and if the remove icon is not null, then set icon and label on the button afterwards?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll check if that segfaults as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

} else {
m_pRemoveButton = new QPushButton("-", this);
}
m_pRemoveColorButton->setFixedWidth(32);
m_pRemoveColorButton->setToolTip(tr("Remove Color"));
m_pRemoveColorButton->setDisabled(true);
Expand All @@ -41,7 +46,12 @@ ColorPaletteEditor::ColorPaletteEditor(QWidget* parent, bool showHotcueNumbers)
this,
&ColorPaletteEditor::slotRemoveColor);

m_pAddColorButton = new QPushButton("+", this);
QIcon addIcon = QIcon::fromTheme("list-add", QIcon());
if (!addIcon.isNull()) {
m_pAddColorButton = new QPushButton(addIcon, "", this);
} else {
m_pAddColorButton = new QPushButton("+", this);
}
m_pAddColorButton->setFixedWidth(32);
m_pAddColorButton->setToolTip(tr("Add Color"));
pColorButtonLayout->addWidget(m_pAddColorButton);
Expand Down