~ubuntu-branches/ubuntu/wily/kdebase-workspace/wily

« back to all changes in this revision

Viewing changes to kwin/effects/windowgeometry/windowgeometry.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Christian Mangold
  • Date: 2011-04-03 16:54:55 UTC
  • mfrom: (1.1.55 upstream)
  • Revision ID: james.westby@ubuntu.com-20110403165455-8tnwxt82p21p15hh
Tags: 4:4.6.2a-0ubuntu1
* New upstream release
  - Update kde-sc-dev-latest version
  - Update kdebase-workspace-wallpapers.install,
    kde-window-manager.install and not-installed

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
    iAmActivated = true;
36
36
    iAmActive = false;
37
37
    myResizeWindow = 0L;
38
 
    myResizeString =   i18nc("Window geometry display, %1 and %2 are the new size,"
39
 
                             " %3 and %4 are pixel increments - avoid reformatting or suffixes like 'px'", 
40
 
                             "Width: %1 (%3)\nHeight: %2 (%4)");
41
 
    myCoordString[0] = i18nc("Window geometry display, %1 and %2 are the cartesian x and y coordinates"
42
 
                             " - avoid reformatting or suffixes like 'px'", 
43
 
                             "X: %1\nY: %2");
44
 
    myCoordString[1] = i18nc("Window geometry display, %1 and %2 are the cartesian x and y coordinates,"
45
 
                             " %3 and %4 are the resp. increments - avoid reformatting or suffixes like 'px'", 
46
 
                             "X: %1 (%3)\nY: %2 (%4)");
 
38
#define myResizeString "Window geometry display, %1 and %2 are the new size," \
 
39
                       " %3 and %4 are pixel increments - avoid reformatting or suffixes like 'px'", \
 
40
                       "Width: %1 (%3)\nHeight: %2 (%4)"
 
41
#define myCoordString_0 "Window geometry display, %1 and %2 are the cartesian x and y coordinates" \
 
42
                        " - avoid reformatting or suffixes like 'px'", \
 
43
                        "X: %1\nY: %2"
 
44
#define myCoordString_1 "Window geometry display, %1 and %2 are the cartesian x and y coordinates," \
 
45
                        " %3 and %4 are the resp. increments - avoid reformatting or suffixes like 'px'", \
 
46
                        "X: %1 (%3)\nY: %2 (%4)"
47
47
    reconfigure( ReconfigureAll );
48
48
    QFont fnt; fnt.setBold(true); fnt.setPointSize(12);
49
49
    for ( int i = 0; i < 3; ++i )
141
141
    
142
142
        // upper left ----------------------
143
143
        if ( w->isUserResize() )
144
 
            myMeasure[0]->setText( myCoordString[1].arg( r.x() ).arg( r.y() ).arg( number(dx) ).arg( number(dy) ) );
 
144
            myMeasure[0]->setText( i18nc(myCoordString_1, r.x(), r.y(), number(dx), number(dy) ) );
145
145
        else
146
 
            myMeasure[0]->setText( myCoordString[0].arg( r.x() ).arg( r.y() ) );
 
146
            myMeasure[0]->setText( i18nc(myCoordString_0, r.x(), r.y() ) );
147
147
        myMeasure[0]->setPosition( geometry.topLeft() );
148
148
        
149
149
        // center ----------------------
155
155
        
156
156
            // TODO: i hate this. anyone got a nice idea to invoke the stringbuilder or otherwise avoid
157
157
            // dogslow QString::arg() system here?
158
 
            myMeasure[1]->setText( myResizeString.arg( r.width() ).arg( r.height() ).arg( number(dx) ).arg( number(dy) ) );
 
158
            // I think is better than using QString:arg(), right?
 
159
            myMeasure[1]->setText( i18nc(myResizeString, r.width(), r.height(), number(dx), number(dy) ) );
159
160
            
160
161
            // calc width for bottomright element, superflous otherwise
161
162
            dx = r.right() - r2.right();
162
163
            dy = r.bottom() - r2.bottom();
163
164
            }
164
165
        else
165
 
            myMeasure[1]->setText( myCoordString[0].arg( number(dx) ).arg( number(dy) ) );
 
166
            myMeasure[1]->setText( i18nc(myCoordString_0, number(dx), number(dy) ) );
166
167
 
167
168
        myMeasure[1]->setPosition( geometry.center() );
168
169
 
169
170
        // lower right ----------------------
170
171
        if ( w->isUserResize() )
171
 
            myMeasure[2]->setText( myCoordString[1].arg( r.right() ).arg( r.bottom() ).arg( number(dx) ).arg( number(dy) ) );
 
172
            myMeasure[2]->setText( i18nc(myCoordString_1, r.right(), r.bottom(), number(dx), number(dy) ) );
172
173
        else
173
 
            myMeasure[2]->setText( myCoordString[0].arg( r.right() ).arg( r.bottom() ) );
 
174
            myMeasure[2]->setText( i18nc(myCoordString_0, r.right(), r.bottom() ) );
174
175
        myMeasure[2]->setPosition( geometry.bottomRight() );
175
176
 
176
177
        effects->addRepaint( geometry.adjusted(-20, -20, 20, 20) );