Mercurial > octave
annotate libgui/src/octave-dock-widget.h @ 26376:00f796120a6d stable
maint: Update copyright dates in all source files.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 02 Jan 2019 16:32:43 -0500 |
parents | 0146d16055a8 |
children | f7b10bd40045 |
rev | line source |
---|---|
16057
c3057d80cf91
Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents:
diff
changeset
|
1 /* |
c3057d80cf91
Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents:
diff
changeset
|
2 |
26376
00f796120a6d
maint: Update copyright dates in all source files.
John W. Eaton <jwe@octave.org>
parents:
25907
diff
changeset
|
3 Copyright (C) 2012-2019 Richard Crozier |
16057
c3057d80cf91
Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents:
diff
changeset
|
4 |
c3057d80cf91
Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents:
diff
changeset
|
5 This file is part of Octave. |
c3057d80cf91
Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents:
diff
changeset
|
6 |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24318
diff
changeset
|
7 Octave is free software: you can redistribute it and/or modify it |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22417
diff
changeset
|
8 under the terms of the GNU General Public License as published by |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24318
diff
changeset
|
9 the Free Software Foundation, either version 3 of the License, or |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22417
diff
changeset
|
10 (at your option) any later version. |
16057
c3057d80cf91
Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents:
diff
changeset
|
11 |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22417
diff
changeset
|
12 Octave is distributed in the hope that it will be useful, but |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22417
diff
changeset
|
13 WITHOUT ANY WARRANTY; without even the implied warranty of |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22417
diff
changeset
|
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22417
diff
changeset
|
15 GNU General Public License for more details. |
16057
c3057d80cf91
Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents:
diff
changeset
|
16 |
c3057d80cf91
Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents:
diff
changeset
|
17 You should have received a copy of the GNU General Public License |
c3057d80cf91
Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents:
diff
changeset
|
18 along with Octave; see the file COPYING. If not, see |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24318
diff
changeset
|
19 <https://www.gnu.org/licenses/>. |
16057
c3057d80cf91
Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents:
diff
changeset
|
20 |
c3057d80cf91
Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents:
diff
changeset
|
21 */ |
c3057d80cf91
Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents:
diff
changeset
|
22 |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
20186
diff
changeset
|
23 #if ! defined (octave_octave_dock_widget_h) |
17822
ebb3ef964372
maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents:
17790
diff
changeset
|
24 #define octave_octave_dock_widget_h 1 |
16057
c3057d80cf91
Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents:
diff
changeset
|
25 |
c3057d80cf91
Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents:
diff
changeset
|
26 #include <QDockWidget> |
16611
999400bebe5e
move more common code from dock widgets into octave-dock-widget.h
Torsten <ttl@justmail.de>
parents:
16461
diff
changeset
|
27 #include <QSettings> |
16798
d749c9b588e5
make stand-alone windows from dock widgets when floating (bug #38785)
Torsten <ttl@justmail.de>
parents:
16611
diff
changeset
|
28 #include <QIcon> |
d749c9b588e5
make stand-alone windows from dock widgets when floating (bug #38785)
Torsten <ttl@justmail.de>
parents:
16611
diff
changeset
|
29 #include <QMainWindow> |
18180
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
17899
diff
changeset
|
30 #include <QToolButton> |
16798
d749c9b588e5
make stand-alone windows from dock widgets when floating (bug #38785)
Torsten <ttl@justmail.de>
parents:
16611
diff
changeset
|
31 #include <QMouseEvent> |
16057
c3057d80cf91
Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents:
diff
changeset
|
32 |
25907
0146d16055a8
use signal/slot to give all gui dock widgets access to the command queue
Torsten <mttl@mailbox.org>
parents:
25355
diff
changeset
|
33 #include "octave-cmd.h" |
0146d16055a8
use signal/slot to give all gui dock widgets access to the command queue
Torsten <mttl@mailbox.org>
parents:
25355
diff
changeset
|
34 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
35 namespace octave |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24534
diff
changeset
|
36 { |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
37 |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
38 // The few decoration items common to both main window and variable editor. |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24534
diff
changeset
|
39 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
40 class label_dock_widget : public QDockWidget |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
41 { |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
42 Q_OBJECT |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24534
diff
changeset
|
43 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
44 public: |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24534
diff
changeset
|
45 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
46 label_dock_widget (QWidget *p = nullptr); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
47 |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25054
diff
changeset
|
48 // set_title() uses the custom title bar while setWindowTitle() uses |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25054
diff
changeset
|
49 // the default title bar (with style sheets) |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
50 void set_title (const QString&); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24534
diff
changeset
|
51 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
52 protected slots: |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24534
diff
changeset
|
53 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
54 //! Slots to handle copy & paste. |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
55 //!@{ |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
56 virtual void copyClipboard (void) { } |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
57 virtual void pasteClipboard (void) { } |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
58 virtual void selectAll (void) { } |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
59 //!@} |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24534
diff
changeset
|
60 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
61 //! Slot to handle undo. |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24534
diff
changeset
|
62 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
63 virtual void do_undo (void) { } |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
64 |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
65 protected: |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24534
diff
changeset
|
66 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
67 int m_icon_size; |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
68 QWidget *m_title_widget; |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
69 QToolButton *m_dock_button; |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
70 QToolButton *m_close_button; |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
71 QAction *m_dock_action; |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
72 QAction *m_close_action; |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25054
diff
changeset
|
73 |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25054
diff
changeset
|
74 QAbstractButton *m_default_float_button; |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25054
diff
changeset
|
75 QAbstractButton *m_default_close_button; |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
76 }; |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24534
diff
changeset
|
77 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
78 class octave_dock_widget : public label_dock_widget |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
79 { |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
80 Q_OBJECT |
16057
c3057d80cf91
Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents:
diff
changeset
|
81 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
82 public: |
16461
094bd3627ead
move common functionality to octave_dock_widget base class
John W. Eaton <jwe@octave.org>
parents:
16340
diff
changeset
|
83 |
25355
5bb07f6e3707
fix uninitialized settings of octave dock widgets at startup (bug #53835)
Torsten <mttl@mailbox.org>
parents:
25354
diff
changeset
|
84 octave_dock_widget (const QString& obj_name, QWidget *p = nullptr); |
24014
bffd7d826887
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23457
diff
changeset
|
85 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
86 virtual ~octave_dock_widget (void) = default; |
16057
c3057d80cf91
Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents:
diff
changeset
|
87 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
88 virtual void connect_visibility_changed (void); |
24014
bffd7d826887
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23457
diff
changeset
|
89 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
90 void set_predecessor_widget (octave_dock_widget *prev_widget); |
24014
bffd7d826887
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23457
diff
changeset
|
91 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
92 signals: |
16461
094bd3627ead
move common functionality to octave_dock_widget base class
John W. Eaton <jwe@octave.org>
parents:
16340
diff
changeset
|
93 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
94 //! Custom signal that tells whether a user has clicked away that dock |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
95 //! widget, i.e the active dock widget has changed. |
24109
1d6c940a1b37
doc: Improve Doxygen documentation for some files in libgui.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
24014
diff
changeset
|
96 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
97 void active_changed (bool active); |
16057
c3057d80cf91
Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents:
diff
changeset
|
98 |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25054
diff
changeset
|
99 void queue_make_window (void); |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25054
diff
changeset
|
100 |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25054
diff
changeset
|
101 void queue_make_widget (void); |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25054
diff
changeset
|
102 |
25907
0146d16055a8
use signal/slot to give all gui dock widgets access to the command queue
Torsten <mttl@mailbox.org>
parents:
25355
diff
changeset
|
103 void request_queue_cmd (octave_cmd *); |
0146d16055a8
use signal/slot to give all gui dock widgets access to the command queue
Torsten <mttl@mailbox.org>
parents:
25355
diff
changeset
|
104 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
105 protected: |
16057
c3057d80cf91
Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents:
diff
changeset
|
106 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
107 virtual void closeEvent (QCloseEvent *e); |
16798
d749c9b588e5
make stand-alone windows from dock widgets when floating (bug #38785)
Torsten <ttl@justmail.de>
parents:
16611
diff
changeset
|
108 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
109 QWidget * focusWidget (void); |
16461
094bd3627ead
move common functionality to octave_dock_widget base class
John W. Eaton <jwe@octave.org>
parents:
16340
diff
changeset
|
110 |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25054
diff
changeset
|
111 bool event (QEvent *event); |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25054
diff
changeset
|
112 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
113 public slots: |
16461
094bd3627ead
move common functionality to octave_dock_widget base class
John W. Eaton <jwe@octave.org>
parents:
16340
diff
changeset
|
114 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
115 virtual void focus (void) |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
116 { |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
117 if (! isVisible ()) |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
118 setVisible (true); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
119 |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
120 setFocus (); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
121 activateWindow (); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
122 raise (); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
123 } |
16461
094bd3627ead
move common functionality to octave_dock_widget base class
John W. Eaton <jwe@octave.org>
parents:
16340
diff
changeset
|
124 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
125 virtual void handle_visibility (bool visible) |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
126 { |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
127 if (visible && ! isFloating ()) |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
128 focus (); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
129 } |
16461
094bd3627ead
move common functionality to octave_dock_widget base class
John W. Eaton <jwe@octave.org>
parents:
16340
diff
changeset
|
130 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
131 virtual void notice_settings (const QSettings*) { } |
24014
bffd7d826887
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23457
diff
changeset
|
132 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
133 void handle_settings (const QSettings*); |
16611
999400bebe5e
move more common code from dock widgets into octave-dock-widget.h
Torsten <ttl@justmail.de>
parents:
16461
diff
changeset
|
134 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
135 void handle_active_dock_changed (octave_dock_widget*, octave_dock_widget*); |
19423
d93293218966
custom style of dock widget title bars depending on focus (bug #43837)
Torsten <ttl@justmail.de>
parents:
19360
diff
changeset
|
136 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
137 QMainWindow * main_win (void) { return m_parent; } |
16798
d749c9b588e5
make stand-alone windows from dock widgets when floating (bug #38785)
Torsten <ttl@justmail.de>
parents:
16611
diff
changeset
|
138 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
139 void save_settings (void); |
22177
6e9f5408c0db
Save settings in Qt convention, delete all children in destructors (bug #45366)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
20986
diff
changeset
|
140 |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25054
diff
changeset
|
141 void moveEvent (QMoveEvent *event); |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25054
diff
changeset
|
142 |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25054
diff
changeset
|
143 void resizeEvent (QResizeEvent *event); |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25054
diff
changeset
|
144 |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25054
diff
changeset
|
145 void make_window (bool not_used = false); |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25054
diff
changeset
|
146 |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25054
diff
changeset
|
147 void make_widget (bool not_used = false); |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25054
diff
changeset
|
148 |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25054
diff
changeset
|
149 void default_dock (bool not_used = false); |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25054
diff
changeset
|
150 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
151 protected slots: |
16057
c3057d80cf91
Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents:
diff
changeset
|
152 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
153 //! Slot to steer changing visibility from outside. |
24109
1d6c940a1b37
doc: Improve Doxygen documentation for some files in libgui.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
24014
diff
changeset
|
154 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
155 virtual void handle_visibility_changed (bool visible) |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
156 { |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
157 if (visible) |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
158 emit active_changed (true); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
159 } |
24014
bffd7d826887
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23457
diff
changeset
|
160 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
161 //! Event filter for double clicks into the window decoration elements. |
24109
1d6c940a1b37
doc: Improve Doxygen documentation for some files in libgui.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
24014
diff
changeset
|
162 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
163 bool eventFilter (QObject *obj, QEvent *e); |
19360
2f9d9663b6b0
fix double clicks into the borders of floating dock widgets (bug #43662)
Torsten <ttl@justmail.de>
parents:
18555
diff
changeset
|
164 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
165 private slots: |
16798
d749c9b588e5
make stand-alone windows from dock widgets when floating (bug #38785)
Torsten <ttl@justmail.de>
parents:
16611
diff
changeset
|
166 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
167 void change_visibility (bool); |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25054
diff
changeset
|
168 void toplevel_change (bool); |
16798
d749c9b588e5
make stand-alone windows from dock widgets when floating (bug #38785)
Torsten <ttl@justmail.de>
parents:
16611
diff
changeset
|
169 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
170 private: |
16798
d749c9b588e5
make stand-alone windows from dock widgets when floating (bug #38785)
Torsten <ttl@justmail.de>
parents:
16611
diff
changeset
|
171 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
172 void set_style (bool active); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
173 void set_focus_predecessor (void); |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25054
diff
changeset
|
174 void store_geometry (void); |
19423
d93293218966
custom style of dock widget title bars depending on focus (bug #43837)
Torsten <ttl@justmail.de>
parents:
19360
diff
changeset
|
175 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
176 //! Stores the parent, since we are reparenting to 0. |
24109
1d6c940a1b37
doc: Improve Doxygen documentation for some files in libgui.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
24014
diff
changeset
|
177 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
178 QMainWindow *m_parent; |
24109
1d6c940a1b37
doc: Improve Doxygen documentation for some files in libgui.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
24014
diff
changeset
|
179 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
180 bool m_custom_style; |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
181 int m_title_3d; |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
182 QColor m_bg_color; |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
183 QColor m_bg_color_active; |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
184 QColor m_fg_color; |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
185 QColor m_fg_color_active; |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
186 QString m_icon_color; |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
187 QString m_icon_color_active; |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
188 octave_dock_widget *m_predecessor_widget; |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25054
diff
changeset
|
189 QRect m_recent_float_geom; |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25054
diff
changeset
|
190 QByteArray m_recent_dock_geom; |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25054
diff
changeset
|
191 bool m_waiting_for_mouse_button_release; |
16798
d749c9b588e5
make stand-alone windows from dock widgets when floating (bug #38785)
Torsten <ttl@justmail.de>
parents:
16611
diff
changeset
|
192 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
193 }; |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
194 } |
16057
c3057d80cf91
Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents:
diff
changeset
|
195 |
16461
094bd3627ead
move common functionality to octave_dock_widget base class
John W. Eaton <jwe@octave.org>
parents:
16340
diff
changeset
|
196 #endif |