Commit cf94f67e authored by Dan Leinir Turthra Jensen's avatar Dan Leinir Turthra Jensen 🌈
Browse files

sketch: Expose the default image settings when using the custom image panel

parent b34d865e
......@@ -23,6 +23,7 @@ set(kritasketchlib_SRCS
KisSketchPart.cpp
RecentFileManager.cpp
ProgressProxy.cpp
PropertyContainer.cpp
Settings.cpp
SketchDeclarativeView.cpp
SketchInputContext.cpp
......
......@@ -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"
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment