Commit a33cb321 authored by Simone Gaiarin's avatar Simone Gaiarin

Improve layout of annotation configuration dialogs

Summary:
The config dialog of each annotation tool is now a form layout without group boxes. Everything is aligned.

Reviewers: #okular, #vdg, ngraham, aacid

Reviewed By: #okular, #vdg, ngraham, aacid

Subscribers: sander, davidhurka, aacid, okular-devel, knambiar, ngraham

Tags: #okular

Maniphest Tasks: T8076

Differential Revision: https://phabricator.kde.org/D10859
parent 0991819a
......@@ -52,7 +52,7 @@
<item row="0" column="0" >
<widget class="QLabel" name="label" >
<property name="text" >
<string>&amp;Author:</string>
<string>Au&amp;thor:</string>
</property>
<property name="alignment" >
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
......@@ -68,7 +68,7 @@
<item row="1" column="0" colspan="2" >
<widget class="QLabel" name="label_2" >
<property name="text" >
<string>&lt;b>Note&lt;/b>: the information here is used only for comments and reviews. Information inserted here will not be transmitted without your knowledge.</string>
<string>&lt;b>Note&lt;/b>: the information here is used only for annotations. The information is saved in annotated documents, and so will be transmitted together with the document.</string>
</property>
<property name="alignment" >
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
......
......@@ -10,6 +10,7 @@
#include "annotationpropertiesdialog.h"
// qt/kde includes
#include <QFormLayout>
#include <qframe.h>
#include <qlayout.h>
#include <qlabel.h>
......@@ -61,25 +62,21 @@ AnnotsPropertiesDialog::AnnotsPropertiesDialog( QWidget *parent, Okular::Documen
QFrame* page = new QFrame( this );
addPage( page, i18n( "&General" ) );
// m_tabitem[1]->setIcon( QIcon::fromTheme( "fonts" ) );
QGridLayout* gridlayout = new QGridLayout( page );
tmplabel = new QLabel( i18n( "&Author:" ), page );
QFormLayout * gridlayout = new QFormLayout( page );
AuthorEdit = new KLineEdit( ann->author(), page );
AuthorEdit->setEnabled( canEditAnnotations );
tmplabel->setBuddy( AuthorEdit );
gridlayout->addWidget( tmplabel, 0, 0, Qt::AlignRight );
gridlayout->addWidget( AuthorEdit, 0, 1 );
gridlayout->addRow( i18n( "&Author:" ), AuthorEdit );
tmplabel = new QLabel( page );
tmplabel->setText( i18n( "Created: %1", QLocale().toString( ann->creationDate(), QLocale::LongFormat ) ) );
tmplabel->setText( QLocale().toString( ann->creationDate(), QLocale::LongFormat ) );
tmplabel->setTextInteractionFlags( Qt::TextSelectableByMouse );
gridlayout->addWidget( tmplabel, 1, 0, 1, 2 );
gridlayout->addRow( i18n( "Created:" ), tmplabel );
m_modifyDateLabel = new QLabel( page );
m_modifyDateLabel->setText( i18n( "Modified: %1", QLocale().toString( ann->modificationDate(), QLocale::LongFormat ) ) );
m_modifyDateLabel->setText( QLocale().toString( ann->modificationDate(), QLocale::LongFormat ) );
m_modifyDateLabel->setTextInteractionFlags( Qt::TextSelectableByMouse );
gridlayout->addWidget( m_modifyDateLabel, 2, 0, 1, 2 );
gridlayout->addRow( i18n( "Modified:" ), m_modifyDateLabel );
gridlayout->addItem( new QSpacerItem( 5, 5, QSizePolicy::Fixed, QSizePolicy::MinimumExpanding ), 3, 0 );
//END tab 2
QWidget * extraWidget = m_annotWidget->extraWidget();
......
This diff is collapsed.
......@@ -17,6 +17,7 @@
class QCheckBox;
class QComboBox;
class QDoubleSpinBox;
class QFormLayout;
class QLabel;
class QWidget;
class KColorButton;
......@@ -88,13 +89,14 @@ Q_SIGNALS:
protected:
QWidget * createAppearanceWidget();
virtual QWidget * createStyleWidget();
virtual void createStyleWidget(QFormLayout * formLayout);
virtual QWidget * createExtraWidget();
private:
virtual bool hasColorButton() const { return true; }
virtual bool hasOpacityBox() const { return true; }
void addColorButton( QWidget * widget, QFormLayout * formlayout );
void addOpacitySpinBox( QWidget * widget, QFormLayout * formlayout );
void addVerticalSpacer( QFormLayout * formlayout );
private:
Okular::Annotation * m_ann;
QWidget * m_appearanceWidget { nullptr };
QWidget * m_extraWidget { nullptr };
......@@ -103,7 +105,7 @@ private:
};
class QVBoxLayout;
class QGridLayout;
class QFormLayout;
class TextAnnotationWidget
: public AnnotationWidget
......@@ -116,20 +118,18 @@ public:
void applyChanges() override;
protected:
QWidget * createStyleWidget() override;
void createStyleWidget( QFormLayout * formlayout ) override;
private:
virtual bool hasColorButton() const override;
virtual bool hasOpacityBox() const override;
void createPopupNoteStyleUi( QWidget * widget, QVBoxLayout * layout );
void createInlineNoteStyleUi( QWidget * widget, QVBoxLayout * layout );
void createTypewriterStyleUi( QWidget * widget, QVBoxLayout * layout );
void addPixmapSelector( QWidget * widget, QLayout * layout );
void addFontRequester( QWidget * widget, QGridLayout * layout );
void addTextColorButton( QWidget * widget, QGridLayout * layout );
void addTextAlignComboBox( QWidget * widget, QGridLayout * layout );
void addWidthSpinBox( QWidget * widget, QGridLayout * layout );
void createPopupNoteStyleUi( QWidget * widget, QFormLayout * formlayout );
void createInlineNoteStyleUi( QWidget * widget, QFormLayout * formlayout );
void createTypewriterStyleUi( QWidget * widget, QFormLayout * formlayout );
void addPixmapSelector( QWidget * widget, QFormLayout * formlayout );
void addFontRequester( QWidget * widget, QFormLayout * formlayout );
void addTextColorButton( QWidget * widget, QFormLayout * formlayout );
void addTextAlignComboBox( QWidget * widget, QFormLayout * formlayout );
void addWidthSpinBox( QWidget * widget, QFormLayout * formlayout );
inline bool isTypewriter() const { return ( m_textAnn->inplaceIntent() == Okular::TextAnnotation::TypeWriter ); }
......@@ -152,7 +152,7 @@ public:
void applyChanges() override;
protected:
QWidget * createStyleWidget() override;
void createStyleWidget( QFormLayout * formlayout ) override;
private:
Okular::StampAnnotation * m_stampAnn;
......@@ -170,7 +170,7 @@ public:
void applyChanges() override;
protected:
QWidget * createStyleWidget() override;
void createStyleWidget( QFormLayout * formlayout ) override;
private:
static QIcon endStyleIcon( Okular::LineAnnotation::TermStyle endStyle, const QColor &lineColor );
......@@ -197,7 +197,7 @@ public:
void applyChanges() override;
protected:
QWidget * createStyleWidget() override;
void createStyleWidget( QFormLayout * formlayout ) override;
private:
Okular::HighlightAnnotation * m_hlAnn;
......@@ -215,7 +215,7 @@ public:
void applyChanges() override;
protected:
QWidget * createStyleWidget() override;
void createStyleWidget( QFormLayout * formlayout ) override;
private:
Okular::GeomAnnotation * m_geomAnn;
......@@ -236,7 +236,7 @@ public:
void applyChanges() override;
protected:
QWidget * createStyleWidget() override;
void createStyleWidget( QFormLayout * formlayout ) override;
QWidget * createExtraWidget() override;
private:
......@@ -255,7 +255,7 @@ public:
void applyChanges() override;
protected:
QWidget * createStyleWidget() override;
void createStyleWidget( QFormLayout * formlayout ) override;
private:
Okular::CaretAnnotation * m_caretAnn;
......@@ -273,7 +273,7 @@ public:
void applyChanges() override;
protected:
QWidget * createStyleWidget() override;
void createStyleWidget( QFormLayout * formlayout ) override;
private:
Okular::InkAnnotation * m_inkAnn;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment