Mercurial > octave
annotate libgui/src/gui-settings.h @ 31637:34c3cd39c4b9
eliminate unused gui_pref::ignore data member
* gui-settings.h (gui_settings::value): Don't check pref.ignore. No
code in Octave sets it to true.
* gui-preferences.h (gui_pref::ignore): Delete unused data member.
(gui_pref::gui_pref): Remove ignore arg from constructor.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sun, 04 Dec 2022 15:29:51 -0500 |
parents | 0645ea65ca6b |
children | 474e184321d3 |
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) 2019-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 //////////////////////////////////////////////////////////////////////// |
27611
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
25 |
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
26 #if ! defined (octave_gui_settings_h) |
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
27 #define octave_gui_settings_h 1 |
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
28 |
31621
0645ea65ca6b
handle icons and themes in gui_settings class, not resource_manager
John W. Eaton <jwe@octave.org>
parents:
31612
diff
changeset
|
29 #include <QIcon> |
0645ea65ca6b
handle icons and themes in gui_settings class, not resource_manager
John W. Eaton <jwe@octave.org>
parents:
31612
diff
changeset
|
30 #include <QString> |
27611
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
31 #include <QSettings> |
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
32 |
27672
a36443e94f8a
simplify gui_settings->value (PREF.key, PREF.def) calls
John W. Eaton <jwe@octave.org>
parents:
27611
diff
changeset
|
33 #include "gui-preferences.h" |
a36443e94f8a
simplify gui_settings->value (PREF.key, PREF.def) calls
John W. Eaton <jwe@octave.org>
parents:
27611
diff
changeset
|
34 |
27611
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
35 namespace octave |
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
36 { |
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
37 class gui_settings : public QSettings |
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
38 { |
27672
a36443e94f8a
simplify gui_settings->value (PREF.key, PREF.def) calls
John W. Eaton <jwe@octave.org>
parents:
27611
diff
changeset
|
39 Q_OBJECT |
a36443e94f8a
simplify gui_settings->value (PREF.key, PREF.def) calls
John W. Eaton <jwe@octave.org>
parents:
27611
diff
changeset
|
40 |
27611
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
41 public: |
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
42 |
31612
351a4c8e92c3
provide default constructor for gui_settings
John W. Eaton <jwe@octave.org>
parents:
31558
diff
changeset
|
43 gui_settings (QObject *parent = nullptr) |
351a4c8e92c3
provide default constructor for gui_settings
John W. Eaton <jwe@octave.org>
parents:
31558
diff
changeset
|
44 : QSettings (parent) |
351a4c8e92c3
provide default constructor for gui_settings
John W. Eaton <jwe@octave.org>
parents:
31558
diff
changeset
|
45 { } |
351a4c8e92c3
provide default constructor for gui_settings
John W. Eaton <jwe@octave.org>
parents:
31558
diff
changeset
|
46 |
27611
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
47 gui_settings (const QString& file_name, QSettings::Format format, |
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
48 QObject *parent = nullptr) |
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
49 : QSettings (file_name, format, parent) |
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
50 { } |
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
51 |
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
52 gui_settings (QSettings::Format format, QSettings::Scope scope, |
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
53 const QString& organization, |
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
54 const QString& application = QString (), |
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
55 QObject *parent = nullptr) |
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
56 : QSettings (format, scope, organization, application, parent) |
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
57 { } |
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
58 |
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
59 // No copying! |
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
60 |
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
61 gui_settings (const gui_settings&) = delete; |
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
62 |
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
63 gui_settings& operator = (const gui_settings&) = delete; |
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
64 |
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
65 ~gui_settings (void) = default; |
27672
a36443e94f8a
simplify gui_settings->value (PREF.key, PREF.def) calls
John W. Eaton <jwe@octave.org>
parents:
27611
diff
changeset
|
66 |
a36443e94f8a
simplify gui_settings->value (PREF.key, PREF.def) calls
John W. Eaton <jwe@octave.org>
parents:
27611
diff
changeset
|
67 using QSettings::value; |
a36443e94f8a
simplify gui_settings->value (PREF.key, PREF.def) calls
John W. Eaton <jwe@octave.org>
parents:
27611
diff
changeset
|
68 |
a36443e94f8a
simplify gui_settings->value (PREF.key, PREF.def) calls
John W. Eaton <jwe@octave.org>
parents:
27611
diff
changeset
|
69 QVariant value (const gui_pref& pref) const |
a36443e94f8a
simplify gui_settings->value (PREF.key, PREF.def) calls
John W. Eaton <jwe@octave.org>
parents:
27611
diff
changeset
|
70 { |
a36443e94f8a
simplify gui_settings->value (PREF.key, PREF.def) calls
John W. Eaton <jwe@octave.org>
parents:
27611
diff
changeset
|
71 return value (pref.key, pref.def); |
a36443e94f8a
simplify gui_settings->value (PREF.key, PREF.def) calls
John W. Eaton <jwe@octave.org>
parents:
27611
diff
changeset
|
72 } |
27724
19e80f22aa47
provide structure and settings value method for shortcut key sequences
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27672
diff
changeset
|
73 |
29484
bed2fd5b8263
allow a second color theme for the console window (dark mode)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29358
diff
changeset
|
74 /*! |
29498
5384bb4efc51
rearrange default lexer settings and add second color mode to gui editor
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29487
diff
changeset
|
75 Reading a color from the given QVaraitn @p def taking different |
5384bb4efc51
rearrange default lexer settings and add second color mode to gui editor
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29487
diff
changeset
|
76 color modes into account. The default value for a second color mode |
5384bb4efc51
rearrange default lexer settings and add second color mode to gui editor
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29487
diff
changeset
|
77 @p mode=1 is deterimined from the standard default value @p mode=0 |
5384bb4efc51
rearrange default lexer settings and add second color mode to gui editor
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29487
diff
changeset
|
78 by inverting the lightness |
5384bb4efc51
rearrange default lexer settings and add second color mode to gui editor
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29487
diff
changeset
|
79 \f{eqnarray*}{ |
5384bb4efc51
rearrange default lexer settings and add second color mode to gui editor
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29487
diff
changeset
|
80 H_1 &=& H_0\\ |
5384bb4efc51
rearrange default lexer settings and add second color mode to gui editor
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29487
diff
changeset
|
81 S_1 &=& S_0\\ |
5384bb4efc51
rearrange default lexer settings and add second color mode to gui editor
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29487
diff
changeset
|
82 L_1 &=& 1.0 - 0.85 L_0 L_0 > 0.3 |
5384bb4efc51
rearrange default lexer settings and add second color mode to gui editor
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29487
diff
changeset
|
83 L_1 &=& 1.0 - 0.70 L_0 L_0 < 0.3 |
5384bb4efc51
rearrange default lexer settings and add second color mode to gui editor
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29487
diff
changeset
|
84 \f} |
5384bb4efc51
rearrange default lexer settings and add second color mode to gui editor
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29487
diff
changeset
|
85 |
5384bb4efc51
rearrange default lexer settings and add second color mode to gui editor
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29487
diff
changeset
|
86 @param def Color default value given by a QVariant of QColor |
5384bb4efc51
rearrange default lexer settings and add second color mode to gui editor
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29487
diff
changeset
|
87 or QPalette::ColorRole |
5384bb4efc51
rearrange default lexer settings and add second color mode to gui editor
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29487
diff
changeset
|
88 @param mode Color mode (currently 0 or 1, default is 0) |
5384bb4efc51
rearrange default lexer settings and add second color mode to gui editor
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29487
diff
changeset
|
89 |
5384bb4efc51
rearrange default lexer settings and add second color mode to gui editor
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29487
diff
changeset
|
90 @return Color as QColor |
5384bb4efc51
rearrange default lexer settings and add second color mode to gui editor
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29487
diff
changeset
|
91 */ |
5384bb4efc51
rearrange default lexer settings and add second color mode to gui editor
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29487
diff
changeset
|
92 QColor get_color_value (const QVariant& def, int mode = 0) const; |
5384bb4efc51
rearrange default lexer settings and add second color mode to gui editor
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29487
diff
changeset
|
93 |
5384bb4efc51
rearrange default lexer settings and add second color mode to gui editor
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29487
diff
changeset
|
94 /*! |
29484
bed2fd5b8263
allow a second color theme for the console window (dark mode)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29358
diff
changeset
|
95 Reading a color from the gui_settings taking possible color modes |
bed2fd5b8263
allow a second color theme for the console window (dark mode)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29358
diff
changeset
|
96 into account. The default value for a second color mode @p mode=1 is |
bed2fd5b8263
allow a second color theme for the console window (dark mode)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29358
diff
changeset
|
97 deterimined from the standard default value @p mode=0 by inverting |
29498
5384bb4efc51
rearrange default lexer settings and add second color mode to gui editor
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29487
diff
changeset
|
98 the lightness (see get_color_value()) |
29484
bed2fd5b8263
allow a second color theme for the console window (dark mode)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29358
diff
changeset
|
99 |
bed2fd5b8263
allow a second color theme for the console window (dark mode)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29358
diff
changeset
|
100 @param pref gui preference (key string, default value); the default |
bed2fd5b8263
allow a second color theme for the console window (dark mode)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29358
diff
changeset
|
101 value can be given by QColor or QPalette::ColorRole |
bed2fd5b8263
allow a second color theme for the console window (dark mode)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29358
diff
changeset
|
102 @param mode Color mode (currently 0 or 1, default is 0) |
bed2fd5b8263
allow a second color theme for the console window (dark mode)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29358
diff
changeset
|
103 |
bed2fd5b8263
allow a second color theme for the console window (dark mode)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29358
diff
changeset
|
104 @return Color as QColor |
bed2fd5b8263
allow a second color theme for the console window (dark mode)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29358
diff
changeset
|
105 */ |
bed2fd5b8263
allow a second color theme for the console window (dark mode)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29358
diff
changeset
|
106 QColor color_value (const gui_pref& pref, int mode = 0) const; |
bed2fd5b8263
allow a second color theme for the console window (dark mode)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29358
diff
changeset
|
107 |
bed2fd5b8263
allow a second color theme for the console window (dark mode)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29358
diff
changeset
|
108 /*! |
bed2fd5b8263
allow a second color theme for the console window (dark mode)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29358
diff
changeset
|
109 Writing a color to the gui_settings taking possible color modes |
bed2fd5b8263
allow a second color theme for the console window (dark mode)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29358
diff
changeset
|
110 into account. When @p mode is not zero (standard mode), the |
bed2fd5b8263
allow a second color theme for the console window (dark mode)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29358
diff
changeset
|
111 extension related to the mode is appended to the settings key string |
bed2fd5b8263
allow a second color theme for the console window (dark mode)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29358
diff
changeset
|
112 |
bed2fd5b8263
allow a second color theme for the console window (dark mode)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29358
diff
changeset
|
113 @param pref gui preference where the color should be written |
bed2fd5b8263
allow a second color theme for the console window (dark mode)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29358
diff
changeset
|
114 @param color QColor to write to the settings |
bed2fd5b8263
allow a second color theme for the console window (dark mode)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29358
diff
changeset
|
115 @param mode Color mode (currently 0 or 1, default is 0) |
bed2fd5b8263
allow a second color theme for the console window (dark mode)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29358
diff
changeset
|
116 |
bed2fd5b8263
allow a second color theme for the console window (dark mode)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29358
diff
changeset
|
117 */ |
bed2fd5b8263
allow a second color theme for the console window (dark mode)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29358
diff
changeset
|
118 void set_color_value (const gui_pref& pref, const QColor& color, |
bed2fd5b8263
allow a second color theme for the console window (dark mode)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29358
diff
changeset
|
119 int mode = 0); |
bed2fd5b8263
allow a second color theme for the console window (dark mode)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29358
diff
changeset
|
120 |
27818
fa0582694fda
replace literal strings by symbolic constants for shortcut preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27724
diff
changeset
|
121 QString sc_value (const sc_pref& pref) const; |
fa0582694fda
replace literal strings by symbolic constants for shortcut preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27724
diff
changeset
|
122 |
fa0582694fda
replace literal strings by symbolic constants for shortcut preferences
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27724
diff
changeset
|
123 QKeySequence sc_def_value (const sc_pref& pref) const; |
27724
19e80f22aa47
provide structure and settings value method for shortcut key sequences
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27672
diff
changeset
|
124 |
31621
0645ea65ca6b
handle icons and themes in gui_settings class, not resource_manager
John W. Eaton <jwe@octave.org>
parents:
31612
diff
changeset
|
125 // Both config_icon_theme and icon could be global functions instead |
0645ea65ca6b
handle icons and themes in gui_settings class, not resource_manager
John W. Eaton <jwe@octave.org>
parents:
31612
diff
changeset
|
126 // of member functions. But at least for the icon function, |
0645ea65ca6b
handle icons and themes in gui_settings class, not resource_manager
John W. Eaton <jwe@octave.org>
parents:
31612
diff
changeset
|
127 // defining it as a member function means that we can create a |
0645ea65ca6b
handle icons and themes in gui_settings class, not resource_manager
John W. Eaton <jwe@octave.org>
parents:
31612
diff
changeset
|
128 // single gui_settings object and access multiple icon objects |
0645ea65ca6b
handle icons and themes in gui_settings class, not resource_manager
John W. Eaton <jwe@octave.org>
parents:
31612
diff
changeset
|
129 // rather than having to create a separate settings object each time |
0645ea65ca6b
handle icons and themes in gui_settings class, not resource_manager
John W. Eaton <jwe@octave.org>
parents:
31612
diff
changeset
|
130 // that an icon is needed. OTOH, creating the base QSettings object |
0645ea65ca6b
handle icons and themes in gui_settings class, not resource_manager
John W. Eaton <jwe@octave.org>
parents:
31612
diff
changeset
|
131 // is supposed to be fast, so that may not matter. Hmm. |
0645ea65ca6b
handle icons and themes in gui_settings class, not resource_manager
John W. Eaton <jwe@octave.org>
parents:
31612
diff
changeset
|
132 |
0645ea65ca6b
handle icons and themes in gui_settings class, not resource_manager
John W. Eaton <jwe@octave.org>
parents:
31612
diff
changeset
|
133 void config_icon_theme (void); |
0645ea65ca6b
handle icons and themes in gui_settings class, not resource_manager
John W. Eaton <jwe@octave.org>
parents:
31612
diff
changeset
|
134 |
0645ea65ca6b
handle icons and themes in gui_settings class, not resource_manager
John W. Eaton <jwe@octave.org>
parents:
31612
diff
changeset
|
135 QIcon icon (const QString& icon_name, bool octave_only = false, |
0645ea65ca6b
handle icons and themes in gui_settings class, not resource_manager
John W. Eaton <jwe@octave.org>
parents:
31612
diff
changeset
|
136 const QString& icon_alt_name = QString ()); |
27611
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
137 }; |
29484
bed2fd5b8263
allow a second color theme for the console window (dark mode)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29358
diff
changeset
|
138 |
27611
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
139 } |
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
140 |
31558
69c8979f8b2c
fix missing trnaslation for new strings in settings dialog (bug #63404)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31304
diff
changeset
|
141 // Some constants used in the preferences of several widgets and therefore |
69c8979f8b2c
fix missing trnaslation for new strings in settings dialog (bug #63404)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31304
diff
changeset
|
142 // defined globally here |
29484
bed2fd5b8263
allow a second color theme for the console window (dark mode)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29358
diff
changeset
|
143 |
31558
69c8979f8b2c
fix missing trnaslation for new strings in settings dialog (bug #63404)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31304
diff
changeset
|
144 // Constants for handling different color schemes |
69c8979f8b2c
fix missing trnaslation for new strings in settings dialog (bug #63404)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31304
diff
changeset
|
145 const QColor settings_color_no_change (255, 0, 255); |
29484
bed2fd5b8263
allow a second color theme for the console window (dark mode)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29358
diff
changeset
|
146 const QStringList settings_color_modes_ext (QStringList () << "" << "_2"); |
29524
730cac3d6d5a
allow reloading default colors and styles in the preferences dialog
Torsten Lilge <ttl-octave@mailbox.org>
parents:
29498
diff
changeset
|
147 const int settings_reload_default_colors_flag = -1; |
31558
69c8979f8b2c
fix missing trnaslation for new strings in settings dialog (bug #63404)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31304
diff
changeset
|
148 |
27611
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
149 #endif |
0495b64288f7
use new gui_settings class instead of using QSettings directly
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
150 |