summaryrefslogtreecommitdiffstats
path: root/kpresenter/KPrShadowDialogImpl.cpp
blob: d273066595ec352761b311c93dd5a8ca6b04ee1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
#include <tqspinbox.h>
#include <tqgroupbox.h>
#include <tqlayout.h>
#include <tqbuttongroup.h>

#include <kcolorbutton.h>
#include <tdelocale.h>

#include "KPrShadowDialogImpl.h"
#include "KPrTextPreview.h"

KPrShadowDialogImpl::KPrShadowDialogImpl( TQWidget *parent, const char* name )
    : ShadowDialogBase( parent, name )
{
    _preview = new KPrTextPreview( previewPanel );
    TQHBoxLayout *lay = new TQHBoxLayout( previewPanel, previewPanel->lineWidth(), 0 );
    lay->addWidget( _preview );
    distanceSpinBox->setSuffix(i18n("pt"));
    ltButton->setPixmap( BarIcon( "shadowLU" ) );
    tButton->setPixmap( BarIcon( "shadowU" ) );
    rtButton->setPixmap( BarIcon( "shadowRU" ) );
    rButton->setPixmap( BarIcon( "shadowR" ) );
    rbButton->setPixmap( BarIcon( "shadowRB" ) );
    bButton->setPixmap( BarIcon( "shadowB" ) );
    lbButton->setPixmap( BarIcon( "shadowLB" ) );
    lButton->setPixmap( BarIcon( "shadowL" ) );

    connect( colorButton, TQT_SIGNAL( changed( const TQColor& ) ),
             TQT_SLOT( colorChanged( const TQColor& ) ) );
}

void KPrShadowDialogImpl::setShadowDirection( ShadowDirection d )
{
    _preview->setShadowDirection( d );
    directionGroup->setButton( d );
}

void KPrShadowDialogImpl::setShadowDistance( int d )
{
    _preview->setShadowDistance( d );
    distanceSpinBox->setValue( d );
}

void KPrShadowDialogImpl::setShadowColor( const TQColor &c )
{
    _preview->setShadowColor( c );
    colorButton->setColor( c );
}

void KPrShadowDialogImpl::colorChanged( const TQColor& c )
{
    _preview->setShadowColor( c );
}

void KPrShadowDialogImpl::directionChanged( int d )
{
    _preview->setShadowDirection( (ShadowDirection)d );
}

void KPrShadowDialogImpl::distanceChanged( int d )
{
    _preview->setShadowDistance( d );
}

void KPrShadowDialogImpl::applyClicked()
{
    emit apply();
}

void KPrShadowDialogImpl::okClicked()
{
    applyClicked();
    accept();
}

ShadowDirection KPrShadowDialogImpl::shadowDirection()
{
    return (ShadowDirection) ( directionGroup->id( directionGroup->selected() ) );
}

int KPrShadowDialogImpl::shadowDistance()
{
    return distanceSpinBox->value();
}

TQColor KPrShadowDialogImpl::shadowColor()
{
    return colorButton->color();
}
#include "KPrShadowDialogImpl.moc"