mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
Fix setting of math matrix size with mouse
This commit is contained in:
parent
99f7d7fa74
commit
110862b09f
@ -22,10 +22,6 @@
|
||||
* A simple widget for a quick "preview" in TabularCreateDialog
|
||||
*/
|
||||
|
||||
unsigned int const cellheight = 20;
|
||||
unsigned int const cellwidth = 30;
|
||||
|
||||
|
||||
EmptyTable::EmptyTable(QWidget * parent, int rows, int columns)
|
||||
: QTableWidget(rows, columns, parent)
|
||||
{
|
||||
@ -34,7 +30,9 @@ EmptyTable::EmptyTable(QWidget * parent, int rows, int columns)
|
||||
setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
|
||||
viewport()->resize(cellheight * rows, cellwidth * columns);
|
||||
setSelectionMode(QAbstractItemView::NoSelection);
|
||||
setFocusPolicy(Qt::NoFocus);
|
||||
setEditTriggers(QAbstractItemView::NoEditTriggers);
|
||||
adjustMinCellSize();
|
||||
}
|
||||
|
||||
|
||||
@ -43,6 +41,16 @@ QSize EmptyTable::sizeHint() const
|
||||
return QSize(cellwidth * (2 + columnCount()), cellheight * (2 + rowCount()));
|
||||
}
|
||||
|
||||
|
||||
void EmptyTable::adjustMinCellSize()
|
||||
{
|
||||
setRowHeight(0, cellheight);
|
||||
cellheight = rowHeight(0);
|
||||
setColumnWidth(0, cellwidth);
|
||||
cellwidth = columnWidth(0);
|
||||
}
|
||||
|
||||
|
||||
void EmptyTable::resetCellSize()
|
||||
{
|
||||
for(int i = 0; i < rowCount(); ++i)
|
||||
|
@ -49,6 +49,10 @@ protected:
|
||||
virtual void resetCellSize();
|
||||
|
||||
private:
|
||||
void adjustMinCellSize();
|
||||
|
||||
int cellheight = 20;
|
||||
int cellwidth = 30;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user