Commit a33cb321 authored by Simone Gaiarin's avatar Simone Gaiarin
Browse files

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 @@ ...@@ -52,7 +52,7 @@
<item row="0" column="0" > <item row="0" column="0" >
<widget class="QLabel" name="label" > <widget class="QLabel" name="label" >
<property name="text" > <property name="text" >
<string>&amp;Author:</string> <string>Au&amp;thor:</string>
</property> </property>
<property name="alignment" > <property name="alignment" >
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
<item row="1" column="0" colspan="2" > <item row="1" column="0" colspan="2" >
<widget class="QLabel" name="label_2" > <widget class="QLabel" name="label_2" >
<property name="text" > <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>
<property name="alignment" > <property name="alignment" >
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "annotationpropertiesdialog.h" #include "annotationpropertiesdialog.h"
// qt/kde includes // qt/kde includes
#include <QFormLayout>
#include <qframe.h> #include <qframe.h>
#include <qlayout.h> #include <qlayout.h>
#include <qlabel.h> #include <qlabel.h>
...@@ -61,25 +62,21 @@ AnnotsPropertiesDialog::AnnotsPropertiesDialog( QWidget *parent, Okular::Documen ...@@ -61,25 +62,21 @@ AnnotsPropertiesDialog::AnnotsPropertiesDialog( QWidget *parent, Okular::Documen
QFrame* page = new QFrame( this ); QFrame* page = new QFrame( this );
addPage( page, i18n( "&General" ) ); addPage( page, i18n( "&General" ) );
// m_tabitem[1]->setIcon( QIcon::fromTheme( "fonts" ) ); // m_tabitem[1]->setIcon( QIcon::fromTheme( "fonts" ) );
QGridLayout* gridlayout = new QGridLayout( page ); QFormLayout * gridlayout = new QFormLayout( page );
tmplabel = new QLabel( i18n( "&Author:" ), page );
AuthorEdit = new KLineEdit( ann->author(), page ); AuthorEdit = new KLineEdit( ann->author(), page );
AuthorEdit->setEnabled( canEditAnnotations ); AuthorEdit->setEnabled( canEditAnnotations );
tmplabel->setBuddy( AuthorEdit ); gridlayout->addRow( i18n( "&Author:" ), AuthorEdit );
gridlayout->addWidget( tmplabel, 0, 0, Qt::AlignRight );
gridlayout->addWidget( AuthorEdit, 0, 1 );
tmplabel = new QLabel( page ); 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 ); tmplabel->setTextInteractionFlags( Qt::TextSelectableByMouse );
gridlayout->addWidget( tmplabel, 1, 0, 1, 2 ); gridlayout->addRow( i18n( "Created:" ), tmplabel );
m_modifyDateLabel = new QLabel( page ); 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 ); 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 //END tab 2
QWidget * extraWidget = m_annotWidget->extraWidget(); QWidget * extraWidget = m_annotWidget->extraWidget();
......
This diff is collapsed.
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
class QCheckBox; class QCheckBox;
class QComboBox; class QComboBox;
class QDoubleSpinBox; class QDoubleSpinBox;
class QFormLayout;
class QLabel; class QLabel;
class QWidget; class QWidget;
class KColorButton; class KColorButton;
...@@ -88,13 +89,14 @@ Q_SIGNALS: ...@@ -88,13 +89,14 @@ Q_SIGNALS:
protected: protected:
QWidget * createAppearanceWidget(); QWidget * createAppearanceWidget();
virtual QWidget * createStyleWidget(); virtual void createStyleWidget(QFormLayout * formLayout);
virtual QWidget * createExtraWidget(); virtual QWidget * createExtraWidget();
private: void addColorButton( QWidget * widget, QFormLayout * formlayout );
virtual bool hasColorButton() const { return true; } void addOpacitySpinBox( QWidget * widget, QFormLayout * formlayout );
virtual bool hasOpacityBox() const { return true; } void addVerticalSpacer( QFormLayout * formlayout );
private:
Okular::Annotation * m_ann; Okular::Annotation * m_ann;
QWidget * m_appearanceWidget { nullptr }; QWidget * m_appearanceWidget { nullptr };
QWidget * m_extraWidget { nullptr }; QWidget * m_extraWidget { nullptr };
...@@ -103,7 +105,7 @@ private: ...@@ -103,7 +105,7 @@ private:
}; };
class QVBoxLayout; class QVBoxLayout;
class QGridLayout; class QFormLayout;
class TextAnnotationWidget class TextAnnotationWidget
: public AnnotationWidget : public AnnotationWidget
...@@ -116,20 +118,18 @@ public: ...@@ -116,20 +118,18 @@ public:
void applyChanges() override; void applyChanges() override;
protected: protected:
QWidget * createStyleWidget() override; void createStyleWidget( QFormLayout * formlayout ) override;
private: private:
virtual bool hasColorButton() const override;
virtual bool hasOpacityBox() const override; void createPopupNoteStyleUi( QWidget * widget, QFormLayout * formlayout );
void createInlineNoteStyleUi( QWidget * widget, QFormLayout * formlayout );
void createPopupNoteStyleUi( QWidget * widget, QVBoxLayout * layout ); void createTypewriterStyleUi( QWidget * widget, QFormLayout * formlayout );
void createInlineNoteStyleUi( QWidget * widget, QVBoxLayout * layout ); void addPixmapSelector( QWidget * widget, QFormLayout * formlayout );
void createTypewriterStyleUi( QWidget * widget, QVBoxLayout * layout ); void addFontRequester( QWidget * widget, QFormLayout * formlayout );
void addPixmapSelector( QWidget * widget, QLayout * layout ); void addTextColorButton( QWidget * widget, QFormLayout * formlayout );
void addFontRequester( QWidget * widget, QGridLayout * layout ); void addTextAlignComboBox( QWidget * widget, QFormLayout * formlayout );
void addTextColorButton( QWidget * widget, QGridLayout * layout ); void addWidthSpinBox( QWidget * widget, QFormLayout * formlayout );
void addTextAlignComboBox( QWidget * widget, QGridLayout * layout );
void addWidthSpinBox( QWidget * widget, QGridLayout * layout );
inline bool isTypewriter() const { return ( m_textAnn->inplaceIntent() == Okular::TextAnnotation::TypeWriter ); } inline bool isTypewriter() const { return ( m_textAnn->inplaceIntent() == Okular::TextAnnotation::TypeWriter ); }
...@@ -152,7 +152,7 @@ public: ...@@ -152,7 +152,7 @@ public:
void applyChanges() override; void applyChanges() override;
protected: protected:
QWidget * createStyleWidget() override; void createStyleWidget( QFormLayout * formlayout ) override;
private: private:
Okular::StampAnnotation * m_stampAnn; Okular::StampAnnotation * m_stampAnn;
...@@ -170,7 +170,7 @@ public: ...@@ -170,7 +170,7 @@ public:
void applyChanges() override; void applyChanges() override;
protected: protected:
QWidget * createStyleWidget() override; void createStyleWidget( QFormLayout * formlayout ) override;
private: private:
static QIcon endStyleIcon( Okular::LineAnnotation::TermStyle endStyle, const QColor &lineColor ); static QIcon endStyleIcon( Okular::LineAnnotation::TermStyle endStyle, const QColor &lineColor );
...@@ -197,7 +197,7 @@ public: ...@@ -197,7 +197,7 @@ public:
void applyChanges() override; void applyChanges() override;
protected: protected:
QWidget * createStyleWidget() override; void createStyleWidget( QFormLayout * formlayout ) override;
private: private:
Okular::HighlightAnnotation * m_hlAnn; Okular::HighlightAnnotation * m_hlAnn;
...@@ -215,7 +215,7 @@ public: ...@@ -215,7 +215,7 @@ public:
void applyChanges() override; void applyChanges() override;
protected: protected:
QWidget * createStyleWidget() override; void createStyleWidget( QFormLayout * formlayout ) override;
private: private:
Okular::GeomAnnotation * m_geomAnn; Okular::GeomAnnotation * m_geomAnn;
...@@ -236,7 +236,7 @@ public: ...@@ -236,7 +236,7 @@ public:
void applyChanges() override; void applyChanges() override;
protected: protected:
QWidget * createStyleWidget() override; void createStyleWidget( QFormLayout * formlayout ) override;
QWidget * createExtraWidget() override; QWidget * createExtraWidget() override;
private: private:
...@@ -255,7 +255,7 @@ public: ...@@ -255,7 +255,7 @@ public:
void applyChanges() override; void applyChanges() override;
protected: protected:
QWidget * createStyleWidget() override; void createStyleWidget( QFormLayout * formlayout ) override;
private: private:
Okular::CaretAnnotation * m_caretAnn; Okular::CaretAnnotation * m_caretAnn;
...@@ -273,7 +273,7 @@ public: ...@@ -273,7 +273,7 @@ public:
void applyChanges() override; void applyChanges() override;
protected: protected:
QWidget * createStyleWidget() override; void createStyleWidget( QFormLayout * formlayout ) override;
private: private:
Okular::InkAnnotation * m_inkAnn; 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