Add config icon color based on background

This commit is contained in:
lupoDharkael
2017-05-13 22:05:44 +02:00
parent 2de3045288
commit 811c714a81
5 changed files with 27 additions and 14 deletions

View File

@@ -51,8 +51,11 @@ Button::Button(Type t, QWidget *parent) : QPushButton(parent) {
}
QIcon Button::getIcon(const Type t) {
QString iconColor = "White"; // or "Black"
QIcon Button::getIcon(const Type t, bool isWhite) {
QString iconColor = "Black"; // or "Black"
if (isWhite) {
iconColor = "White";
}
QString path = ":/img/buttonIcons" + iconColor + "/";
if (t == Type::mouseVisibility) {
@@ -115,6 +118,12 @@ QIcon Button::getIcon(const Type t) {
return QIcon(path);
}
QIcon Button::getIcon(const Type t) {
// assign th isWhite based on the settings
bool isWhite = true;
return getIcon(t, isWhite);
}
void Button::enterEvent(QEvent *e) {
Q_EMIT hovered();
QWidget::enterEvent(e);