21#include <tqgroupbox.h>
26#include <kpushbutton.h>
28#include "kis_global.h"
30#include "wdglayerproperties.h"
31#include "kis_dlg_layer_properties.h"
32#include "kis_cmb_composite.h"
33#include "kis_cmb_idlist.h"
34#include "kis_profile.h"
35#include "kis_int_spinbox.h"
36#include "kis_colorspace.h"
38KisDlgLayerProperties::KisDlgLayerProperties(
const TQString& deviceName,
40 const KisCompositeOp& compositeOp,
42 TQWidget *parent,
const char *name, WFlags f)
43 : super(parent, name, f, name, Ok | Cancel)
45 m_page =
new WdgLayerProperties(
this);
46 m_page->layout()->setMargin(0);
48 opacity = int((opacity * 100.0) / 255 + 0.5);
50 setCaption(i18n(
"Layer Properties"));
51 setMainWidget(m_page);
53 m_page->editName->setText(deviceName);
54 connect( m_page->editName, TQ_SIGNAL( textChanged (
const TQString & ) ),
this, TQ_SLOT( slotNameChanged(
const TQString & ) ) );
56 m_page->cmbColorSpaces->setCurrent(colorSpace->
id());
57 m_page->cmbColorSpaces->setEnabled(
false);
60 if (KisProfile* profile =
const_cast<KisColorSpace *
>(colorSpace)->getProfile())
61 profilename = profile->productName();
62 m_page->cmbProfile->insertItem(profilename);
63 m_page->cmbProfile->setEnabled(
false);
65 m_page->intOpacity->setRange(0, 100, 13);
66 m_page->intOpacity->setValue(opacity);
69 m_page->cmbComposite->setCurrentItem(compositeOp);
71 slotNameChanged( m_page->editName->text() );
74KisDlgLayerProperties::~KisDlgLayerProperties()
78void KisDlgLayerProperties::slotNameChanged(
const TQString &_text )
80 enableButtonOK( !_text.isEmpty() );
83TQString KisDlgLayerProperties::getName()
const
85 return m_page->editName->text();
88int KisDlgLayerProperties::getOpacity()
const
90 TQ_INT32 opacity = m_page->intOpacity->value();
95 opacity = int((opacity * 255.0) / 100 + 0.5);
101KisCompositeOp KisDlgLayerProperties::getCompositeOp()
const
103 return m_page->cmbComposite->currentItem();
106#include "kis_dlg_layer_properties.moc"
A colorspace is the definition of a certain color model in Chalk.
virtual KisCompositeOpList userVisiblecompositeOps() const =0
Returns the list of user-visible composite ops supported by this colourspace.
virtual KisID id() const =0
Chalk definition for use in .kra files and internally: unchanging name + i18n'able description.