Mercurial > octave
diff libgui/src/dw-main-window.h @ 25411:ad3d018e595f
provide shortcuts for switching between widgets in var. editor (bug #53002)
* dw-main-window.cc (dw_main_window): add new actions for switching to
next/previous widget, collect all actions that are required in floating
widgets in a list;
(notice_settings): set the shortcuts for the new actions;
(request_close_file, request_close_other_files, request_close_all_files):
renamed, dropping term file, and using the new class variable storing
the list of current dock widgets;
(request_switch_left, request_switch_right): new slots for the new actions;
(request_switch): function with common part for switching widgets;
(event): re-implementation of the event method, updating the list of all
dock widgets when widget was added or removed, and adding actions to
floating widgets when floating status has changed.
* dw_main-window.h: re-implemented event, new actions wit new slots for
switching between widgets, new class variables for widget list and list
of actions for floating widgets
author | Torsten <mttl@mailbox.org> |
---|---|
date | Sat, 26 May 2018 20:50:46 +0200 |
parents | a78e5b8d5ee7 |
children | 00f796120a6d |
line wrap: on
line diff
--- a/libgui/src/dw-main-window.h Thu May 24 18:42:52 2018 -0700 +++ b/libgui/src/dw-main-window.h Sat May 26 20:50:46 2018 +0200 @@ -54,18 +54,23 @@ virtual QMenu* createPopupMenu (); + virtual bool event (QEvent *ev); + private slots: - void request_close_file (); - void request_close_all_files (); - void request_close_other_files (); + void request_close (); + void request_close_all (); + void request_close_other (); - signals: - - protected: + void request_switch_left (); + void request_switch_right (); private: + void request_switch (int direction); + + QList<QDockWidget *> m_dw_list; + QAction *add_action (QMenu *menu, const QIcon& icon, const QString& text, const char *member, QWidget *receiver); @@ -73,6 +78,10 @@ QAction *m_close_all_action; QAction *m_close_others_action; + QAction *m_switch_left_action; + QAction *m_switch_right_action; + + QList<QAction *> m_actions_list; }; }