2001-03-23 Juergen Vigna <jug@sad.it>
+ * insetcollapsable.C (InsetMotionNotify):
+ (InsetButtonRelease):
+ (InsetButtonPress): fixed y-offset (minipages).
+
* insettext.C (draw): force a FULL update if cleared == true.
* insetcollapsable.C (draw): Lars forgotten entry for changing this
void InsetCollapsable::InsetButtonPress(BufferView * bv,int x,int y,int button)
{
if (!collapsed && (x >= button_length)) {
- inset->InsetButtonPress(bv, x - widthCollapsed, y, button);
+ inset->InsetButtonPress(bv, x - widthCollapsed,
+ y + (top_baseline - inset->y()),
+ button);
}
}
bv->updateInset(this, false);
}
} else if (!collapsed && (x >= button_length) && (y >= button_top_y)) {
- inset->InsetButtonRelease(bv, x - widthCollapsed, y, button);
+ inset->InsetButtonRelease(bv, x - widthCollapsed,
+ y + (top_baseline - inset->y()),
+ button);
}
}
int x, int y, int state)
{
if (x >= button_length) {
- inset->InsetMotionNotify(bv, x-widthCollapsed, y, state);
+ inset->InsetMotionNotify(bv, x-widthCollapsed,
+ y + (top_baseline - inset->y()),
+ state);
}
}
if ((action < 0) && arg.empty())
return FINISHED;
+ bool hs = hasSelection();
+
+ result=DISPATCHED;
+ // this one have priority over the locked InsetText!
+ switch (action) {
+ case LFUN_SHIFT_TAB:
+ case LFUN_TAB:
+ {
+ HideInsetCursor(bv);
+ if (the_locking_inset) {
+ UnlockInsetInInset(bv, the_locking_inset);
+ the_locking_inset = 0;
+ }
+ if (action == LFUN_TAB)
+ moveNextCell(bv, old_locking_inset != 0);
+ else
+ movePrevCell(bv, old_locking_inset != 0);
+ sel_cell_start = sel_cell_end = actcell;
+ if (hs)
+ UpdateLocal(bv, SELECTION, false);
+ ShowInsetCursor(bv);
+ return result;
+ }
+ }
+
if (the_locking_inset) {
result=the_locking_inset->LocalDispatch(bv, action, arg);
if (result == DISPATCHED_NOUPDATE) {
}
}
- bool hs = hasSelection();
HideInsetCursor(bv);
result=DISPATCHED;
switch (action) {
break;
case LFUN_END:
break;
- case LFUN_SHIFT_TAB:
- case LFUN_TAB:
- {
- if (the_locking_inset) {
- UnlockInsetInInset(bv, the_locking_inset);
- the_locking_inset = 0;
- }
- if (action == LFUN_TAB)
- moveNextCell(bv, old_locking_inset != 0);
- else
- movePrevCell(bv, old_locking_inset != 0);
- sel_cell_start = sel_cell_end = actcell;
- if (hs)
- UpdateLocal(bv, SELECTION, false);
- break;
- }
case LFUN_LAYOUT_TABULAR:
{
bv->owner()->getDialogs()->showTabular(this);
frame_color = LColor::insetframe;
locked = false;
old_par = 0;
+ last_drawn_width = -1;
}
xpos = x;
UpdatableInset::draw(bv, f, baseline, x, cleared);
+ // update insetWidth and insetHeight with dummy calls
+ (void)ascent(bv, f);
+ (void)descent(bv, f);
+ (void)width(bv, f);
+
// if top_x differs we have a rule down and we don't have to clear anything
if (!cleared && (top_x == int(x)) &&
- ((need_update==INIT)||(need_update==FULL)||(top_baseline!=baseline)))
+ ((need_update==INIT)||(need_update==FULL)||(top_baseline!=baseline)||
+ (last_drawn_width!=insetWidth)))
{
int w = insetWidth;
int h = insetAscent + insetDescent;
bv->text->status = LyXText::CHANGED_IN_DRAW;
return;
}
- if (cleared)
- need_update = FULL;
+ if (cleared || (last_drawn_width != insetWidth)) {
+ need_update |= FULL;
+ last_drawn_width = insetWidth;
+ }
top_baseline = baseline;
top_y = baseline - ascent(bv, f);
LyXParagraph * old_par;
/// The cache.
mutable Cache cache;
+ ///
+ mutable int last_drawn_width;
};
#endif
features.longtable = true;
if (NeedRotating())
features.rotating = true;
- for (int cell = 0; cell < numberofcells; ++cell) {
+ for (int cell = 0; !features.array && (cell < numberofcells); ++cell) {
if (GetVAlignment(cell) != LYX_VALIGN_TOP)
features.array = true;
GetCellInset(cell)->Validate(features);