Skip to content

Commit

Permalink
core/scopymainwindow: Added collapseToolMenu method.
Browse files Browse the repository at this point in the history
Signed-off-by: andreidanila1 <[email protected]>
  • Loading branch information
andreidanila1 committed Dec 2, 2024
1 parent e37a2f3 commit d818696
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
1 change: 1 addition & 0 deletions core/include/core/scopymainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public Q_SLOTS:
void handleScanner();
void enableScanner();
void deviceAutoconnect();
void collapseToolMenu(bool collapse);

protected:
void closeEvent(QCloseEvent *event) override;
Expand Down
23 changes: 12 additions & 11 deletions core/src/scopymainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d818696

Please sign in to comment.