|
|
@ -153,15 +153,10 @@ public: |
|
|
|
if (!confirm || confirmed || !state || dialog.exec()) { |
|
|
|
if (!confirm || confirmed || !state || dialog.exec()) { |
|
|
|
if (store_confirm && state) params.putBool(key + "Confirmed", true); |
|
|
|
if (store_confirm && state) params.putBool(key + "Confirmed", true); |
|
|
|
params.putBool(key, state); |
|
|
|
params.putBool(key, state); |
|
|
|
|
|
|
|
setIcon(state); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
toggle.togglePosition(); |
|
|
|
toggle.togglePosition(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (state && !active_icon_pixmap.isNull()) { |
|
|
|
|
|
|
|
icon_label->setPixmap(active_icon_pixmap); |
|
|
|
|
|
|
|
} else if (!icon_pixmap.isNull()) { |
|
|
|
|
|
|
|
icon_label->setPixmap(icon_pixmap); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -175,8 +170,10 @@ public: |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void refresh() { |
|
|
|
void refresh() { |
|
|
|
if (params.getBool(key) != toggle.on) { |
|
|
|
bool state = params.getBool(key); |
|
|
|
|
|
|
|
if (state != toggle.on) { |
|
|
|
toggle.togglePosition(); |
|
|
|
toggle.togglePosition(); |
|
|
|
|
|
|
|
setIcon(state); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -185,6 +182,14 @@ public: |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
|
|
|
|
void setIcon(bool state) { |
|
|
|
|
|
|
|
if (state && !active_icon_pixmap.isNull()) { |
|
|
|
|
|
|
|
icon_label->setPixmap(active_icon_pixmap); |
|
|
|
|
|
|
|
} else if (!icon_pixmap.isNull()) { |
|
|
|
|
|
|
|
icon_label->setPixmap(icon_pixmap); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
std::string key; |
|
|
|
std::string key; |
|
|
|
Params params; |
|
|
|
Params params; |
|
|
|
QPixmap active_icon_pixmap; |
|
|
|
QPixmap active_icon_pixmap; |
|
|
|