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 qreal colorSamplerZoomPreviewScale() const;
77 bool colorSamplerZoomPreviewEnabled() const;
78 KisConfig::ColorSamplerPreviewCirclePosition colorSamplerPreviewCirclePosition() const;
79
80 KisConfig::SessionOnStartup sessionOnStartup() const;
81 KisConfig::IconsInMenu iconsInMenu() const;
82 bool saveSessionOnQuit() const;
83
84 bool showRootLayer();
85 int autoSaveInterval();
86 void setDefault();
87 int undoStackSize();
88 bool showOutlineWhilePainting();
89 bool showEraserOutlineWhilePainting();
90
91 int mdiMode();
92 bool showCanvasMessages();
93 bool compressKra();
94 bool trimKra();
95 bool trimFramesImport();
96 bool useZip64();
97 bool toolOptionsInDocker();
98 int zoomSteps();
99 bool longPressEnabled();
100 bool kineticScrollingEnabled();
101 int kineticScrollingGesture();
102 int kineticScrollingSensitivity();
103 bool kineticScrollingHiddenScrollbars();
104 int zoomMarginSize();
105 bool switchSelectionCtrlAlt();
106 bool convertToImageColorspaceOnImport();
107
108 bool autopinLayersToTimeline();
109 bool adaptivePlaybackRange();
110 bool autoZoomTimelineToPlaybackRange();
111
112 bool renameMergedLayers();
113 bool renamePastedLayers();
114 bool renameDuplicatedLayers();
115 QString exportMimeType();
116 int forcedFontDpi();
117
118 static void setColorSamplerPreviewStyleItems(QComboBox *cmb);
119 static void setColorSamplerPreviewStyleIndexByValue(QComboBox *cmb, KisConfig::ColorSamplerPreviewStyle style);
120 static KisConfig::ColorSamplerPreviewStyle getColorSamplerPreviewStyleValue(const QComboBox *cmb);
121
122private Q_SLOTS:
123 void getBackgroundImage();
124 void clearBackgroundImage();
125 void checkResourcePath();
126 void enableSubWindowOptions(int);
127 void updateTouchPressureSensitivityEnabled(int);
128 void showAdvancedCumulativeUndoSettings();
129
130 void colorSamplePreviewStyleChanged(int index);
131 void colorSamplePreviewSizeChanged(int value);
132 void colorSamplePreviewThicknessChanged(qreal value);
133 void colorSamplePreviewOutlineEnabledChanged(int value);
134
135 static void setButtonGroupEnabled(const QButtonGroup& buttonGroup, bool value);
136
137public:
138 QButtonGroup m_pasteFormatGroup;
140};
141
142
143
149{
150 Q_OBJECT
151
152public:
153 WdgShortcutSettings(QWidget *parent)
155 KisShortcutsEditor::LetterShortcutsAllowed,
156 parent)
157 { }
158};
159
161
162class ShortcutSettingsTab : public QWidget
163{
164 Q_OBJECT
165
166public:
167
168 ShortcutSettingsTab(QWidget *parent = 0, const char *name = 0);
169 ~ShortcutSettingsTab() override;
170
171public:
172 void setDefault();
174 QScopedPointer<KisActionsSnapshot> m_snapshot;
175
176public Q_SLOTS:
177 void saveChanges();
178 void cancelChanges();
179};
180
181
182
187class WdgColorSettings : public QWidget, public Ui::WdgColorSettings
188{
189 Q_OBJECT
190
191public:
192 WdgColorSettings(QWidget *parent) : QWidget(parent) {
193 setupUi(this);
194 }
195};
196
239
240//=======================
241
242class WdgTabletSettings : public QWidget, public Ui::WdgTabletSettings {
243
244 Q_OBJECT
245
246public:
247 WdgTabletSettings(QWidget *parent) : QWidget(parent) {
248 setupUi(this);
249 }
250
251};
252
253class TabletSettingsTab : public QWidget {
254 Q_OBJECT
255public:
256 TabletSettingsTab(QWidget *parent = 0, const char *name = 0);
257
258private Q_SLOTS:
259 void slotTabletTest();
261
262public:
263 void setDefault();
265
266
267};
268
269//=======================
270
276
277class WdgPerformanceSettings : public QWidget, public Ui::WdgPerformanceSettings
278{
279 Q_OBJECT
280
281public:
282 WdgPerformanceSettings(QWidget *parent, const char *name) : QWidget(parent) {
283 setObjectName(name); setupUi(this);
284 }
285};
286
288{
289 Q_OBJECT
290
291public:
292 PerformanceTab(QWidget *parent = 0, const char *name = 0);
293
294 ~PerformanceTab() override;
295
296 void load(bool requestDefault);
297 void save();
298
299private Q_SLOTS:
302
303private:
304 int realTilesRAM();
305
306private:
310 QScopedPointer<KisFrameRateLimitModel> m_frameRateModel;
311};
312
313//=======================
314
315class WdgDisplaySettings : public QWidget, public Ui::WdgDisplaySettings
316{
317 Q_OBJECT
318
319public:
320 WdgDisplaySettings(QWidget *parent, const char *name) : QWidget(parent) {
321 setObjectName(name); setupUi(this);
322 }
323};
324
331{
332 Q_OBJECT
333
334public:
335 DisplaySettingsTab(QWidget *parent = 0, const char *name = 0);
336
337public:
338 void setDefault();
339protected Q_SLOTS:
340 void slotUseOpenGLToggled(bool isChecked);
341 void slotPreferredSurfaceFormatChanged(int index);
342
343public:
344};
345
346//=======================
347
352class WdgFullscreenSettingsBase : public QWidget, public Ui::WdgFullscreenSettings
353{
354 Q_OBJECT
355
356public:
357 WdgFullscreenSettingsBase(QWidget *parent) : QWidget(parent) {
358 setupUi(this);
359 }
360};
361
363{
364 Q_OBJECT
365public:
366 FullscreenSettingsTab(QWidget *parent);
367public:
368 void setDefault();
369};
370
371//=======================
372
377class WdgPopupPaletteSettingsBase : public QWidget, public Ui::WdgPopupPaletteSettings
378{
379 Q_OBJECT
380
381public:
382 WdgPopupPaletteSettingsBase(QWidget *parent, const char *name) : QWidget(parent) {
383 setObjectName(name); setupUi(this);
384 }
385};
386
388{
389 Q_OBJECT
390
391public:
392 PopupPaletteTab(QWidget *parent = 0, const char *name = 0);
393
394 void load();
395 void save();
396 void setDefault();
397protected Q_SLOTS:
398 void slotSelectorTypeChanged(int index);
399};
400
401//=======================
402
403
407class KisDlgPreferences : public KPageDialog
408{
409 Q_OBJECT
410
411public:
450
451 struct PageDesc {
453 int tab;
454 };
455
456 KisDlgPreferences(QWidget *parent = 0, const char *name = 0);
457 ~KisDlgPreferences() override;
458
459 bool editPreferences(std::optional<PageDesc> page);
460
461 void showEvent(QShowEvent *event) override;
462
463private:
464 KPageWidgetItem* getPage(Page page_enum);
465 void switchTab (PageDesc tab);
466
477
479
480private Q_SLOTS:
481
482 void slotButtonClicked(QAbstractButton *button);
483 void slotDefault();
484
485private:
486
487 bool m_cancelClicked {false};
488};
489
490#endif
float value(const T *src, size_t ch)
void toggleUseDefaultColorSpace(bool useDefColorSpace)
QList< QLabel * > m_monitorProfileLabels
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
ColorSamplerPreviewCirclePosition
Definition kis_config.h:168
CanvasSurfaceBitDepthMode
Definition kis_config.h:206
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)