Subversion Repositories Scribus

Rev

Rev 1195 | Rev 1834 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
788 fschmid 1
#include "tabtypography.h"
2
#include "tabtypography.moc"
3
#include <qlayout.h>
4
#include <qgroupbox.h>
5
#include <qlabel.h>
6
#include <qtooltip.h>
7
#include <qspinbox.h>
8
#include "mspinbox.h"
838 cbradney 9
#include "scribusstructs.h"
788 fschmid 10
 
1195 fschmid 11
TabTypograpy::TabTypograpy( QWidget* parent, struct typoPrefs *prefsData) : QWidget( parent, "tabtypo", 0 )
788 fschmid 12
{
13
        tabTypoLayout = new QGridLayout( this, 1, 1, 11, 6, "tabTypoLayout");
14
        groupBox1a = new QGroupBox( this, "groupBox1a" );
15
        groupBox1a->setColumnLayout(0, Qt::Vertical );
16
        groupBox1a->layout()->setSpacing( 6 );
17
        groupBox1a->layout()->setMargin( 11 );
18
        groupBox1a->setTitle( tr( "Subscript" ) );
19
        groupBox1aLayout = new QGridLayout( groupBox1a->layout() );
20
        groupBox1aLayout->setAlignment( Qt::AlignTop );
21
        subDisplacement = new QSpinBox( groupBox1a, "subDisplacement" );
22
        subDisplacement->setMaxValue( 100 );
823 fschmid 23
        subDisplacement->setValue( prefsData->valueSubScript );
788 fschmid 24
        subDisplacement->setSuffix( tr( " %" ) );
25
        groupBox1aLayout->addWidget( subDisplacement, 0, 1, Qt::AlignLeft );
26
        textLabel1a = new QLabel(subDisplacement, tr( "&Displacement:" ), groupBox1a, "textLabel1a" );
27
        groupBox1aLayout->addWidget( textLabel1a, 0, 0 );
28
        subScaling = new QSpinBox( groupBox1a, "subScaling" );
29
        subScaling->setMaxValue( 100 );
30
        subScaling->setMinValue( 1 );
823 fschmid 31
        subScaling->setValue( prefsData->scalingSubScript );
788 fschmid 32
        subScaling->setSuffix( tr( " %" ) );
33
        groupBox1aLayout->addWidget( subScaling, 0, 3, Qt::AlignLeft );
34
        textLabel2a = new QLabel(subScaling, tr( "&Scaling:" ), groupBox1a, "textLabel2a" );
35
        groupBox1aLayout->addWidget( textLabel2a, 0, 2 );
36
        tabTypoLayout->addWidget( groupBox1a, 0, 0 );
37
        groupBox2a = new QGroupBox( this, "groupBox2a" );
38
        groupBox2a->setColumnLayout(0, Qt::Vertical );
39
        groupBox2a->layout()->setSpacing( 6 );
40
        groupBox2a->layout()->setMargin( 11 );
41
        groupBox2a->setTitle( tr( "Superscript" ) );
42
        groupBox2aLayout = new QGridLayout( groupBox2a->layout() );
43
        groupBox2aLayout->setAlignment( Qt::AlignTop );
44
        superDisplacement = new QSpinBox( groupBox2a, "superDisplacement" );
45
        superDisplacement->setMaxValue( 100 );
823 fschmid 46
        superDisplacement->setValue( prefsData->valueSuperScript );
788 fschmid 47
        superDisplacement->setSuffix( tr( " %" ) );
48
        groupBox2aLayout->addWidget( superDisplacement, 0, 1, Qt::AlignLeft );
49
        textLabel3a = new QLabel(superDisplacement, tr( "D&isplacement:" ), groupBox2a, "textLabel3a" );
50
        groupBox2aLayout->addWidget( textLabel3a, 0, 0 );
51
        superScaling = new QSpinBox( groupBox2a, "superScaling" );
52
        superScaling->setMaxValue( 100 );
53
        superScaling->setMinValue( 1 );
823 fschmid 54
        superScaling->setValue( prefsData->scalingSuperScript );
788 fschmid 55
        superScaling->setSuffix( tr( " %" ) );
56
        groupBox2aLayout->addWidget( superScaling, 0, 3, Qt::AlignLeft );
57
        textLabel4a = new QLabel(superScaling, tr( "S&caling:" ), groupBox2a, "textLabel4a" );
58
        groupBox2aLayout->addWidget( textLabel4a, 0, 2 );
59
        tabTypoLayout->addWidget( groupBox2a, 1, 0 );
60
        groupBox3a = new QGroupBox( this, "groupBox3a" );
61
        groupBox3a->setColumnLayout(0, Qt::Vertical );
62
        groupBox3a->layout()->setSpacing( 6 );
63
        groupBox3a->layout()->setMargin( 11 );
64
        groupBox3a->setTitle( tr( "Small Caps" ) );
65
        groupBox3aLayout = new QGridLayout( groupBox3a->layout() );
66
        groupBox3aLayout->setAlignment( Qt::AlignTop );
67
        capsScaling = new QSpinBox( groupBox3a, "capsScaling" );
68
        capsScaling->setMaxValue( 100 );
69
        capsScaling->setMinValue( 1 );
823 fschmid 70
        capsScaling->setValue( prefsData->valueSmallCaps );
788 fschmid 71
        capsScaling->setSuffix( tr( " %" ) );
72
        groupBox3aLayout->addWidget( capsScaling, 0, 1, Qt::AlignLeft );
73
        textLabel5a = new QLabel(capsScaling, tr( "Sc&aling:" ), groupBox3a, "textLabel5a" );
74
        groupBox3aLayout->addWidget( textLabel5a, 0, 0 );
75
        tabTypoLayout->addWidget( groupBox3a, 2, 0 );
1195 fschmid 76
 
788 fschmid 77
        QToolTip::add( superDisplacement, tr( "Displacement above the baseline of the font on a line" ) );
78
        QToolTip::add( superScaling, tr( "Relative size of the superscript compared to the normal font" ) );
79
        QToolTip::add( subDisplacement, tr( "Displacement below the baseline of the normal font on a line" ) );
80
        QToolTip::add( subScaling, tr( "Relative size of the subscript compared to the normal font" ) );
81
        QToolTip::add( capsScaling, tr( "Relative size of the small caps font compared to the normal font" ) );
82
}
1828 fschmid 83
 
84
void TabTypograpy::restoreDefaults(struct typoPrefs *prefsData)
85
{
86
        subDisplacement->setValue( prefsData->valueSubScript );
87
        capsScaling->setValue( prefsData->valueSmallCaps );
88
        superScaling->setValue( prefsData->scalingSuperScript );
89
        subScaling->setValue( prefsData->scalingSubScript );
90
}