Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_dlg_preferences.h
Go to the documentation of this file.
1/*
2 * preferencesdlg.h - part of KImageShop^WKrita
3 *
4 * SPDX-FileCopyrightText: 1999 Michael Koch <koch@kde.org>
5 * SPDX-FileCopyrightText: 2003-2011 Boudewijn Rempt <boud@valdyas.org>
6 *
7 * SPDX-License-Identifier: GPL-2.0-or-later
8 */
9
10#ifndef _KIS_DLG_PREFERENCES_H_
11#define _KIS_DLG_PREFERENCES_H_
12
13#include <QWidget>
14#include <QButtonGroup>
15#include <QMap>
16#include <QString>
17
18#include <kpagedialog.h>
19#include <kis_config.h>
20
22#include "kis_global.h"
23#include <KisSqueezedComboBox.h>
25
26#include "ui_wdggeneralsettings.h"
27#include "ui_wdgdisplaysettings.h"
28#include "ui_wdgcolorsettings.h"
29#include "ui_wdgtabletsettings.h"
30#include "ui_wdgperformancesettings.h"
31#include "ui_wdgfullscreensettings.h"
32#include "ui_WdgPopupPaletteSettings.h"
33#include "KisShortcutsDialog.h"
35
36class KoID;
41
46class WdgGeneralSettings : public QWidget, public Ui::WdgGeneralSettings
47{
48 Q_OBJECT
49
50public:
51 WdgGeneralSettings(QWidget *parent, const char *name) : QWidget(parent) {
52 setObjectName(name);
53 setupUi(this);
54 formLayout_13->takeRow(chkShowRootLayer);
55 chkShowRootLayer->setVisible(false);
56 }
57};
58
59class KRITAUI_EXPORT GeneralTab : public WdgGeneralSettings
60{
61 Q_OBJECT
62
63public:
64
65 GeneralTab(QWidget *parent = 0, const char *name = 0);
66
67 CursorStyle cursorStyle();
68 OutlineStyle outlineStyle();
69 CursorStyle eraserCursorStyle();
70 OutlineStyle eraserOutlineStyle();
71 KisConfig::ColorSamplerPreviewStyle colorSamplerPreviewStyle() const;
72 int colorSamplerPreviewCircleDiameter() const;
73 qreal colorSamplerPreviewCircleThickness() const;
74 bool colorSamplerPreviewCircleOutlineEnabled() const;
75 bool colorSamplerPreviewCircleExtraCirclesEnabled() const;
76
77 KisConfig::SessionOnStartup sessionOnStartup() const;
78 bool saveSessionOnQuit() const;
79
80 bool showRootLayer();
81 int autoSaveInterval();
82 void setDefault();
83 int undoStackSize();
84 bool showOutlineWhilePainting();
85 bool showEraserOutlineWhilePainting();
86
87 int mdiMode();
88 bool showCanvasMessages();
89 bool compressKra();
90 bool trimKra();
91 bool trimFramesImport();
92 bool useZip64();
93 bool toolOptionsInDocker();
94 int zoomSteps();
95 bool longPressEnabled();
96 bool kineticScrollingEnabled();
97 int kineticScrollingGesture();
98 int kineticScrollingSensitivity();
99 bool kineticScrollingHiddenScrollbars();
100 int zoomMarginSize();
101 bool switchSelectionCtrlAlt();
102 bool convertToImageColorspaceOnImport();
103
104 bool autopinLayersToTimeline();
105 bool adaptivePlaybackRange();
106 bool autoZoomTimelineToPlaybackRange();
107
108 bool renameMergedLayers();
109 bool renamePastedLayers();
110 bool renameDuplicatedLayers();
111 QString exportMimeType();
112 int forcedFontDpi();
113
114 static void setColorSamplerPreviewStyleItems(QComboBox *cmb);
115 static void setColorSamplerPreviewStyleIndexByValue(QComboBox *cmb, KisConfig::ColorSamplerPreviewStyle style);
116 static KisConfig::ColorSamplerPreviewStyle getColorSamplerPreviewStyleValue(const QComboBox *cmb);
117
118private Q_SLOTS:
119 void getBackgroundImage();
120 void clearBackgroundImage();
121 void checkResourcePath();
122 void enableSubWindowOptions(int);
123 void updateTouchPressureSensitivityEnabled(int);
124 void showAdvancedCumulativeUndoSettings();
125
126 void colorSamplePreviewStyleChanged(int index);
127 void colorSamplePreviewSizeChanged(int value);
128 void colorSamplePreviewThicknessChanged(qreal value);
129 void colorSamplePreviewOutlineEnabledChanged(int value);
130
131 static void setButtonGroupEnabled(const QButtonGroup& buttonGroup, bool value);
132
133public:
134 QButtonGroup m_pasteFormatGroup;
136};
137
138
139
145{
146 Q_OBJECT
147
148public:
149 WdgShortcutSettings(QWidget *parent)
151 KisShortcutsEditor::LetterShortcutsAllowed,
152 parent)
153 { }
154};
155
157
158class ShortcutSettingsTab : public QWidget
159{
160 Q_OBJECT
161
162public:
163
164 ShortcutSettingsTab(QWidget *parent = 0, const char *name = 0);
165 ~ShortcutSettingsTab() override;
166
167public:
168 void setDefault();
170 QScopedPointer<KisActionsSnapshot> m_snapshot;
171
172public Q_SLOTS:
173 void saveChanges();
174 void cancelChanges();
175};
176
177
178
183class WdgColorSettings : public QWidget, public Ui::WdgColorSettings
184{
185 Q_OBJECT
186
187public:
188 WdgColorSettings(QWidget *parent) : QWidget(parent) {
189 setupUi(this);
190 }
191};
192
236
237//=======================
238
239class WdgTabletSettings : public QWidget, public Ui::WdgTabletSettings {
240
241 Q_OBJECT
242
243public:
244 WdgTabletSettings(QWidget *parent) : QWidget(parent) {
245 setupUi(this);
246 }
247
248};
249
250class TabletSettingsTab : public QWidget {
251 Q_OBJECT
252public:
253 TabletSettingsTab(QWidget *parent = 0, const char *name = 0);
254
255private Q_SLOTS:
256 void slotTabletTest();
258
259public:
260 void setDefault();
262
263
264};
265
266//=======================
267
273
274class WdgPerformanceSettings : public QWidget, public Ui::WdgPerformanceSettings
275{
276 Q_OBJECT
277
278public:
279 WdgPerformanceSettings(QWidget *parent, const char *name) : QWidget(parent) {
280 setObjectName(name); setupUi(this);
281 }
282};
283
285{
286 Q_OBJECT
287
288public:
289 PerformanceTab(QWidget *parent = 0, const char *name = 0);
290
291 ~PerformanceTab() override;
292
293 void load(bool requestDefault);
294 void save();
295
296private Q_SLOTS:
299
300private:
301 int realTilesRAM();
302
303private:
307 QScopedPointer<KisFrameRateLimitModel> m_frameRateModel;
308};
309
310//=======================
311
312class WdgDisplaySettings : public QWidget, public Ui::WdgDisplaySettings
313{
314 Q_OBJECT
315
316public:
317 WdgDisplaySettings(QWidget *parent, const char *name) : QWidget(parent) {
318 setObjectName(name); setupUi(this);
319 }
320};
321
328{
329 Q_OBJECT
330
331public:
332 DisplaySettingsTab(QWidget *parent = 0, const char *name = 0);
333
334public:
335 void setDefault();
336protected Q_SLOTS:
337 void slotUseOpenGLToggled(bool isChecked);
338 void slotPreferredSurfaceFormatChanged(int index);
339
340public:
341};
342
343//=======================
344
349class WdgFullscreenSettingsBase : public QWidget, public Ui::WdgFullscreenSettings
350{
351 Q_OBJECT
352
353public:
354 WdgFullscreenSettingsBase(QWidget *parent) : QWidget(parent) {
355 setupUi(this);
356 }
357};
358
360{
361 Q_OBJECT
362public:
363 FullscreenSettingsTab(QWidget *parent);
364public:
365 void setDefault();
366};
367
368//=======================
369
374class WdgPopupPaletteSettingsBase : public QWidget, public Ui::WdgPopupPaletteSettings
375{
376 Q_OBJECT
377
378public:
379 WdgPopupPaletteSettingsBase(QWidget *parent, const char *name) : QWidget(parent) {
380 setObjectName(name); setupUi(this);
381 }
382};
383
385{
386 Q_OBJECT
387
388public:
389 PopupPaletteTab(QWidget *parent = 0, const char *name = 0);
390
391 void load();
392 void save();
393 void setDefault();
394protected Q_SLOTS:
395 void slotSelectorTypeChanged(int index);
396};
397
398//=======================
399
400
404class KisDlgPreferences : public KPageDialog
405{
406 Q_OBJECT
407
408public:
447
448 struct PageDesc {
450 int tab;
451 };
452
453 KisDlgPreferences(QWidget *parent = 0, const char *name = 0);
454 ~KisDlgPreferences() override;
455
456 bool editPreferences(std::optional<PageDesc> page);
457
458 void showEvent(QShowEvent *event) override;
459
460private:
461 KPageWidgetItem* getPage(Page page_enum);
462 void switchTab (PageDesc tab);
463
474
476
477private Q_SLOTS:
478
479 void slotButtonClicked(QAbstractButton *button);
480 void slotDefault();
481
482private:
483
484 bool m_cancelClicked {false};
485};
486
487#endif
float value(const T *src, size_t ch)
void toggleUseDefaultColorSpace(bool useDefColorSpace)
QList< QLabel * > m_monitorProfileLabels
void toggleAllowMonitorProfileSelection(bool useSystemProfile)
QPointer< KisCIETongueWidget > m_preferredSpaceGraphic
QButtonGroup m_pasteBehaviourGroup
QPointer< QCheckBox > m_chkEnableCanvasColorSpaceManagement
QPointer< KisSqueezedComboBox > m_canvasSurfaceBitDepth
QScopedPointer< KisProofingConfigModel > m_proofModel
QPointer< KisSqueezedComboBox > m_canvasSurfaceColorSpace
QList< KisSqueezedComboBox * > m_monitorProfileWidgets
void refillMonitorProfiles(const KoID &s)
QButtonGroup m_preferredSpaceGraphicMode
ColorSettingsTab(QWidget *parent=0, const char *name=0)
WdgColorSettings * m_page
QScopedPointer< KisScreenMigrationTracker > m_screenMigrationTracker
DisplaySettingsTab(QWidget *parent=0, const char *name=0)
void slotUseOpenGLToggled(bool isChecked)
void slotPreferredSurfaceFormatChanged(int index)
FullscreenSettingsTab(QWidget *parent)
QButtonGroup m_pasteFormatGroup
KisCumulativeUndoData m_cumulativeUndoData
The KisActionsSnapshot class.
ColorSamplerPreviewStyle
Definition kis_config.h:138
CanvasSurfaceBitDepthMode
Definition kis_config.h:189
KoConfigAuthorPage * m_authorPage
PerformanceTab * m_performanceSettings
ColorSettingsTab * m_colorSettings
PopupPaletteTab * m_popupPaletteSettings
KPageWidgetItem * getPage(Page page_enum)
KisInputConfigurationPage * m_inputConfiguration
FullscreenSettingsTab * m_fullscreenSettings
ShortcutSettingsTab * m_shortcutSettings
TabletSettingsTab * m_tabletSettings
bool editPreferences(std::optional< PageDesc > page)
QList< KPageWidgetItem * > m_pages
DisplaySettingsTab * m_displaySettings
void slotButtonClicked(QAbstractButton *button)
KisDlgPreferences(QWidget *parent=0, const char *name=0)
void switchTab(PageDesc tab)
void showEvent(QShowEvent *event) override
A Configuration Dialog Page to configure the canvas input.
The KisProofingConfigModel class.
Widget for configuration of KAccel and KGlobalAccel.
Definition KoID.h:30
void load(bool requestDefault)
PerformanceTab(QWidget *parent=0, const char *name=0)
QScopedPointer< KisFrameRateLimitModel > m_frameRateModel
void slotThreadsLimitChanged(int value)
QVector< SliderAndSpinBoxSync * > m_syncs
void slotFrameClonesLimitChanged(int value)
PopupPaletteTab(QWidget *parent=0, const char *name=0)
void slotSelectorTypeChanged(int index)
WdgShortcutSettings * m_page
QScopedPointer< KisActionsSnapshot > m_snapshot
ShortcutSettingsTab(QWidget *parent=0, const char *name=0)
WdgTabletSettings * m_page
TabletSettingsTab(QWidget *parent=0, const char *name=0)
WdgColorSettings(QWidget *parent)
WdgDisplaySettings(QWidget *parent, const char *name)
WdgFullscreenSettingsBase(QWidget *parent)
WdgGeneralSettings(QWidget *parent, const char *name)
WdgPerformanceSettings(QWidget *parent, const char *name)
WdgPopupPaletteSettingsBase(QWidget *parent, const char *name)
WdgShortcutSettings(QWidget *parent)
WdgTabletSettings(QWidget *parent)
OutlineStyle
Definition kis_global.h:53
CursorStyle
Definition kis_global.h:62
QString button(const QWheelEvent &ev)