mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 21:40:19 +00:00
cleanups
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21498 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
be85a6fcb5
commit
4aa5f6cd2d
@ -88,8 +88,6 @@ InsetCollapsable::InsetCollapsable(BufferParams const & bp,
|
|||||||
InsetCollapsable::InsetCollapsable(InsetCollapsable const & rhs)
|
InsetCollapsable::InsetCollapsable(InsetCollapsable const & rhs)
|
||||||
: InsetText(rhs),
|
: InsetText(rhs),
|
||||||
button_dim(rhs.button_dim),
|
button_dim(rhs.button_dim),
|
||||||
topx(rhs.topx),
|
|
||||||
topbaseline(rhs.topbaseline),
|
|
||||||
layout_(rhs.layout_),
|
layout_(rhs.layout_),
|
||||||
labelstring_(rhs.labelstring_),
|
labelstring_(rhs.labelstring_),
|
||||||
status_(rhs.status_),
|
status_(rhs.status_),
|
||||||
@ -325,7 +323,7 @@ void InsetCollapsable::draw(PainterInfo & pi, int x, int y) const
|
|||||||
pi.pain.line(xx1, y + desc - 4,
|
pi.pain.line(xx1, y + desc - 4,
|
||||||
xx1, y + desc,
|
xx1, y + desc,
|
||||||
layout_->labelfont.color());
|
layout_->labelfont.color());
|
||||||
if (internalStatus() == Open)
|
if (status_ == Open)
|
||||||
pi.pain.line(xx1, y + desc,
|
pi.pain.line(xx1, y + desc,
|
||||||
xx2, y + desc,
|
xx2, y + desc,
|
||||||
layout_->labelfont.color());
|
layout_->labelfont.color());
|
||||||
@ -511,7 +509,7 @@ void InsetCollapsable::doDispatch(Cursor & cur, FuncRequest & cmd)
|
|||||||
if (geometry() == Corners ||
|
if (geometry() == Corners ||
|
||||||
geometry() == SubLabel ||
|
geometry() == SubLabel ||
|
||||||
geometry() == NoButton) {
|
geometry() == NoButton) {
|
||||||
if (internalStatus() == Open)
|
if (status_ == Open)
|
||||||
setStatus(cur, Collapsed);
|
setStatus(cur, Collapsed);
|
||||||
else
|
else
|
||||||
setStatus(cur, Open);
|
setStatus(cur, Open);
|
||||||
@ -562,7 +560,7 @@ void InsetCollapsable::doDispatch(Cursor & cur, FuncRequest & cmd)
|
|||||||
else if (cmd.argument() == "close")
|
else if (cmd.argument() == "close")
|
||||||
setStatus(cur, Collapsed);
|
setStatus(cur, Collapsed);
|
||||||
else if (cmd.argument() == "toggle" || cmd.argument().empty())
|
else if (cmd.argument() == "toggle" || cmd.argument().empty())
|
||||||
if (internalStatus() == Open) {
|
if (status_ == Open) {
|
||||||
setStatus(cur, Collapsed);
|
setStatus(cur, Collapsed);
|
||||||
if (geometry() == ButtonOnly)
|
if (geometry() == ButtonOnly)
|
||||||
cur.top().forwardPos();
|
cur.top().forwardPos();
|
||||||
|
@ -154,10 +154,6 @@ protected:
|
|||||||
///
|
///
|
||||||
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
|
virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
|
||||||
///
|
///
|
||||||
Dimension dimensionCollapsed() const;
|
|
||||||
///
|
|
||||||
Box const & buttonDim() const;
|
|
||||||
///
|
|
||||||
void edit(Cursor & cur, bool left);
|
void edit(Cursor & cur, bool left);
|
||||||
///
|
///
|
||||||
Inset * editXY(Cursor & cur, int x, int y);
|
Inset * editXY(Cursor & cur, int x, int y);
|
||||||
@ -167,20 +163,16 @@ protected:
|
|||||||
virtual void resetParagraphsFont();
|
virtual void resetParagraphsFont();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
///
|
|
||||||
mutable Box button_dim;
|
|
||||||
///
|
|
||||||
mutable int topx;
|
|
||||||
///
|
|
||||||
mutable int topbaseline;
|
|
||||||
///
|
///
|
||||||
InsetLayout const * layout_;
|
InsetLayout const * layout_;
|
||||||
///
|
|
||||||
CollapseStatus internalStatus() const { return status_; }
|
|
||||||
private:
|
private:
|
||||||
|
///
|
||||||
|
Dimension dimensionCollapsed() const;
|
||||||
///
|
///
|
||||||
docstring labelstring_;
|
docstring labelstring_;
|
||||||
///
|
///
|
||||||
|
mutable Box button_dim;
|
||||||
|
///
|
||||||
mutable CollapseStatus status_;
|
mutable CollapseStatus status_;
|
||||||
/// a substatus of the Open status, determined automatically in metrics
|
/// a substatus of the Open status, determined automatically in metrics
|
||||||
mutable bool openinlined_;
|
mutable bool openinlined_;
|
||||||
@ -190,9 +182,6 @@ private:
|
|||||||
bool mouse_hover_;
|
bool mouse_hover_;
|
||||||
};
|
};
|
||||||
|
|
||||||
// A helper function that pushes the cursor out of the inset.
|
|
||||||
void leaveInset(Cursor & cur, Inset const & in);
|
|
||||||
|
|
||||||
} // namespace lyx
|
} // namespace lyx
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user