Subversion Repositories Scribus

Rev

Rev 1834 | Rev 2174 | 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
{
1878 cbradney 13
        tabTypoLayout = new QGridLayout( this, 1, 1, 0, 6, "tabTypoLayout");
788 fschmid 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 );
1834 fschmid 76
 
77
        groupBox4a = new QGroupBox( this, "groupBox3a" );
78
        groupBox4a->setColumnLayout(0, Qt::Vertical );
79
        groupBox4a->layout()->setSpacing( 6 );
80
        groupBox4a->layout()->setMargin( 11 );
81
        groupBox4a->setTitle( tr( "Automatic &Line Spacing" ) );
82
        groupBox4aLayout = new QGridLayout( groupBox4a->layout() );
83
        groupBox4aLayout->setAlignment( Qt::AlignTop );
84
        autoLine = new QSpinBox( groupBox4a, "autoLine" );
85
        autoLine->setMaxValue( 100 );
86
        autoLine->setMinValue( 1 );
87
        autoLine->setValue( prefsData->autoLineSpacing );
88
        autoLine->setSuffix( tr( " %" ) );
89
        groupBox4aLayout->addWidget( autoLine, 1, 1 );
90
        textLabel8a = new QLabel( autoLine, tr( "Line Spacing:" ), groupBox4a, "textLabel8a" );
91
        groupBox4aLayout->addWidget( textLabel8a, 1, 0 );
92
        tabTypoLayout->addWidget( groupBox4a, 3, 0 );
1195 fschmid 93
 
788 fschmid 94
        QToolTip::add( superDisplacement, tr( "Displacement above the baseline of the font on a line" ) );
95
        QToolTip::add( superScaling, tr( "Relative size of the superscript compared to the normal font" ) );
96
        QToolTip::add( subDisplacement, tr( "Displacement below the baseline of the normal font on a line" ) );
97
        QToolTip::add( subScaling, tr( "Relative size of the subscript compared to the normal font" ) );
98
        QToolTip::add( capsScaling, tr( "Relative size of the small caps font compared to the normal font" ) );
1834 fschmid 99
        QToolTip::add( autoLine, tr( "Percentage increase over the font size for the line spacing" ) );
788 fschmid 100
}
1828 fschmid 101
 
102
void TabTypograpy::restoreDefaults(struct typoPrefs *prefsData)
103
{
104
        subDisplacement->setValue( prefsData->valueSubScript );
105
        capsScaling->setValue( prefsData->valueSmallCaps );
106
        superScaling->setValue( prefsData->scalingSuperScript );
107
        subScaling->setValue( prefsData->scalingSubScript );
1834 fschmid 108
        autoLine->setValue( prefsData->autoLineSpacing );
1828 fschmid 109
}