comment all the mouse visibility related stuff
This commit is contained in:
@@ -60,16 +60,16 @@ QIcon Button::getIcon(const Type t, bool isWhite) {
|
||||
}
|
||||
QString path = ":/img/buttonIcons" + iconColor + "/";
|
||||
|
||||
if (t == Type::mouseVisibility) {
|
||||
QSettings settings;
|
||||
bool mouseVisible = settings.value("mouseVisible").toBool();
|
||||
if (mouseVisible){
|
||||
path += "mouse.svg";
|
||||
} else {
|
||||
path += "mouse-off.svg";
|
||||
}
|
||||
return QIcon(path);
|
||||
}
|
||||
// if (t == Type::mouseVisibility) {
|
||||
// QSettings settings;
|
||||
// bool mouseVisible = settings.value("mouseVisible").toBool();
|
||||
// if (mouseVisible){
|
||||
// path += "mouse.svg";
|
||||
// } else {
|
||||
// path += "mouse-off.svg";
|
||||
// }
|
||||
// return QIcon(path);
|
||||
// }
|
||||
|
||||
switch (t) {
|
||||
case Type::arrow:
|
||||
@@ -150,17 +150,19 @@ void Button::leaveEvent(QEvent *e) {
|
||||
Q_EMIT mouseExited();
|
||||
QWidget::leaveEvent(e);
|
||||
}
|
||||
#include <QMouseEvent>
|
||||
void Button::mouseReleaseEvent(QMouseEvent *e) {
|
||||
if (e->button() == Qt::LeftButton){
|
||||
// if (m_buttonType == Type::mouseVisibility) {
|
||||
// QSettings settings;
|
||||
// bool mouseVisible = settings.value("mouseVisible").toBool();
|
||||
// settings.setValue("mouseVisible", !mouseVisible);
|
||||
// setIcon(getIcon(Type::mouseVisibility));
|
||||
// } else if (m_buttonType == Type::colorPicker) {
|
||||
|
||||
void Button::mouseReleaseEvent(QMouseEvent *) {
|
||||
if (m_buttonType == Type::mouseVisibility) {
|
||||
QSettings settings;
|
||||
bool mouseVisible = settings.value("mouseVisible").toBool();
|
||||
settings.setValue("mouseVisible", !mouseVisible);
|
||||
setIcon(getIcon(Type::mouseVisibility));
|
||||
} else if (m_buttonType == Type::colorPicker) {
|
||||
|
||||
// }
|
||||
Q_EMIT typeEmited(m_buttonType);
|
||||
}
|
||||
Q_EMIT typeEmited(m_buttonType);
|
||||
}
|
||||
|
||||
void Button::animatedShow() {
|
||||
|
||||
@@ -31,7 +31,6 @@ class Button : public QPushButton {
|
||||
public:
|
||||
enum class Type {
|
||||
selectionIndicator,
|
||||
mouseVisibility,
|
||||
exit,
|
||||
copy,
|
||||
save,
|
||||
@@ -42,11 +41,12 @@ public:
|
||||
circle,
|
||||
marker,
|
||||
text,
|
||||
colorPicker,
|
||||
undo,
|
||||
imageUploader,
|
||||
move,
|
||||
last
|
||||
last, // used for iteration over the enum
|
||||
mouseVisibility,
|
||||
colorPicker
|
||||
};
|
||||
|
||||
explicit Button(Type, QWidget *parent = 0);
|
||||
|
||||
@@ -402,7 +402,7 @@ void CaptureWidget::downResize() {
|
||||
|
||||
void CaptureWidget::setState(Button::Type t) {
|
||||
if(t == Button::Type::selectionIndicator ||
|
||||
t == Button::Type::mouseVisibility ||
|
||||
//t == Button::Type::mouseVisibility ||
|
||||
t == Button::Type::colorPicker) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -103,9 +103,9 @@ QString Screenshot::graphicalSave(const QRect &selection) const {
|
||||
pixToSave = m_screenshot.copy(selection);
|
||||
}
|
||||
|
||||
if (settings.value("mouseVisible").toBool()) {
|
||||
// TO DO
|
||||
}
|
||||
// if (settings.value("mouseVisible").toBool()) {
|
||||
// // TO DO
|
||||
// }
|
||||
|
||||
if (!pixToSave.save(fileName)) {
|
||||
QMessageBox::warning(nullptr, QObject::tr("Save Error"),
|
||||
|
||||
@@ -85,7 +85,7 @@ void Controller::initDefaults() {
|
||||
if (!settings.value("initiated").toBool()) {
|
||||
settings.setValue("initiated", true);
|
||||
settings.setValue("drawColor", QColor(Qt::red));
|
||||
settings.setValue("mouseVisible", false);
|
||||
//settings.setValue("mouseVisible", false);
|
||||
settings.setValue("whiteIconColor", true);
|
||||
settings.setValue("uiColor", QColor(136, 0, 170));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user