1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-21 22:09:39 +00:00
openmw-tes3mp/apps/opencs/view/doc/subview.hpp
cc9cii e9ca022162 Add an optional horizontal scrollbar to the main view window. Should resolve Feature #2549.
- TableSubviews and DialogueSubviews now provide size hints
- Option to stop the growth of the window at the screen boundary for multi-monitor setup with different resolution.
- Three options:
  Grow Only: No change to current, except the use of size hints
  Scrollbar Only: Simple addition of a scrollbar, the view window does not grow
  Grow then Scroll: Window grows as per current behaviour. The scrollbar appears once it cannot grow any further.
2015-05-17 20:45:13 +10:00

88 lines
1.8 KiB
C++

#ifndef CSV_DOC_SUBVIEW_H
#define CSV_DOC_SUBVIEW_H
#include "../../model/doc/document.hpp"
#include "../../model/world/universalid.hpp"
#include "subviewfactory.hpp"
#include <QDockWidget>
#include <QSize>
class QUndoStack;
namespace CSMWorld
{
class Data;
}
namespace CSVDoc
{
class View;
class SubView : public QDockWidget
{
Q_OBJECT
CSMWorld::UniversalId mUniversalId;
// not implemented
SubView (const SubView&);
SubView& operator= (SubView&);
protected:
void setUniversalId(const CSMWorld::UniversalId& id);
public:
SubView (const CSMWorld::UniversalId& id);
CSMWorld::UniversalId getUniversalId() const;
virtual void setEditLock (bool locked) = 0;
virtual void setStatusBar (bool show);
///< Default implementation: ignored
virtual void useHint (const std::string& hint);
///< Default implementation: ignored
virtual std::string getTitle() const;
virtual void updateUserSetting (const QString& name, const QStringList& value);
private:
void closeEvent (QCloseEvent *event);
signals:
void focusId (const CSMWorld::UniversalId& universalId, const std::string& hint);
void closeRequest (SubView *subView);
void updateTitle();
void updateSubViewIndicies (SubView *view = 0);
protected slots:
void closeRequest();
};
class SizeHintWidget : public QWidget
{
QSize mSize;
public:
SizeHintWidget(QWidget *parent = 0);
~SizeHintWidget();
virtual QSize sizeHint() const;
void setSizeHint(const QSize &size);
};
}
#endif