Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "Clear all plots" button to GUI #569

Merged
merged 1 commit into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions fmusim-gui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,12 @@ MainWindow::MainWindow(QWidget *parent)
connect(ui->filterInputVariablesToolButton, &QToolButton::clicked, variablesFilterModel, &VariablesFilterModel::setFilterInputVariables);
connect(ui->filterOutputVariablesToolButton, &QToolButton::clicked, variablesFilterModel, &VariablesFilterModel::setFilterOutputVariables);
connect(ui->filterLocalVariablesToolButton, &QToolButton::clicked, variablesFilterModel, &VariablesFilterModel::setFilterLocalVariables);
connect(ui->clearPlotsToolButton, &QToolButton::clicked, this, [this]() {
plotVariables.clear();
variablesListModel->setPlotVariables(&plotVariables);
modelVariablesTreeModel->setPlotVariables(&plotVariables);
updatePlot();
});
connect(ui->showOptionalColumnsToolButton, &QToolButton::clicked, this, &MainWindow::setOptionalColumnsVisible);
connect(ui->showListViewToolButton, &QToolButton::clicked, this, &MainWindow::showModelVariablesListView);

Expand Down Expand Up @@ -519,6 +525,7 @@ void MainWindow::setColorScheme(Qt::ColorScheme colorScheme) {
ui->filterInputVariablesToolButton->setIcon(QIcon(":/buttons/" + theme + "/input-variable.svg"));
ui->filterOutputVariablesToolButton->setIcon(QIcon(":/buttons/" + theme + "/output-variable.svg"));
ui->filterLocalVariablesToolButton->setIcon(QIcon(":/buttons/" + theme + "/local-variable.svg"));
ui->clearPlotsToolButton->setIcon(QIcon(":/buttons/" + theme + "/broom.svg"));
ui->showOptionalColumnsToolButton->setIcon(QIcon(":/buttons/" + theme + "/columns.svg"));
ui->showListViewToolButton->setIcon(QIcon(":/buttons/" + theme + "/list.svg"));

Expand Down
100 changes: 57 additions & 43 deletions fmusim-gui/MainWindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -987,20 +987,7 @@
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLineEdit" name="filterLineEdit">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>21</height>
</size>
</property>
<property name="placeholderText">
<string>filter variables</string>
</property>
</widget>
</item>
<item row="0" column="5">
<item row="0" column="6">
<widget class="QToolButton" name="showOptionalColumnsToolButton">
<property name="toolTip">
<string>Show optional columns</string>
Expand All @@ -1020,17 +1007,23 @@
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QToolButton" name="filterOutputVariablesToolButton">
<item row="0" column="4">
<widget class="QToolButton" name="filterLocalVariablesToolButton">
<property name="toolTip">
<string>Filter output variables</string>
<string>Filter local variables</string>
</property>
<property name="text">
<string>O</string>
<string>L</string>
</property>
<property name="icon">
<iconset resource="buttons.qrc">
<normaloff>:/buttons/dark/output-variable.svg</normaloff>:/buttons/dark/output-variable.svg</iconset>
<normaloff>:/buttons/dark/local-variable.svg</normaloff>:/buttons/dark/local-variable.svg</iconset>
</property>
<property name="iconSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
Expand All @@ -1043,46 +1036,50 @@
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QToolButton" name="filterInputVariablesToolButton">
<item row="0" column="7">
<widget class="QToolButton" name="showListViewToolButton">
<property name="toolTip">
<string>Filter input variables</string>
<string>Show list view</string>
</property>
<property name="text">
<string>I</string>
<string>...</string>
</property>
<property name="icon">
<iconset resource="buttons.qrc">
<normaloff>:/buttons/dark/input-variable.svg</normaloff>:/buttons/dark/input-variable.svg</iconset>
<normaloff>:/buttons/dark/list.svg</normaloff>:/buttons/dark/list.svg</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QToolButton" name="filterLocalVariablesToolButton">
<item row="0" column="0">
<widget class="QLineEdit" name="filterLineEdit">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>21</height>
</size>
</property>
<property name="placeholderText">
<string>filter variables</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QToolButton" name="filterOutputVariablesToolButton">
<property name="toolTip">
<string>Filter local variables</string>
<string>Filter output variables</string>
</property>
<property name="text">
<string>L</string>
<string>O</string>
</property>
<property name="icon">
<iconset resource="buttons.qrc">
<normaloff>:/buttons/dark/local-variable.svg</normaloff>:/buttons/dark/local-variable.svg</iconset>
</property>
<property name="iconSize">
<size>
<width>16</width>
<height>16</height>
</size>
<normaloff>:/buttons/dark/output-variable.svg</normaloff>:/buttons/dark/output-variable.svg</iconset>
</property>
<property name="checkable">
<bool>true</bool>
Expand All @@ -1095,21 +1092,38 @@
</property>
</widget>
</item>
<item row="0" column="6">
<widget class="QToolButton" name="showListViewToolButton">
<item row="0" column="2">
<widget class="QToolButton" name="filterInputVariablesToolButton">
<property name="toolTip">
<string>Show list view</string>
<string>Filter input variables</string>
</property>
<property name="text">
<string>...</string>
<string>I</string>
</property>
<property name="icon">
<iconset resource="buttons.qrc">
<normaloff>:/buttons/dark/list.svg</normaloff>:/buttons/dark/list.svg</iconset>
<normaloff>:/buttons/dark/input-variable.svg</normaloff>:/buttons/dark/input-variable.svg</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="5">
<widget class="QToolButton" name="clearPlotsToolButton">
<property name="toolTip">
<string>Clear all plots</string>
</property>
<property name="icon">
<iconset resource="buttons.qrc">
<normaloff>:/buttons/dark/broom.svg</normaloff>:/buttons/dark/broom.svg</iconset>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
Expand Down
2 changes: 2 additions & 0 deletions fmusim-gui/buttons.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,7 @@
<file>buttons/light/hammer.svg</file>
<file>buttons/dark/list.svg</file>
<file>buttons/light/list.svg</file>
<file>buttons/dark/broom.svg</file>
<file>buttons/light/broom.svg</file>
</qresource>
</RCC>
1 change: 1 addition & 0 deletions fmusim-gui/buttons/dark/broom.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions fmusim-gui/buttons/light/broom.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified fmusim-gui/buttons/toolbuttons.afdesign
Binary file not shown.