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 QString splashScreenImage() const;
88 int undoStackSize();
89 bool showOutlineWhilePainting();
90 bool showEraserOutlineWhilePainting();
91
92 int mdiMode();
93 bool showCanvasMessages();
94 bool compressKra();
95 bool trimKra();
96 bool trimFramesImport();
97 bool useZip64();
98 bool toolOptionsInDocker();
99 int zoomSteps();
100 bool longPressEnabled();
101 bool kineticScrollingEnabled();
102 int kineticScrollingGesture();
103 int kineticScrollingSensitivity();
104 bool kineticScrollingHiddenScrollbars();
105 int zoomMarginSize();
106 bool switchSelectionCtrlAlt();
107 bool convertToImageColorspaceOnImport();
108
109 bool autopinLayersToTimeline();
110 bool adaptivePlaybackRange();
111 bool autoZoomTimelineToPlaybackRange();
112
113 bool renameMergedLayers();
114 bool renamePastedLayers();
115 bool renameDuplicatedLayers();
116 QString exportMimeType();
117 int forcedFontDpi();
118
119 static void setColorSamplerPreviewStyleItems(QComboBox *cmb);
120 static void setColorSamplerPreviewStyleIndexByValue(QComboBox *cmb, KisConfig::ColorSamplerPreviewStyle style);
121 static KisConfig::ColorSamplerPreviewStyle getColorSamplerPreviewStyleValue(const QComboBox *cmb);
122
123private Q_SLOTS:
124 void getBackgroundImage();
125 void clearBackgroundImage();
126 void checkResourcePath();
127 void enableSubWindowOptions(int);
128 void updateTouchPressureSensitivityEnabled(int);
129 void showAdvancedCumulativeUndoSettings();
130
131 void colorSamplePreviewStyleChanged(int index);
132 void colorSamplePreviewSizeChanged(int value);
133 void colorSamplePreviewThicknessChanged(qreal value);
134 void colorSamplePreviewOutlineEnabledChanged(int value);
135
136 void slotUpdateCurrentSplashScreenTitle();
137 void slotChangeSplashScreen();
138
139 static void setButtonGroupEnabled(const QButtonGroup& buttonGroup, bool value);
140
141public:
142 QButtonGroup m_pasteFormatGroup;
145};
146
147
148
154{
155 Q_OBJECT
156
157public:
158 WdgShortcutSettings(QWidget *parent)
160 KisShortcutsEditor::LetterShortcutsAllowed,
161 parent)
162 { }
163};
164
166
167class ShortcutSettingsTab : public QWidget
168{
169 Q_OBJECT
170
171public:
172
173 ShortcutSettingsTab(QWidget *parent = 0, const char *name = 0);
174 ~ShortcutSettingsTab() override;
175
176public:
177 void setDefault();
179 QScopedPointer<KisActionsSnapshot> m_snapshot;
180
181public Q_SLOTS:
182 void saveChanges();
183 void cancelChanges();
184};
185
186
187
192class WdgColorSettings : public QWidget, public Ui::WdgColorSettings
193{
194 Q_OBJECT
195
196public:
197 WdgColorSettings(QWidget *parent) : QWidget(parent) {
198 setupUi(this);
199 }
200};
201
244
245//=======================
246
247class WdgTabletSettings : public QWidget, public Ui::WdgTabletSettings {
248
249 Q_OBJECT
250
251public:
252 WdgTabletSettings(QWidget *parent) : QWidget(parent) {
253 setupUi(this);
254 }
255
256};
257
258class TabletSettingsTab : public QWidget {
259 Q_OBJECT
260public:
261 TabletSettingsTab(QWidget *parent = 0, const char *name = 0);
262
263private Q_SLOTS:
264 void slotTabletTest();
266
267public:
268 void setDefault();
270
271
272};
273
274//=======================
275
281
282class WdgPerformanceSettings : public QWidget, public Ui::WdgPerformanceSettings
283{
284 Q_OBJECT
285
286public:
287 WdgPerformanceSettings(QWidget *parent, const char *name) : QWidget(parent) {
288 setObjectName(name); setupUi(this);
289 }
290};
291
293{
294 Q_OBJECT
295
296public:
297 PerformanceTab(QWidget *parent = 0, const char *name = 0);
298
299 ~PerformanceTab() override;
300
301 void load(bool requestDefault);
302 void save();
303
304private Q_SLOTS:
307
308private:
309 int realTilesRAM();
310
311private:
315 QScopedPointer<KisFrameRateLimitModel> m_frameRateModel;
316};
317
318//=======================
319
320class WdgDisplaySettings : public QWidget, public Ui::WdgDisplaySettings
321{
322 Q_OBJECT
323
324public:
325 WdgDisplaySettings(QWidget *parent, const char *name) : QWidget(parent) {
326 setObjectName(name); setupUi(this);
327 }
328};
329
336{
337 Q_OBJECT
338
339public:
340 DisplaySettingsTab(QWidget *parent = 0, const char *name = 0);
341
342public:
343 void setDefault();
344protected Q_SLOTS:
345 void slotUseOpenGLToggled(bool isChecked);
346 void slotPreferredSurfaceFormatChanged(int index);
347
348public:
349};
350
351//=======================
352
357class WdgFullscreenSettingsBase : public QWidget, public Ui::WdgFullscreenSettings
358{
359 Q_OBJECT
360
361public:
362 WdgFullscreenSettingsBase(QWidget *parent) : QWidget(parent) {
363 setupUi(this);
364 }
365};
366
368{
369 Q_OBJECT
370public:
371 FullscreenSettingsTab(QWidget *parent);
372public:
373 void setDefault();
374};
375
376//=======================
377
382class WdgPopupPaletteSettingsBase : public QWidget, public Ui::WdgPopupPaletteSettings
383{
384 Q_OBJECT
385
386public:
387 WdgPopupPaletteSettingsBase(QWidget *parent, const char *name) : QWidget(parent) {
388 setObjectName(name); setupUi(this);
389 }
390};
391
393{
394 Q_OBJECT
395
396public:
397 PopupPaletteTab(QWidget *parent = 0, const char *name = 0);
398
399 void load();
400 void save();
401 void setDefault();
402protected Q_SLOTS:
403 void slotSelectorTypeChanged(int index);
404};
405
406//=======================
407
408
412class KisDlgPreferences : public KPageDialog
413{
414 Q_OBJECT
415
416public:
455
456 struct PageDesc {
458 int tab;
459 };
460
461 KisDlgPreferences(QWidget *parent = 0, const char *name = 0);
462 ~KisDlgPreferences() override;
463
464 bool editPreferences(std::optional<PageDesc> page);
465
466 void showEvent(QShowEvent *event) override;
467
468private:
469 KPageWidgetItem* getPage(Page page_enum);
470 void switchTab (PageDesc tab);
471
482
484
485private Q_SLOTS:
486
487 void slotButtonClicked(QAbstractButton *button);
488 void slotDefault();
489
490private:
491
492 bool m_cancelClicked {false};
493};
494
495#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)
QString m_splashScreenImage
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:214
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)