lyx_mirror/src/frontends/qt4/QParagraph.h
Richard Heck 1a3daacc5f Fix some UI bugs related to the paragraph settings dialog. The default
checkbox has been changed to a radio button, so that other alignments
can be chosen without the user's having to uncheck "Default".

There was some disagreement about the interface here. See, for example,
this thread:
  http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg121328.html
For now, this will do.

The interface here is not fully functional. At present, if the Default 
happens to be Justified, then checking Justified is simply equivalent to
checking Default. This is due to the behavior of Text::setParagraph(), and
it should be changed if this interface is retained.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18860 a592a061-630c-0410-9148-cb99ea01b6c8
2007-06-22 22:34:16 +00:00

80 lines
1.5 KiB
C++

// -*- C++ -*-
/**
* \file QParagraph.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author Edwin Leuven
* \author John Levon
*
* Full author contact details are available in file CREDITS.
*/
#ifndef QPARAGRAPH_H
#define QPARAGRAPH_H
#include "QDialogView.h"
#include "Layout.h"
#include "ui/ParagraphUi.h"
#include <QDialog>
#include <QCloseEvent>
#include <map>
namespace lyx {
namespace frontend {
class QParagraph;
class QParagraphDialog : public QDialog, public Ui::QParagraphUi {
Q_OBJECT
public:
QParagraphDialog(QParagraph * form);
///
void checkAlignmentRadioButtons();
///
void alignmentToRadioButtons(LyXAlignment align = LYX_ALIGN_LAYOUT);
///
LyXAlignment getAlignmentFromDialog();
protected:
void closeEvent (QCloseEvent * e);
private:
QParagraph * form_;
typedef std::map<LyXAlignment, QRadioButton *> QPRadioMap;
QPRadioMap radioMap;
// typedef std::map<LyXAlignment, std::string> QPAlignmentLabels;
// QPAlignmentLabels labelMap;
protected Q_SLOTS:
///
void change_adaptor();
///
void enableLinespacingValue(int);
};
class ControlParagraph;
class QParagraph
: public QController<ControlParagraph, QView<QParagraphDialog> >
{
public:
friend class QParagraphDialog;
QParagraph(Dialog &);
private:
/// Apply changes
virtual void apply();
/// update
virtual void update_contents();
/// build the dialog
virtual void build_dialog();
};
} // namespace frontend
} // namespace lyx
#endif // QPARAGRAPH_H