Skip to content
Snippets Groups Projects
Commit bdcab295 authored by Oliver Bock's avatar Oliver Bock
Browse files

GUI improvements

* Added toggle for status bar (view menu)
* Added toggle for menu bar (now invisible, have to preserve shortcuts somehow!)
* Added primary control button to animation control
* Improved animation control action
parent 96582290
No related branches found
No related tags found
No related merge requests found
......@@ -24,7 +24,10 @@ PulsatingScience::PulsatingScience(QWidget *parent) : QMainWindow(parent)
{
ui.setupUi(this);
ui.menuView->addAction(ui.dockAnimControl->toggleViewAction());
QAction* animControl = ui.dockAnimControl->toggleViewAction();
animControl->setStatusTip("Toggle the animation control visibility");
animControl->setShortcut(QKeySequence::fromString("Alt+A"));
ui.menuView->addAction(animControl);
connect(ui.actionRun, SIGNAL(activated()),
ui.pulsarGlWidget, SLOT(runAnimation()));
......@@ -62,3 +65,13 @@ void PulsatingScience::on_sliderOrbitFrequency_valueChanged(int value)
ui.pulsarGlWidget->setOrbitFrequency(value / 10.0);
ui.lcdOrbitFrequency->display(QString::number(value / 10.0, 'f', 1));
}
void PulsatingScience::on_actionMenu_bar_toggled(bool checked)
{
checked ? ui.menuBar->show() : ui.menuBar->hide();
}
void PulsatingScience::on_actionStatus_bar_toggled(bool checked)
{
checked ? ui.statusbar->show() : ui.statusbar->hide();
}
......@@ -37,6 +37,9 @@ public slots:
void on_sliderOrbitRadius_valueChanged(int value);
void on_sliderOrbitFrequency_valueChanged(int value);
void on_actionMenu_bar_toggled(bool checked);
void on_actionStatus_bar_toggled(bool checked);
private:
Ui::PulsatingScienceClass ui;
};
......
......@@ -36,7 +36,7 @@
</attribute>
<widget class="QWidget" name="dockWidgetContents" >
<layout class="QGridLayout" name="gridLayout_3" >
<item row="0" column="0" >
<item row="0" column="1" >
<layout class="QGridLayout" name="gridLayout_2" >
<item row="0" column="0" >
<widget class="QLabel" name="label" >
......@@ -181,6 +181,43 @@
</item>
</layout>
</item>
<item row="0" column="0" >
<layout class="QVBoxLayout" name="verticalLayout" >
<item>
<widget class="QPushButton" name="pushRun" >
<property name="text" >
<string>Run</string>
</property>
<property name="icon" >
<iconset resource="pulsatingscience.qrc" >
<normaloff>:/icons/resources/control-run.png</normaloff>:/icons/resources/control-run.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushPause" >
<property name="text" >
<string>Pause</string>
</property>
<property name="icon" >
<iconset resource="pulsatingscience.qrc" >
<normaloff>:/icons/resources/control-pause.png</normaloff>:/icons/resources/control-pause.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushStop" >
<property name="text" >
<string>Stop</string>
</property>
<property name="icon" >
<iconset resource="pulsatingscience.qrc" >
<normaloff>:/icons/resources/control-stop.png</normaloff>:/icons/resources/control-stop.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
......@@ -195,12 +232,14 @@
</property>
<widget class="QMenu" name="menuView" >
<property name="title" >
<string>View</string>
<string>&amp;View</string>
</property>
<addaction name="actionMenu_bar" />
<addaction name="actionStatus_bar" />
</widget>
<widget class="QMenu" name="menuHelp" >
<property name="title" >
<string>Help</string>
<string>&amp;Help</string>
</property>
<addaction name="actionHelp" />
<addaction name="actionWebsite" />
......@@ -209,7 +248,7 @@
</widget>
<widget class="QMenu" name="menuControl" >
<property name="title" >
<string>Control</string>
<string>&amp;Control</string>
</property>
<addaction name="actionRun" />
<addaction name="actionPause" />
......@@ -250,6 +289,9 @@
<property name="shortcut" >
<string>Ctrl+A</string>
</property>
<property name="menuRole" >
<enum>QAction::AboutRole</enum>
</property>
</action>
<action name="actionQuit" >
<property name="icon" >
......@@ -265,6 +307,9 @@
<property name="shortcut" >
<string>Ctrl+Q</string>
</property>
<property name="menuRole" >
<enum>QAction::QuitRole</enum>
</property>
</action>
<action name="actionRun" >
<property name="icon" >
......@@ -326,6 +371,37 @@
<string>Ctrl+H</string>
</property>
</action>
<action name="actionMenu_bar" >
<property name="checkable" >
<bool>true</bool>
</property>
<property name="checked" >
<bool>true</bool>
</property>
<property name="text" >
<string>Menu bar</string>
</property>
<property name="shortcut" >
<string>Alt+M</string>
</property>
<property name="visible" >
<bool>false</bool>
</property>
</action>
<action name="actionStatus_bar" >
<property name="checkable" >
<bool>true</bool>
</property>
<property name="checked" >
<bool>true</bool>
</property>
<property name="text" >
<string>Status bar</string>
</property>
<property name="shortcut" >
<string>Alt+S</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
......@@ -355,5 +431,53 @@
</hint>
</hints>
</connection>
<connection>
<sender>pushRun</sender>
<signal>clicked()</signal>
<receiver>actionRun</receiver>
<slot>trigger()</slot>
<hints>
<hint type="sourcelabel" >
<x>47</x>
<y>491</y>
</hint>
<hint type="destinationlabel" >
<x>-1</x>
<y>-1</y>
</hint>
</hints>
</connection>
<connection>
<sender>pushPause</sender>
<signal>clicked()</signal>
<receiver>actionPause</receiver>
<slot>trigger()</slot>
<hints>
<hint type="sourcelabel" >
<x>47</x>
<y>523</y>
</hint>
<hint type="destinationlabel" >
<x>-1</x>
<y>-1</y>
</hint>
</hints>
</connection>
<connection>
<sender>pushStop</sender>
<signal>clicked()</signal>
<receiver>actionStop</receiver>
<slot>trigger()</slot>
<hints>
<hint type="sourcelabel" >
<x>47</x>
<y>555</y>
</hint>
<hint type="destinationlabel" >
<x>-1</x>
<y>-1</y>
</hint>
</hints>
</connection>
</connections>
</ui>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment