Mercurial > octave
annotate libgui/src/octave-dock-widget.cc @ 30788:c11d34f72b3c
provide different icon sets for the GUI
* FigureWindow.cc (FigureWindow): rename icon path used for figure icons
* ToolBarButton.cc (get_icon): dito
* libgui/src/cursors: moved directory into libgui/src/icons/cursors
* gui-preferences-global.h: update enum for icon related string list,
renamed global_icon_fallback_paths into global_icon_paths and extended
by cursors directory, string lists for icon themes and the related names
* libgui/src/icons/octave/128x128/document-open.png
* libgui/src/icons/octave/128x128/folder-new.png
* libgui/src/icons/octave/128x128/folder-up.png
* libgui/src/icons/octave/128x128/folder.png
* libgui/src/icons/octave/128x128/user-home.png: moved from tango theme
* libgui/src/icons/octave/scalable/document-open.svg
* libgui/src/icons/octave/scalable/folder-new.svg
* libgui/src/icons/octave/scalable/folder-up.svg
* libgui/src/icons/octave/scalable/folder.svg
* libgui/src/icons/octave/scalable/user-home.svg: moved from tango theme
* libgui/src/icons/tango/128x128/document-open.png
* libgui/src/icons/tango/128x128/folder-new.png
* libgui/src/icons/tango/128x128/folder-up.png
* libgui/src/icons/tango/128x128/folder.png
* libgui/src/icons/tango/128x128/user-home.png: recovered tango versions
* libgui/src/icons/tango/scalable/document-open.svg
* libgui/src/icons/tango/scalable/folder-new.svg
* libgui/src/icons/tango/scalable/folder-up.svg
* libgui/src/icons/tango/scalable/folder.svg
* libgui/src/icons/tango/scalable/user-home.svg: recovered tango versions
* module.mk: updated according to changed icon files
* octave-dock-widget.cc (label_dock_widget): use second boolean argument of
ressource_manager::icon for icons only available in the octave theme
and using new icon search path for octave only icons in style sheets;
(octave_dock_widget, make_window, make_widget, set_style): dito;
* resource-manager.cc (config_icon_theme): check new and old icon theme
preference and transfer old into new if required, add fallbacks
search paths depending on current theme;
(icon): look for icon in current theme, if not existing, go through
the defined icon search paths, use second boolean argument for icons
that are only available in the octave icon theme like widget-xyz icnos
* resource-manager.h: updated secon boolean argument of icon function
* resource.qrc: update icon file names and paths
* settings-dialog.cc (settings_dialog): fill new combo box with names of
available icon themes;
(write_changed_settings): write current index of combo box in pref file
* settings-dialog.ui: replaced check box for system icon theme by
combo box for icon themes
author | Torsten Lilge <ttl-octave@mailbox.org> |
---|---|
date | Sun, 27 Feb 2022 20:21:12 +0100 |
parents | 439eb9bd4c04 |
children | ad014fc78bd6 c6d54dd31a7e |
rev | line source |
---|---|
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
1 //////////////////////////////////////////////////////////////////////// |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
2 // |
30564
796f54d4ddbf
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
30398
diff
changeset
|
3 // Copyright (C) 2012-2022 The Octave Project Developers |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
4 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
5 // See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
6 // distribution or <https://octave.org/copyright/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
7 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
8 // This file is part of Octave. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
9 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
10 // Octave is free software: you can redistribute it and/or modify it |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
11 // under the terms of the GNU General Public License as published by |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
12 // the Free Software Foundation, either version 3 of the License, or |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
13 // (at your option) any later version. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
14 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
15 // Octave is distributed in the hope that it will be useful, but |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
16 // WITHOUT ANY WARRANTY; without even the implied warranty of |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
18 // GNU General Public License for more details. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
19 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
20 // You should have received a copy of the GNU General Public License |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
21 // along with Octave; see the file COPYING. If not, see |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
22 // <https://www.gnu.org/licenses/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
23 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
24 //////////////////////////////////////////////////////////////////////// |
16798
d749c9b588e5
make stand-alone windows from dock widgets when floating (bug #38785)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
25 |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21301
diff
changeset
|
26 #if defined (HAVE_CONFIG_H) |
21301
40de9f8f23a6
Use '#include "config.h"' rather than <config.h>.
Rik <rik@octave.org>
parents:
21203
diff
changeset
|
27 # include "config.h" |
17923
b602014eeb54
* octave-dock-widget.cc: Include config.h.
John W. Eaton <jwe@octave.org>
parents:
17899
diff
changeset
|
28 #endif |
b602014eeb54
* octave-dock-widget.cc: Include config.h.
John W. Eaton <jwe@octave.org>
parents:
17899
diff
changeset
|
29 |
27412
da1f59fe04b3
try to use consitent ordering for include files in libgui sources
John W. Eaton <jwe@octave.org>
parents:
27302
diff
changeset
|
30 #include <QAction> |
16881
944ade6e7f66
Make main window copy and paste global for current focused window
John Donoghue <john.donoghue@ieee.org>
parents:
16865
diff
changeset
|
31 #include <QApplication> |
16798
d749c9b588e5
make stand-alone windows from dock widgets when floating (bug #38785)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
32 #include <QHBoxLayout> |
d749c9b588e5
make stand-alone windows from dock widgets when floating (bug #38785)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
33 #include <QLabel> |
30690
e2c8c852399e
replace use of depreciated QDesktopWidget in GUI
Torsten Lilge <ttl-octave@mailbox.org>
parents:
30626
diff
changeset
|
34 #include <QScreen> |
19918
66928b4546ab
dock-/undock- and close-icons with variable size (bug #41938)
Torsten <ttl@justmail.de>
parents:
19913
diff
changeset
|
35 #include <QStyle> |
26299
c95884eed1cf
make restoring gui more robust to changes of desktop size (bug #53207)
Torsten <mttl@mailbox.org>
parents:
25907
diff
changeset
|
36 #include <QToolBar> |
27468
8ba19629d5ef
compacter menu bars in dock widgets (bug #53902)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27467
diff
changeset
|
37 #include <QMenuBar> |
30690
e2c8c852399e
replace use of depreciated QDesktopWidget in GUI
Torsten Lilge <ttl-octave@mailbox.org>
parents:
30626
diff
changeset
|
38 #include <QWindow> |
16798
d749c9b588e5
make stand-alone windows from dock widgets when floating (bug #38785)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
39 |
27665
a1271c5b621a
replace preference literals by symbolic constants for dock widgets
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27629
diff
changeset
|
40 #include "gui-preferences-dw.h" |
27671
61883a1a80a1
don't include gui-preferences-global.h in gui-preferences.h
John W. Eaton <jwe@octave.org>
parents:
27665
diff
changeset
|
41 #include "gui-preferences-global.h" |
27562
d7876110e854
use symbolic preference keys if available
John W. Eaton <jwe@octave.org>
parents:
27560
diff
changeset
|
42 #include "gui-preferences-mw.h" |
27937
8dc5b36f1245
include new undock/dock actions into the shortcut manager
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27936
diff
changeset
|
43 #include "gui-preferences-sc.h" |
27611
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
27562
diff
changeset
|
44 #include "gui-settings.h" |
30690
e2c8c852399e
replace use of depreciated QDesktopWidget in GUI
Torsten Lilge <ttl-octave@mailbox.org>
parents:
30626
diff
changeset
|
45 #include "gui-utils.h" |
29613
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
46 #include "main-window.h" |
27412
da1f59fe04b3
try to use consitent ordering for include files in libgui sources
John W. Eaton <jwe@octave.org>
parents:
27302
diff
changeset
|
47 #include "octave-dock-widget.h" |
27629
8b6e928e0705
in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents:
27620
diff
changeset
|
48 #include "octave-qobject.h" |
16798
d749c9b588e5
make stand-alone windows from dock widgets when floating (bug #38785)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
49 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
50 namespace octave |
16798
d749c9b588e5
make stand-alone windows from dock widgets when floating (bug #38785)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
51 { |
27629
8b6e928e0705
in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents:
27620
diff
changeset
|
52 label_dock_widget::label_dock_widget (QWidget *p, base_qobject& oct_qobj) |
8b6e928e0705
in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents:
27620
diff
changeset
|
53 : QDockWidget (p), m_octave_qobj (oct_qobj), |
27620
45bb5bbaf291
don't use singleton pattern for resource manager in GUI
John W. Eaton <jwe@octave.org>
parents:
27611
diff
changeset
|
54 m_default_float_button (nullptr), m_default_close_button (nullptr) |
24828
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 QStyle *st = style (); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
57 m_icon_size = 0.75*st->pixelMetric (QStyle::PM_SmallIconSize); |
19918
66928b4546ab
dock-/undock- and close-icons with variable size (bug #41938)
Torsten <ttl@justmail.de>
parents:
19913
diff
changeset
|
58 |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
59 // keep track of the original buttons on the default title bar, |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
60 // the button further left is considered "float" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
61 QList<QAbstractButton *> buttonlist = findChildren<QAbstractButton *> (); |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
62 if (buttonlist.size () == 2) |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
63 { |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
64 if (buttonlist.at (0)->x () < buttonlist.at (1)->x ()) |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
65 { |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
66 m_default_float_button = buttonlist.at (0); |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
67 m_default_close_button = buttonlist.at (1); |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
68 } |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
69 else |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
70 { |
26343
df510676ca6a
octave-dock-widget.cc: Fix copy & paste error. (bug #55347)
Andreas Weber <octave@josoansi.de>
parents:
26299
diff
changeset
|
71 m_default_float_button = buttonlist.at (1); |
df510676ca6a
octave-dock-widget.cc: Fix copy & paste error. (bug #55347)
Andreas Weber <octave@josoansi.de>
parents:
26299
diff
changeset
|
72 m_default_close_button = buttonlist.at (0); |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
73 } |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
74 } |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
75 |
30777
439eb9bd4c04
icon fallback concept without QIcon::fallbackSearchPaths (bug #62106)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
30772
diff
changeset
|
76 resource_manager& rmgr = m_octave_qobj.get_resource_manager (); |
439eb9bd4c04
icon fallback concept without QIcon::fallbackSearchPaths (bug #62106)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
30772
diff
changeset
|
77 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
78 // the custom (extra) title bar of the widget |
24858
8ce66fe46f18
Improve fullscreen action for variable editor panes (bug #53275)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24842
diff
changeset
|
79 m_title_widget = new QWidget (); |
8ce66fe46f18
Improve fullscreen action for variable editor panes (bug #53275)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24842
diff
changeset
|
80 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
81 m_dock_action = new QAction |
30788
c11d34f72b3c
provide different icon sets for the GUI
Torsten Lilge <ttl-octave@mailbox.org>
parents:
30777
diff
changeset
|
82 (rmgr.icon ("widget-undock", true), "", this); |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
83 m_dock_action->setToolTip (tr ("Undock widget")); |
24858
8ce66fe46f18
Improve fullscreen action for variable editor panes (bug #53275)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24842
diff
changeset
|
84 m_dock_button = new QToolButton (m_title_widget); |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
85 m_dock_button->setDefaultAction (m_dock_action); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
86 m_dock_button->setFocusPolicy (Qt::NoFocus); |
30398
d4d83344d653
maint: style check C++ files in src/ and libgui/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30275
diff
changeset
|
87 m_dock_button->setIconSize (QSize (m_icon_size, m_icon_size)); |
16798
d749c9b588e5
make stand-alone windows from dock widgets when floating (bug #38785)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
88 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
89 m_close_action = new QAction |
30788
c11d34f72b3c
provide different icon sets for the GUI
Torsten Lilge <ttl-octave@mailbox.org>
parents:
30777
diff
changeset
|
90 (rmgr.icon ("widget-close", true), "", this); |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
91 m_close_action->setToolTip (tr ("Close widget")); |
24858
8ce66fe46f18
Improve fullscreen action for variable editor panes (bug #53275)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24842
diff
changeset
|
92 m_close_button = new QToolButton (m_title_widget); |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
93 m_close_button->setDefaultAction (m_close_action); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
94 m_close_button->setFocusPolicy (Qt::NoFocus); |
30398
d4d83344d653
maint: style check C++ files in src/ and libgui/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30275
diff
changeset
|
95 m_close_button->setIconSize (QSize (m_icon_size, m_icon_size)); |
16798
d749c9b588e5
make stand-alone windows from dock widgets when floating (bug #38785)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
96 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
97 QString css_button = QString ("QToolButton {background: transparent; border: 0px;}"); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
98 m_dock_button->setStyleSheet (css_button); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
99 m_close_button->setStyleSheet (css_button); |
18218
7952fb0435db
improve title bar of dock widgets
Torsten <ttl@justmail.de>
parents:
18180
diff
changeset
|
100 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
101 QHBoxLayout *h_layout = new QHBoxLayout (); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
102 h_layout->addStretch (100); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
103 h_layout->addWidget (m_dock_button); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
104 h_layout->addWidget (m_close_button); |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
105 h_layout->setSpacing (10); |
30398
d4d83344d653
maint: style check C++ files in src/ and libgui/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30275
diff
changeset
|
106 h_layout->setContentsMargins (5, 2, 2, 2); |
16798
d749c9b588e5
make stand-alone windows from dock widgets when floating (bug #38785)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
107 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
108 m_title_widget->setLayout (h_layout); |
16798
d749c9b588e5
make stand-alone windows from dock widgets when floating (bug #38785)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
109 |
29895
744bb06fea2a
avoid connecting non existing signals from variable editor
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29894
diff
changeset
|
110 if (p && (p->objectName () == gui_obj_name_main_window)) |
29780
d79f65e37e89
provide shortcuts in widgets launched from the cli
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29754
diff
changeset
|
111 { |
d79f65e37e89
provide shortcuts in widgets launched from the cli
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29754
diff
changeset
|
112 // Only connect the when a parent (main window) is given |
d79f65e37e89
provide shortcuts in widgets launched from the cli
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29754
diff
changeset
|
113 // copy & paste handling |
29894
2a14420440b8
fix regression from cset 7f22f024afdf
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29891
diff
changeset
|
114 connect (p, SIGNAL (copyClipboard_signal ()), |
30398
d4d83344d653
maint: style check C++ files in src/ and libgui/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30275
diff
changeset
|
115 this, SLOT (copyClipboard ())); |
29894
2a14420440b8
fix regression from cset 7f22f024afdf
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29891
diff
changeset
|
116 connect (p, SIGNAL (pasteClipboard_signal ()), |
30398
d4d83344d653
maint: style check C++ files in src/ and libgui/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30275
diff
changeset
|
117 this, SLOT (pasteClipboard ())); |
29894
2a14420440b8
fix regression from cset 7f22f024afdf
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29891
diff
changeset
|
118 connect (p, SIGNAL (selectAll_signal ()), |
30398
d4d83344d653
maint: style check C++ files in src/ and libgui/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30275
diff
changeset
|
119 this, SLOT (selectAll ())); |
29147
5d7a651bf0bb
fix error when restoring previous main window layout (bug #59426)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29145
diff
changeset
|
120 |
29780
d79f65e37e89
provide shortcuts in widgets launched from the cli
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29754
diff
changeset
|
121 // undo handling |
29894
2a14420440b8
fix regression from cset 7f22f024afdf
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29891
diff
changeset
|
122 connect (p, SIGNAL (undo_signal ()), this, SLOT (do_undo ())); |
29780
d79f65e37e89
provide shortcuts in widgets launched from the cli
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29754
diff
changeset
|
123 } |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
124 } |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24696
diff
changeset
|
125 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
126 // set the title in the dockwidgets title bar |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
127 void |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
128 label_dock_widget::set_title (const QString& title) |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
129 { |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
130 QHBoxLayout *h_layout |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
131 = static_cast<QHBoxLayout *> (m_title_widget->layout ()); |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
132 QLabel *label = new QLabel (title, m_title_widget); |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
133 label->setStyleSheet ("background-color: transparent;"); |
30398
d4d83344d653
maint: style check C++ files in src/ and libgui/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30275
diff
changeset
|
134 h_layout->insertWidget (0, label); |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
135 setTitleBarWidget (m_title_widget); |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
136 setWindowTitle (title); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
137 } |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24696
diff
changeset
|
138 |
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24696
diff
changeset
|
139 |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
140 static QString |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
141 qdockwidget_css (const QString& close_icon, const QString& close_tooltip, |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
142 const QString& float_icon, const QString& float_tooltip, |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
143 int icon_size, const QString& titlebar_foreground, |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
144 const QString& titlebar_background) |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
145 { |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
146 return QString ("QDockWidget\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
147 "{\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
148 "%6" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
149 " border: none;\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
150 " titlebar-close-icon: url(%1);\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
151 " titlebar-normal-icon: url(%2);\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
152 "}\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
153 "\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
154 "QDockWidget::close-button, QDockWidget::float-button\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
155 "{\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
156 " border: none;\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
157 " icon-size: %3px;\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
158 "}\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
159 "\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
160 "QAbstractButton#qt_dockwidget_closebutton\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
161 "{\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
162 " qproperty-toolTip: \"%4\";\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
163 "}\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
164 "\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
165 "QAbstractButton#qt_dockwidget_floatbutton\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
166 "{\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
167 " qproperty-toolTip: \"%5\";\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
168 "}\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
169 "\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
170 "QDockWidget::title {\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
171 " text-align: left;\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
172 "%7" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
173 " padding-left: 1px;\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
174 "}\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
175 "\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
176 "QDockWidget::close-button\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
177 "{\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
178 " right: %8px;\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
179 " top: 3px;\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
180 "}\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
181 "\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
182 "QDockWidget::float-button\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
183 "{\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
184 " right: %9px;\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
185 " top: 3px;\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
186 "}\n" |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
187 ).arg (close_icon).arg (float_icon).arg (icon_size) |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
188 .arg (close_tooltip).arg (float_tooltip) |
27893
465ac679e976
Fix typos and grammar errors in comments in libgui (patch #9790)
Andrew Janke <andrew@apjanke.net>
parents:
27672
diff
changeset
|
189 .arg (titlebar_foreground).arg (titlebar_background) |
465ac679e976
Fix typos and grammar errors in comments in libgui (patch #9790)
Andrew Janke <andrew@apjanke.net>
parents:
27672
diff
changeset
|
190 .arg ((icon_size*2)/3).arg((icon_size*7)/3); |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
191 } |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
192 |
27620
45bb5bbaf291
don't use singleton pattern for resource manager in GUI
John W. Eaton <jwe@octave.org>
parents:
27611
diff
changeset
|
193 octave_dock_widget::octave_dock_widget (const QString& obj_name, QWidget *p, |
27629
8b6e928e0705
in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents:
27620
diff
changeset
|
194 base_qobject& oct_qobj) |
29754
4c569e386e9b
improve behavior of dockable widgets (bug #60750)
John W. Eaton <jwe@octave.org>
parents:
29709
diff
changeset
|
195 : label_dock_widget (p, oct_qobj), m_adopted (false), |
4c569e386e9b
improve behavior of dockable widgets (bug #60750)
John W. Eaton <jwe@octave.org>
parents:
29709
diff
changeset
|
196 m_custom_style (false), m_focus_follows_mouse (false), |
29202
66af654b3485
provide focus follows mouse for widgets in the main window (bug #59701)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29199
diff
changeset
|
197 m_recent_float_geom (), m_recent_dock_geom (), |
66af654b3485
provide focus follows mouse for widgets in the main window (bug #59701)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29199
diff
changeset
|
198 m_waiting_for_mouse_button_release (false) |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
199 { |
25355
5bb07f6e3707
fix uninitialized settings of octave dock widgets at startup (bug #53835)
Torsten <mttl@mailbox.org>
parents:
25354
diff
changeset
|
200 setObjectName (obj_name); |
5bb07f6e3707
fix uninitialized settings of octave dock widgets at startup (bug #53835)
Torsten <mttl@mailbox.org>
parents:
25354
diff
changeset
|
201 |
29613
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
202 // FIXME: Can we avoid the cast here? |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
203 m_main_window = dynamic_cast<main_window *> (p); |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
204 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
205 m_predecessor_widget = nullptr; |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24696
diff
changeset
|
206 |
29542
3d34b70b5a49
connect many Qt signals and slots without SIGNAL and SLOT macros
John W. Eaton <jwe@octave.org>
parents:
29434
diff
changeset
|
207 connect (this, &octave_dock_widget::topLevelChanged, |
3d34b70b5a49
connect many Qt signals and slots without SIGNAL and SLOT macros
John W. Eaton <jwe@octave.org>
parents:
29434
diff
changeset
|
208 this, &octave_dock_widget::toplevel_change); |
3d34b70b5a49
connect many Qt signals and slots without SIGNAL and SLOT macros
John W. Eaton <jwe@octave.org>
parents:
29434
diff
changeset
|
209 connect (this, &octave_dock_widget::visibilityChanged, |
3d34b70b5a49
connect many Qt signals and slots without SIGNAL and SLOT macros
John W. Eaton <jwe@octave.org>
parents:
29434
diff
changeset
|
210 this, &octave_dock_widget::handle_visibility); |
29199
0b18887bc997
simplify initialization of gui dock widgets
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29147
diff
changeset
|
211 |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
212 if (m_default_float_button != nullptr) |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
213 { |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
214 disconnect (m_default_float_button, 0, 0, 0); |
29542
3d34b70b5a49
connect many Qt signals and slots without SIGNAL and SLOT macros
John W. Eaton <jwe@octave.org>
parents:
29434
diff
changeset
|
215 connect (m_default_float_button, &QAbstractButton::clicked, |
3d34b70b5a49
connect many Qt signals and slots without SIGNAL and SLOT macros
John W. Eaton <jwe@octave.org>
parents:
29434
diff
changeset
|
216 this, &octave_dock_widget::make_window); |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
217 } |
29542
3d34b70b5a49
connect many Qt signals and slots without SIGNAL and SLOT macros
John W. Eaton <jwe@octave.org>
parents:
29434
diff
changeset
|
218 connect (this, &octave_dock_widget::queue_make_window, |
3d34b70b5a49
connect many Qt signals and slots without SIGNAL and SLOT macros
John W. Eaton <jwe@octave.org>
parents:
29434
diff
changeset
|
219 this, &octave_dock_widget::make_window, Qt::QueuedConnection); |
3d34b70b5a49
connect many Qt signals and slots without SIGNAL and SLOT macros
John W. Eaton <jwe@octave.org>
parents:
29434
diff
changeset
|
220 connect (this, &octave_dock_widget::queue_make_widget, |
3d34b70b5a49
connect many Qt signals and slots without SIGNAL and SLOT macros
John W. Eaton <jwe@octave.org>
parents:
29434
diff
changeset
|
221 this, [=] () { make_widget (); }, Qt::QueuedConnection); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24696
diff
changeset
|
222 |
27937
8dc5b36f1245
include new undock/dock actions into the shortcut manager
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27936
diff
changeset
|
223 shortcut_manager& scmgr = m_octave_qobj.get_shortcut_manager (); |
8dc5b36f1245
include new undock/dock actions into the shortcut manager
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27936
diff
changeset
|
224 scmgr.set_shortcut (m_dock_action, sc_dock_widget_dock); |
27936
106c8ba2f13c
Add shortcut keys for octave_dock_widget undock, dock and close (bug #54078)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
27935
diff
changeset
|
225 m_dock_action->setShortcutContext (Qt::WidgetWithChildrenShortcut); |
106c8ba2f13c
Add shortcut keys for octave_dock_widget undock, dock and close (bug #54078)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
27935
diff
changeset
|
226 addAction (m_dock_action); |
29542
3d34b70b5a49
connect many Qt signals and slots without SIGNAL and SLOT macros
John W. Eaton <jwe@octave.org>
parents:
29434
diff
changeset
|
227 connect (m_dock_action, &QAction::triggered, |
3d34b70b5a49
connect many Qt signals and slots without SIGNAL and SLOT macros
John W. Eaton <jwe@octave.org>
parents:
29434
diff
changeset
|
228 this, &octave_dock_widget::make_window); |
27937
8dc5b36f1245
include new undock/dock actions into the shortcut manager
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27936
diff
changeset
|
229 |
8dc5b36f1245
include new undock/dock actions into the shortcut manager
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27936
diff
changeset
|
230 scmgr.set_shortcut (m_close_action, sc_dock_widget_close); |
27936
106c8ba2f13c
Add shortcut keys for octave_dock_widget undock, dock and close (bug #54078)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
27935
diff
changeset
|
231 m_close_action->setShortcutContext (Qt::WidgetWithChildrenShortcut); |
106c8ba2f13c
Add shortcut keys for octave_dock_widget undock, dock and close (bug #54078)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
27935
diff
changeset
|
232 addAction (m_close_action); |
29542
3d34b70b5a49
connect many Qt signals and slots without SIGNAL and SLOT macros
John W. Eaton <jwe@octave.org>
parents:
29434
diff
changeset
|
233 connect (m_close_action, &QAction::triggered, |
3d34b70b5a49
connect many Qt signals and slots without SIGNAL and SLOT macros
John W. Eaton <jwe@octave.org>
parents:
29434
diff
changeset
|
234 this, &octave_dock_widget::change_visibility); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24696
diff
changeset
|
235 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
236 m_close_action->setToolTip (tr ("Hide widget")); |
24812
ed9ba20d6ed3
Make the variable editor multi-panel via a QMainWindow layout (bug #53046)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
24696
diff
changeset
|
237 |
30777
439eb9bd4c04
icon fallback concept without QIcon::fallbackSearchPaths (bug #62106)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
30772
diff
changeset
|
238 setStyleSheet (qdockwidget_css ( |
30788
c11d34f72b3c
provide different icon sets for the GUI
Torsten Lilge <ttl-octave@mailbox.org>
parents:
30777
diff
changeset
|
239 global_icon_paths.at (ICON_THEME_OCTAVE) + "widget-close.png", |
30777
439eb9bd4c04
icon fallback concept without QIcon::fallbackSearchPaths (bug #62106)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
30772
diff
changeset
|
240 QString ("Close widget"), |
30788
c11d34f72b3c
provide different icon sets for the GUI
Torsten Lilge <ttl-octave@mailbox.org>
parents:
30777
diff
changeset
|
241 global_icon_paths.at (ICON_THEME_OCTAVE) + "widget-undock.png", |
30777
439eb9bd4c04
icon fallback concept without QIcon::fallbackSearchPaths (bug #62106)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
30772
diff
changeset
|
242 QString ("Undock widget"), |
439eb9bd4c04
icon fallback concept without QIcon::fallbackSearchPaths (bug #62106)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
30772
diff
changeset
|
243 m_icon_size, |
439eb9bd4c04
icon fallback concept without QIcon::fallbackSearchPaths (bug #62106)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
30772
diff
changeset
|
244 QString (""), |
439eb9bd4c04
icon fallback concept without QIcon::fallbackSearchPaths (bug #62106)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
30772
diff
changeset
|
245 QString (""))); |
439eb9bd4c04
icon fallback concept without QIcon::fallbackSearchPaths (bug #62106)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
30772
diff
changeset
|
246 |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
247 if (widget ()) |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
248 widget ()->setToolTip (QString ("")); |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
249 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
250 m_icon_color = ""; |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
251 m_title_3d = 50; |
19360
2f9d9663b6b0
fix double clicks into the borders of floating dock widgets (bug #43662)
Torsten <ttl@justmail.de>
parents:
18555
diff
changeset
|
252 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
253 installEventFilter (this); |
19360
2f9d9663b6b0
fix double clicks into the borders of floating dock widgets (bug #43662)
Torsten <ttl@justmail.de>
parents:
18555
diff
changeset
|
254 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
255 setFocusPolicy (Qt::StrongFocus); |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
256 |
30275
cf434923aec0
gui: Avoid deprecated enum QDockWidget::AllDockWidgetFeatures.
Markus Mützel <markus.muetzel@gmx.de>
parents:
29895
diff
changeset
|
257 setFeatures (QDockWidget::DockWidgetClosable |
cf434923aec0
gui: Avoid deprecated enum QDockWidget::AllDockWidgetFeatures.
Markus Mützel <markus.muetzel@gmx.de>
parents:
29895
diff
changeset
|
258 | QDockWidget::DockWidgetMovable |
cf434923aec0
gui: Avoid deprecated enum QDockWidget::AllDockWidgetFeatures.
Markus Mützel <markus.muetzel@gmx.de>
parents:
29895
diff
changeset
|
259 | QDockWidget::DockWidgetFloatable); |
25355
5bb07f6e3707
fix uninitialized settings of octave dock widgets at startup (bug #53835)
Torsten <mttl@mailbox.org>
parents:
25354
diff
changeset
|
260 |
27629
8b6e928e0705
in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents:
27620
diff
changeset
|
261 resource_manager& rmgr = m_octave_qobj.get_resource_manager (); |
8b6e928e0705
in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents:
27620
diff
changeset
|
262 handle_settings (rmgr.get_settings ()); |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
263 } |
16798
d749c9b588e5
make stand-alone windows from dock widgets when floating (bug #38785)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
264 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
265 void |
29199
0b18887bc997
simplify initialization of gui dock widgets
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29147
diff
changeset
|
266 octave_dock_widget::init_window_menu_entry (void) |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
267 { |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
268 emit active_changed (isVisible ()); // emit once for init of window menu |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
269 } |
16809
84505f200e05
fix checked state of window menu entries at startup (bug #39322)
Torsten <ttl@justmail.de>
parents:
16798
diff
changeset
|
270 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
271 // make the widget floating |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
272 void |
26818
f7b10bd40045
fix dock widget position when being dragged out of the main window (bug #55704)
Torsten <mttl@mailbox.org>
parents:
26452
diff
changeset
|
273 octave_dock_widget::make_window (bool widget_was_dragged) |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
274 { |
25356
1008b4797a6e
fix visibility of dock widgets at startup
Torsten <mttl@mailbox.org>
parents:
25355
diff
changeset
|
275 bool vis = isVisible (); |
1008b4797a6e
fix visibility of dock widgets at startup
Torsten <mttl@mailbox.org>
parents:
25355
diff
changeset
|
276 |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
277 // prevent follow-up calls by clearing state variable |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
278 m_waiting_for_mouse_button_release = false; |
17686
65544374c1cf
restore (un)docking of widgets without reparenting on non-windows systems
Torsten <ttl@justmail.de>
parents:
17090
diff
changeset
|
279 |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
280 set_focus_predecessor (); // set focus previously active widget if tabbed |
16798
d749c9b588e5
make stand-alone windows from dock widgets when floating (bug #38785)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
281 |
26818
f7b10bd40045
fix dock widget position when being dragged out of the main window (bug #55704)
Torsten <mttl@mailbox.org>
parents:
26452
diff
changeset
|
282 // Before unparenting, get current geometry for restoring if dragged |
f7b10bd40045
fix dock widget position when being dragged out of the main window (bug #55704)
Torsten <mttl@mailbox.org>
parents:
26452
diff
changeset
|
283 QRect geom = geometry (); |
f7b10bd40045
fix dock widget position when being dragged out of the main window (bug #55704)
Torsten <mttl@mailbox.org>
parents:
26452
diff
changeset
|
284 |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
285 // the widget has to be reparented (parent = 0), preferably |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
286 // from a non-toplevel widget otherwise may not have full |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
287 // decorations, e.g., no taskbar icon and always in front |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
288 if (isFloating ()) |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
289 setFloating (false); |
26818
f7b10bd40045
fix dock widget position when being dragged out of the main window (bug #55704)
Torsten <mttl@mailbox.org>
parents:
26452
diff
changeset
|
290 |
29613
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
291 if (m_main_window) |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
292 { |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
293 // Before making it a separate (no more parent) floating widget, |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
294 // remove the dock widget from the main window. This ensures |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
295 // that tabbed widgets keep their focus when it is re-docked |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
296 // later |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
297 m_main_window->removeDockWidget (this); |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
298 } |
26818
f7b10bd40045
fix dock widget position when being dragged out of the main window (bug #55704)
Torsten <mttl@mailbox.org>
parents:
26452
diff
changeset
|
299 |
25509
e00aa6a75edd
Do not make floated widgets a Qt::Window to conserve title bar (bug #54078)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25396
diff
changeset
|
300 setParent (0, Qt::CustomizeWindowHint | Qt::WindowTitleHint | |
25887
ad3417a54be6
Keep QWindow flag when setting parent in undocked mode (Bug #54495)
John Donoghue
parents:
25509
diff
changeset
|
301 Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint | Qt::Window); |
24570
c9aab297130e
make floating dock widgets resizable in KDE Oxygen (bug #52797)
Torsten <mttl@mailbox.org>
parents:
24534
diff
changeset
|
302 |
26818
f7b10bd40045
fix dock widget position when being dragged out of the main window (bug #55704)
Torsten <mttl@mailbox.org>
parents:
26452
diff
changeset
|
303 // restore the last geometry when floating only if we have not dragged |
f7b10bd40045
fix dock widget position when being dragged out of the main window (bug #55704)
Torsten <mttl@mailbox.org>
parents:
26452
diff
changeset
|
304 // the window outside the main window |
f7b10bd40045
fix dock widget position when being dragged out of the main window (bug #55704)
Torsten <mttl@mailbox.org>
parents:
26452
diff
changeset
|
305 if (! widget_was_dragged) |
f7b10bd40045
fix dock widget position when being dragged out of the main window (bug #55704)
Torsten <mttl@mailbox.org>
parents:
26452
diff
changeset
|
306 geom = m_recent_float_geom.isNull () ? QRect (50,100,480,480) |
f7b10bd40045
fix dock widget position when being dragged out of the main window (bug #55704)
Torsten <mttl@mailbox.org>
parents:
26452
diff
changeset
|
307 : m_recent_float_geom; |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
308 setGeometry (geom); |
16798
d749c9b588e5
make stand-alone windows from dock widgets when floating (bug #38785)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
309 |
27937
8dc5b36f1245
include new undock/dock actions into the shortcut manager
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27936
diff
changeset
|
310 // adjust the (un)dock action |
27936
106c8ba2f13c
Add shortcut keys for octave_dock_widget undock, dock and close (bug #54078)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
27935
diff
changeset
|
311 disconnect (m_dock_action, 0, this, 0); |
29542
3d34b70b5a49
connect many Qt signals and slots without SIGNAL and SLOT macros
John W. Eaton <jwe@octave.org>
parents:
29434
diff
changeset
|
312 connect (m_dock_action, &QAction::triggered, |
3d34b70b5a49
connect many Qt signals and slots without SIGNAL and SLOT macros
John W. Eaton <jwe@octave.org>
parents:
29434
diff
changeset
|
313 this, &octave_dock_widget::make_widget); |
27937
8dc5b36f1245
include new undock/dock actions into the shortcut manager
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27936
diff
changeset
|
314 |
8dc5b36f1245
include new undock/dock actions into the shortcut manager
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27936
diff
changeset
|
315 // adjust the (un)dock icon |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
316 if (titleBarWidget ()) |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
317 { |
30777
439eb9bd4c04
icon fallback concept without QIcon::fallbackSearchPaths (bug #62106)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
30772
diff
changeset
|
318 resource_manager& rmgr = m_octave_qobj.get_resource_manager (); |
30788
c11d34f72b3c
provide different icon sets for the GUI
Torsten Lilge <ttl-octave@mailbox.org>
parents:
30777
diff
changeset
|
319 m_dock_action->setIcon (rmgr.icon ("widget-dock" + m_icon_color, true)); |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
320 m_dock_action->setToolTip (tr ("Dock widget")); |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
321 } |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
322 else |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
323 { |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
324 disconnect (m_default_float_button, 0, this, 0); |
29542
3d34b70b5a49
connect many Qt signals and slots without SIGNAL and SLOT macros
John W. Eaton <jwe@octave.org>
parents:
29434
diff
changeset
|
325 connect (m_default_float_button, &QAbstractButton::clicked, |
3d34b70b5a49
connect many Qt signals and slots without SIGNAL and SLOT macros
John W. Eaton <jwe@octave.org>
parents:
29434
diff
changeset
|
326 this, &octave_dock_widget::make_widget); |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
327 } |
17686
65544374c1cf
restore (un)docking of widgets without reparenting on non-windows systems
Torsten <ttl@justmail.de>
parents:
17090
diff
changeset
|
328 |
25384
9b67c2294129
fix missing title bar highlighting when (un)docking a widget
Torsten <mttl@mailbox.org>
parents:
25373
diff
changeset
|
329 raise (); |
9b67c2294129
fix missing title bar highlighting when (un)docking a widget
Torsten <mttl@mailbox.org>
parents:
25373
diff
changeset
|
330 activateWindow (); |
9b67c2294129
fix missing title bar highlighting when (un)docking a widget
Torsten <mttl@mailbox.org>
parents:
25373
diff
changeset
|
331 |
25356
1008b4797a6e
fix visibility of dock widgets at startup
Torsten <mttl@mailbox.org>
parents:
25355
diff
changeset
|
332 if (vis) |
27935
f1844e33f621
maint: Use Octave coding conventions in libgui/ directory.
Rik <rik@octave.org>
parents:
27923
diff
changeset
|
333 { |
f1844e33f621
maint: Use Octave coding conventions in libgui/ directory.
Rik <rik@octave.org>
parents:
27923
diff
changeset
|
334 show (); |
f1844e33f621
maint: Use Octave coding conventions in libgui/ directory.
Rik <rik@octave.org>
parents:
27923
diff
changeset
|
335 setFocus (); |
f1844e33f621
maint: Use Octave coding conventions in libgui/ directory.
Rik <rik@octave.org>
parents:
27923
diff
changeset
|
336 set_style (true); |
f1844e33f621
maint: Use Octave coding conventions in libgui/ directory.
Rik <rik@octave.org>
parents:
27923
diff
changeset
|
337 } |
27089
9326c2258e60
fix visibility of find dialog when editor is docked/undocked (bug #5)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
26818
diff
changeset
|
338 |
9326c2258e60
fix visibility of find dialog when editor is docked/undocked (bug #5)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
26818
diff
changeset
|
339 emit topLevelChanged (true); // Be sure signal is emitted |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
340 } |
16798
d749c9b588e5
make stand-alone windows from dock widgets when floating (bug #38785)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
341 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
342 // dock the widget |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
343 void |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
344 octave_dock_widget::make_widget (bool) |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
345 { |
25356
1008b4797a6e
fix visibility of dock widgets at startup
Torsten <mttl@mailbox.org>
parents:
25355
diff
changeset
|
346 bool vis = isVisible (); |
1008b4797a6e
fix visibility of dock widgets at startup
Torsten <mttl@mailbox.org>
parents:
25355
diff
changeset
|
347 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
348 // Since floating widget has no parent, we have to read it |
27629
8b6e928e0705
in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents:
27620
diff
changeset
|
349 resource_manager& rmgr = m_octave_qobj.get_resource_manager (); |
8b6e928e0705
in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents:
27620
diff
changeset
|
350 gui_settings *settings = rmgr.get_settings (); |
16798
d749c9b588e5
make stand-alone windows from dock widgets when floating (bug #38785)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
351 |
29613
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
352 if (m_main_window) |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
353 { |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
354 settings->setValue (mw_state.key, m_main_window->saveState ()); |
29754
4c569e386e9b
improve behavior of dockable widgets (bug #60750)
John W. Eaton <jwe@octave.org>
parents:
29709
diff
changeset
|
355 |
29613
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
356 // Stay window, otherwise will bounce back to window by default |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
357 // because there is no layout information for this widget in the |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
358 // saved settings. |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
359 setParent (m_main_window, Qt::Window); |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
360 m_main_window->addDockWidget (Qt::BottomDockWidgetArea, this); |
29754
4c569e386e9b
improve behavior of dockable widgets (bug #60750)
John W. Eaton <jwe@octave.org>
parents:
29709
diff
changeset
|
361 m_adopted = false; |
29613
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
362 // recover old window states, hide and re-show new added widget |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
363 m_main_window->restoreState (settings->value (mw_state.key).toByteArray ()); |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
364 setFloating (false); |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
365 // restore size using setGeometry instead of restoreGeometry |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
366 // following this post: |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
367 // https://forum.qt.io/topic/79326/qdockwidget-restoregeometry-not-working-correctly-when-qmainwindow-is-maximized/5 |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
368 setGeometry (m_recent_dock_geom); |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
369 } |
16798
d749c9b588e5
make stand-alone windows from dock widgets when floating (bug #38785)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
370 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
371 // adjust the (un)dock icon |
29754
4c569e386e9b
improve behavior of dockable widgets (bug #60750)
John W. Eaton <jwe@octave.org>
parents:
29709
diff
changeset
|
372 disconnect (m_dock_action, 0, this, 0); |
29542
3d34b70b5a49
connect many Qt signals and slots without SIGNAL and SLOT macros
John W. Eaton <jwe@octave.org>
parents:
29434
diff
changeset
|
373 connect (m_dock_action, &QAction::triggered, |
3d34b70b5a49
connect many Qt signals and slots without SIGNAL and SLOT macros
John W. Eaton <jwe@octave.org>
parents:
29434
diff
changeset
|
374 this, &octave_dock_widget::make_window); |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
375 if (titleBarWidget ()) |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
376 { |
30788
c11d34f72b3c
provide different icon sets for the GUI
Torsten Lilge <ttl-octave@mailbox.org>
parents:
30777
diff
changeset
|
377 m_dock_action->setIcon (rmgr.icon ("widget-undock" + m_icon_color, true)); |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
378 m_dock_action->setToolTip (tr ("Undock widget")); |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
379 } |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
380 else |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
381 { |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
382 disconnect (m_default_float_button, 0, this, 0); |
29542
3d34b70b5a49
connect many Qt signals and slots without SIGNAL and SLOT macros
John W. Eaton <jwe@octave.org>
parents:
29434
diff
changeset
|
383 connect (m_default_float_button, &QAbstractButton::clicked, |
3d34b70b5a49
connect many Qt signals and slots without SIGNAL and SLOT macros
John W. Eaton <jwe@octave.org>
parents:
29434
diff
changeset
|
384 this, &octave_dock_widget::make_window); |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
385 } |
25356
1008b4797a6e
fix visibility of dock widgets at startup
Torsten <mttl@mailbox.org>
parents:
25355
diff
changeset
|
386 |
25384
9b67c2294129
fix missing title bar highlighting when (un)docking a widget
Torsten <mttl@mailbox.org>
parents:
25373
diff
changeset
|
387 raise (); |
9b67c2294129
fix missing title bar highlighting when (un)docking a widget
Torsten <mttl@mailbox.org>
parents:
25373
diff
changeset
|
388 QApplication::setActiveWindow (this); |
9b67c2294129
fix missing title bar highlighting when (un)docking a widget
Torsten <mttl@mailbox.org>
parents:
25373
diff
changeset
|
389 |
25356
1008b4797a6e
fix visibility of dock widgets at startup
Torsten <mttl@mailbox.org>
parents:
25355
diff
changeset
|
390 if (vis) |
1008b4797a6e
fix visibility of dock widgets at startup
Torsten <mttl@mailbox.org>
parents:
25355
diff
changeset
|
391 { |
1008b4797a6e
fix visibility of dock widgets at startup
Torsten <mttl@mailbox.org>
parents:
25355
diff
changeset
|
392 show (); |
27281
0915fec3d3a9
prevent gui from catching focus when its desktop workspace becomes active
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27255
diff
changeset
|
393 setFocus (); |
25384
9b67c2294129
fix missing title bar highlighting when (un)docking a widget
Torsten <mttl@mailbox.org>
parents:
25373
diff
changeset
|
394 set_style (true); |
25356
1008b4797a6e
fix visibility of dock widgets at startup
Torsten <mttl@mailbox.org>
parents:
25355
diff
changeset
|
395 } |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
396 } |
17686
65544374c1cf
restore (un)docking of widgets without reparenting on non-windows systems
Torsten <ttl@justmail.de>
parents:
17090
diff
changeset
|
397 |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
398 // dock the widget |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
399 void |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
400 octave_dock_widget::default_dock (bool) |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
401 { |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
402 setFloating (false); |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
403 } |
24014
bffd7d826887
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23807
diff
changeset
|
404 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
405 // set the widget which previously had focus when tabified |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
406 void |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
407 octave_dock_widget::set_predecessor_widget (octave_dock_widget *prev_widget) |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
408 { |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
409 m_predecessor_widget = prev_widget; |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
410 } |
24014
bffd7d826887
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23807
diff
changeset
|
411 |
29613
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
412 void |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
413 octave_dock_widget::set_main_window (main_window *mw) |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
414 { |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
415 m_main_window = mw; |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
416 |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
417 if (m_main_window) |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
418 { |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
419 connect (m_main_window, &main_window::copyClipboard_signal, |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
420 this, &octave_dock_widget::copyClipboard); |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
421 |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
422 connect (m_main_window, &main_window::pasteClipboard_signal, |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
423 this, &octave_dock_widget::pasteClipboard); |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
424 |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
425 connect (m_main_window, &main_window::selectAll_signal, |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
426 this, &octave_dock_widget::selectAll); |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
427 |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
428 connect (m_main_window, &main_window::undo_signal, |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
429 this, &octave_dock_widget::do_undo); |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
430 } |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
431 } |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
432 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
433 // close event |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
434 void |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
435 octave_dock_widget::closeEvent (QCloseEvent *e) |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
436 { |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
437 emit active_changed (false); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
438 set_focus_predecessor (); |
28018
20a9b99d515c
fix restoring floating console widget (bug #56989)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
28005
diff
changeset
|
439 save_settings (); |
20a9b99d515c
fix restoring floating console widget (bug #56989)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
28005
diff
changeset
|
440 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
441 QDockWidget::closeEvent (e); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
442 } |
24014
bffd7d826887
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23807
diff
changeset
|
443 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
444 // get focus widget |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
445 QWidget * |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
446 octave_dock_widget::focusWidget (void) |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
447 { |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
448 QWidget *w = QApplication::focusWidget (); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
449 if (w && w->focusProxy ()) w = w->focusProxy (); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
450 return w; |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
451 } |
24014
bffd7d826887
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23807
diff
changeset
|
452 |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
453 bool |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
454 octave_dock_widget::event (QEvent *event) |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
455 { |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
456 // low-level check of whether docked-widget became a window via |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
457 // double-click or via drag-and-drop |
26818
f7b10bd40045
fix dock widget position when being dragged out of the main window (bug #55704)
Torsten <mttl@mailbox.org>
parents:
26452
diff
changeset
|
458 if ( (event->type () == QEvent::MouseButtonDblClick && ! isFloating ()) |
27935
f1844e33f621
maint: Use Octave coding conventions in libgui/ directory.
Rik <rik@octave.org>
parents:
27923
diff
changeset
|
459 || (event->type () == QEvent::ActivationChange |
f1844e33f621
maint: Use Octave coding conventions in libgui/ directory.
Rik <rik@octave.org>
parents:
27923
diff
changeset
|
460 && m_waiting_for_mouse_button_release)) |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
461 { |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
462 bool retval = QDockWidget::event (event); |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
463 if (isFloating () && parent () != 0) |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
464 { |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
465 m_waiting_for_mouse_button_release = false; |
26818
f7b10bd40045
fix dock widget position when being dragged out of the main window (bug #55704)
Torsten <mttl@mailbox.org>
parents:
26452
diff
changeset
|
466 emit queue_make_window (event->type () != QEvent::MouseButtonDblClick); |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
467 } |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
468 return retval; |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
469 } |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
470 |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
471 return QDockWidget::event (event); |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
472 } |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
473 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
474 void |
27611
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
27562
diff
changeset
|
475 octave_dock_widget::handle_settings (const gui_settings *settings) |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
476 { |
29613
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
477 if (! settings) |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
478 return; |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
479 |
29202
66af654b3485
provide focus follows mouse for widgets in the main window (bug #59701)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29199
diff
changeset
|
480 m_focus_follows_mouse = settings->value (dw_focus_follows_mouse).toBool (); |
66af654b3485
provide focus follows mouse for widgets in the main window (bug #59701)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29199
diff
changeset
|
481 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
482 m_custom_style |
27672
a36443e94f8a
simplify gui_settings->value (PREF.key, PREF.def) calls
John W. Eaton <jwe@octave.org>
parents:
27671
diff
changeset
|
483 = settings->value (dw_title_custom_style).toBool (); |
24014
bffd7d826887
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23807
diff
changeset
|
484 |
27665
a1271c5b621a
replace preference literals by symbolic constants for dock widgets
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27629
diff
changeset
|
485 m_title_3d = settings->value (dw_title_3d.key, dw_title_3d.def).toInt (); |
a1271c5b621a
replace preference literals by symbolic constants for dock widgets
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27629
diff
changeset
|
486 |
a1271c5b621a
replace preference literals by symbolic constants for dock widgets
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27629
diff
changeset
|
487 m_fg_color |
27672
a36443e94f8a
simplify gui_settings->value (PREF.key, PREF.def) calls
John W. Eaton <jwe@octave.org>
parents:
27671
diff
changeset
|
488 = settings->value (dw_title_fg_color).value<QColor> (); |
24014
bffd7d826887
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23807
diff
changeset
|
489 |
27665
a1271c5b621a
replace preference literals by symbolic constants for dock widgets
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27629
diff
changeset
|
490 m_fg_color_active |
27672
a36443e94f8a
simplify gui_settings->value (PREF.key, PREF.def) calls
John W. Eaton <jwe@octave.org>
parents:
27671
diff
changeset
|
491 = settings->value (dw_title_fg_color_active).value<QColor> (); |
24014
bffd7d826887
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23807
diff
changeset
|
492 |
27672
a36443e94f8a
simplify gui_settings->value (PREF.key, PREF.def) calls
John W. Eaton <jwe@octave.org>
parents:
27671
diff
changeset
|
493 m_bg_color = settings->value (dw_title_bg_color).value<QColor> (); |
27665
a1271c5b621a
replace preference literals by symbolic constants for dock widgets
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27629
diff
changeset
|
494 |
a1271c5b621a
replace preference literals by symbolic constants for dock widgets
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27629
diff
changeset
|
495 m_bg_color_active |
27672
a36443e94f8a
simplify gui_settings->value (PREF.key, PREF.def) calls
John W. Eaton <jwe@octave.org>
parents:
27671
diff
changeset
|
496 = settings->value (dw_title_bg_color_active).value<QColor> (); |
24014
bffd7d826887
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23807
diff
changeset
|
497 |
24842
74229798f604
always select suitable icon color for sock widgets depending on title bar color
Torsten <mttl@mailbox.org>
parents:
24836
diff
changeset
|
498 QColor bcol (m_bg_color); |
74229798f604
always select suitable icon color for sock widgets depending on title bar color
Torsten <mttl@mailbox.org>
parents:
24836
diff
changeset
|
499 QColor bcola (m_bg_color_active); |
74229798f604
always select suitable icon color for sock widgets depending on title bar color
Torsten <mttl@mailbox.org>
parents:
24836
diff
changeset
|
500 |
74229798f604
always select suitable icon color for sock widgets depending on title bar color
Torsten <mttl@mailbox.org>
parents:
24836
diff
changeset
|
501 if (! m_custom_style) |
74229798f604
always select suitable icon color for sock widgets depending on title bar color
Torsten <mttl@mailbox.org>
parents:
24836
diff
changeset
|
502 { |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
503 bcol = QWidget::palette ().color (m_title_widget->backgroundRole ()); |
24842
74229798f604
always select suitable icon color for sock widgets depending on title bar color
Torsten <mttl@mailbox.org>
parents:
24836
diff
changeset
|
504 bcola = bcol; |
74229798f604
always select suitable icon color for sock widgets depending on title bar color
Torsten <mttl@mailbox.org>
parents:
24836
diff
changeset
|
505 } |
74229798f604
always select suitable icon color for sock widgets depending on title bar color
Torsten <mttl@mailbox.org>
parents:
24836
diff
changeset
|
506 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
507 int r, g, b; |
24842
74229798f604
always select suitable icon color for sock widgets depending on title bar color
Torsten <mttl@mailbox.org>
parents:
24836
diff
changeset
|
508 bcol.getRgb (&r, &g, &b); |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
509 if (r+g+b < 400) |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
510 m_icon_color = "-light"; |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
511 else |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
512 m_icon_color = ""; |
24014
bffd7d826887
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23807
diff
changeset
|
513 |
24842
74229798f604
always select suitable icon color for sock widgets depending on title bar color
Torsten <mttl@mailbox.org>
parents:
24836
diff
changeset
|
514 bcola.getRgb (&r, &g, &b); |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
515 if (r+g+b < 400) |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
516 m_icon_color_active = "-light"; |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
517 else |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
518 m_icon_color_active = ""; |
24014
bffd7d826887
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23807
diff
changeset
|
519 |
29694
54c0eb5548ee
restore previous widget geometry when invoked from cli (bug #60630)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29613
diff
changeset
|
520 |
54c0eb5548ee
restore previous widget geometry when invoked from cli (bug #60630)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29613
diff
changeset
|
521 int x, y, w, h; |
30690
e2c8c852399e
replace use of depreciated QDesktopWidget in GUI
Torsten Lilge <ttl-octave@mailbox.org>
parents:
30626
diff
changeset
|
522 QGuiApplication::primaryScreen ()->availableGeometry ().getRect (&x, &y, &w, &h); |
29694
54c0eb5548ee
restore previous widget geometry when invoked from cli (bug #60630)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29613
diff
changeset
|
523 QRect default_floating_size = QRect (x+16, y+32, w/3, h/2); |
54c0eb5548ee
restore previous widget geometry when invoked from cli (bug #60630)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29613
diff
changeset
|
524 |
54c0eb5548ee
restore previous widget geometry when invoked from cli (bug #60630)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29613
diff
changeset
|
525 QRect default_dock_size; |
29613
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
526 if (m_main_window) |
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29612
diff
changeset
|
527 { |
29694
54c0eb5548ee
restore previous widget geometry when invoked from cli (bug #60630)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29613
diff
changeset
|
528 // We have a main window, dock size depends on size of main window |
54c0eb5548ee
restore previous widget geometry when invoked from cli (bug #60630)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29613
diff
changeset
|
529 m_main_window->geometry ().getRect (&x, &y, &w, &h); |
54c0eb5548ee
restore previous widget geometry when invoked from cli (bug #60630)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29613
diff
changeset
|
530 default_dock_size = QRect (x+16, y+32, w/3, h/3); |
54c0eb5548ee
restore previous widget geometry when invoked from cli (bug #60630)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29613
diff
changeset
|
531 } |
54c0eb5548ee
restore previous widget geometry when invoked from cli (bug #60630)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29613
diff
changeset
|
532 else |
54c0eb5548ee
restore previous widget geometry when invoked from cli (bug #60630)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29613
diff
changeset
|
533 { |
54c0eb5548ee
restore previous widget geometry when invoked from cli (bug #60630)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29613
diff
changeset
|
534 // No main window, default dock size should never be used |
54c0eb5548ee
restore previous widget geometry when invoked from cli (bug #60630)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29613
diff
changeset
|
535 default_dock_size = QRect (0, 0, w/10, h/10); |
54c0eb5548ee
restore previous widget geometry when invoked from cli (bug #60630)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29613
diff
changeset
|
536 } |
26299
c95884eed1cf
make restoring gui more robust to changes of desktop size (bug #53207)
Torsten <mttl@mailbox.org>
parents:
25907
diff
changeset
|
537 |
30398
d4d83344d653
maint: style check C++ files in src/ and libgui/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30275
diff
changeset
|
538 m_recent_float_geom |
d4d83344d653
maint: style check C++ files in src/ and libgui/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30275
diff
changeset
|
539 = settings->value (dw_float_geometry.key.arg (objectName ()), |
d4d83344d653
maint: style check C++ files in src/ and libgui/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30275
diff
changeset
|
540 default_floating_size).toRect (); |
26428
93c4fabb2ead
only reset floating geometry of dock widget when not visible (bug #53207)
Torsten <mttl@mailbox.org>
parents:
26376
diff
changeset
|
541 |
30690
e2c8c852399e
replace use of depreciated QDesktopWidget in GUI
Torsten Lilge <ttl-octave@mailbox.org>
parents:
30626
diff
changeset
|
542 adjust_to_screen (m_recent_float_geom, default_floating_size); |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
543 |
30398
d4d83344d653
maint: style check C++ files in src/ and libgui/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30275
diff
changeset
|
544 // The following is required for ensure smooth transition from old |
d4d83344d653
maint: style check C++ files in src/ and libgui/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30275
diff
changeset
|
545 // saveGeomety to new QRect setting (see comment for restoring size |
d4d83344d653
maint: style check C++ files in src/ and libgui/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30275
diff
changeset
|
546 // of docked widgets) |
d4d83344d653
maint: style check C++ files in src/ and libgui/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30275
diff
changeset
|
547 QVariant dock_geom |
d4d83344d653
maint: style check C++ files in src/ and libgui/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30275
diff
changeset
|
548 = settings->value (dw_dock_geometry.key.arg (objectName ()), |
d4d83344d653
maint: style check C++ files in src/ and libgui/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30275
diff
changeset
|
549 default_dock_size); |
d4d83344d653
maint: style check C++ files in src/ and libgui/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30275
diff
changeset
|
550 if (dock_geom.canConvert (QMetaType::QRect)) |
d4d83344d653
maint: style check C++ files in src/ and libgui/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30275
diff
changeset
|
551 m_recent_dock_geom = dock_geom.toRect (); |
d4d83344d653
maint: style check C++ files in src/ and libgui/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30275
diff
changeset
|
552 else |
d4d83344d653
maint: style check C++ files in src/ and libgui/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30275
diff
changeset
|
553 m_recent_dock_geom = dw_dock_geometry.def.toRect (); |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
554 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
555 notice_settings (settings); // call individual handler |
24014
bffd7d826887
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23807
diff
changeset
|
556 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
557 set_style (false); |
27467
c7a898396151
compacter tool bar and filter bars in dock widgets (bug #53902)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27412
diff
changeset
|
558 |
c7a898396151
compacter tool bar and filter bars in dock widgets (bug #53902)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27412
diff
changeset
|
559 // Compacter design |
30398
d4d83344d653
maint: style check C++ files in src/ and libgui/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30275
diff
changeset
|
560 QToolBar *toolbar = findChild <QToolBar *> (); |
27467
c7a898396151
compacter tool bar and filter bars in dock widgets (bug #53902)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27412
diff
changeset
|
561 if (toolbar) |
27560
3fcc650de22f
split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
27478
diff
changeset
|
562 toolbar->setStyleSheet (toolbar->styleSheet () + global_toolbar_style); |
27478
9e526393d80a
reduced vertical space in gui with responsive toolbar buttons (bug #53902)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27468
diff
changeset
|
563 |
30398
d4d83344d653
maint: style check C++ files in src/ and libgui/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30275
diff
changeset
|
564 QMenuBar *menubar = findChild <QMenuBar *> (); |
27468
8ba19629d5ef
compacter menu bars in dock widgets (bug #53902)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27467
diff
changeset
|
565 if (menubar) |
27560
3fcc650de22f
split gui-preferences.h into one file per widget
John W. Eaton <jwe@octave.org>
parents:
27478
diff
changeset
|
566 menubar->setStyleSheet (menubar->styleSheet () + global_menubar_style); |
27467
c7a898396151
compacter tool bar and filter bars in dock widgets (bug #53902)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27412
diff
changeset
|
567 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
568 } |
24014
bffd7d826887
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23807
diff
changeset
|
569 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
570 void |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
571 octave_dock_widget::handle_active_dock_changed (octave_dock_widget *w_old, |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
572 octave_dock_widget *w_new) |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
573 { |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
574 if (m_custom_style && this == w_old) |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
575 { |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
576 set_style (false); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
577 update (); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
578 } |
24014
bffd7d826887
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23807
diff
changeset
|
579 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
580 if (m_custom_style && this == w_new) |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
581 { |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
582 set_style (true); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
583 update (); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
584 } |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
585 } |
24014
bffd7d826887
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23807
diff
changeset
|
586 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
587 void |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
588 octave_dock_widget::save_settings (void) |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
589 { |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
590 // save state of this dock-widget |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
591 QString name = objectName (); |
27629
8b6e928e0705
in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents:
27620
diff
changeset
|
592 resource_manager& rmgr = m_octave_qobj.get_resource_manager (); |
8b6e928e0705
in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents:
27620
diff
changeset
|
593 gui_settings *settings = rmgr.get_settings (); |
24014
bffd7d826887
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23807
diff
changeset
|
594 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
595 if (! settings) |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
596 return; |
24014
bffd7d826887
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23807
diff
changeset
|
597 |
25355
5bb07f6e3707
fix uninitialized settings of octave dock widgets at startup (bug #53835)
Torsten <mttl@mailbox.org>
parents:
25354
diff
changeset
|
598 store_geometry (); |
5bb07f6e3707
fix uninitialized settings of octave dock widgets at startup (bug #53835)
Torsten <mttl@mailbox.org>
parents:
25354
diff
changeset
|
599 |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
600 // conditional needed? |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
601 if (! m_recent_float_geom.isNull ()) |
27665
a1271c5b621a
replace preference literals by symbolic constants for dock widgets
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27629
diff
changeset
|
602 settings->setValue (dw_float_geometry.key.arg (name), m_recent_float_geom); |
24014
bffd7d826887
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23807
diff
changeset
|
603 |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
604 if (! m_recent_dock_geom.isEmpty ()) |
27665
a1271c5b621a
replace preference literals by symbolic constants for dock widgets
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27629
diff
changeset
|
605 settings->setValue (dw_dock_geometry.key.arg (name), m_recent_dock_geom); |
a1271c5b621a
replace preference literals by symbolic constants for dock widgets
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27629
diff
changeset
|
606 settings->setValue (dw_is_visible.key.arg (name), isVisible ()); // store visibility |
a1271c5b621a
replace preference literals by symbolic constants for dock widgets
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27629
diff
changeset
|
607 settings->setValue (dw_is_floating.key.arg (name), isFloating ()); // store floating |
a1271c5b621a
replace preference literals by symbolic constants for dock widgets
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27629
diff
changeset
|
608 settings->setValue (dw_is_minimized.key.arg (name), isMinimized ()); // store minimized |
24014
bffd7d826887
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23807
diff
changeset
|
609 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
610 settings->sync (); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
611 } |
24014
bffd7d826887
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23807
diff
changeset
|
612 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
613 bool octave_dock_widget::eventFilter (QObject *obj, QEvent *e) |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
614 { |
29202
66af654b3485
provide focus follows mouse for widgets in the main window (bug #59701)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29199
diff
changeset
|
615 // Ignore double clicks into window decoration elements |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
616 if (e->type () == QEvent::NonClientAreaMouseButtonDblClick) |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
617 { |
29202
66af654b3485
provide focus follows mouse for widgets in the main window (bug #59701)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29199
diff
changeset
|
618 e->ignore (); |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
619 return true; |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
620 } |
24014
bffd7d826887
style fixes for some GUI source files
John W. Eaton <jwe@octave.org>
parents:
23807
diff
changeset
|
621 |
29202
66af654b3485
provide focus follows mouse for widgets in the main window (bug #59701)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29199
diff
changeset
|
622 // Detect mouse enter events if "focus follows mouse" is desired |
66af654b3485
provide focus follows mouse for widgets in the main window (bug #59701)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29199
diff
changeset
|
623 // for widgets docked to the main window (non floating) and activate |
29434
91f32bf0d497
maint: strip trailing spaces from code base.
Rik <rik@octave.org>
parents:
29359
diff
changeset
|
624 // the widget currently under the mouse |
29202
66af654b3485
provide focus follows mouse for widgets in the main window (bug #59701)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29199
diff
changeset
|
625 if (m_focus_follows_mouse && ! isFloating () && (e->type () == QEvent::Enter)) |
30626
171414e74e9b
focus follows mouse event should not raise the window (bug #61770)
Lars Kindermann <lars.kindermann@reglos.de>
parents:
30564
diff
changeset
|
626 setFocus (); |
29202
66af654b3485
provide focus follows mouse for widgets in the main window (bug #59701)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29199
diff
changeset
|
627 |
30398
d4d83344d653
maint: style check C++ files in src/ and libgui/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
30275
diff
changeset
|
628 return QDockWidget::eventFilter (obj, e); |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
629 } |
16798
d749c9b588e5
make stand-alone windows from dock widgets when floating (bug #38785)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
630 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
631 void |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
632 octave_dock_widget::store_geometry (void) |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
633 { |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
634 if (isFloating ()) |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
635 { |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
636 if (! parent ()) |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
637 m_recent_float_geom = geometry (); |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
638 } |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
639 else |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
640 { |
29088
909d68d27892
fix restoring dock widgets geometry in full screen main window
Torsten Lilge <ttl-octave@mailbox.org>
parents:
28018
diff
changeset
|
641 m_recent_dock_geom = geometry (); |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
642 } |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
643 } |
16798
d749c9b588e5
make stand-alone windows from dock widgets when floating (bug #38785)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
644 |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
645 void |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
646 octave_dock_widget::moveEvent (QMoveEvent *event) |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
647 { |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
648 store_geometry (); |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
649 |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
650 QDockWidget::moveEvent (event); |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
651 } |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
652 |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
653 void |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
654 octave_dock_widget::resizeEvent (QResizeEvent *event) |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
655 { |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
656 store_geometry (); |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
657 |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
658 QDockWidget::resizeEvent (event); |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
659 } |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
660 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
661 // slot for hiding the widget |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
662 void |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
663 octave_dock_widget::change_visibility (bool) |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
664 { |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
665 setVisible (false); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
666 emit active_changed (false); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
667 } |
16798
d749c9b588e5
make stand-alone windows from dock widgets when floating (bug #38785)
Torsten <ttl@justmail.de>
parents:
diff
changeset
|
668 |
27281
0915fec3d3a9
prevent gui from catching focus when its desktop workspace becomes active
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27255
diff
changeset
|
669 void octave_dock_widget::activate (void) |
0915fec3d3a9
prevent gui from catching focus when its desktop workspace becomes active
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27255
diff
changeset
|
670 { |
0915fec3d3a9
prevent gui from catching focus when its desktop workspace becomes active
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27255
diff
changeset
|
671 if (! isVisible ()) |
0915fec3d3a9
prevent gui from catching focus when its desktop workspace becomes active
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27255
diff
changeset
|
672 setVisible (true); |
0915fec3d3a9
prevent gui from catching focus when its desktop workspace becomes active
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27255
diff
changeset
|
673 |
0915fec3d3a9
prevent gui from catching focus when its desktop workspace becomes active
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27255
diff
changeset
|
674 setFocus (); |
0915fec3d3a9
prevent gui from catching focus when its desktop workspace becomes active
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27255
diff
changeset
|
675 activateWindow (); |
0915fec3d3a9
prevent gui from catching focus when its desktop workspace becomes active
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27255
diff
changeset
|
676 raise (); |
0915fec3d3a9
prevent gui from catching focus when its desktop workspace becomes active
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27255
diff
changeset
|
677 } |
0915fec3d3a9
prevent gui from catching focus when its desktop workspace becomes active
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27255
diff
changeset
|
678 |
0915fec3d3a9
prevent gui from catching focus when its desktop workspace becomes active
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27255
diff
changeset
|
679 void octave_dock_widget::handle_visibility (bool visible) |
0915fec3d3a9
prevent gui from catching focus when its desktop workspace becomes active
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27255
diff
changeset
|
680 { |
29199
0b18887bc997
simplify initialization of gui dock widgets
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29147
diff
changeset
|
681 if (visible) |
0b18887bc997
simplify initialization of gui dock widgets
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29147
diff
changeset
|
682 { |
0b18887bc997
simplify initialization of gui dock widgets
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29147
diff
changeset
|
683 emit active_changed (true); |
0b18887bc997
simplify initialization of gui dock widgets
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29147
diff
changeset
|
684 if (! isFloating ()) |
0b18887bc997
simplify initialization of gui dock widgets
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29147
diff
changeset
|
685 setFocus (); |
0b18887bc997
simplify initialization of gui dock widgets
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29147
diff
changeset
|
686 } |
27281
0915fec3d3a9
prevent gui from catching focus when its desktop workspace becomes active
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27255
diff
changeset
|
687 } |
0915fec3d3a9
prevent gui from catching focus when its desktop workspace becomes active
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27255
diff
changeset
|
688 |
27935
f1844e33f621
maint: Use Octave coding conventions in libgui/ directory.
Rik <rik@octave.org>
parents:
27923
diff
changeset
|
689 void |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
690 octave_dock_widget::toplevel_change (bool toplevel) |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
691 { |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
692 QObject *dockobj; |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
693 const char *docksig; |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
694 |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
695 if (titleBarWidget ()) |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
696 { |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
697 dockobj = m_dock_action; |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
698 docksig = SIGNAL (triggered (bool)); |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
699 } |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
700 else |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
701 { |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
702 dockobj = m_default_float_button; |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
703 docksig = SIGNAL (clicked (bool)); |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
704 } |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
705 |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
706 if (toplevel) |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
707 { |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
708 // This is a fallback in case the attempt to create a floated |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
709 // top-level window fails and the QDockWidget remains a child |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
710 // of the QMainWindow. |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
711 connect (dockobj, docksig, this, SLOT (default_dock (bool))); |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
712 |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
713 // Could be dragging window, so must wait until there is a |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
714 // change in focus. |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
715 if (parent () != 0) |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
716 m_waiting_for_mouse_button_release = true; |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
717 } |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
718 else |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
719 { |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
720 // If a drag-and-drop within the QMainWindow occurred, want to remain a widget. |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
721 m_waiting_for_mouse_button_release = false; |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
722 |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
723 // Making into a widget immediately will mangle the double-click |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
724 // status and cause problems on followup button clicks. |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
725 if (parent () == 0) |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
726 emit queue_make_widget (); |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
727 } |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
728 } |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
729 |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
730 void |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
731 octave_dock_widget::set_style (bool active) |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
732 { |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
733 QString css_foreground; |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
734 QString css_background; |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
735 QString css_button; |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
736 QString dock_icon; |
18218
7952fb0435db
improve title bar of dock widgets
Torsten <ttl@justmail.de>
parents:
18180
diff
changeset
|
737 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
738 QString icon_col = m_icon_color; |
19431
bd27cd403d00
fix errors when building octave for windows (regression from d93293218966)
Torsten <ttl@justmail.de>
parents:
19423
diff
changeset
|
739 |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
740 QString close_tooltip = "Close widget"; |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
741 QString dock_tooltip; |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
742 |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
743 if (isFloating ()) |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
744 { |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
745 dock_icon = "widget-dock"; |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
746 dock_tooltip = "Dock widget"; |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
747 } |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
748 else |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
749 { |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
750 dock_icon = "widget-undock"; |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
751 dock_tooltip = "Undock widget"; |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
752 } |
18180
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
17929
diff
changeset
|
753 |
20794
e870a68742a6
change alignment of dock widget titles for OSX (bug #46592)
Torsten <ttl@justmail.de>
parents:
20630
diff
changeset
|
754 #if defined (Q_OS_MAC) |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
755 QString alignment = "center"; |
20794
e870a68742a6
change alignment of dock widget titles for OSX (bug #46592)
Torsten <ttl@justmail.de>
parents:
20630
diff
changeset
|
756 #else |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
757 QString alignment = "center left"; |
20794
e870a68742a6
change alignment of dock widget titles for OSX (bug #46592)
Torsten <ttl@justmail.de>
parents:
20630
diff
changeset
|
758 #endif |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
759 if (m_custom_style) |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
760 { |
18180
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
17929
diff
changeset
|
761 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
762 QColor bg_col, fg_col; |
18180
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
17929
diff
changeset
|
763 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
764 if (active) |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
765 { |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
766 bg_col = m_bg_color_active; |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
767 fg_col = m_fg_color_active; |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
768 icon_col = m_icon_color_active; |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
769 } |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
770 else |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
771 { |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
772 bg_col = m_bg_color; |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
773 fg_col = m_fg_color; |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
774 icon_col = m_icon_color; |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
775 } |
18218
7952fb0435db
improve title bar of dock widgets
Torsten <ttl@justmail.de>
parents:
18180
diff
changeset
|
776 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
777 QColor bg_col_top, bg_col_bottom; |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
778 if (m_title_3d > 0) |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
779 { |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
780 bg_col_top = bg_col.lighter (100 + m_title_3d); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
781 bg_col_bottom = bg_col.darker (100 + m_title_3d); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
782 } |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
783 else |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
784 { |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
785 bg_col_top = bg_col.darker (100 - m_title_3d); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
786 bg_col_bottom = bg_col.lighter (100 - m_title_3d); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
787 } |
19913
2a992bd19169
make color gradient of custom title bar adjustable (bug #44435)
Torsten <ttl@justmail.de>
parents:
19911
diff
changeset
|
788 |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
789 css_foreground = QString (" color: %1;\n").arg (fg_col.name ()); |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
790 |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
791 css_background = |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
792 QString (" background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1," |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
793 " stop: 0 %1, stop: 0.60 %2, stop: 0.95 %2 stop: 1.0 %3);\n"). |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
794 arg (bg_col_top.name ()). |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
795 arg (bg_col.name ()). |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
796 arg (bg_col_bottom.name ()); |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
797 } |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
798 else |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
799 { |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
800 css_foreground = QString (""); |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
801 css_background = QString (""); |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
802 } |
18180
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
17929
diff
changeset
|
803 |
30772
36dc11ee220d
reorganize GUIs icons
Torsten Lilge <ttl-octave@mailbox.org>
parents:
30690
diff
changeset
|
804 QString full_dock_icon = dock_icon + icon_col; |
36dc11ee220d
reorganize GUIs icons
Torsten Lilge <ttl-octave@mailbox.org>
parents:
30690
diff
changeset
|
805 QString full_close_icon = "widget-close" + icon_col; |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
806 if (titleBarWidget ()) |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
807 { |
30777
439eb9bd4c04
icon fallback concept without QIcon::fallbackSearchPaths (bug #62106)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
30772
diff
changeset
|
808 resource_manager& rmgr = m_octave_qobj.get_resource_manager (); |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
809 titleBarWidget ()->setStyleSheet (css_foreground + css_background); |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
810 css_button = QString ("QToolButton {background: transparent; border: 0px;}"); |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
811 m_dock_button->setStyleSheet (css_button); |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
812 m_close_button->setStyleSheet (css_button); |
30788
c11d34f72b3c
provide different icon sets for the GUI
Torsten Lilge <ttl-octave@mailbox.org>
parents:
30777
diff
changeset
|
813 m_dock_action->setIcon (rmgr.icon (full_dock_icon, true)); |
c11d34f72b3c
provide different icon sets for the GUI
Torsten Lilge <ttl-octave@mailbox.org>
parents:
30777
diff
changeset
|
814 m_close_action->setIcon (rmgr.icon (full_close_icon, true)); |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
815 } |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
816 else |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
817 { |
30788
c11d34f72b3c
provide different icon sets for the GUI
Torsten Lilge <ttl-octave@mailbox.org>
parents:
30777
diff
changeset
|
818 setStyleSheet (qdockwidget_css (global_icon_paths.at (ICON_THEME_OCTAVE) + full_close_icon + ".png", |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
819 close_tooltip, |
30788
c11d34f72b3c
provide different icon sets for the GUI
Torsten Lilge <ttl-octave@mailbox.org>
parents:
30777
diff
changeset
|
820 global_icon_paths.at (ICON_THEME_OCTAVE) + full_dock_icon + ".png", |
25354
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
821 dock_tooltip, |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
822 m_icon_size, |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
823 css_foreground, |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
824 css_background)); |
05a690606fd5
Use default title bar to preserve GUI float decorations (bug #53276)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25172
diff
changeset
|
825 } |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
826 } |
19423
d93293218966
custom style of dock widget title bars depending on focus (bug #43837)
Torsten <ttl@justmail.de>
parents:
19360
diff
changeset
|
827 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
828 // set focus to previously active widget in tabbed widget stack |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
829 void |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
830 octave_dock_widget::set_focus_predecessor (void) |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
831 { |
25396
75fef3484d12
Prevent hidden predecessor windows appearing when successor is floated (bug #53357)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25384
diff
changeset
|
832 // only != 0 if widget was tabbed |
75fef3484d12
Prevent hidden predecessor windows appearing when successor is floated (bug #53357)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
25384
diff
changeset
|
833 if (m_predecessor_widget && m_predecessor_widget->isVisible ()) |
27281
0915fec3d3a9
prevent gui from catching focus when its desktop workspace becomes active
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27255
diff
changeset
|
834 m_predecessor_widget->setFocus (); |
19423
d93293218966
custom style of dock widget title bars depending on focus (bug #43837)
Torsten <ttl@justmail.de>
parents:
19360
diff
changeset
|
835 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
836 m_predecessor_widget = nullptr; |
27629
8b6e928e0705
in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents:
27620
diff
changeset
|
837 |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
838 // FIXME: Until cset bda0c5b38bda, the wrong keys "Dockwidget/..." were used |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
839 // here. This had no effect in Qt4, but does in Qt5. In the following, the |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
840 // four incorrect keys are updated if still present in the settings files. |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
841 // The keys are also used in the settings dialog, but |
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
842 // octave_dock_widget::handle_settings is already called at program start. |
25172
7b1b504c2f12
update future version numbers in doc strings and comments
John W. Eaton <jwe@octave.org>
parents:
25086
diff
changeset
|
843 // These tests can be removed in a future version of Octave (version 6). |
27629
8b6e928e0705
in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents:
27620
diff
changeset
|
844 |
8b6e928e0705
in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents:
27620
diff
changeset
|
845 resource_manager& rmgr = m_octave_qobj.get_resource_manager (); |
8b6e928e0705
in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents:
27620
diff
changeset
|
846 |
8b6e928e0705
in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents:
27620
diff
changeset
|
847 rmgr.update_settings_key ("Dockwidgets/title_bg_color", |
27665
a1271c5b621a
replace preference literals by symbolic constants for dock widgets
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27629
diff
changeset
|
848 dw_title_bg_color.key); |
27629
8b6e928e0705
in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents:
27620
diff
changeset
|
849 |
8b6e928e0705
in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents:
27620
diff
changeset
|
850 rmgr.update_settings_key ("Dockwidgets/title_bg_color_active", |
27665
a1271c5b621a
replace preference literals by symbolic constants for dock widgets
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27629
diff
changeset
|
851 dw_title_bg_color_active.key); |
27629
8b6e928e0705
in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents:
27620
diff
changeset
|
852 |
8b6e928e0705
in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents:
27620
diff
changeset
|
853 rmgr.update_settings_key ("Dockwidgets/title_fg_color", |
27665
a1271c5b621a
replace preference literals by symbolic constants for dock widgets
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27629
diff
changeset
|
854 dw_title_fg_color.key); |
27629
8b6e928e0705
in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents:
27620
diff
changeset
|
855 |
8b6e928e0705
in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents:
27620
diff
changeset
|
856 rmgr.update_settings_key ("Dockwidgets/title_fg_color_active", |
27665
a1271c5b621a
replace preference literals by symbolic constants for dock widgets
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27629
diff
changeset
|
857 dw_title_fg_color_active.key); |
24828
0f6a261ab144
move some GUI classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24812
diff
changeset
|
858 } |
18180
b3838cedfe04
redesign of dock widgets title bar with configurable colors
Torsten <ttl@justmail.de>
parents:
17929
diff
changeset
|
859 } |