diff --git a/core/include/core/scopymainwindow.h b/core/include/core/scopymainwindow.h index 5e4263e017..552a44420d 100644 --- a/core/include/core/scopymainwindow.h +++ b/core/include/core/scopymainwindow.h @@ -108,6 +108,7 @@ public Q_SLOTS: void handleScanner(); void enableScanner(); void deviceAutoconnect(); + void collapseToolMenu(bool collapse); protected: void closeEvent(QCloseEvent *event) override; diff --git a/core/src/scopymainwindow.cpp b/core/src/scopymainwindow.cpp index 8d7f2f8e55..6de05ad689 100644 --- a/core/src/scopymainwindow.cpp +++ b/core/src/scopymainwindow.cpp @@ -96,22 +96,13 @@ ScopyMainWindow::ScopyMainWindow(QWidget *parent) auto ts = ui->wsToolStack; - //////// BrowseMenu *browseMenu = new BrowseMenu(ui->wToolBrowser); ui->wToolBrowser->layout()->addWidget(browseMenu); - connect(browseMenu, &BrowseMenu::requestTool, ts, &ToolStack::show, Qt::QueuedConnection); connect(browseMenu, SIGNAL(requestLoad()), this, SLOT(load())); connect(browseMenu, SIGNAL(requestSave()), this, SLOT(save())); - connect(browseMenu, &BrowseMenu::collapsed, this, [this](bool coll) { - if(coll) { - ui->animHolder->setAnimMin(Style::getDimension(json::global::unit_4)); - } else { - ui->animHolder->setAnimMax(230); - } - ui->animHolder->toggleMenu(!coll); - }); - //////// + connect(browseMenu, &BrowseMenu::collapsed, this, &ScopyMainWindow::collapseToolMenu); + Style::setBackgroundColor(ui->centralwidget, json::theme::background_primary); scanTask = new IIOScanTask(this); @@ -253,6 +244,16 @@ void ScopyMainWindow::deviceAutoconnect() } } +void ScopyMainWindow::collapseToolMenu(bool collapse) +{ + if(collapse) { + ui->animHolder->setAnimMin(Style::getDimension(json::global::unit_4)); + } else { + ui->animHolder->setAnimMax(230); + } + ui->animHolder->toggleMenu(!collapse); +} + void ScopyMainWindow::save() { QString selectedFilter;