80 QFont smallerFont = font();
81 smallerFont.setPointSize( smallerFont.pointSize() - 1 );
83 setFocusPolicy(Qt::StrongFocus);
99 Q3GridLayout* mainGrid =
new Q3GridLayout(
this, 3, 3, 0 );
100 mainGrid->addWidget( photoFrame, 0, 1 );
101 mainGrid->setRowStretch(0, 1);
102 mainGrid->addMultiCellWidget( controlsFrame, 1,1, 0,2 );
122 Q3GridLayout* selectionGrid =
new Q3GridLayout( photoFrame, 1, 5, 0 );
124 selectionGrid->addWidget(
previousButton, 0, 1, Qt::AlignCenter );
126 selectionGrid->setColStretch( 2, 1 );
127 selectionGrid->addWidget(
nextButton, 0, 3, Qt::AlignCenter );
132 Q3HGroupBox* frameControls =
new Q3HGroupBox( tr(
"Frame"), controlsFrame,
"frameControls" );
133 frameControls->setAlignment( Qt::AlignHCenter );
136 Q3HGroupBox* enhanceControls =
new Q3HGroupBox( tr(
"Enhance"), controlsFrame,
"enhanceControls" );
137 enhanceControls->setAlignment( Qt::AlignHCenter );
140 Q3HGroupBox* manipulateControls =
new Q3HGroupBox( tr(
"Manipulate"), controlsFrame,
"applyEffect" );
141 manipulateControls->setAlignment( Qt::AlignHCenter );
145 Q3GridLayout* controlsGrid =
new Q3GridLayout( controlsFrame, 1, 5, 0 );
146 controlsGrid->addWidget( frameControls, 0, 1 );
147 controlsGrid->addWidget( enhanceControls, 0, 2 );
148 controlsGrid->addWidget( manipulateControls, 0, 3 );
152 controlsGrid->setColStretch(0, 1);
154 controlsGrid->setColStretch(4, 1);
165 QToolButton* rotateRightButton =
new QToolButton( rotateFlipFrame,
"rotateRight" );
166 rotateRightButton->setIconSet( QPixmap(QString(
IMAGE_PATH)+
"buttonIcons/rotate90.png") );
167 rotateRightButton->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
168 connect( rotateRightButton, SIGNAL(clicked()), SLOT(
rotateRight()) );
169 QToolTip::add( rotateRightButton, tr(
"Rotate clockwise") );
171 QToolButton* rotateLeftButton =
new QToolButton( rotateFlipFrame,
"rotateLeft" );
172 rotateLeftButton->setIconSet( QPixmap(QString(
IMAGE_PATH)+
"buttonIcons/rotate270.png") );
173 rotateLeftButton->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
174 connect( rotateLeftButton, SIGNAL(clicked()), SLOT(
rotateLeft()) );
175 QToolTip::add( rotateLeftButton, tr(
"Rotate counterclockwise") );
177 QToolButton* flipHorizontalButton =
new QToolButton( rotateFlipFrame,
"flipHorizontal" );
178 flipHorizontalButton->setIconSet( QPixmap(QString(
IMAGE_PATH)+
"buttonIcons/flipHorizontally.png") );
179 flipHorizontalButton->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
180 connect( flipHorizontalButton, SIGNAL(clicked()), SLOT(
flipHorizontal()) );
181 QToolTip::add( flipHorizontalButton, tr(
"Flip horizontally") );
183 QToolButton* flipVerticalButton =
new QToolButton( rotateFlipFrame,
"flipVertical" );
184 flipVerticalButton->setIconSet( QPixmap(QString(
IMAGE_PATH)+
"buttonIcons/flipVertically.png") );
185 flipVerticalButton->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
186 connect( flipVerticalButton, SIGNAL(clicked()), SLOT(
flipVertical()) );
187 QToolTip::add( flipVerticalButton, tr(
"Flip vertically") );
201 Q3GridLayout* rotateFlipGrid =
new Q3GridLayout( rotateFlipFrame, 1, 5, 0 );
203 rotateFlipGrid->addWidget( rotateRightButton, 0, 0 );
204 rotateFlipGrid->addWidget( rotateLeftButton, 0, 1 );
205 rotateFlipGrid->addWidget( flipHorizontalButton, 0, 2 );
206 rotateFlipGrid->addWidget( flipVerticalButton, 0, 3 );
215 int curAspectRatio = 0;
254 QToolTip::add(
aspectRatios, tr(
"Select region for cropping using a particular aspect ratio") );
256 QLabel* aspectRatioLabel =
new QLabel( tr(
"Aspect Ratio"), frameControlsFrame );
257 aspectRatioLabel->setFont( smallerFont );
261 cropButton =
new QToolButton( frameControlsFrame );
263 cropIcon.setPixmap( QString(
IMAGE_PATH)+
"buttonIcons/crop.png",
267 cropIcon.setPixmap( QString(
IMAGE_PATH)+
"buttonIcons/crop_disabled.png",
272 QToolTip::add(
cropButton, tr(
"Crop photo to selected region") );
274 QLabel* cropLabel =
new QLabel( tr(
"Crop"), frameControlsFrame );
275 cropLabel->setFont( smallerFont );
280 Q3GridLayout* frameControlsGrid =
new Q3GridLayout( frameControlsFrame, 3, 2, 0 );
282 frameControlsGrid->addMultiCellWidget( rotateFlipFrame, 0,0, 0,1 );
283 frameControlsGrid->addWidget(
aspectRatios, 1, 0, Qt::AlignHCenter );
284 frameControlsGrid->addWidget(
cropButton, 1, 1, Qt::AlignHCenter );
285 frameControlsGrid->addWidget( aspectRatioLabel, 2, 0, Qt::AlignHCenter );
286 frameControlsGrid->addWidget( cropLabel, 2, 1, Qt::AlignHCenter );
294 int numLargeButtons = 3;
295 int curButtonIndex=0;
301 Q3Frame* autoEnhanceControlsFrame =
new Q3Frame( enhanceControlsFrame );
304 ClickableLabel* enhanceColorButton = largeButtons[curButtonIndex] =
306 largeButtons[curButtonIndex]->
setPixmap( QPixmap(QString(
IMAGE_PATH)+
"buttonIcons/improveColorBalance.png") );
307 connect( largeButtons[curButtonIndex], SIGNAL(clicked()), SLOT(
colorBalance()) );
308 QToolTip::add( largeButtons[curButtonIndex], tr(
"Enhance color balance") );
311 QLabel* enhanceColorLabel =
new QLabel( tr(
"Color"), autoEnhanceControlsFrame );
312 enhanceColorLabel->setFont( smallerFont );
315 ClickableLabel* enhanceContrastButton = largeButtons[curButtonIndex] =
317 largeButtons[curButtonIndex]->
setPixmap( QPixmap(QString(
IMAGE_PATH)+
"buttonIcons/enhanceContrast.png") );
318 connect( largeButtons[curButtonIndex], SIGNAL(clicked()), SLOT(
enhanceContrast()) );
319 QToolTip::add( largeButtons[curButtonIndex], tr(
"Enhance contrast") );
322 QLabel* enhanceContrastLabel =
new QLabel( tr(
"Contrast"), autoEnhanceControlsFrame );
323 enhanceContrastLabel->setFont( smallerFont );
329 largeButtons[curButtonIndex]->
setPixmap( QPixmap( QString(
IMAGE_PATH)+
"buttonIcons/redEyeReduction.png" ) );
330 connect( largeButtons[curButtonIndex], SIGNAL(clicked()), SLOT(
removeRedeye()) );
331 QToolTip::add( largeButtons[curButtonIndex], tr(
"Remove red-eye") );
334 QLabel* removeRedyEyeLabel =
new QLabel( tr(
"Red Eye"), autoEnhanceControlsFrame );
335 removeRedyEyeLabel->setFont( smallerFont );
338 Q3GridLayout* autoEnhanceControlsGrid =
new Q3GridLayout( autoEnhanceControlsFrame, 2, 3, 0 );
340 autoEnhanceControlsGrid->addWidget( enhanceColorButton, 0, 0, Qt::AlignHCenter );
341 autoEnhanceControlsGrid->addWidget( enhanceColorLabel, 1, 0, Qt::AlignHCenter );
343 autoEnhanceControlsGrid->addWidget( enhanceContrastButton, 0, 1, Qt::AlignHCenter );
344 autoEnhanceControlsGrid->addWidget( enhanceContrastLabel, 1, 1, Qt::AlignHCenter );
347 autoEnhanceControlsGrid->addWidget( removeRedyEyeLabel, 1, 2, Qt::AlignHCenter );
350 Q3Frame* manualEnhanceControlsFrame =
new Q3Frame( enhanceControlsFrame );
355 connect( tuneLevelsButton, SIGNAL(clicked()), SLOT(
tuneLevels()) );
356 QToolTip::add( tuneLevelsButton, tr(
"Fine tune brightness, contrast, and colors") );
358 QLabel* tuneLevelsLabel =
new QLabel( tr(
"Levels..."), manualEnhanceControlsFrame );
359 tuneLevelsLabel->setFont( smallerFont );
363 adjustGrainButton->
setPixmap( QPixmap(QString(
IMAGE_PATH)+
"buttonIcons/adjustGrain.png") );
364 connect( adjustGrainButton, SIGNAL(clicked()), SLOT(
adjustGrain()) );
365 QToolTip::add( adjustGrainButton, tr(
"Blur or sharpen image") );
367 QLabel* adjustGrainLabel =
new QLabel( tr(
"Grain..."), manualEnhanceControlsFrame );
368 adjustGrainLabel->setFont( smallerFont );
371 Q3GridLayout* manualEnhanceControlsGrid =
new Q3GridLayout( manualEnhanceControlsFrame, 2, 3, 0 );
373 manualEnhanceControlsGrid->addWidget( tuneLevelsButton, 0, 0, Qt::AlignHCenter );
374 manualEnhanceControlsGrid->addWidget( tuneLevelsLabel, 1, 0, Qt::AlignHCenter );
376 manualEnhanceControlsGrid->addWidget( adjustGrainButton, 0, 2, Qt::AlignHCenter );
377 manualEnhanceControlsGrid->addWidget( adjustGrainLabel, 1, 2, Qt::AlignHCenter );
381 Q3GridLayout* enhanceControlsGrid =
new Q3GridLayout( enhanceControlsFrame, 4, 2, 0 );
383 enhanceControlsGrid->addWidget( autoEnhanceControlsFrame, 0, 0, Qt::AlignHCenter );
384 enhanceControlsGrid->addWidget( manualEnhanceControlsFrame, 1, 0, Qt::AlignHCenter );
385 enhanceControlsGrid->setRowStretch( 0, 1 );
386 enhanceControlsGrid->setRowStretch( 3, 1 );
391 Q3Frame* manipulateControlsFrame =
new Q3Frame( manipulateControls,
"manipulateControlsFrame" );
394 effectsList =
new QComboBox( manipulateControlsFrame );
422 Q3GridLayout* manipulateControlsGrid =
new Q3GridLayout( manipulateControlsFrame, 2, 2, 0 );
424 manipulateControlsGrid->addWidget(
effectsList, 0, 0 );
426 manipulateControlsGrid->addMultiCellWidget(
effectPreview, 0,1, 1,1, Qt::AlignHCenter );
430 manipulateControlsGrid->setColSpacing(1, 85 );