13 , ui(new
Ui::DraggableToolbar)
14 , _fullscreen_mode(false)
19 QString theme = settings.value(
"StyleSheet::theme",
"light").toString();
22 ui->buttonFullscreen->setVisible(
false);
23 ui->buttonSplitHorizontal->setVisible(
false);
24 ui->buttonSplitVertical->setVisible(
false);
25 ui->buttonBackground->setVisible(
false);
27 setMouseTracking(
true);
28 ui->widgetButtons->setMouseTracking(
true);
30 ui->label->installEventFilter(
this);
42 button->setIcon(icon);
55 ui->buttonSplitHorizontal->setVisible(
false);
56 ui->buttonSplitVertical->setVisible(
false);
72 ui->buttonFullscreen->setVisible(
true);
73 ui->buttonBackground->setVisible(
true);
79 QWidget::mouseMoveEvent(ev);
84 ui->buttonFullscreen->setVisible(
true);
85 ui->buttonBackground->setVisible(
true);
90 QWidget::enterEvent(ev);
95 if (event->type() == QEvent::MouseButtonDblClick)
99 QInputDialog::getText(
this, tr(
"Change name of the Area"), tr(
"New name:"),
100 QLineEdit::Normal,
ui->label->text(), &
ok);
103 ui->label->setText(newName);
110 return QObject::eventFilter(
object, event);
121 LoadSvg(
":/resources/svg/add_column.svg", theme));
127 const QMimeData* mimeData =
event->mimeData();
128 QStringList mimeFormats = mimeData->formats();
130 bool has_curve =
false;
131 for (
const QString&
format : mimeFormats)
133 QByteArray encoded = mimeData->data(
format);
134 QDataStream stream(&encoded, QIODevice::ReadOnly);
136 if (
format ==
"curveslist/add_curve")
138 while (!stream.atEnd())
141 stream >> curve_name;
142 if (!curve_name.isEmpty())
162 ui->buttonFullscreen->setVisible(
true);
163 ui->buttonBackground->setVisible(
true);
171 ui->buttonFullscreen->setVisible(
false);
172 ui->buttonBackground->setVisible(
ui->buttonBackground->isChecked());
173 ui->buttonSplitHorizontal->setVisible(
false);
174 ui->buttonSplitVertical->setVisible(
false);
179 auto global_pos = mapToGlobal(event->pos());
180 auto pos =
ui->buttonBackground->mapFromGlobal(global_pos);
181 bool on_label =
ui->buttonBackground->rect().contains(pos);
192 ui->buttonSplitHorizontal->setVisible(
false);
193 ui->buttonSplitVertical->setVisible(
false);
194 ui->buttonBackground->setVisible(
ui->buttonBackground->isChecked());
195 QWidget::leaveEvent(ev);