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);
130public:
131 QButtonGroup m_pasteFormatGroup;
133};
134
135
136
142{
143 Q_OBJECT
144
145public:
146 WdgShortcutSettings(QWidget *parent)
148 KisShortcutsEditor::LetterShortcutsAllowed,
149 parent)
150 { }
151};
152
154
155class ShortcutSettingsTab : public QWidget
156{
157 Q_OBJECT
158
159public:
160
161 ShortcutSettingsTab(QWidget *parent = 0, const char *name = 0);
162 ~ShortcutSettingsTab() override;
163
164public:
165 void setDefault();
167 QScopedPointer<KisActionsSnapshot> m_snapshot;
168
169public Q_SLOTS:
170 void saveChanges();
171 void cancelChanges();
172};
173
174
175
180class WdgColorSettings : public QWidget, public Ui::WdgColorSettings
181{
182 Q_OBJECT
183
184public:
185 WdgColorSettings(QWidget *parent) : QWidget(parent) {
186 setupUi(this);
187 }
188};
189
233
234//=======================
235
236class WdgTabletSettings : public QWidget, public Ui::WdgTabletSettings {
237
238 Q_OBJECT
239
240public:
241 WdgTabletSettings(QWidget *parent) : QWidget(parent) {
242 setupUi(this);
243 }
244
245};
246
247class TabletSettingsTab : public QWidget {
248 Q_OBJECT
249public:
250 TabletSettingsTab(QWidget *parent = 0, const char *name = 0);
251
252private Q_SLOTS:
253 void slotTabletTest();
255
256public:
257 void setDefault();
259
260
261};
262
263//=======================
264
270
271class WdgPerformanceSettings : public QWidget, public Ui::WdgPerformanceSettings
272{
273 Q_OBJECT
274
275public:
276 WdgPerformanceSettings(QWidget *parent, const char *name) : QWidget(parent) {
277 setObjectName(name); setupUi(this);
278 }
279};
280
282{
283 Q_OBJECT
284
285public:
286 PerformanceTab(QWidget *parent = 0, const char *name = 0);
287
288 ~PerformanceTab() override;
289
290 void load(bool requestDefault);
291 void save();
292
293private Q_SLOTS:
296
297private:
298 int realTilesRAM();
299
300private:
304 QScopedPointer<KisFrameRateLimitModel> m_frameRateModel;
305};
306
307//=======================
308
309class WdgDisplaySettings : public QWidget, public Ui::WdgDisplaySettings
310{
311 Q_OBJECT
312
313public:
314 WdgDisplaySettings(QWidget *parent, const char *name) : QWidget(parent) {
315 setObjectName(name); setupUi(this);
316 }
317};
318
325{
326 Q_OBJECT
327
328public:
329 DisplaySettingsTab(QWidget *parent = 0, const char *name = 0);
330
331public:
332 void setDefault();
333protected Q_SLOTS:
334 void slotUseOpenGLToggled(bool isChecked);
335 void slotPreferredSurfaceFormatChanged(int index);
336
337public:
338};
339
340//=======================
341
346class WdgFullscreenSettingsBase : public QWidget, public Ui::WdgFullscreenSettings
347{
348 Q_OBJECT
349
350public:
351 WdgFullscreenSettingsBase(QWidget *parent) : QWidget(parent) {
352 setupUi(this);
353 }
354};
355
357{
358 Q_OBJECT
359public:
360 FullscreenSettingsTab(QWidget *parent);
361public:
362 void setDefault();
363};
364
365//=======================
366
371class WdgPopupPaletteSettingsBase : public QWidget, public Ui::WdgPopupPaletteSettings
372{
373 Q_OBJECT
374
375public:
376 WdgPopupPaletteSettingsBase(QWidget *parent, const char *name) : QWidget(parent) {
377 setObjectName(name); setupUi(this);
378 }
379};
380
382{
383 Q_OBJECT
384
385public:
386 PopupPaletteTab(QWidget *parent = 0, const char *name = 0);
387
388 void load();
389 void save();
390 void setDefault();
391protected Q_SLOTS:
392 void slotSelectorTypeChanged(int index);
393};
394
395//=======================
396
397
401class KisDlgPreferences : public KPageDialog
402{
403 Q_OBJECT
404
405public:
444
445 struct PageDesc {
447 int tab;
448 };
449
450 KisDlgPreferences(QWidget *parent = 0, const char *name = 0);
451 ~KisDlgPreferences() override;
452
453 bool editPreferences(std::optional<PageDesc> page);
454
455 void showEvent(QShowEvent *event) override;
456
457private:
458 KPageWidgetItem* getPage(Page page_enum);
459 void switchTab (PageDesc tab);
460
471
473
474private Q_SLOTS:
475
476 void slotButtonClicked(QAbstractButton *button);
477 void slotDefault();
478
479private:
480
481 bool m_cancelClicked {false};
482};
483
484#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)