/* * menubar.h * * This file is covered by the LICENSE file in the root of this project. */ #ifndef MENUBAR_H #define MENUBAR_H #include #include "bigintmandelwidget.h" class MenuBar : public QMenuBar { Q_OBJECT MandelSettings * const settings; QMenu *file_menu; QAction *load_action, *save_action; QAction *export_action, *exit_action; QMenu *calc_menu; QAction *reset_action, *resize_action, *settings_action; QMenu *zoom_menu; QAction *no_action, *two_action, *four_action; QAction *eight_action, *sixteen_action; inline void check_action() { no_action->setChecked(settings->get_zoom_factor() == -1); two_action->setChecked(settings->get_zoom_factor() == 2); four_action->setChecked(settings->get_zoom_factor() == 4); eight_action->setChecked(settings->get_zoom_factor() == 8); sixteen_action->setChecked(settings->get_zoom_factor() == 16); } public: explicit MenuBar(BigintMandelWidget *parent); public Q_SLOTS: void change_zoom_factor() { settings->set_zoom_factor( static_cast(sender())->data().toInt() ); } }; #endif // MENUBAR_H