Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Miguel Lopez
Krita
Commits
cf94f67e
Commit
cf94f67e
authored
Apr 30, 2014
by
Dan Leinir Turthra Jensen
🌈
Browse files
sketch: Expose the default image settings when using the custom image panel
parent
b34d865e
Changes
3
Hide whitespace changes
Inline
Side-by-side
krita/sketch/CMakeLists.txt
View file @
cf94f67e
...
...
@@ -23,6 +23,7 @@ set(kritasketchlib_SRCS
KisSketchPart.cpp
RecentFileManager.cpp
ProgressProxy.cpp
PropertyContainer.cpp
Settings.cpp
SketchDeclarativeView.cpp
SketchInputContext.cpp
...
...
krita/sketch/Settings.cpp
View file @
cf94f67e
...
...
@@ -26,6 +26,8 @@
#include <kstandarddirs.h>
#include "Theme.h"
#include "PropertyContainer.h"
#include <kis_config.h>
class
Settings
::
Private
{
...
...
@@ -120,4 +122,17 @@ void Settings::setThemeID(const QString& id)
}
}
QObject
*
Settings
::
customImageSettings
()
const
{
QObject
*
settings
=
new
PropertyContainer
(
"customImageSettings"
,
qApp
);
KisConfig
cfg
;
settings
->
setProperty
(
"Width"
,
cfg
.
defImageWidth
());
settings
->
setProperty
(
"Height"
,
cfg
.
defImageHeight
());
settings
->
setProperty
(
"Resolution"
,
qRound
(
cfg
.
defImageResolution
()
*
72
));
// otherwise we end up with silly floating point numbers
settings
->
setProperty
(
"ColorModel"
,
cfg
.
defColorModel
());
settings
->
setProperty
(
"ColorDepth"
,
cfg
.
defaultColorDepth
());
settings
->
setProperty
(
"ColorProfile"
,
cfg
.
defColorProfile
());
return
settings
;
}
#include "Settings.moc"
krita/sketch/Settings.h
View file @
cf94f67e
...
...
@@ -35,6 +35,7 @@ class KRITA_SKETCH_EXPORT Settings : public QObject
Q_PROPERTY
(
QDeclarativeItem
*
focusItem
READ
focusItem
WRITE
setFocusItem
NOTIFY
focusItemChanged
)
Q_PROPERTY
(
QObject
*
theme
READ
theme
NOTIFY
themeChanged
)
Q_PROPERTY
(
QString
themeID
READ
themeID
WRITE
setThemeID
NOTIFY
themeChanged
)
Q_PROPERTY
(
QObject
*
customImageSettings
READ
customImageSettings
NOTIFY
customImageSettingsChanged
)
public:
explicit
Settings
(
QObject
*
parent
=
0
);
...
...
@@ -57,11 +58,14 @@ public Q_SLOTS:
QString
themeID
()
const
;
void
setThemeID
(
const
QString
&
id
);
QObject
*
customImageSettings
()
const
;
Q_SIGNALS:
void
currentFileChanged
();
void
temporaryFileChanged
();
void
focusItemChanged
();
void
themeChanged
();
void
customImageSettingsChanged
();
private:
class
Private
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment