Changeset View
Standalone View
ui/annotationwidgets.cpp
Show All 19 Lines | |||||
20 | #include <kcombobox.h> | 20 | #include <kcombobox.h> | ||
21 | #include <kfontrequester.h> | 21 | #include <kfontrequester.h> | ||
22 | #include <QIcon> | 22 | #include <QIcon> | ||
23 | #include <kiconloader.h> | 23 | #include <kiconloader.h> | ||
24 | #include <KLocalizedString> | 24 | #include <KLocalizedString> | ||
25 | #include <QDebug> | 25 | #include <QDebug> | ||
26 | #include <QMimeDatabase> | 26 | #include <QMimeDatabase> | ||
27 | #include <KFormat> | 27 | #include <KFormat> | ||
28 | #include <QFormLayout> | ||||
28 | 29 | | |||
29 | #include "core/document.h" | 30 | #include "core/document.h" | ||
30 | #include "guiutils.h" | 31 | #include "guiutils.h" | ||
31 | 32 | | |||
32 | #define FILEATTACH_ICONSIZE 48 | 33 | #define FILEATTACH_ICONSIZE 48 | ||
33 | 34 | | |||
34 | PixmapPreviewSelector::PixmapPreviewSelector( QWidget * parent ) | 35 | PixmapPreviewSelector::PixmapPreviewSelector( QWidget * parent ) | ||
35 | : QWidget( parent ) | 36 | : QWidget( parent ) | ||
▲ Show 20 Lines • Show All 160 Lines • ▼ Show 20 Line(s) | 196 | if (m_opacity) | |||
196 | m_ann->style().setOpacity( (double)m_opacity->value() / 100.0 ); | 197 | m_ann->style().setOpacity( (double)m_opacity->value() / 100.0 ); | ||
197 | } | 198 | } | ||
198 | 199 | | |||
199 | QWidget * AnnotationWidget::createAppearanceWidget() | 200 | QWidget * AnnotationWidget::createAppearanceWidget() | ||
200 | { | 201 | { | ||
201 | QWidget * widget = new QWidget(); | 202 | QWidget * widget = new QWidget(); | ||
202 | QGridLayout * gridlayout = new QGridLayout( widget ); | 203 | QGridLayout * gridlayout = new QGridLayout( widget ); | ||
203 | if ( hasColorButton() ) | 204 | if ( hasColorButton() ) | ||
204 | { | 205 | { | ||
simgunz: Is it correct to set this growth policy? I have not found any guideline on the HIG. Compared to… | |||||
For this one, FieldsStayAtSizeHint might be better, and then we just set sensible sizehints for anything that winds up too small. That's basically what we're doing for all our QML software. In general we're trying to move towards making the controls optimally sized in the first place and then static in size when the window grows or shrinks. We often manually set the width of spinboxes, comboboxes, and text fields to make sure they're all the same width. ngraham: For this one, `FieldsStayAtSizeHint` might be better, and then we just set sensible sizehints… | |||||
Let's not have static sizes, this is not a phone screen where you can't resize windows. aacid: Let's not have static sizes, this is not a phone screen where you can't resize windows. | |||||
205 | QLabel * tmplabel = new QLabel( i18n( "&Color:" ), widget ); | 206 | QLabel * tmplabel = new QLabel( i18n( "&Color:" ), widget ); | ||
206 | gridlayout->addWidget( tmplabel, 0, 0, Qt::AlignRight ); | 207 | gridlayout->addWidget( tmplabel, 0, 0, Qt::AlignRight ); | ||
207 | m_colorBn = new KColorButton( widget ); | 208 | m_colorBn = new KColorButton( widget ); | ||
208 | m_colorBn->setColor( m_ann->style().color() ); | 209 | m_colorBn->setColor( m_ann->style().color() ); | ||
209 | tmplabel->setBuddy( m_colorBn ); | 210 | tmplabel->setBuddy( m_colorBn ); | ||
210 | gridlayout->addWidget( m_colorBn, 0, 1 ); | 211 | gridlayout->addWidget( m_colorBn, 0, 1 ); | ||
211 | } | 212 | } | ||
212 | if ( hasOpacityBox() ) | 213 | if ( hasOpacityBox() ) | ||
213 | { | 214 | { | ||
214 | QLabel * tmplabel = new QLabel( i18n( "&Opacity:" ), widget ); | 215 | QLabel * tmplabel = new QLabel( i18n( "&Opacity:" ), widget ); | ||
215 | gridlayout->addWidget( tmplabel, 1, 0, Qt::AlignRight ); | 216 | gridlayout->addWidget( tmplabel, 1, 0, Qt::AlignRight ); | ||
216 | m_opacity = new QSpinBox( widget ); | 217 | m_opacity = new QSpinBox( widget ); | ||
217 | m_opacity->setRange( 0, 100 ); | 218 | m_opacity->setRange( 0, 100 ); | ||
218 | m_opacity->setValue( (int)( m_ann->style().opacity() * 100 ) ); | 219 | m_opacity->setValue( (int)( m_ann->style().opacity() * 100 ) ); | ||
219 | m_opacity->setSuffix( i18nc( "Suffix for the opacity level, eg '80 %'", " %" ) ); | 220 | m_opacity->setSuffix( i18nc( "Suffix for the opacity level, eg '80 %'", " %" ) ); | ||
220 | tmplabel->setBuddy( m_opacity ); | 221 | tmplabel->setBuddy( m_opacity ); | ||
221 | gridlayout->addWidget( m_opacity, 1, 1 ); | 222 | gridlayout->addWidget( m_opacity, 1, 1 ); | ||
222 | } | 223 | } | ||
223 | 224 | | |||
224 | QWidget * styleWidget = createStyleWidget(); | 225 | createStyleWidget(gridlayout); | ||
225 | if ( styleWidget ) | | |||
226 | gridlayout->addWidget( styleWidget, 2, 0, 1, 2 ); | | |||
227 | 226 | | |||
228 | gridlayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Fixed, QSizePolicy::MinimumExpanding ), 3, 0 ); | 227 | gridlayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Fixed, QSizePolicy::MinimumExpanding ), | ||
228 | gridlayout->rowCount()+1, 0 ); | ||||
229 | 229 | | |||
230 | if ( m_colorBn ) | 230 | if ( m_colorBn ) | ||
231 | connect( m_colorBn, &KColorButton::changed, this, &AnnotationWidget::dataChanged ); | 231 | connect( m_colorBn, &KColorButton::changed, this, &AnnotationWidget::dataChanged ); | ||
232 | if ( m_opacity ) | 232 | if ( m_opacity ) | ||
233 | connect( m_opacity, SIGNAL(valueChanged(int)), this, SIGNAL(dataChanged()) ); | 233 | connect( m_opacity, SIGNAL(valueChanged(int)), this, SIGNAL(dataChanged()) ); | ||
234 | 234 | | |||
235 | return widget; | 235 | return widget; | ||
236 | } | 236 | } | ||
237 | 237 | | |||
238 | QWidget * AnnotationWidget::createStyleWidget() | 238 | void AnnotationWidget::createStyleWidget(QGridLayout * gridLayout) | ||
239 | { | 239 | { | ||
240 | return nullptr; | 240 | Q_UNUSED( gridLayout ); | ||
241 | } | 241 | } | ||
242 | 242 | | |||
243 | QWidget * AnnotationWidget::createExtraWidget() | 243 | QWidget * AnnotationWidget::createExtraWidget() | ||
244 | { | 244 | { | ||
245 | return nullptr; | 245 | return nullptr; | ||
246 | } | 246 | } | ||
247 | 247 | | |||
248 | 248 | | |||
249 | TextAnnotationWidget::TextAnnotationWidget( Okular::Annotation * ann ) | 249 | TextAnnotationWidget::TextAnnotationWidget( Okular::Annotation * ann ) | ||
250 | : AnnotationWidget( ann ) | 250 | : AnnotationWidget( ann ) | ||
251 | { | 251 | { | ||
252 | m_textAnn = static_cast< Okular::TextAnnotation * >( ann ); | 252 | m_textAnn = static_cast< Okular::TextAnnotation * >( ann ); | ||
253 | } | 253 | } | ||
254 | 254 | | |||
255 | QWidget * TextAnnotationWidget::createStyleWidget() | 255 | void TextAnnotationWidget::createStyleWidget(QGridLayout * gridLayout) | ||
256 | { | 256 | { | ||
257 | QWidget * widget = new QWidget(); | 257 | QWidget * widget = (QWidget*)gridLayout->parent(); | ||
258 | QVBoxLayout * layout = new QVBoxLayout( widget ); | | |||
259 | layout->setMargin( 0 ); | | |||
260 | 258 | | |||
261 | if ( m_textAnn->textType() == Okular::TextAnnotation::Linked ) | 259 | if ( m_textAnn->textType() == Okular::TextAnnotation::Linked ) | ||
262 | { | 260 | { | ||
263 | createPopupNoteStyleUi( widget, layout ); | 261 | createPopupNoteStyleUi( widget, gridLayout ); | ||
264 | } | 262 | } | ||
265 | else if ( m_textAnn->textType() == Okular::TextAnnotation::InPlace ) | 263 | else if ( m_textAnn->textType() == Okular::TextAnnotation::InPlace ) | ||
266 | { | 264 | { | ||
267 | if ( isTypewriter() ) | 265 | if ( isTypewriter() ) | ||
268 | createTypewriterStyleUi( widget, layout ); | 266 | createTypewriterStyleUi( widget, gridLayout ); | ||
269 | else | 267 | else | ||
270 | createInlineNoteStyleUi( widget, layout ); | 268 | createInlineNoteStyleUi( widget, gridLayout ); | ||
271 | } | 269 | } | ||
272 | | ||||
273 | return widget; | | |||
274 | } | 270 | } | ||
275 | 271 | | |||
276 | bool TextAnnotationWidget::hasColorButton() const { | 272 | bool TextAnnotationWidget::hasColorButton() const { | ||
277 | return !isTypewriter(); | 273 | return !isTypewriter(); | ||
278 | } | 274 | } | ||
279 | 275 | | |||
280 | bool TextAnnotationWidget::hasOpacityBox() const { | 276 | bool TextAnnotationWidget::hasOpacityBox() const { | ||
281 | return !isTypewriter(); | 277 | return !isTypewriter(); | ||
Show All 20 Lines | 289 | { | |||
302 | else | 298 | else | ||
303 | { | 299 | { | ||
304 | Q_ASSERT( m_textColorBn ); | 300 | Q_ASSERT( m_textColorBn ); | ||
305 | m_textAnn->setTextColor( m_textColorBn->color() ); | 301 | m_textAnn->setTextColor( m_textColorBn->color() ); | ||
306 | } | 302 | } | ||
307 | } | 303 | } | ||
308 | } | 304 | } | ||
309 | 305 | | |||
310 | void TextAnnotationWidget::createPopupNoteStyleUi( QWidget * widget, QVBoxLayout * layout ) { | 306 | void TextAnnotationWidget::createPopupNoteStyleUi( QWidget * widget, QGridLayout * gridLayout ) { | ||
311 | QGroupBox * gb = new QGroupBox( widget ); | 307 | addPixmapSelector( widget, gridLayout ); | ||
312 | layout->addWidget( gb ); | 308 | } | ||
313 | QHBoxLayout * gblay = new QHBoxLayout( gb ); | 309 | | ||
314 | gb->setTitle( i18n( "Icon" ) ); | 310 | void TextAnnotationWidget::createInlineNoteStyleUi( QWidget * widget, QGridLayout * gridLayout ) { | ||
315 | addPixmapSelector( gb, gblay ); | 311 | addFontRequester( widget, gridLayout ); | ||
316 | } | 312 | addTextAlignComboBox( widget, gridLayout ); | ||
317 | 313 | addWidthSpinBox( widget, gridLayout ); | |||
318 | void TextAnnotationWidget::createInlineNoteStyleUi( QWidget * widget, QVBoxLayout * layout ) { | 314 | } | ||
319 | QGridLayout * innerlay = new QGridLayout(); | 315 | | ||
320 | layout->addLayout( innerlay ); | 316 | void TextAnnotationWidget::createTypewriterStyleUi( QWidget * widget, QGridLayout * gridLayout ) { | ||
321 | addFontRequester( widget, innerlay ); | 317 | addFontRequester( widget, gridLayout ); | ||
322 | addTextAlignComboBox( widget, innerlay ); | 318 | addTextColorButton( widget, gridLayout ); | ||
323 | addWidthSpinBox( widget, innerlay ); | | |||
324 | } | | |||
325 | | ||||
326 | void TextAnnotationWidget::createTypewriterStyleUi( QWidget * widget, QVBoxLayout * layout ) { | | |||
327 | QGridLayout * innerlay = new QGridLayout(); | | |||
328 | layout->addLayout( innerlay ); | | |||
329 | addFontRequester( widget, innerlay ); | | |||
330 | addTextColorButton( widget, innerlay ); | | |||
331 | } | 319 | } | ||
332 | 320 | | |||
333 | void TextAnnotationWidget::addPixmapSelector( QWidget * widget, QLayout * layout ) | 321 | void TextAnnotationWidget::addPixmapSelector( QWidget * widget, QGridLayout * gridLayout ) | ||
334 | { | 322 | { | ||
323 | const int row = gridLayout->rowCount(); | ||||
324 | QLabel * icon = new QLabel(i18n( "Icon:" ), widget); | ||||
325 | gridLayout->addWidget(icon, row, 0, Qt::AlignRight); | ||||
335 | m_pixmapSelector = new PixmapPreviewSelector( widget ); | 326 | m_pixmapSelector = new PixmapPreviewSelector( widget ); | ||
336 | layout->addWidget( m_pixmapSelector ); | 327 | gridLayout->addWidget( m_pixmapSelector, row, 1 ); | ||
337 | m_pixmapSelector->addItem( i18n( "Comment" ), QStringLiteral("Comment") ); | 328 | m_pixmapSelector->addItem( i18n( "Comment" ), QStringLiteral("Comment") ); | ||
338 | m_pixmapSelector->addItem( i18n( "Help" ), QStringLiteral("Help") ); | 329 | m_pixmapSelector->addItem( i18n( "Help" ), QStringLiteral("Help") ); | ||
339 | m_pixmapSelector->addItem( i18n( "Insert" ), QStringLiteral("Insert") ); | 330 | m_pixmapSelector->addItem( i18n( "Insert" ), QStringLiteral("Insert") ); | ||
340 | m_pixmapSelector->addItem( i18n( "Key" ), QStringLiteral("Key") ); | 331 | m_pixmapSelector->addItem( i18n( "Key" ), QStringLiteral("Key") ); | ||
341 | m_pixmapSelector->addItem( i18n( "New Paragraph" ), QStringLiteral("NewParagraph") ); | 332 | m_pixmapSelector->addItem( i18n( "New paragraph" ), QStringLiteral("NewParagraph") ); | ||
342 | m_pixmapSelector->addItem( i18n( "Note" ), QStringLiteral("Note") ); | 333 | m_pixmapSelector->addItem( i18n( "Note" ), QStringLiteral("Note") ); | ||
343 | m_pixmapSelector->addItem( i18n( "Paragraph" ), QStringLiteral("Paragraph") ); | 334 | m_pixmapSelector->addItem( i18n( "Paragraph" ), QStringLiteral("Paragraph") ); | ||
344 | m_pixmapSelector->setIcon( m_textAnn->textIcon() ); | 335 | m_pixmapSelector->setIcon( m_textAnn->textIcon() ); | ||
345 | connect( m_pixmapSelector, &PixmapPreviewSelector::iconChanged, this, &AnnotationWidget::dataChanged ); | 336 | connect( m_pixmapSelector, &PixmapPreviewSelector::iconChanged, this, &AnnotationWidget::dataChanged ); | ||
346 | } | 337 | } | ||
347 | 338 | | |||
348 | void TextAnnotationWidget::addFontRequester( QWidget * widget, QGridLayout * layout ) | 339 | void TextAnnotationWidget::addFontRequester( QWidget * widget, QGridLayout * gridLayout ) | ||
349 | { | 340 | { | ||
350 | const int row = layout->rowCount(); | 341 | const int row = gridLayout->rowCount(); | ||
351 | QLabel * tmplabel = new QLabel( i18n( "Font:" ), widget ); | 342 | QLabel * tmplabel = new QLabel( i18n( "Font:" ), widget ); | ||
352 | layout->addWidget( tmplabel, row, 0 ); | 343 | gridLayout->addWidget( tmplabel, row, 0 , Qt::AlignRight ); | ||
353 | m_fontReq = new KFontRequester( widget ); | 344 | m_fontReq = new KFontRequester( widget ); | ||
354 | layout->addWidget( m_fontReq, row, 1 ); | 345 | tmplabel->setBuddy( m_fontReq ); | ||
346 | gridLayout->addWidget( m_fontReq, row, 1 ); | ||||
355 | m_fontReq->setFont( m_textAnn->textFont() ); | 347 | m_fontReq->setFont( m_textAnn->textFont() ); | ||
356 | connect( m_fontReq, &KFontRequester::fontSelected, this, &AnnotationWidget::dataChanged ); | 348 | connect( m_fontReq, &KFontRequester::fontSelected, this, &AnnotationWidget::dataChanged ); | ||
357 | } | 349 | } | ||
358 | 350 | | |||
359 | void TextAnnotationWidget::addTextColorButton( QWidget * widget, QGridLayout * layout ) | 351 | void TextAnnotationWidget::addTextColorButton( QWidget * widget, QGridLayout * gridLayout ) | ||
360 | { | 352 | { | ||
361 | const int row = layout->rowCount(); | 353 | const int row = gridLayout->rowCount(); | ||
362 | QLabel * tmplabel = new QLabel( i18n( "&Text Color:" ), widget ); | 354 | QLabel * tmplabel = new QLabel( i18n( "&Text color:" ), widget ); | ||
363 | layout->addWidget( tmplabel, row, 0, Qt::AlignRight ); | 355 | gridLayout->addWidget( tmplabel, row, 0, Qt::AlignRight ); | ||
364 | m_textColorBn = new KColorButton( widget ); | 356 | m_textColorBn = new KColorButton( widget ); | ||
365 | m_textColorBn->setColor( m_textAnn->textColor() ); | 357 | m_textColorBn->setColor( m_textAnn->textColor() ); | ||
366 | tmplabel->setBuddy( m_textColorBn ); | 358 | tmplabel->setBuddy( m_textColorBn ); | ||
367 | layout->addWidget( m_textColorBn, row, 1 ); | 359 | gridLayout->addWidget( m_textColorBn, row, 1 ); | ||
368 | connect( m_textColorBn, &KColorButton::changed, this, &AnnotationWidget::dataChanged ); | 360 | connect( m_textColorBn, &KColorButton::changed, this, &AnnotationWidget::dataChanged ); | ||
369 | } | 361 | } | ||
370 | 362 | | |||
371 | void TextAnnotationWidget::addTextAlignComboBox( QWidget * widget, QGridLayout * layout ) | 363 | void TextAnnotationWidget::addTextAlignComboBox( QWidget * widget, QGridLayout * gridLayout ) | ||
372 | { | 364 | { | ||
373 | const int row = layout->rowCount(); | 365 | const int row = gridLayout->rowCount(); | ||
374 | QLabel * tmplabel = new QLabel( i18n( "Align:" ), widget ); | 366 | QLabel * tmplabel = new QLabel( i18n( "Align:" ), widget ); | ||
375 | layout->addWidget( tmplabel, row, 0 ); | 367 | gridLayout->addWidget( tmplabel, row, 0, Qt::AlignRight ); | ||
376 | m_textAlign = new KComboBox( widget ); | 368 | m_textAlign = new KComboBox( widget ); | ||
377 | layout->addWidget( m_textAlign, row, 1 ); | 369 | tmplabel->setBuddy( m_textAlign ); | ||
370 | gridLayout->addWidget( m_textAlign, row, 1 ); | ||||
378 | m_textAlign->addItem( i18n("Left") ); | 371 | m_textAlign->addItem( i18n("Left") ); | ||
379 | m_textAlign->addItem( i18n("Center") ); | 372 | m_textAlign->addItem( i18n("Center") ); | ||
380 | m_textAlign->addItem( i18n("Right") ); | 373 | m_textAlign->addItem( i18n("Right") ); | ||
381 | m_textAlign->setCurrentIndex( m_textAnn->inplaceAlignment() ); | 374 | m_textAlign->setCurrentIndex( m_textAnn->inplaceAlignment() ); | ||
382 | connect( m_textAlign, SIGNAL(currentIndexChanged(int)), this, SIGNAL(dataChanged()) ); | 375 | connect( m_textAlign, SIGNAL(currentIndexChanged(int)), this, SIGNAL(dataChanged()) ); | ||
383 | } | 376 | } | ||
384 | 377 | | |||
385 | void TextAnnotationWidget::addWidthSpinBox( QWidget * widget, QGridLayout * layout ) | 378 | void TextAnnotationWidget::addWidthSpinBox( QWidget * widget, QGridLayout * gridLayout ) | ||
386 | { | 379 | { | ||
387 | const int row = layout->rowCount(); | 380 | const int row = gridLayout->rowCount(); | ||
388 | QLabel * tmplabel = new QLabel( i18n( "Border Width:" ), widget ); | 381 | QLabel * tmplabel = new QLabel( i18n( "Border width:" ), widget ); | ||
389 | layout->addWidget( tmplabel, row, 0, Qt::AlignRight ); | 382 | gridLayout->addWidget( tmplabel, row, 0, Qt::AlignRight ); | ||
390 | m_spinWidth = new QDoubleSpinBox( widget ); | 383 | m_spinWidth = new QDoubleSpinBox( widget ); | ||
391 | layout->addWidget( m_spinWidth, row, 1 ); | | |||
392 | tmplabel->setBuddy( m_spinWidth ); | 384 | tmplabel->setBuddy( m_spinWidth ); | ||
385 | gridLayout->addWidget( m_spinWidth, row, 1 ); | ||||
393 | m_spinWidth->setRange( 0, 100 ); | 386 | m_spinWidth->setRange( 0, 100 ); | ||
394 | m_spinWidth->setValue( m_textAnn->style().width() ); | 387 | m_spinWidth->setValue( m_textAnn->style().width() ); | ||
395 | m_spinWidth->setSingleStep( 0.1 ); | 388 | m_spinWidth->setSingleStep( 0.1 ); | ||
396 | connect( m_spinWidth, SIGNAL(valueChanged(double)), this, SIGNAL(dataChanged()) ); | 389 | connect( m_spinWidth, SIGNAL(valueChanged(double)), this, SIGNAL(dataChanged()) ); | ||
397 | } | 390 | } | ||
398 | 391 | | |||
399 | StampAnnotationWidget::StampAnnotationWidget( Okular::Annotation * ann ) | 392 | StampAnnotationWidget::StampAnnotationWidget( Okular::Annotation * ann ) | ||
400 | : AnnotationWidget( ann ), m_pixmapSelector( nullptr ) | 393 | : AnnotationWidget( ann ), m_pixmapSelector( nullptr ) | ||
401 | { | 394 | { | ||
402 | m_stampAnn = static_cast< Okular::StampAnnotation * >( ann ); | 395 | m_stampAnn = static_cast< Okular::StampAnnotation * >( ann ); | ||
403 | } | 396 | } | ||
404 | 397 | | |||
405 | QWidget * StampAnnotationWidget::createStyleWidget() | 398 | void StampAnnotationWidget::createStyleWidget(QGridLayout * gridLayout) | ||
406 | { | 399 | { | ||
407 | QWidget * widget = new QWidget(); | 400 | const int row = gridLayout->rowCount(); | ||
408 | QVBoxLayout * lay = new QVBoxLayout( widget ); | 401 | QWidget * widget = (QWidget*)gridLayout->parent(); | ||
409 | lay->setMargin( 0 ); | 402 | QLabel * tmplabel = new QLabel( i18n( "Stamp symbol:" ), widget ); | ||
davidhurka: Capitalize symbol? | |||||
KDE HIG prescribe sentence style capitalization for labels in a form layout: https://hig.kde.org/style/writing/capitalization.html simgunz: KDE HIG prescribe sentence style capitalization for labels in a form layout: https://hig.kde. | |||||
410 | QGroupBox * gb = new QGroupBox( widget ); | 403 | gridLayout->addWidget( tmplabel, row, 0, Qt::AlignRight); | ||
411 | lay->addWidget( gb ); | 404 | | ||
412 | gb->setTitle( i18n( "Stamp Symbol" ) ); | 405 | m_pixmapSelector = new PixmapPreviewSelector( widget ); | ||
413 | QHBoxLayout * gblay = new QHBoxLayout( gb ); | 406 | tmplabel->setBuddy( m_pixmapSelector ); | ||
414 | m_pixmapSelector = new PixmapPreviewSelector( gb ); | 407 | gridLayout->addWidget( m_pixmapSelector, row, 1 ); | ||
415 | gblay->addWidget( m_pixmapSelector ); | | |||
416 | m_pixmapSelector->setEditable( true ); | 408 | m_pixmapSelector->setEditable( true ); | ||
davidhurka: Why is this editable? Entering a path to an image does not work. | |||||
davidhurka: Read in the user documentatio that it theoretically works. | |||||
Sometimes works. :-) Try with a path to an icon. In any case I'll improve the Stamp tool soon, adding a 'select file' button. I have some code ready that I'll share soon. simgunz: Sometimes works. :-) Try with a path to an icon. In any case I'll improve the Stamp tool soon… | |||||
Once you do that, it will fix https://bugs.kde.org/show_bug.cgi?id=383652 :) ngraham: Once you do that, it will fix https://bugs.kde.org/show_bug.cgi?id=383652 :) | |||||
417 | 409 | | |||
418 | m_pixmapSelector->addItem( i18n( "Okular" ), QStringLiteral("okular") ); | 410 | m_pixmapSelector->addItem( i18n( "Okular" ), QStringLiteral("okular") ); | ||
419 | m_pixmapSelector->addItem( i18n( "Bookmark" ), QStringLiteral("bookmarks") ); | 411 | m_pixmapSelector->addItem( i18n( "Bookmark" ), QStringLiteral("bookmarks") ); | ||
420 | m_pixmapSelector->addItem( i18n( "KDE" ), QStringLiteral("kde") ); | 412 | m_pixmapSelector->addItem( i18n( "KDE" ), QStringLiteral("kde") ); | ||
421 | m_pixmapSelector->addItem( i18n( "Information" ), QStringLiteral("help-about") ); | 413 | m_pixmapSelector->addItem( i18n( "Information" ), QStringLiteral("help-about") ); | ||
422 | m_pixmapSelector->addItem( i18n( "Approved" ), QStringLiteral("Approved") ); | 414 | m_pixmapSelector->addItem( i18n( "Approved" ), QStringLiteral("Approved") ); | ||
423 | m_pixmapSelector->addItem( i18n( "As Is" ), QStringLiteral("AsIs") ); | 415 | m_pixmapSelector->addItem( i18n( "As Is" ), QStringLiteral("AsIs") ); | ||
424 | m_pixmapSelector->addItem( i18n( "Confidential" ), QStringLiteral("Confidential") ); | 416 | m_pixmapSelector->addItem( i18n( "Confidential" ), QStringLiteral("Confidential") ); | ||
425 | m_pixmapSelector->addItem( i18n( "Departmental" ), QStringLiteral("Departmental") ); | 417 | m_pixmapSelector->addItem( i18n( "Departmental" ), QStringLiteral("Departmental") ); | ||
426 | m_pixmapSelector->addItem( i18n( "Draft" ), QStringLiteral("Draft") ); | 418 | m_pixmapSelector->addItem( i18n( "Draft" ), QStringLiteral("Draft") ); | ||
427 | m_pixmapSelector->addItem( i18n( "Experimental" ), QStringLiteral("Experimental") ); | 419 | m_pixmapSelector->addItem( i18n( "Experimental" ), QStringLiteral("Experimental") ); | ||
428 | m_pixmapSelector->addItem( i18n( "Expired" ), QStringLiteral("Expired") ); | 420 | m_pixmapSelector->addItem( i18n( "Expired" ), QStringLiteral("Expired") ); | ||
429 | m_pixmapSelector->addItem( i18n( "Final" ), QStringLiteral("Final") ); | 421 | m_pixmapSelector->addItem( i18n( "Final" ), QStringLiteral("Final") ); | ||
430 | m_pixmapSelector->addItem( i18n( "For Comment" ), QStringLiteral("ForComment") ); | 422 | m_pixmapSelector->addItem( i18n( "For Comment" ), QStringLiteral("ForComment") ); | ||
431 | m_pixmapSelector->addItem( i18n( "For Public Release" ), QStringLiteral("ForPublicRelease") ); | 423 | m_pixmapSelector->addItem( i18n( "For Public Release" ), QStringLiteral("ForPublicRelease") ); | ||
432 | m_pixmapSelector->addItem( i18n( "Not Approved" ), QStringLiteral("NotApproved") ); | 424 | m_pixmapSelector->addItem( i18n( "Not Approved" ), QStringLiteral("NotApproved") ); | ||
433 | m_pixmapSelector->addItem( i18n( "Not For Public Release" ), QStringLiteral("NotForPublicRelease") ); | 425 | m_pixmapSelector->addItem( i18n( "Not For Public Release" ), QStringLiteral("NotForPublicRelease") ); | ||
434 | m_pixmapSelector->addItem( i18n( "Sold" ), QStringLiteral("Sold") ); | 426 | m_pixmapSelector->addItem( i18n( "Sold" ), QStringLiteral("Sold") ); | ||
435 | m_pixmapSelector->addItem( i18n( "Top Secret" ), QStringLiteral("TopSecret") ); | 427 | m_pixmapSelector->addItem( i18n( "Top Secret" ), QStringLiteral("TopSecret") ); | ||
436 | m_pixmapSelector->setIcon( m_stampAnn->stampIconName() ); | 428 | m_pixmapSelector->setIcon( m_stampAnn->stampIconName() ); | ||
437 | m_pixmapSelector->setPreviewSize( 64 ); | 429 | m_pixmapSelector->setPreviewSize( 64 ); | ||
438 | 430 | | |||
439 | connect( m_pixmapSelector, &PixmapPreviewSelector::iconChanged, this, &AnnotationWidget::dataChanged ); | 431 | connect( m_pixmapSelector, &PixmapPreviewSelector::iconChanged, this, &AnnotationWidget::dataChanged ); | ||
440 | | ||||
441 | return widget; | | |||
442 | } | 432 | } | ||
443 | 433 | | |||
444 | void StampAnnotationWidget::applyChanges() | 434 | void StampAnnotationWidget::applyChanges() | ||
445 | { | 435 | { | ||
446 | AnnotationWidget::applyChanges(); | 436 | AnnotationWidget::applyChanges(); | ||
447 | m_stampAnn->setStampIconName( m_pixmapSelector->icon() ); | 437 | m_stampAnn->setStampIconName( m_pixmapSelector->icon() ); | ||
448 | } | 438 | } | ||
449 | 439 | | |||
450 | 440 | | |||
451 | 441 | | |||
452 | LineAnnotationWidget::LineAnnotationWidget( Okular::Annotation * ann ) | 442 | LineAnnotationWidget::LineAnnotationWidget( Okular::Annotation * ann ) | ||
453 | : AnnotationWidget( ann ) | 443 | : AnnotationWidget( ann ) | ||
454 | { | 444 | { | ||
455 | m_lineAnn = static_cast< Okular::LineAnnotation * >( ann ); | 445 | m_lineAnn = static_cast< Okular::LineAnnotation * >( ann ); | ||
456 | if ( m_lineAnn->linePoints().count() == 2 ) | 446 | if ( m_lineAnn->linePoints().count() == 2 ) | ||
457 | m_lineType = 0; // line | 447 | m_lineType = 0; // line | ||
458 | else if ( m_lineAnn->lineClosed() ) | 448 | else if ( m_lineAnn->lineClosed() ) | ||
459 | m_lineType = 1; // polygon | 449 | m_lineType = 1; // polygon | ||
460 | else | 450 | else | ||
461 | m_lineType = 2; // polyline | 451 | m_lineType = 2; // polyline | ||
462 | } | 452 | } | ||
463 | 453 | | |||
464 | QWidget * LineAnnotationWidget::createStyleWidget() | 454 | void LineAnnotationWidget::createStyleWidget(QGridLayout * gridLayout) | ||
465 | { | 455 | { | ||
466 | QWidget * widget = new QWidget(); | 456 | const int row = gridLayout->rowCount(); | ||
467 | QVBoxLayout * lay = new QVBoxLayout( widget ); | 457 | QWidget * widget = (QWidget*)gridLayout->parent(); | ||
468 | lay->setMargin( 0 ); | 458 | | ||
459 | QLabel * tmplabel = new QLabel( i18n( "&Size:" ), widget ); | ||||
460 | gridLayout->addWidget( tmplabel, row, 0, Qt::AlignRight ); | ||||
461 | m_spinSize = new QDoubleSpinBox( widget ); | ||||
462 | tmplabel->setBuddy( m_spinSize ); | ||||
463 | gridLayout->addWidget( m_spinSize, row, 1 ); | ||||
464 | | ||||
465 | // Straight line | ||||
469 | if ( m_lineType == 0 ) | 466 | if ( m_lineType == 0 ) | ||
470 | { | 467 | { | ||
471 | QGroupBox * gb = new QGroupBox( widget ); | 468 | tmplabel = new QLabel( i18n( "Leader line length:" ), widget ); | ||
472 | lay->addWidget( gb ); | 469 | gridLayout->addWidget( tmplabel, row+3, 0, Qt::AlignRight ); | ||
473 | gb->setTitle( i18n( "Line Extensions" ) ); | 470 | m_spinLL = new QDoubleSpinBox( widget ); | ||
474 | QGridLayout * gridlay = new QGridLayout( gb ); | 471 | gridLayout->addWidget( m_spinLL, row+3, 1 ); | ||
475 | QLabel * tmplabel = new QLabel( i18n( "Leader Line Length:" ), gb ); | | |||
476 | gridlay->addWidget( tmplabel, 0, 0, Qt::AlignRight ); | | |||
477 | m_spinLL = new QDoubleSpinBox( gb ); | | |||
478 | gridlay->addWidget( m_spinLL, 0, 1 ); | | |||
479 | tmplabel->setBuddy( m_spinLL ); | 472 | tmplabel->setBuddy( m_spinLL ); | ||
480 | tmplabel = new QLabel( i18n( "Leader Line Extensions Length:" ), gb ); | 473 | tmplabel = new QLabel( i18n( "Leader line extensions length:" ), widget ); | ||
481 | gridlay->addWidget( tmplabel, 1, 0, Qt::AlignRight ); | 474 | gridLayout->addWidget( tmplabel, row+4, 0, Qt::AlignRight ); | ||
482 | m_spinLLE = new QDoubleSpinBox( gb ); | 475 | m_spinLLE = new QDoubleSpinBox( widget ); | ||
483 | gridlay->addWidget( m_spinLLE, 1, 1 ); | 476 | gridLayout->addWidget( m_spinLLE, row+4, 1 ); | ||
484 | tmplabel->setBuddy( m_spinLLE ); | 477 | tmplabel->setBuddy( m_spinLLE ); | ||
485 | } | 478 | } | ||
486 | 479 | | |||
487 | QGroupBox * gb2 = new QGroupBox( widget ); | 480 | // Polygon | ||
488 | lay->addWidget( gb2 ); | 481 | if ( m_lineType == 1 ) | ||
489 | gb2->setTitle( i18n( "Style" ) ); | 482 | { | ||
490 | QGridLayout * gridlay2 = new QGridLayout( gb2 ); | 483 | tmplabel = new QLabel( i18n( "Shape fill:" ), widget); | ||
491 | QLabel * tmplabel2 = new QLabel( i18n( "&Size:" ), gb2 ); | 484 | gridLayout->addWidget( tmplabel, row+1, 0, Qt::AlignRight ); | ||
492 | gridlay2->addWidget( tmplabel2, 0, 0, Qt::AlignRight ); | 485 | QHBoxLayout * colorlay = new QHBoxLayout(widget); | ||
493 | m_spinSize = new QDoubleSpinBox( gb2 ); | 486 | m_useColor = new QCheckBox( i18n( "Enabled" ), widget ); | ||
494 | gridlay2->addWidget( m_spinSize, 0, 1 ); | 487 | colorlay->addWidget( m_useColor ); | ||
495 | tmplabel2->setBuddy( m_spinSize ); | 488 | tmplabel->setBuddy( m_useColor ); | ||
496 | 489 | m_innerColor = new KColorButton( widget ); | |||
497 | if ( m_lineType == 1 ) //Polygon | 490 | colorlay->addWidget( m_innerColor); | ||
498 | { | 491 | gridLayout->addLayout( colorlay, row+1, 1 ); | ||
499 | m_useColor = new QCheckBox( i18n( "Inner color:" ), gb2 ); | 492 | } | ||
500 | gridlay2->addWidget( m_useColor, 1, 0 ); | 493 | | ||
501 | m_innerColor = new KColorButton( gb2 ); | 494 | if ( m_lineType == 0 ) | ||
502 | gridlay2->addWidget( m_innerColor, 1, 1 ); | 495 | { | ||
496 | m_spinLL->setRange( -500, 500 ); | ||||
497 | m_spinLL->setValue( m_lineAnn->lineLeadingForwardPoint() ); | ||||
498 | m_spinLLE->setRange( 0, 500 ); | ||||
499 | m_spinLLE->setValue( m_lineAnn->lineLeadingBackwardPoint() ); | ||||
500 | } | ||||
501 | else if ( m_lineType == 1 ) | ||||
502 | { | ||||
503 | m_innerColor->setColor( m_lineAnn->lineInnerColor() ); | 503 | m_innerColor->setColor( m_lineAnn->lineInnerColor() ); | ||
504 | if ( m_lineAnn->lineInnerColor().isValid() ) | 504 | if ( m_lineAnn->lineInnerColor().isValid() ) | ||
505 | { | 505 | { | ||
506 | m_useColor->setChecked( true ); | 506 | m_useColor->setChecked( true ); | ||
507 | } | 507 | } | ||
508 | else | 508 | else | ||
509 | { | 509 | { | ||
510 | m_innerColor->setEnabled( false ); | 510 | m_innerColor->setEnabled( false ); | ||
511 | } | 511 | } | ||
512 | } | 512 | } | ||
513 | 513 | | |||
514 | if ( m_lineType == 0 ) //Straight line | 514 | if ( m_lineType == 0 ) //Straight line | ||
515 | { | 515 | { | ||
516 | m_spinLL->setRange( -500, 500 ); | 516 | m_spinLL->setRange( -500, 500 ); | ||
517 | m_spinLL->setValue( m_lineAnn->lineLeadingForwardPoint() ); | 517 | m_spinLL->setValue( m_lineAnn->lineLeadingForwardPoint() ); | ||
518 | m_spinLLE->setRange( 0, 500 ); | 518 | m_spinLLE->setRange( 0, 500 ); | ||
519 | m_spinLLE->setValue( m_lineAnn->lineLeadingBackwardPoint() ); | 519 | m_spinLLE->setValue( m_lineAnn->lineLeadingBackwardPoint() ); | ||
520 | 520 | | |||
521 | //Line Term Styles | 521 | //Line Term Styles | ||
522 | QLabel * tmplabel3 = new QLabel( i18n( "Line Start:" ), widget ); | 522 | QLabel * tmplabel3 = new QLabel( i18n( "Line start:" ), widget ); | ||
523 | QLabel * tmplabel4 = new QLabel( i18n( "Line End:" ), widget ); | 523 | QLabel * tmplabel4 = new QLabel( i18n( "Line end:" ), widget ); | ||
524 | gridlay2->addWidget( tmplabel3, 1, 0, Qt::AlignRight ); | 524 | gridLayout->addWidget( tmplabel3, row+1, 0, Qt::AlignRight ); | ||
525 | gridlay2->addWidget( tmplabel4, 2, 0, Qt::AlignRight ); | 525 | gridLayout->addWidget( tmplabel4, row+2, 0, Qt::AlignRight ); | ||
526 | m_startStyleCombo = new QComboBox( widget ); | 526 | m_startStyleCombo = new QComboBox( widget ); | ||
527 | m_endStyleCombo = new QComboBox( widget ); | 527 | m_endStyleCombo = new QComboBox( widget ); | ||
528 | tmplabel3->setBuddy( m_startStyleCombo ); | 528 | tmplabel3->setBuddy( m_startStyleCombo ); | ||
529 | tmplabel4->setBuddy( m_endStyleCombo ); | 529 | tmplabel4->setBuddy( m_endStyleCombo ); | ||
530 | gridlay2->addWidget( m_startStyleCombo, 1, 1, Qt::AlignLeft ); | 530 | gridLayout->addWidget( m_startStyleCombo, row+1, 1, Qt::AlignLeft ); | ||
531 | gridlay2->addWidget( m_endStyleCombo, 2, 1, Qt::AlignLeft ); | 531 | gridLayout->addWidget( m_endStyleCombo, row+2, 1, Qt::AlignLeft ); | ||
532 | tmplabel3->setToolTip( i18n("Only for PDF documents") ); | 532 | tmplabel3->setToolTip( i18n("Only for PDF documents") ); | ||
533 | tmplabel4->setToolTip( i18n("Only for PDF documents") ); | 533 | tmplabel4->setToolTip( i18n("Only for PDF documents") ); | ||
534 | m_startStyleCombo->setToolTip( i18n("Only for PDF documents") ); | 534 | m_startStyleCombo->setToolTip( i18n("Only for PDF documents") ); | ||
you're going to have conflicts, AFAICS this "only for PDF documents" is gone. aacid: you're going to have conflicts, AFAICS this "only for PDF documents" is gone. | |||||
535 | m_endStyleCombo->setToolTip( i18n("Only for PDF documents") ); | 535 | m_endStyleCombo->setToolTip( i18n("Only for PDF documents") ); | ||
536 | 536 | | |||
537 | for ( const QString &i: { i18n( "Square" ), i18n( "Circle" ), i18n( "Diamond" ), i18n( "Open Arrow" ), i18n( "Closed Arrow" ), | 537 | for ( const QString &i: { i18n( "Square" ), i18n( "Circle" ), i18n( "Diamond" ), i18n( "Open arrow" ), i18n( "Closed arrow" ), | ||
538 | i18n( "None" ), i18n( "Butt" ), i18n( "Right Open Arrow" ), i18n( "Right Closed Arrow" ), i18n( "Slash" ) } ) | 538 | i18n( "None" ), i18n( "Butt" ), i18n( "Right open arrow" ), i18n( "Right closed arrow" ), i18n( "Slash" ) } ) | ||
539 | { | 539 | { | ||
540 | m_startStyleCombo->addItem( i ); | 540 | m_startStyleCombo->addItem( i ); | ||
541 | m_endStyleCombo->addItem( i ); | 541 | m_endStyleCombo->addItem( i ); | ||
542 | } | 542 | } | ||
543 | 543 | | |||
544 | m_startStyleCombo->setCurrentIndex( m_lineAnn->lineStartStyle() ); | 544 | m_startStyleCombo->setCurrentIndex( m_lineAnn->lineStartStyle() ); | ||
545 | m_endStyleCombo->setCurrentIndex( m_lineAnn->lineEndStyle() ); | 545 | m_endStyleCombo->setCurrentIndex( m_lineAnn->lineEndStyle() ); | ||
546 | connect( m_startStyleCombo, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &LineAnnotationWidget::dataChanged ); | 546 | connect( m_startStyleCombo, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &LineAnnotationWidget::dataChanged ); | ||
Show All 11 Lines | |||||
558 | } | 558 | } | ||
559 | else if ( m_lineType == 1 ) | 559 | else if ( m_lineType == 1 ) | ||
560 | { | 560 | { | ||
561 | connect( m_innerColor, &KColorButton::changed, this, &AnnotationWidget::dataChanged ); | 561 | connect( m_innerColor, &KColorButton::changed, this, &AnnotationWidget::dataChanged ); | ||
562 | connect( m_useColor, &QAbstractButton::toggled, this, &AnnotationWidget::dataChanged ); | 562 | connect( m_useColor, &QAbstractButton::toggled, this, &AnnotationWidget::dataChanged ); | ||
563 | connect( m_useColor, &QCheckBox::toggled, m_innerColor, &KColorButton::setEnabled ); | 563 | connect( m_useColor, &QCheckBox::toggled, m_innerColor, &KColorButton::setEnabled ); | ||
564 | } | 564 | } | ||
565 | connect( m_spinSize, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &LineAnnotationWidget::dataChanged ); | 565 | connect( m_spinSize, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &LineAnnotationWidget::dataChanged ); | ||
566 | | ||||
567 | return widget; | | |||
568 | } | 566 | } | ||
569 | 567 | | |||
570 | void LineAnnotationWidget::applyChanges() | 568 | void LineAnnotationWidget::applyChanges() | ||
571 | { | 569 | { | ||
572 | AnnotationWidget::applyChanges(); | 570 | AnnotationWidget::applyChanges(); | ||
573 | if ( m_lineType == 0 ) | 571 | if ( m_lineType == 0 ) | ||
574 | { | 572 | { | ||
575 | Q_ASSERT(m_spinLL && m_spinLLE && m_startStyleCombo && m_endStyleCombo); | 573 | Q_ASSERT(m_spinLL && m_spinLLE && m_startStyleCombo && m_endStyleCombo); | ||
Show All 21 Lines | |||||
597 | 595 | | |||
598 | 596 | | |||
599 | InkAnnotationWidget::InkAnnotationWidget( Okular::Annotation * ann ) | 597 | InkAnnotationWidget::InkAnnotationWidget( Okular::Annotation * ann ) | ||
600 | : AnnotationWidget( ann ) | 598 | : AnnotationWidget( ann ) | ||
601 | { | 599 | { | ||
602 | m_inkAnn = static_cast< Okular::InkAnnotation * >( ann ); | 600 | m_inkAnn = static_cast< Okular::InkAnnotation * >( ann ); | ||
603 | } | 601 | } | ||
604 | 602 | | |||
605 | QWidget * InkAnnotationWidget::createStyleWidget() | 603 | void InkAnnotationWidget::createStyleWidget(QGridLayout * gridLayout) | ||
606 | { | 604 | { | ||
607 | QWidget * widget = new QWidget(); | 605 | const int row = gridLayout->rowCount(); | ||
608 | QVBoxLayout * lay = new QVBoxLayout( widget ); | 606 | QWidget * widget = (QWidget*)gridLayout->parent(); | ||
609 | lay->setMargin( 0 ); | 607 | QLabel * tmplabel = new QLabel( i18n( "&Size:" ), widget ); | ||
610 | 608 | | |||
611 | QGroupBox * gb2 = new QGroupBox( widget ); | 609 | gridLayout->addWidget( tmplabel, row, 0, Qt::AlignRight ); | ||
612 | lay->addWidget( gb2 ); | 610 | m_spinSize = new QDoubleSpinBox( widget ); | ||
613 | gb2->setTitle( i18n( "Style" ) ); | 611 | gridLayout->addWidget( m_spinSize, row, 1 ); | ||
614 | QGridLayout * gridlay2 = new QGridLayout( gb2 ); | 612 | tmplabel->setBuddy( m_spinSize ); | ||
615 | QLabel * tmplabel2 = new QLabel( i18n( "&Size:" ), gb2 ); | | |||
616 | gridlay2->addWidget( tmplabel2, 0, 0, Qt::AlignRight ); | | |||
617 | m_spinSize = new QDoubleSpinBox( gb2 ); | | |||
618 | gridlay2->addWidget( m_spinSize, 0, 1 ); | | |||
619 | tmplabel2->setBuddy( m_spinSize ); | | |||
620 | 613 | | |||
621 | m_spinSize->setRange( 1, 100 ); | 614 | m_spinSize->setRange( 1, 100 ); | ||
622 | m_spinSize->setValue( m_inkAnn->style().width() ); | 615 | m_spinSize->setValue( m_inkAnn->style().width() ); | ||
623 | 616 | | |||
624 | connect( m_spinSize, SIGNAL(valueChanged(double)), this, SIGNAL(dataChanged()) ); | 617 | connect( m_spinSize, SIGNAL(valueChanged(double)), this, SIGNAL(dataChanged()) ); | ||
625 | | ||||
626 | return widget; | | |||
627 | } | 618 | } | ||
628 | 619 | | |||
629 | void InkAnnotationWidget::applyChanges() | 620 | void InkAnnotationWidget::applyChanges() | ||
630 | { | 621 | { | ||
631 | AnnotationWidget::applyChanges(); | 622 | AnnotationWidget::applyChanges(); | ||
632 | m_inkAnn->style().setWidth( m_spinSize->value() ); | 623 | m_inkAnn->style().setWidth( m_spinSize->value() ); | ||
633 | } | 624 | } | ||
634 | 625 | | |||
635 | 626 | | |||
636 | 627 | | |||
637 | HighlightAnnotationWidget::HighlightAnnotationWidget( Okular::Annotation * ann ) | 628 | HighlightAnnotationWidget::HighlightAnnotationWidget( Okular::Annotation * ann ) | ||
638 | : AnnotationWidget( ann ) | 629 | : AnnotationWidget( ann ) | ||
639 | { | 630 | { | ||
640 | m_hlAnn = static_cast< Okular::HighlightAnnotation * >( ann ); | 631 | m_hlAnn = static_cast< Okular::HighlightAnnotation * >( ann ); | ||
641 | } | 632 | } | ||
642 | 633 | | |||
643 | QWidget * HighlightAnnotationWidget::createStyleWidget() | 634 | void HighlightAnnotationWidget::createStyleWidget(QGridLayout * gridLayout) | ||
644 | { | 635 | { | ||
645 | QWidget * widget = new QWidget(); | 636 | const int row = gridLayout->rowCount(); | ||
646 | QVBoxLayout * lay = new QVBoxLayout( widget ); | 637 | QWidget * widget = (QWidget*)gridLayout->parent(); | ||
647 | lay->setMargin( 0 ); | | |||
648 | QHBoxLayout * typelay = new QHBoxLayout(); | | |||
649 | lay->addLayout( typelay ); | | |||
650 | QLabel * tmplabel = new QLabel( i18n( "Type:" ), widget ); | 638 | QLabel * tmplabel = new QLabel( i18n( "Type:" ), widget ); | ||
651 | typelay->addWidget( tmplabel, 0, Qt::AlignRight ); | 639 | gridLayout->addWidget( tmplabel, row, 0, Qt::AlignRight); | ||
652 | m_typeCombo = new KComboBox( widget ); | 640 | m_typeCombo = new KComboBox( widget ); | ||
653 | tmplabel->setBuddy( m_typeCombo ); | 641 | tmplabel->setBuddy( m_typeCombo ); | ||
654 | typelay->addWidget( m_typeCombo ); | 642 | gridLayout->addWidget( m_typeCombo, row, 1 ); | ||
655 | 643 | | |||
656 | m_typeCombo->addItem( i18n( "Highlight" ) ); | 644 | m_typeCombo->addItem( i18n( "Highlight" ) ); | ||
657 | m_typeCombo->addItem( i18n( "Squiggle" ) ); | 645 | m_typeCombo->addItem( i18n( "Squiggle" ) ); | ||
658 | m_typeCombo->addItem( i18n( "Underline" ) ); | 646 | m_typeCombo->addItem( i18n( "Underline" ) ); | ||
659 | m_typeCombo->addItem( i18n( "Strike out" ) ); | 647 | m_typeCombo->addItem( i18n( "Strike out" ) ); | ||
660 | m_typeCombo->setCurrentIndex( m_hlAnn->highlightType() ); | 648 | m_typeCombo->setCurrentIndex( m_hlAnn->highlightType() ); | ||
661 | 649 | | |||
662 | connect( m_typeCombo, SIGNAL(currentIndexChanged(int)), this, SIGNAL(dataChanged()) ); | 650 | connect( m_typeCombo, SIGNAL(currentIndexChanged(int)), this, SIGNAL(dataChanged()) ); | ||
663 | | ||||
664 | return widget; | | |||
665 | } | 651 | } | ||
666 | 652 | | |||
667 | void HighlightAnnotationWidget::applyChanges() | 653 | void HighlightAnnotationWidget::applyChanges() | ||
668 | { | 654 | { | ||
669 | AnnotationWidget::applyChanges(); | 655 | AnnotationWidget::applyChanges(); | ||
670 | m_hlAnn->setHighlightType( (Okular::HighlightAnnotation::HighlightType)m_typeCombo->currentIndex() ); | 656 | m_hlAnn->setHighlightType( (Okular::HighlightAnnotation::HighlightType)m_typeCombo->currentIndex() ); | ||
671 | } | 657 | } | ||
672 | 658 | | |||
673 | 659 | | |||
674 | 660 | | |||
675 | GeomAnnotationWidget::GeomAnnotationWidget( Okular::Annotation * ann ) | 661 | GeomAnnotationWidget::GeomAnnotationWidget( Okular::Annotation * ann ) | ||
676 | : AnnotationWidget( ann ) | 662 | : AnnotationWidget( ann ) | ||
677 | { | 663 | { | ||
678 | m_geomAnn = static_cast< Okular::GeomAnnotation * >( ann ); | 664 | m_geomAnn = static_cast< Okular::GeomAnnotation * >( ann ); | ||
679 | } | 665 | } | ||
680 | 666 | | |||
681 | QWidget * GeomAnnotationWidget::createStyleWidget() | 667 | void GeomAnnotationWidget::createStyleWidget(QGridLayout * gridLayout) | ||
682 | { | 668 | { | ||
683 | QWidget * widget = new QWidget(); | 669 | const int row = gridLayout->rowCount(); | ||
684 | QGridLayout * lay = new QGridLayout( widget ); | 670 | QWidget * widget = (QWidget*)gridLayout->parent(); | ||
685 | lay->setMargin( 0 ); | | |||
686 | QLabel * tmplabel = new QLabel( i18n( "Type:" ), widget ); | 671 | QLabel * tmplabel = new QLabel( i18n( "Type:" ), widget ); | ||
687 | lay->addWidget( tmplabel, 0, 0, Qt::AlignRight ); | 672 | gridLayout->addWidget( tmplabel, row, 0, Qt::AlignRight); | ||
688 | m_typeCombo = new KComboBox( widget ); | 673 | m_typeCombo = new KComboBox( widget ); | ||
689 | tmplabel->setBuddy( m_typeCombo ); | 674 | tmplabel->setBuddy( m_typeCombo ); | ||
690 | lay->addWidget( m_typeCombo, 0, 1 ); | 675 | gridLayout->addWidget( m_typeCombo, row, 1 ); | ||
691 | m_useColor = new QCheckBox( i18n( "Inner color:" ), widget ); | 676 | tmplabel = new QLabel( i18n( "Shape fill:" ), widget); | ||
692 | lay->addWidget( m_useColor, 1, 0 ); | 677 | gridLayout->addWidget( tmplabel, row+1, 0, Qt::AlignRight ); | ||
678 | QHBoxLayout * colorlay = new QHBoxLayout(widget); | ||||
679 | m_useColor = new QCheckBox( i18n( "Enabled" ), widget ); | ||||
680 | colorlay->addWidget(m_useColor); | ||||
693 | m_innerColor = new KColorButton( widget ); | 681 | m_innerColor = new KColorButton( widget ); | ||
694 | lay->addWidget( m_innerColor, 1, 1 ); | 682 | colorlay->addWidget( m_innerColor); | ||
683 | tmplabel->setBuddy( m_useColor ); | ||||
684 | gridLayout->addLayout( colorlay, row+1, 1 ); | ||||
695 | tmplabel = new QLabel( i18n( "&Size:" ), widget ); | 685 | tmplabel = new QLabel( i18n( "&Size:" ), widget ); | ||
696 | lay->addWidget( tmplabel, 2, 0, Qt::AlignRight ); | 686 | gridLayout->addWidget( tmplabel, row+2, 0, Qt::AlignRight ); | ||
697 | m_spinSize = new QDoubleSpinBox( widget ); | 687 | m_spinSize = new QDoubleSpinBox( widget ); | ||
698 | lay->addWidget( m_spinSize, 2, 1 ); | 688 | gridLayout->addWidget( m_spinSize, row+2, 1 ); | ||
699 | tmplabel->setBuddy( m_spinSize ); | 689 | tmplabel->setBuddy( m_spinSize ); | ||
700 | 690 | | |||
701 | m_typeCombo->addItem( i18n( "Rectangle" ) ); | 691 | m_typeCombo->addItem( i18n( "Rectangle" ) ); | ||
702 | m_typeCombo->addItem( i18n( "Ellipse" ) ); | 692 | m_typeCombo->addItem( i18n( "Ellipse" ) ); | ||
703 | m_typeCombo->setCurrentIndex( m_geomAnn->geometricalType() ); | 693 | m_typeCombo->setCurrentIndex( m_geomAnn->geometricalType() ); | ||
704 | m_innerColor->setColor( m_geomAnn->geometricalInnerColor() ); | 694 | m_innerColor->setColor( m_geomAnn->geometricalInnerColor() ); | ||
705 | if ( m_geomAnn->geometricalInnerColor().isValid() ) | 695 | if ( m_geomAnn->geometricalInnerColor().isValid() ) | ||
706 | { | 696 | { | ||
707 | m_useColor->setChecked( true ); | 697 | m_useColor->setChecked( true ); | ||
708 | } | 698 | } | ||
709 | else | 699 | else | ||
710 | { | 700 | { | ||
711 | m_innerColor->setEnabled( false ); | 701 | m_innerColor->setEnabled( false ); | ||
712 | } | 702 | } | ||
713 | m_spinSize->setRange( 0, 100 ); | 703 | m_spinSize->setRange( 0, 100 ); | ||
714 | m_spinSize->setValue( m_geomAnn->style().width() ); | 704 | m_spinSize->setValue( m_geomAnn->style().width() ); | ||
715 | 705 | | |||
716 | connect( m_typeCombo, SIGNAL(currentIndexChanged(int)), this, SIGNAL(dataChanged()) ); | 706 | connect( m_typeCombo, SIGNAL(currentIndexChanged(int)), this, SIGNAL(dataChanged()) ); | ||
717 | connect( m_innerColor, &KColorButton::changed, this, &AnnotationWidget::dataChanged ); | 707 | connect( m_innerColor, &KColorButton::changed, this, &AnnotationWidget::dataChanged ); | ||
718 | connect( m_useColor, &QAbstractButton::toggled, this, &AnnotationWidget::dataChanged ); | 708 | connect( m_useColor, &QAbstractButton::toggled, this, &AnnotationWidget::dataChanged ); | ||
719 | connect(m_useColor, &QCheckBox::toggled, m_innerColor, &KColorButton::setEnabled); | 709 | connect(m_useColor, &QCheckBox::toggled, m_innerColor, &KColorButton::setEnabled); | ||
720 | connect( m_spinSize, SIGNAL(valueChanged(double)), this, SIGNAL(dataChanged()) ); | 710 | connect( m_spinSize, SIGNAL(valueChanged(double)), this, SIGNAL(dataChanged()) ); | ||
721 | | ||||
722 | return widget; | | |||
723 | } | 711 | } | ||
724 | 712 | | |||
725 | void GeomAnnotationWidget::applyChanges() | 713 | void GeomAnnotationWidget::applyChanges() | ||
726 | { | 714 | { | ||
727 | AnnotationWidget::applyChanges(); | 715 | AnnotationWidget::applyChanges(); | ||
728 | m_geomAnn->setGeometricalType( (Okular::GeomAnnotation::GeomType)m_typeCombo->currentIndex() ); | 716 | m_geomAnn->setGeometricalType( (Okular::GeomAnnotation::GeomType)m_typeCombo->currentIndex() ); | ||
729 | if ( !m_useColor->isChecked() ) | 717 | if ( !m_useColor->isChecked() ) | ||
730 | { | 718 | { | ||
Show All 9 Lines | |||||
740 | 728 | | |||
741 | 729 | | |||
742 | FileAttachmentAnnotationWidget::FileAttachmentAnnotationWidget( Okular::Annotation * ann ) | 730 | FileAttachmentAnnotationWidget::FileAttachmentAnnotationWidget( Okular::Annotation * ann ) | ||
743 | : AnnotationWidget( ann ), m_pixmapSelector( nullptr ) | 731 | : AnnotationWidget( ann ), m_pixmapSelector( nullptr ) | ||
744 | { | 732 | { | ||
745 | m_attachAnn = static_cast< Okular::FileAttachmentAnnotation * >( ann ); | 733 | m_attachAnn = static_cast< Okular::FileAttachmentAnnotation * >( ann ); | ||
746 | } | 734 | } | ||
747 | 735 | | |||
748 | QWidget * FileAttachmentAnnotationWidget::createStyleWidget() | 736 | void FileAttachmentAnnotationWidget::createStyleWidget(QGridLayout * gridLayout) | ||
749 | { | 737 | { | ||
750 | QWidget * widget = new QWidget(); | 738 | const int row = gridLayout->rowCount(); | ||
751 | QVBoxLayout * lay = new QVBoxLayout( widget ); | 739 | QWidget * widget = (QWidget*)gridLayout->parent(); | ||
752 | lay->setMargin( 0 ); | 740 | QLabel * icon = new QLabel(i18n( "File attachment symbol:" ), widget); | ||
753 | QGroupBox * gb = new QGroupBox( widget ); | 741 | gridLayout->addWidget(icon, row, 0, Qt::AlignRight); | ||
754 | lay->addWidget( gb ); | 742 | m_pixmapSelector = new PixmapPreviewSelector( widget ); | ||
755 | gb->setTitle( i18n( "File Attachment Symbol" ) ); | 743 | gridLayout->addWidget( m_pixmapSelector, row, 1 ); | ||
756 | QHBoxLayout * gblay = new QHBoxLayout( gb ); | | |||
757 | m_pixmapSelector = new PixmapPreviewSelector( gb ); | | |||
758 | gblay->addWidget( m_pixmapSelector ); | | |||
759 | m_pixmapSelector->setEditable( true ); | 744 | m_pixmapSelector->setEditable( true ); | ||
760 | 745 | | |||
761 | m_pixmapSelector->addItem( i18nc( "Symbol for file attachment annotations", "Graph" ), QStringLiteral("graph") ); | 746 | m_pixmapSelector->addItem( i18nc( "Symbol for file attachment annotations", "Graph" ), QStringLiteral("graph") ); | ||
762 | m_pixmapSelector->addItem( i18nc( "Symbol for file attachment annotations", "Push Pin" ), QStringLiteral("pushpin") ); | 747 | m_pixmapSelector->addItem( i18nc( "Symbol for file attachment annotations", "Push Pin" ), QStringLiteral("pushpin") ); | ||
763 | m_pixmapSelector->addItem( i18nc( "Symbol for file attachment annotations", "Paperclip" ), QStringLiteral("paperclip") ); | 748 | m_pixmapSelector->addItem( i18nc( "Symbol for file attachment annotations", "Paperclip" ), QStringLiteral("paperclip") ); | ||
764 | m_pixmapSelector->addItem( i18nc( "Symbol for file attachment annotations", "Tag" ), QStringLiteral("tag") ); | 749 | m_pixmapSelector->addItem( i18nc( "Symbol for file attachment annotations", "Tag" ), QStringLiteral("tag") ); | ||
765 | m_pixmapSelector->setIcon( m_attachAnn->fileIconName() ); | 750 | m_pixmapSelector->setIcon( m_attachAnn->fileIconName() ); | ||
766 | 751 | | |||
767 | connect( m_pixmapSelector, &PixmapPreviewSelector::iconChanged, this, &AnnotationWidget::dataChanged ); | 752 | connect( m_pixmapSelector, &PixmapPreviewSelector::iconChanged, this, &AnnotationWidget::dataChanged ); | ||
768 | | ||||
769 | return widget; | | |||
770 | } | 753 | } | ||
771 | 754 | | |||
772 | QWidget * FileAttachmentAnnotationWidget::createExtraWidget() | 755 | QWidget * FileAttachmentAnnotationWidget::createExtraWidget() | ||
773 | { | 756 | { | ||
774 | QWidget * widget = new QWidget(); | 757 | QWidget * widget = new QWidget(); | ||
775 | widget->setWindowTitle( i18nc( "'File' as normal file, that can be opened, saved, etc..", "File" ) ); | 758 | widget->setWindowTitle( i18nc( "'File' as normal file, that can be opened, saved, etc..", "File" ) ); | ||
776 | 759 | | |||
777 | Okular::EmbeddedFile *ef = m_attachAnn->embeddedFile(); | 760 | Okular::EmbeddedFile *ef = m_attachAnn->embeddedFile(); | ||
778 | const int size = ef->size(); | 761 | const int size = ef->size(); | ||
779 | const QString sizeString = size <= 0 ? i18nc( "Not available size", "N/A" ) : KFormat().formatByteSize( size ); | 762 | const QString sizeString = size <= 0 ? i18nc( "Not available size", "N/A" ) : KFormat().formatByteSize( size ); | ||
780 | const QString descString = ef->description().isEmpty() ? i18n( "No description available." ) : ef->description(); | 763 | const QString descString = ef->description().isEmpty() ? i18n( "No description available." ) : ef->description(); | ||
781 | 764 | | |||
782 | QGridLayout * lay = new QGridLayout( widget ); | 765 | QHBoxLayout * mainLay = new QHBoxLayout( widget ); | ||
783 | lay->setMargin( 0 ); | 766 | QFormLayout * lay = new QFormLayout( widget ); | ||
784 | QLabel * tmplabel = new QLabel( i18n( "Name: %1", ef->name() ), widget ); | 767 | mainLay->addLayout( lay ); | ||
768 | | ||||
769 | QLabel * tmplabel = new QLabel( ef->name() , widget ); | ||||
785 | tmplabel->setTextInteractionFlags( Qt::TextSelectableByMouse ); | 770 | tmplabel->setTextInteractionFlags( Qt::TextSelectableByMouse ); | ||
786 | lay->addWidget( tmplabel, 0, 0 ); | 771 | lay->addRow( i18n( "Name:" ), tmplabel ); | ||
787 | 772 | | |||
788 | tmplabel = new QLabel( i18n( "Size: %1", sizeString ), widget ); | 773 | tmplabel = new QLabel( sizeString, widget ); | ||
789 | tmplabel->setTextInteractionFlags( Qt::TextSelectableByMouse ); | 774 | tmplabel->setTextInteractionFlags( Qt::TextSelectableByMouse ); | ||
790 | lay->addWidget( tmplabel, 1, 0 ); | 775 | lay->addRow( i18n( "Size:" ), tmplabel ); | ||
791 | 776 | | |||
792 | tmplabel = new QLabel( i18n( "Description:" ), widget ); | | |||
793 | lay->addWidget( tmplabel, 2, 0 ); | | |||
794 | tmplabel = new QLabel( widget ); | 777 | tmplabel = new QLabel( widget ); | ||
795 | tmplabel->setTextFormat( Qt::PlainText ); | 778 | tmplabel->setTextFormat( Qt::PlainText ); | ||
796 | tmplabel->setWordWrap( true ); | 779 | tmplabel->setWordWrap( true ); | ||
797 | tmplabel->setText( descString ); | 780 | tmplabel->setText( descString ); | ||
798 | tmplabel->setTextInteractionFlags( Qt::TextSelectableByMouse ); | 781 | tmplabel->setTextInteractionFlags( Qt::TextSelectableByMouse ); | ||
799 | lay->addWidget( tmplabel, 3, 0, 1, 2 ); | 782 | lay->addRow( i18n( "Description:" ), tmplabel ); | ||
800 | 783 | | |||
801 | QMimeDatabase db; | 784 | QMimeDatabase db; | ||
802 | QMimeType mime = db.mimeTypeForFile( ef->name(), QMimeDatabase::MatchExtension); | 785 | QMimeType mime = db.mimeTypeForFile( ef->name(), QMimeDatabase::MatchExtension); | ||
803 | if ( mime.isValid() ) | 786 | if ( mime.isValid() ) | ||
804 | { | 787 | { | ||
805 | tmplabel = new QLabel( widget ); | 788 | tmplabel = new QLabel( widget ); | ||
806 | tmplabel->setPixmap( QIcon::fromTheme( mime.iconName() ).pixmap( FILEATTACH_ICONSIZE, FILEATTACH_ICONSIZE ) ); | 789 | tmplabel->setPixmap( QIcon::fromTheme( mime.iconName() ).pixmap( FILEATTACH_ICONSIZE, FILEATTACH_ICONSIZE ) ); | ||
807 | tmplabel->setFixedSize( FILEATTACH_ICONSIZE, FILEATTACH_ICONSIZE ); | 790 | tmplabel->setFixedSize( FILEATTACH_ICONSIZE, FILEATTACH_ICONSIZE ); | ||
808 | lay->addWidget( tmplabel, 0, 1, 3, 1, Qt::AlignTop ); | 791 | QVBoxLayout * tmpLayout = new QVBoxLayout( widget ); | ||
792 | tmpLayout->setAlignment( Qt::AlignTop ); | ||||
793 | mainLay->addLayout( tmpLayout ); | ||||
794 | tmpLayout->addWidget( tmplabel ); | ||||
809 | } | 795 | } | ||
810 | 796 | | |||
811 | lay->addItem( new QSpacerItem( 5, 5, QSizePolicy::Fixed, QSizePolicy::MinimumExpanding ), 4, 0 ); | | |||
812 | | ||||
813 | return widget; | 797 | return widget; | ||
814 | } | 798 | } | ||
815 | 799 | | |||
816 | void FileAttachmentAnnotationWidget::applyChanges() | 800 | void FileAttachmentAnnotationWidget::applyChanges() | ||
817 | { | 801 | { | ||
818 | AnnotationWidget::applyChanges(); | 802 | AnnotationWidget::applyChanges(); | ||
819 | m_attachAnn->setFileIconName( m_pixmapSelector->icon() ); | 803 | m_attachAnn->setFileIconName( m_pixmapSelector->icon() ); | ||
820 | } | 804 | } | ||
Show All 22 Lines | |||||
843 | } | 827 | } | ||
844 | 828 | | |||
845 | CaretAnnotationWidget::CaretAnnotationWidget( Okular::Annotation * ann ) | 829 | CaretAnnotationWidget::CaretAnnotationWidget( Okular::Annotation * ann ) | ||
846 | : AnnotationWidget( ann ), m_pixmapSelector( nullptr ) | 830 | : AnnotationWidget( ann ), m_pixmapSelector( nullptr ) | ||
847 | { | 831 | { | ||
848 | m_caretAnn = static_cast< Okular::CaretAnnotation * >( ann ); | 832 | m_caretAnn = static_cast< Okular::CaretAnnotation * >( ann ); | ||
849 | } | 833 | } | ||
850 | 834 | | |||
851 | QWidget * CaretAnnotationWidget::createStyleWidget() | 835 | void CaretAnnotationWidget::createStyleWidget(QGridLayout * gridLayout) | ||
852 | { | 836 | { | ||
853 | QWidget * widget = new QWidget(); | 837 | const int row = gridLayout->rowCount(); | ||
854 | QVBoxLayout * lay = new QVBoxLayout( widget ); | 838 | QWidget * widget = (QWidget*)gridLayout->parent(); | ||
shubham: Why not qobject_cast? | |||||
855 | lay->setMargin( 0 ); | 839 | QLabel * icon = new QLabel(i18n( "Caret symbol:" ), widget); | ||
856 | QGroupBox * gb = new QGroupBox( widget ); | 840 | gridLayout->addWidget(icon, row, 0, Qt::AlignRight); | ||
857 | lay->addWidget( gb ); | 841 | m_pixmapSelector = new PixmapPreviewSelector( widget ); | ||
858 | gb->setTitle( i18n( "Caret Symbol" ) ); | 842 | gridLayout->addWidget( m_pixmapSelector, row, 1 ); | ||
859 | QHBoxLayout * gblay = new QHBoxLayout( gb ); | | |||
860 | m_pixmapSelector = new PixmapPreviewSelector( gb ); | | |||
861 | gblay->addWidget( m_pixmapSelector ); | | |||
862 | 843 | | |||
863 | m_pixmapSelector->addItem( i18nc( "Symbol for caret annotations", "None" ), QStringLiteral("caret-none") ); | 844 | m_pixmapSelector->addItem( i18nc( "Symbol for caret annotations", "None" ), QStringLiteral("caret-none") ); | ||
864 | m_pixmapSelector->addItem( i18nc( "Symbol for caret annotations", "P" ), QStringLiteral("caret-p") ); | 845 | m_pixmapSelector->addItem( i18nc( "Symbol for caret annotations", "P" ), QStringLiteral("caret-p") ); | ||
865 | m_pixmapSelector->setIcon( caretSymbolToIcon( m_caretAnn->caretSymbol() ) ); | 846 | m_pixmapSelector->setIcon( caretSymbolToIcon( m_caretAnn->caretSymbol() ) ); | ||
866 | 847 | | |||
867 | connect( m_pixmapSelector, &PixmapPreviewSelector::iconChanged, this, &AnnotationWidget::dataChanged ); | 848 | connect( m_pixmapSelector, &PixmapPreviewSelector::iconChanged, this, &AnnotationWidget::dataChanged ); | ||
868 | | ||||
869 | return widget; | | |||
870 | } | 849 | } | ||
aacid: return at the end of a function screams really bad at me, please fix :) | |||||
871 | 850 | | |||
872 | void CaretAnnotationWidget::applyChanges() | 851 | void CaretAnnotationWidget::applyChanges() | ||
873 | { | 852 | { | ||
874 | AnnotationWidget::applyChanges(); | 853 | AnnotationWidget::applyChanges(); | ||
875 | m_caretAnn->setCaretSymbol( caretSymbolFromIcon( m_pixmapSelector->icon() ) ); | 854 | m_caretAnn->setCaretSymbol( caretSymbolFromIcon( m_pixmapSelector->icon() ) ); | ||
876 | } | 855 | } | ||
877 | 856 | | |||
878 | 857 | | |||
879 | 858 | | |||
880 | #include "moc_annotationwidgets.cpp" | 859 | #include "moc_annotationwidgets.cpp" |
Is it correct to set this growth policy? I have not found any guideline on the HIG. Compared to the grid layout where label and widget take the same amount of horizontal space, now the widgets take way more space making it a little ugly for some annotation tools. Any idea?