xsheet minimum layout
This commit is contained in:
parent
5d048343f6
commit
b34bf759e2
23 changed files with 624 additions and 185 deletions
|
@ -203,7 +203,8 @@ enum class PredefinedFlag {
|
||||||
THUMBNAIL_AREA_BORDER,
|
THUMBNAIL_AREA_BORDER,
|
||||||
THUMBNAIL_AREA_VISIBLE,
|
THUMBNAIL_AREA_VISIBLE,
|
||||||
CAMERA_ICON_VISIBLE,
|
CAMERA_ICON_VISIBLE,
|
||||||
VOLUME_AREA_VERTICAL
|
VOLUME_AREA_VERTICAL,
|
||||||
|
NOTE_AREA_IN_POPUP
|
||||||
};
|
};
|
||||||
|
|
||||||
// Knows everything about geometry of a particular orientation.
|
// Knows everything about geometry of a particular orientation.
|
||||||
|
|
|
@ -112,6 +112,12 @@ public:
|
||||||
ToggleBetweenGraphAndSpreadsheet
|
ToggleBetweenGraphAndSpreadsheet
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum LevelNameDisplayType {
|
||||||
|
ShowLevelName_Default = 0,
|
||||||
|
ShowLevelNameOnEachMarker,
|
||||||
|
ShowLevelNameOnColumnHeader
|
||||||
|
};
|
||||||
|
|
||||||
//--- callbacks
|
//--- callbacks
|
||||||
// General
|
// General
|
||||||
void enableAutosave();
|
void enableAutosave();
|
||||||
|
@ -212,15 +218,9 @@ public:
|
||||||
bool isActualPixelViewOnSceneEditingModeEnabled() const {
|
bool isActualPixelViewOnSceneEditingModeEnabled() const {
|
||||||
return getBoolValue(actualPixelViewOnSceneEditingMode);
|
return getBoolValue(actualPixelViewOnSceneEditingMode);
|
||||||
}
|
}
|
||||||
bool isLevelNameOnEachMarkerEnabled() const {
|
|
||||||
return getBoolValue(levelNameOnEachMarkerEnabled);
|
|
||||||
}
|
|
||||||
bool isShowRasterImagesDarkenBlendedInViewerEnabled() const {
|
bool isShowRasterImagesDarkenBlendedInViewerEnabled() const {
|
||||||
return getBoolValue(showRasterImagesDarkenBlendedInViewer);
|
return getBoolValue(showRasterImagesDarkenBlendedInViewer);
|
||||||
}
|
}
|
||||||
bool isShowFrameNumberWithLettersEnabled() const {
|
|
||||||
return getBoolValue(showFrameNumberWithLetters);
|
|
||||||
}
|
|
||||||
TDimension getIconSize() const { return getSizeValue(iconSize); }
|
TDimension getIconSize() const { return getSizeValue(iconSize); }
|
||||||
void getViewValues(int &shrink, int &step) const {
|
void getViewValues(int &shrink, int &step) const {
|
||||||
shrink = getIntValue(viewShrink), step = getIntValue(viewStep);
|
shrink = getIntValue(viewShrink), step = getIntValue(viewStep);
|
||||||
|
@ -406,6 +406,16 @@ public:
|
||||||
color = getColorValue(currentColumnColor);
|
color = getColorValue(currentColumnColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LevelNameDisplayType getLevelNameDisplayType() const {
|
||||||
|
return LevelNameDisplayType(getIntValue(levelNameDisplayType));
|
||||||
|
}
|
||||||
|
bool isLevelNameOnEachMarkerEnabled() const {
|
||||||
|
return getLevelNameDisplayType() == ShowLevelNameOnEachMarker;
|
||||||
|
}
|
||||||
|
bool isShowFrameNumberWithLettersEnabled() const {
|
||||||
|
return getBoolValue(showFrameNumberWithLetters);
|
||||||
|
}
|
||||||
|
|
||||||
// Animation tab
|
// Animation tab
|
||||||
int getKeyframeType() const { return getIntValue(keyframeType); }
|
int getKeyframeType() const { return getIntValue(keyframeType); }
|
||||||
int getAnimationStep() const { return getIntValue(animationStep); }
|
int getAnimationStep() const { return getIntValue(animationStep); }
|
||||||
|
|
|
@ -34,9 +34,7 @@ enum PreferencesItemId {
|
||||||
functionEditorToggle,
|
functionEditorToggle,
|
||||||
moveCurrentFrameByClickCellArea,
|
moveCurrentFrameByClickCellArea,
|
||||||
actualPixelViewOnSceneEditingMode,
|
actualPixelViewOnSceneEditingMode,
|
||||||
levelNameOnEachMarkerEnabled,
|
|
||||||
showRasterImagesDarkenBlendedInViewer,
|
showRasterImagesDarkenBlendedInViewer,
|
||||||
showFrameNumberWithLetters,
|
|
||||||
iconSize,
|
iconSize,
|
||||||
viewShrink,
|
viewShrink,
|
||||||
viewStep,
|
viewStep,
|
||||||
|
@ -132,6 +130,8 @@ enum PreferencesItemId {
|
||||||
syncLevelRenumberWithXsheet,
|
syncLevelRenumberWithXsheet,
|
||||||
currentTimelineEnabled,
|
currentTimelineEnabled,
|
||||||
currentColumnColor,
|
currentColumnColor,
|
||||||
|
levelNameDisplayType,
|
||||||
|
showFrameNumberWithLetters,
|
||||||
|
|
||||||
//----------
|
//----------
|
||||||
// Animation
|
// Animation
|
||||||
|
|
|
@ -175,6 +175,7 @@ the tree or
|
||||||
|
|
||||||
void setName(const std::string &name);
|
void setName(const std::string &name);
|
||||||
std::string getName() const;
|
std::string getName() const;
|
||||||
|
bool hasSpecifiedName() { return m_name != ""; }
|
||||||
|
|
||||||
bool hasSpecifiedName() const { return m_name != ""; }
|
bool hasSpecifiedName() const { return m_name != ""; }
|
||||||
|
|
||||||
|
|
|
@ -151,6 +151,7 @@ public slots:
|
||||||
void onCurveChanged(bool isDragging);
|
void onCurveChanged(bool isDragging);
|
||||||
void onCurveSelected(TDoubleParam *);
|
void onCurveSelected(TDoubleParam *);
|
||||||
void onSelectionChanged();
|
void onSelectionChanged();
|
||||||
|
void onPreferenceChanged(const QString &);
|
||||||
|
|
||||||
void doSwitchCurrentObject(TStageObject *obj);
|
void doSwitchCurrentObject(TStageObject *obj);
|
||||||
void doSwitchCurrentFx(TFx *fx);
|
void doSwitchCurrentFx(TFx *fx);
|
||||||
|
|
|
@ -476,6 +476,9 @@ public:
|
||||||
|
|
||||||
virtual int getFrameZoomFactor() const { return 100; }
|
virtual int getFrameZoomFactor() const { return 100; }
|
||||||
|
|
||||||
|
bool isSmallHeader();
|
||||||
|
void updateHeaderHeight();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool event(QEvent *e) override;
|
bool event(QEvent *e) override;
|
||||||
void showEvent(QShowEvent *) override;
|
void showEvent(QShowEvent *) override;
|
||||||
|
|
|
@ -43,6 +43,9 @@ LayerFooterPanel::LayerFooterPanel(XsheetViewer *viewer, QWidget *parent,
|
||||||
m_frameZoomSlider->setInvertedAppearance(invDirection);
|
m_frameZoomSlider->setInvertedAppearance(invDirection);
|
||||||
m_frameZoomSlider->setInvertedControls(invDirection);
|
m_frameZoomSlider->setInvertedControls(invDirection);
|
||||||
|
|
||||||
|
// for minimal layout, hide the slider
|
||||||
|
if (o->rect(PredefinedRect::ZOOM_SLIDER).isEmpty()) m_frameZoomSlider->hide();
|
||||||
|
|
||||||
connect(m_frameZoomSlider, SIGNAL(valueChanged(int)), this,
|
connect(m_frameZoomSlider, SIGNAL(valueChanged(int)), this,
|
||||||
SLOT(onFrameZoomSliderValueChanged(int)));
|
SLOT(onFrameZoomSliderValueChanged(int)));
|
||||||
}
|
}
|
||||||
|
@ -144,6 +147,12 @@ void LayerFooterPanel::showOrHide(const Orientation *o) {
|
||||||
m_frameZoomSlider->setInvertedAppearance(invDirection);
|
m_frameZoomSlider->setInvertedAppearance(invDirection);
|
||||||
m_frameZoomSlider->setInvertedControls(invDirection);
|
m_frameZoomSlider->setInvertedControls(invDirection);
|
||||||
|
|
||||||
|
// for minimal layout, hide the slider
|
||||||
|
if (o->rect(PredefinedRect::ZOOM_SLIDER).isEmpty())
|
||||||
|
m_frameZoomSlider->hide();
|
||||||
|
else
|
||||||
|
m_frameZoomSlider->show();
|
||||||
|
|
||||||
show();
|
show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1003,11 +1003,8 @@ QString PreferencesPopup::getUIString(PreferencesItemId id) {
|
||||||
"Area")},
|
"Area")},
|
||||||
{actualPixelViewOnSceneEditingMode,
|
{actualPixelViewOnSceneEditingMode,
|
||||||
tr("Enable Actual Pixel View on Scene Editing Mode")},
|
tr("Enable Actual Pixel View on Scene Editing Mode")},
|
||||||
{levelNameOnEachMarkerEnabled, tr("Display Level Name on Each Marker")},
|
|
||||||
{showRasterImagesDarkenBlendedInViewer,
|
{showRasterImagesDarkenBlendedInViewer,
|
||||||
tr("Show Raster Images Darken Blended")},
|
tr("Show Raster Images Darken Blended")},
|
||||||
{showFrameNumberWithLetters,
|
|
||||||
tr("Show \"ABC\" Appendix to the Frame Number in Cell")},
|
|
||||||
{iconSize, tr("Level Strip Thumbnail Size*:")},
|
{iconSize, tr("Level Strip Thumbnail Size*:")},
|
||||||
{viewShrink, tr("Viewer Shrink:")},
|
{viewShrink, tr("Viewer Shrink:")},
|
||||||
{viewStep, tr("Step:")},
|
{viewStep, tr("Step:")},
|
||||||
|
@ -1115,6 +1112,11 @@ QString PreferencesPopup::getUIString(PreferencesItemId id) {
|
||||||
{currentTimelineEnabled,
|
{currentTimelineEnabled,
|
||||||
tr("Show Current Time Indicator (Timeline Mode only)")},
|
tr("Show Current Time Indicator (Timeline Mode only)")},
|
||||||
{currentColumnColor, tr("Current Column Color:")},
|
{currentColumnColor, tr("Current Column Color:")},
|
||||||
|
//{ levelNameOnEachMarkerEnabled, tr("Display Level Name on Each Marker")
|
||||||
|
//},
|
||||||
|
{levelNameDisplayType, tr("Level Name Display:")},
|
||||||
|
{showFrameNumberWithLetters,
|
||||||
|
tr("Show \"ABC\" Appendix to the Frame Number in Xsheet Cell")},
|
||||||
|
|
||||||
// Animation
|
// Animation
|
||||||
{keyframeType, tr("Default Interpolation:")},
|
{keyframeType, tr("Default Interpolation:")},
|
||||||
|
@ -1238,7 +1240,13 @@ QList<ComboBoxItem> PreferencesPopup::getComboItemList(
|
||||||
{tr("Enable Tools For Level Only"), 1},
|
{tr("Enable Tools For Level Only"), 1},
|
||||||
{tr("Show Tools For Level Only"), 2}}},
|
{tr("Show Tools For Level Only"), 2}}},
|
||||||
{xsheetLayoutPreference,
|
{xsheetLayoutPreference,
|
||||||
{{tr("Compact"), "Compact"}, {tr("Roomy"), "Roomy"}}},
|
{{tr("Compact"), "Compact"}, {tr("Roomy"), "Roomy"},
|
||||||
|
{tr("Minimum"), "Minimum"}}},
|
||||||
|
{levelNameDisplayType,
|
||||||
|
{{tr("Default"), Preferences::ShowLevelName_Default},
|
||||||
|
{tr("Display on Each Marker"), Preferences::ShowLevelNameOnEachMarker},
|
||||||
|
{tr("Display on Column Header"),
|
||||||
|
Preferences::ShowLevelNameOnColumnHeader}}},
|
||||||
{DragCellsBehaviour,
|
{DragCellsBehaviour,
|
||||||
{{tr("Cells Only"), 0}, {tr("Cells and Column Data"), 1}}},
|
{{tr("Cells Only"), 0}, {tr("Cells and Column Data"), 1}}},
|
||||||
{keyframeType, // note that the value starts from 1, not 0
|
{keyframeType, // note that the value starts from 1, not 0
|
||||||
|
@ -1469,10 +1477,8 @@ QWidget* PreferencesPopup::createInterfacePage() {
|
||||||
insertUI(functionEditorToggle, lay, getComboItemList(functionEditorToggle));
|
insertUI(functionEditorToggle, lay, getComboItemList(functionEditorToggle));
|
||||||
insertUI(moveCurrentFrameByClickCellArea, lay);
|
insertUI(moveCurrentFrameByClickCellArea, lay);
|
||||||
insertUI(actualPixelViewOnSceneEditingMode, lay);
|
insertUI(actualPixelViewOnSceneEditingMode, lay);
|
||||||
// insertUI(levelNameOnEachMarkerEnabled, lay);
|
|
||||||
insertUI(viewerIndicatorEnabled, lay);
|
insertUI(viewerIndicatorEnabled, lay);
|
||||||
insertUI(showRasterImagesDarkenBlendedInViewer, lay);
|
insertUI(showRasterImagesDarkenBlendedInViewer, lay);
|
||||||
// insertUI(showFrameNumberWithLetters, lay);
|
|
||||||
insertUI(iconSize, lay);
|
insertUI(iconSize, lay);
|
||||||
insertDualUIs(viewShrink, viewStep, lay);
|
insertDualUIs(viewShrink, viewStep, lay);
|
||||||
// insertUI(viewerZoomCenter, lay, getComboItemList(viewerZoomCenter));
|
// insertUI(viewerZoomCenter, lay, getComboItemList(viewerZoomCenter));
|
||||||
|
@ -1753,6 +1759,7 @@ QWidget* PreferencesPopup::createXsheetPage() {
|
||||||
|
|
||||||
insertUI(xsheetLayoutPreference, lay,
|
insertUI(xsheetLayoutPreference, lay,
|
||||||
getComboItemList(xsheetLayoutPreference));
|
getComboItemList(xsheetLayoutPreference));
|
||||||
|
insertUI(levelNameDisplayType, lay, getComboItemList(levelNameDisplayType));
|
||||||
insertUI(xsheetStep, lay);
|
insertUI(xsheetStep, lay);
|
||||||
insertUI(xsheetAutopanEnabled, lay);
|
insertUI(xsheetAutopanEnabled, lay);
|
||||||
insertUI(DragCellsBehaviour, lay, getComboItemList(DragCellsBehaviour));
|
insertUI(DragCellsBehaviour, lay, getComboItemList(DragCellsBehaviour));
|
||||||
|
@ -1769,6 +1776,7 @@ QWidget* PreferencesPopup::createXsheetPage() {
|
||||||
// insertUI(syncLevelRenumberWithXsheet, lay);
|
// insertUI(syncLevelRenumberWithXsheet, lay);
|
||||||
// insertUI(currentTimelineEnabled, lay);
|
// insertUI(currentTimelineEnabled, lay);
|
||||||
insertUI(currentColumnColor, lay);
|
insertUI(currentColumnColor, lay);
|
||||||
|
// insertUI(showFrameNumberWithLetters, lay);
|
||||||
|
|
||||||
lay->setRowStretch(lay->rowCount(), 1);
|
lay->setRowStretch(lay->rowCount(), 1);
|
||||||
insertFootNote(lay);
|
insertFootNote(lay);
|
||||||
|
|
|
@ -80,6 +80,26 @@
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
const bool checkContainsSingleLevel(TXshColumn *column) {
|
||||||
|
TXshLevel *level = nullptr;
|
||||||
|
TXshCellColumn *cellColumn = column->getCellColumn();
|
||||||
|
if (cellColumn) {
|
||||||
|
int i, r0, r1;
|
||||||
|
cellColumn->getRange(r0, r1);
|
||||||
|
for (i = r0; i <= r1; i++) {
|
||||||
|
TXshCell cell = cellColumn->getCell(i);
|
||||||
|
if (cell.isEmpty()) continue;
|
||||||
|
TXshLevel *lvl = cell.m_level.getPointer();
|
||||||
|
if (!level)
|
||||||
|
level = lvl;
|
||||||
|
else if (lvl != level)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return level != nullptr;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool selectionContainTlvImage(TCellSelection *selection, TXsheet *xsheet,
|
bool selectionContainTlvImage(TCellSelection *selection, TXsheet *xsheet,
|
||||||
bool onlyTlv = false) {
|
bool onlyTlv = false) {
|
||||||
int r0, r1, c0, c1;
|
int r0, r1, c0, c1;
|
||||||
|
@ -1241,10 +1261,16 @@ void CellArea::drawCells(QPainter &p, const QRect toBeUpdated) {
|
||||||
bool isSoundColumn = false;
|
bool isSoundColumn = false;
|
||||||
bool isPaletteColumn = false;
|
bool isPaletteColumn = false;
|
||||||
bool isSoundTextColumn = false;
|
bool isSoundTextColumn = false;
|
||||||
|
bool showLevelName = true;
|
||||||
if (isColumn) {
|
if (isColumn) {
|
||||||
isSoundColumn = column->getSoundColumn() != 0;
|
isSoundColumn = column->getSoundColumn() != 0;
|
||||||
isPaletteColumn = column->getPaletteColumn() != 0;
|
isPaletteColumn = column->getPaletteColumn() != 0;
|
||||||
isSoundTextColumn = column->getSoundTextColumn() != 0;
|
isSoundTextColumn = column->getSoundTextColumn() != 0;
|
||||||
|
if (Preferences::instance()->getLevelNameDisplayType() ==
|
||||||
|
Preferences::ShowLevelNameOnColumnHeader)
|
||||||
|
showLevelName =
|
||||||
|
(isSoundColumn || isPaletteColumn || isSoundTextColumn ||
|
||||||
|
!checkContainsSingleLevel(column));
|
||||||
}
|
}
|
||||||
// check if the column is reference
|
// check if the column is reference
|
||||||
bool isReference = true;
|
bool isReference = true;
|
||||||
|
@ -1283,7 +1309,7 @@ void CellArea::drawCells(QPainter &p, const QRect toBeUpdated) {
|
||||||
else if (isSoundTextColumn)
|
else if (isSoundTextColumn)
|
||||||
drawSoundTextCell(p, row, col);
|
drawSoundTextCell(p, row, col);
|
||||||
else
|
else
|
||||||
drawLevelCell(p, row, col, isReference);
|
drawLevelCell(p, row, col, isReference, showLevelName);
|
||||||
}
|
}
|
||||||
|
|
||||||
// draw vertical line
|
// draw vertical line
|
||||||
|
@ -1737,7 +1763,8 @@ void CellArea::drawFrameMarker(QPainter &p, const QPoint &xy, QColor color,
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
void CellArea::drawLevelCell(QPainter &p, int row, int col, bool isReference) {
|
void CellArea::drawLevelCell(QPainter &p, int row, int col, bool isReference,
|
||||||
|
bool showLevelName) {
|
||||||
const Orientation *o = m_viewer->orientation();
|
const Orientation *o = m_viewer->orientation();
|
||||||
|
|
||||||
TXsheet *xsh = m_viewer->getXsheet();
|
TXsheet *xsh = m_viewer->getXsheet();
|
||||||
|
@ -1957,6 +1984,12 @@ void CellArea::drawLevelCell(QPainter &p, int row, int col, bool isReference) {
|
||||||
|
|
||||||
QLine continueLine = o->line(which).translated(xy);
|
QLine continueLine = o->line(which).translated(xy);
|
||||||
continueLine.setP2(QPoint(continueLine.x2(), continueLine.y2()) - frameAdj);
|
continueLine.setP2(QPoint(continueLine.x2(), continueLine.y2()) - frameAdj);
|
||||||
|
|
||||||
|
if (!showLevelName) {
|
||||||
|
penColor.setAlphaF(0.5);
|
||||||
|
p.setPen(penColor);
|
||||||
|
}
|
||||||
|
|
||||||
p.drawLine(continueLine);
|
p.drawLine(continueLine);
|
||||||
}
|
}
|
||||||
// draw frame number
|
// draw frame number
|
||||||
|
@ -1987,13 +2020,16 @@ void CellArea::drawLevelCell(QPainter &p, int row, int col, bool isReference) {
|
||||||
fnum = QString::fromStdString(frameNumber);
|
fnum = QString::fromStdString(frameNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
p.drawText(nameRect, Qt::AlignRight | Qt::AlignBottom, fnum);
|
int alignFlag =
|
||||||
|
((showLevelName) ? Qt::AlignRight | Qt::AlignBottom : Qt::AlignCenter);
|
||||||
|
p.drawText(nameRect, alignFlag, fnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
// draw level name
|
// draw level name
|
||||||
if (!sameLevel ||
|
if (showLevelName &&
|
||||||
(isAfterMarkers && !isSimpleView &&
|
(!sameLevel ||
|
||||||
Preferences::instance()->isLevelNameOnEachMarkerEnabled())) {
|
(isAfterMarkers && !isSimpleView &&
|
||||||
|
Preferences::instance()->isLevelNameOnEachMarkerEnabled()))) {
|
||||||
std::wstring levelName = cell.m_level->getName();
|
std::wstring levelName = cell.m_level->getName();
|
||||||
QString text = QString::fromStdWString(levelName);
|
QString text = QString::fromStdWString(levelName);
|
||||||
QFontMetrics fm(font);
|
QFontMetrics fm(font);
|
||||||
|
@ -3008,9 +3044,8 @@ void CellArea::mouseMoveEvent(QMouseEvent *event) {
|
||||||
double e0, e1;
|
double e0, e1;
|
||||||
int rh0, rh1;
|
int rh0, rh1;
|
||||||
if (pegbar->getKeyframeSpan(row, r0, e0, r1, e1) &&
|
if (pegbar->getKeyframeSpan(row, r0, e0, r1, e1) &&
|
||||||
getEaseHandles(
|
getEaseHandles(r0, r1, e0, e1, rh0,
|
||||||
r0, r1, e0, e1, rh0,
|
rh1)) { // triangles in the segment between key frames
|
||||||
rh1)) { // triangles in the segment between key frames
|
|
||||||
if (rh0 == row)
|
if (rh0 == row)
|
||||||
m_tooltip = tr("Click and drag to set the acceleration range");
|
m_tooltip = tr("Click and drag to set the acceleration range");
|
||||||
else if (rh1 == row)
|
else if (rh1 == row)
|
||||||
|
|
|
@ -97,7 +97,10 @@ class CellArea final : public QWidget {
|
||||||
|
|
||||||
void drawFrameSeparator(QPainter &p, int row, int col, bool emptyFrame,
|
void drawFrameSeparator(QPainter &p, int row, int col, bool emptyFrame,
|
||||||
bool heldFrame = false);
|
bool heldFrame = false);
|
||||||
void drawLevelCell(QPainter &p, int row, int col, bool isReference = false);
|
// showLevelName can be OFF only when Preferences::getLevelNameDisplayType()
|
||||||
|
// == ShowLevelNameOnColumnHeader
|
||||||
|
void drawLevelCell(QPainter &p, int row, int col, bool isReference = false,
|
||||||
|
bool showLevelName = true);
|
||||||
void drawSoundTextCell(QPainter &p, int row, int col);
|
void drawSoundTextCell(QPainter &p, int row, int col);
|
||||||
void drawSoundCell(QPainter &p, int row, int col, bool isReference = false);
|
void drawSoundCell(QPainter &p, int row, int col, bool isReference = false);
|
||||||
void drawPaletteCell(QPainter &p, int row, int col, bool isReference = false);
|
void drawPaletteCell(QPainter &p, int row, int col, bool isReference = false);
|
||||||
|
|
|
@ -63,25 +63,28 @@
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
|
#include <QCheckBox>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QDesktopWidget>
|
#include <QDesktopWidget>
|
||||||
|
|
||||||
#include <QBitmap>
|
#include <QBitmap>
|
||||||
|
|
||||||
TEnv::IntVar ShowParentColorsInXsheet("ShowParentColorsInXsheet", 1);
|
TEnv::IntVar ShowParentColorsInXsheet("ShowParentColorsInXsheet", 1);
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
const QSet<TXshSimpleLevel *> getLevels(TXshColumn *column) {
|
const QSet<TXshLevel *> getLevels(TXshColumn *column) {
|
||||||
QSet<TXshSimpleLevel *> levels;
|
QSet<TXshLevel *> levels;
|
||||||
|
|
||||||
TXshCellColumn *cellColumn = column->getCellColumn();
|
TXshCellColumn *cellColumn = column->getCellColumn();
|
||||||
if (cellColumn) {
|
if (cellColumn) {
|
||||||
int i, r0, r1;
|
int i, r0, r1;
|
||||||
cellColumn->getRange(r0, r1);
|
cellColumn->getRange(r0, r1);
|
||||||
for (i = r0; i <= r1; i++) {
|
for (i = r0; i <= r1; i++) {
|
||||||
TXshCell cell = cellColumn->getCell(i);
|
TXshCell cell = cellColumn->getCell(i);
|
||||||
TXshSimpleLevel *sl = cell.getSimpleLevel();
|
// TXshSimpleLevel *sl = cell.getSimpleLevel();
|
||||||
if (sl) levels.insert(sl);
|
if (!cell.isEmpty()) levels.insert(cell.m_level.getPointer());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return levels;
|
return levels;
|
||||||
|
@ -126,12 +129,12 @@ bool containsVectorLevel(int col) {
|
||||||
TXshColumn::ColumnType type = column->getColumnType();
|
TXshColumn::ColumnType type = column->getColumnType();
|
||||||
if (type != TXshColumn::eLevelType) return false;
|
if (type != TXshColumn::eLevelType) return false;
|
||||||
|
|
||||||
const QSet<TXshSimpleLevel *> levels = getLevels(column);
|
const QSet<TXshLevel *> levels = getLevels(column);
|
||||||
QSet<TXshSimpleLevel *>::const_iterator it2;
|
QSet<TXshLevel *>::const_iterator it2;
|
||||||
bool isVector = false;
|
bool isVector = false;
|
||||||
for (it2 = levels.begin(); it2 != levels.end(); it2++) {
|
for (it2 = levels.begin(); it2 != levels.end(); it2++) {
|
||||||
TXshSimpleLevel *sl = *it2;
|
TXshLevel *lvl = *it2;
|
||||||
int type = sl->getType();
|
int type = lvl->getType();
|
||||||
if (type == PLI_XSHLEVEL) {
|
if (type == PLI_XSHLEVEL) {
|
||||||
isVector = true;
|
isVector = true;
|
||||||
return true;
|
return true;
|
||||||
|
@ -140,6 +143,25 @@ bool containsVectorLevel(int col) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QIcon createLockIcon(XsheetViewer *viewer) {
|
||||||
|
QImage icon_on, icon_off;
|
||||||
|
QColor bgColor_on, bgColor_off;
|
||||||
|
viewer->getButton(LOCK_ON_XSHBUTTON, bgColor_on, icon_on);
|
||||||
|
viewer->getButton(LOCK_OFF_XSHBUTTON, bgColor_off, icon_off);
|
||||||
|
QPainter p_on(&icon_on);
|
||||||
|
p_on.setCompositionMode(QPainter::CompositionMode_DestinationOver);
|
||||||
|
p_on.fillRect(0, 0, icon_on.width(), icon_on.height(), bgColor_on);
|
||||||
|
p_on.end();
|
||||||
|
QPainter p_off(&icon_off);
|
||||||
|
p_off.setCompositionMode(QPainter::CompositionMode_DestinationOver);
|
||||||
|
p_off.fillRect(0, 0, icon_off.width(), icon_off.height(), bgColor_off);
|
||||||
|
p_off.end();
|
||||||
|
QIcon lockIcon;
|
||||||
|
lockIcon.addPixmap(QPixmap::fromImage(icon_off));
|
||||||
|
lockIcon.addPixmap(QPixmap::fromImage(icon_on), QIcon::Normal, QIcon::On);
|
||||||
|
return lockIcon;
|
||||||
|
}
|
||||||
|
|
||||||
bool isCtrlPressed = false;
|
bool isCtrlPressed = false;
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
@ -1009,6 +1031,14 @@ void ColumnArea::DrawHeader::drawColumnName() const {
|
||||||
|
|
||||||
// Build column name
|
// Build column name
|
||||||
std::string name(columnObject->getName());
|
std::string name(columnObject->getName());
|
||||||
|
|
||||||
|
// if a single level is in the column, show the level name instead
|
||||||
|
if (column && !columnObject->hasSpecifiedName() &&
|
||||||
|
Preferences::instance()->getLevelNameDisplayType() ==
|
||||||
|
Preferences::ShowLevelNameOnColumnHeader) {
|
||||||
|
QSet<TXshLevel *> levels = getLevels(column);
|
||||||
|
if (levels.size() == 1) name = to_string((*levels.begin())->getName());
|
||||||
|
}
|
||||||
// if (col < 0) name = std::string("Camera");
|
// if (col < 0) name = std::string("Camera");
|
||||||
|
|
||||||
// ZeraryFx columns store name elsewhere
|
// ZeraryFx columns store name elsewhere
|
||||||
|
@ -1089,6 +1119,10 @@ void ColumnArea::DrawHeader::drawThumbnail(QPixmap &iconPixmap) const {
|
||||||
QRect thumbnailRect = o->rect((col < 0) ? PredefinedRect::CAMERA_ICON_AREA
|
QRect thumbnailRect = o->rect((col < 0) ? PredefinedRect::CAMERA_ICON_AREA
|
||||||
: PredefinedRect::THUMBNAIL_AREA)
|
: PredefinedRect::THUMBNAIL_AREA)
|
||||||
.translated(orig);
|
.translated(orig);
|
||||||
|
|
||||||
|
// Minimum layout has no thumbnail area
|
||||||
|
if (thumbnailRect.isEmpty()) return;
|
||||||
|
|
||||||
p.setPen(m_viewer->getVerticalLineColor());
|
p.setPen(m_viewer->getVerticalLineColor());
|
||||||
if (o->flag(PredefinedFlag::THUMBNAIL_AREA_BORDER)) p.drawRect(thumbnailRect);
|
if (o->flag(PredefinedFlag::THUMBNAIL_AREA_BORDER)) p.drawRect(thumbnailRect);
|
||||||
|
|
||||||
|
@ -1540,7 +1574,7 @@ void ColumnArea::drawLevelColumnHead(QPainter &p, int col) {
|
||||||
|
|
||||||
bool isSelected =
|
bool isSelected =
|
||||||
m_viewer->getColumnSelection()->isColumnSelected(col) && !isEditingSpline;
|
m_viewer->getColumnSelection()->isColumnSelected(col) && !isEditingSpline;
|
||||||
bool isCameraSelected = col == -1 && isCurrent && !isEditingSpline;
|
// bool isCameraSelected = col == -1 && isCurrent && !isEditingSpline;
|
||||||
|
|
||||||
// Draw column
|
// Draw column
|
||||||
DrawHeader drawHeader(this, p, col);
|
DrawHeader drawHeader(this, p, col);
|
||||||
|
@ -1551,14 +1585,14 @@ void ColumnArea::drawLevelColumnHead(QPainter &p, int col) {
|
||||||
drawHeader.drawEye();
|
drawHeader.drawEye();
|
||||||
drawHeader.drawPreviewToggle(column ? column->getOpacity() : 0);
|
drawHeader.drawPreviewToggle(column ? column->getOpacity() : 0);
|
||||||
drawHeader.drawLock();
|
drawHeader.drawLock();
|
||||||
drawHeader.drawConfig();
|
|
||||||
drawHeader.drawColumnName();
|
drawHeader.drawColumnName();
|
||||||
drawHeader.drawColumnNumber();
|
drawHeader.drawColumnNumber();
|
||||||
QPixmap iconPixmap = getColumnIcon(col);
|
QPixmap iconPixmap = getColumnIcon(col);
|
||||||
drawHeader.drawThumbnail(iconPixmap);
|
drawHeader.drawThumbnail(iconPixmap);
|
||||||
|
drawHeader.drawFilterColor();
|
||||||
|
drawHeader.drawConfig();
|
||||||
drawHeader.drawPegbarName();
|
drawHeader.drawPegbarName();
|
||||||
drawHeader.drawParentHandleName();
|
drawHeader.drawParentHandleName();
|
||||||
drawHeader.drawFilterColor();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@ -1613,7 +1647,7 @@ void ColumnArea::drawSoundColumnHead(QPainter &p, int col) { // AREA
|
||||||
drawHeader.drawThumbnail(iconignored);
|
drawHeader.drawThumbnail(iconignored);
|
||||||
drawHeader.drawPegbarName();
|
drawHeader.drawPegbarName();
|
||||||
drawHeader.drawParentHandleName();
|
drawHeader.drawParentHandleName();
|
||||||
drawHeader.drawFilterColor();
|
// drawHeader.drawFilterColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@ -1664,7 +1698,7 @@ void ColumnArea::drawPaletteColumnHead(QPainter &p, int col) { // AREA
|
||||||
drawHeader.drawThumbnail(iconPixmap);
|
drawHeader.drawThumbnail(iconPixmap);
|
||||||
drawHeader.drawPegbarName();
|
drawHeader.drawPegbarName();
|
||||||
drawHeader.drawParentHandleName();
|
drawHeader.drawParentHandleName();
|
||||||
drawHeader.drawFilterColor();
|
// drawHeader.drawFilterColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@ -1721,7 +1755,7 @@ void ColumnArea::drawSoundTextColumnHead(QPainter &p, int col) { // AREA
|
||||||
drawHeader.drawThumbnail(iconPixmap);
|
drawHeader.drawThumbnail(iconPixmap);
|
||||||
drawHeader.drawPegbarName();
|
drawHeader.drawPegbarName();
|
||||||
drawHeader.drawParentHandleName();
|
drawHeader.drawParentHandleName();
|
||||||
drawHeader.drawFilterColor();
|
// drawHeader.drawFilterColor();
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@ -1765,11 +1799,10 @@ QPixmap ColumnArea::getColumnIcon(int columnIndex) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QPixmap icon =
|
QPixmap icon =
|
||||||
zColumn
|
zColumn ? FxIconPixmapManager::instance()->getFxIconPm(
|
||||||
? FxIconPixmapManager::instance()->getFxIconPm(
|
zColumn->getZeraryColumnFx()->getZeraryFx()->getFxType())
|
||||||
zColumn->getZeraryColumnFx()->getZeraryFx()->getFxType())
|
: IconGenerator::instance()->getIcon(xl, cell.m_frameId, false,
|
||||||
: IconGenerator::instance()->getIcon(xl, cell.m_frameId, false,
|
onDemand);
|
||||||
onDemand);
|
|
||||||
QRect thumbnailImageRect = o->rect(PredefinedRect::THUMBNAIL);
|
QRect thumbnailImageRect = o->rect(PredefinedRect::THUMBNAIL);
|
||||||
if (thumbnailImageRect.isEmpty()) return QPixmap();
|
if (thumbnailImageRect.isEmpty()) return QPixmap();
|
||||||
return scalePixmapKeepingAspectRatio(icon, thumbnailImageRect.size());
|
return scalePixmapKeepingAspectRatio(icon, thumbnailImageRect.size());
|
||||||
|
@ -1836,8 +1869,9 @@ void ColumnArea::paintEvent(QPaintEvent *event) { // AREA
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
using namespace DVGui;
|
using namespace DVGui;
|
||||||
|
|
||||||
ColumnTransparencyPopup::ColumnTransparencyPopup(QWidget *parent)
|
ColumnTransparencyPopup::ColumnTransparencyPopup(XsheetViewer *viewer,
|
||||||
: QWidget(parent, Qt::Popup) {
|
QWidget *parent)
|
||||||
|
: QWidget(parent, Qt::Popup), m_viewer(viewer), m_lockBtn(nullptr) {
|
||||||
setFixedWidth(8 + 78 + 8 + 100 + 8 + 8 + 8 + 7);
|
setFixedWidth(8 + 78 + 8 + 100 + 8 + 8 + 8 + 7);
|
||||||
|
|
||||||
m_slider = new QSlider(Qt::Horizontal, this);
|
m_slider = new QSlider(Qt::Horizontal, this);
|
||||||
|
@ -1863,31 +1897,59 @@ m_value->setFont(font);*/
|
||||||
m_filterColorCombo->addItem(getColorChipIcon(info.second), info.first, f);
|
m_filterColorCombo->addItem(getColorChipIcon(info.second), info.first, f);
|
||||||
}
|
}
|
||||||
|
|
||||||
QLabel *filterLabel = new QLabel(tr("Filter:"), this);
|
// Lock button is moved in the popup for Minimum layout
|
||||||
QLabel *sliderLabel = new QLabel(tr("Opacity:"), this);
|
QPushButton *lockExtraBtn = nullptr;
|
||||||
|
if (m_viewer->getXsheetLayout() == "Minimum") {
|
||||||
|
m_lockBtn = new QPushButton(tr("Lock Column"), this);
|
||||||
|
m_lockBtn->setCheckable(true);
|
||||||
|
m_lockBtn->setIcon(createLockIcon(m_viewer));
|
||||||
|
lockExtraBtn = new QPushButton(this);
|
||||||
|
QMenu *menu = new QMenu();
|
||||||
|
menu->setObjectName("xsheetColumnAreaMenu_Lock");
|
||||||
|
CommandManager *cmdManager = CommandManager::instance();
|
||||||
|
menu->addAction(cmdManager->getAction("MI_LockThisColumnOnly"));
|
||||||
|
menu->addAction(cmdManager->getAction("MI_LockSelectedColumns"));
|
||||||
|
menu->addAction(cmdManager->getAction("MI_LockAllColumns"));
|
||||||
|
menu->addAction(cmdManager->getAction("MI_UnlockSelectedColumns"));
|
||||||
|
menu->addAction(cmdManager->getAction("MI_UnlockAllColumns"));
|
||||||
|
menu->addAction(cmdManager->getAction("MI_ToggleColumnLocks"));
|
||||||
|
lockExtraBtn->setMenu(menu);
|
||||||
|
lockExtraBtn->setFixedSize(20, 20);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
QVBoxLayout *mainLayout = new QVBoxLayout();
|
QGridLayout *mainLayout = new QGridLayout();
|
||||||
mainLayout->setMargin(3);
|
mainLayout->setMargin(3);
|
||||||
mainLayout->setSpacing(3);
|
mainLayout->setHorizontalSpacing(6);
|
||||||
|
mainLayout->setVerticalSpacing(6);
|
||||||
{
|
{
|
||||||
|
mainLayout->addWidget(new QLabel(tr("Opacity:"), this), 0, 0,
|
||||||
|
Qt::AlignRight | Qt::AlignVCenter);
|
||||||
QHBoxLayout *hlayout = new QHBoxLayout;
|
QHBoxLayout *hlayout = new QHBoxLayout;
|
||||||
// hlayout->setContentsMargins(0, 3, 0, 3);
|
|
||||||
hlayout->setMargin(0);
|
hlayout->setMargin(0);
|
||||||
hlayout->setSpacing(3);
|
hlayout->setSpacing(3);
|
||||||
hlayout->addWidget(sliderLabel, 0);
|
|
||||||
hlayout->addWidget(m_slider);
|
|
||||||
hlayout->addWidget(m_value);
|
|
||||||
hlayout->addWidget(new QLabel("%"));
|
|
||||||
mainLayout->addLayout(hlayout, 0);
|
|
||||||
|
|
||||||
QHBoxLayout *filterColorLay = new QHBoxLayout();
|
|
||||||
filterColorLay->setMargin(0);
|
|
||||||
filterColorLay->setSpacing(2);
|
|
||||||
{
|
{
|
||||||
filterColorLay->addWidget(filterLabel, 0);
|
hlayout->addWidget(m_slider);
|
||||||
filterColorLay->addWidget(m_filterColorCombo, 1);
|
hlayout->addWidget(m_value);
|
||||||
|
hlayout->addWidget(new QLabel("%"));
|
||||||
|
}
|
||||||
|
mainLayout->addLayout(hlayout, 0, 1);
|
||||||
|
|
||||||
|
mainLayout->addWidget(new QLabel(tr("Filter:"), this), 1, 0,
|
||||||
|
Qt::AlignRight | Qt::AlignVCenter);
|
||||||
|
mainLayout->addWidget(m_filterColorCombo, 1, 1,
|
||||||
|
Qt::AlignLeft | Qt::AlignVCenter);
|
||||||
|
|
||||||
|
if (m_lockBtn) {
|
||||||
|
QHBoxLayout *lockLay = new QHBoxLayout();
|
||||||
|
lockLay->setMargin(0);
|
||||||
|
lockLay->setSpacing(3);
|
||||||
|
{
|
||||||
|
lockLay->addWidget(m_lockBtn, 0);
|
||||||
|
lockLay->addWidget(lockExtraBtn, 0);
|
||||||
|
}
|
||||||
|
mainLayout->addLayout(lockLay, 2, 1, Qt::AlignLeft | Qt::AlignVCenter);
|
||||||
}
|
}
|
||||||
mainLayout->addLayout(filterColorLay, 0);
|
|
||||||
}
|
}
|
||||||
setLayout(mainLayout);
|
setLayout(mainLayout);
|
||||||
|
|
||||||
|
@ -1902,6 +1964,10 @@ m_value->setFont(font);*/
|
||||||
|
|
||||||
ret = ret && connect(m_filterColorCombo, SIGNAL(activated(int)), this,
|
ret = ret && connect(m_filterColorCombo, SIGNAL(activated(int)), this,
|
||||||
SLOT(onFilterColorChanged(int)));
|
SLOT(onFilterColorChanged(int)));
|
||||||
|
if (m_lockBtn)
|
||||||
|
ret = ret && connect(m_lockBtn, SIGNAL(clicked(bool)), this,
|
||||||
|
SLOT(onLockButtonClicked(bool)));
|
||||||
|
|
||||||
assert(ret);
|
assert(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1952,6 +2018,17 @@ void ColumnTransparencyPopup::onFilterColorChanged(int id) {
|
||||||
|
|
||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
|
|
||||||
|
void ColumnTransparencyPopup::onLockButtonClicked(bool on) {
|
||||||
|
assert(m_lockBtn);
|
||||||
|
if (!m_lockBtn) return;
|
||||||
|
m_column->lock(on);
|
||||||
|
TApp::instance()->getCurrentScene()->notifySceneChanged();
|
||||||
|
TApp::instance()->getCurrentXsheet()->notifyXsheetChanged();
|
||||||
|
((ColumnArea *)parent())->update();
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------
|
||||||
|
|
||||||
void ColumnTransparencyPopup::setColumn(TXshColumn *column) {
|
void ColumnTransparencyPopup::setColumn(TXshColumn *column) {
|
||||||
m_column = column;
|
m_column = column;
|
||||||
assert(m_column);
|
assert(m_column);
|
||||||
|
@ -1963,6 +2040,8 @@ void ColumnTransparencyPopup::setColumn(TXshColumn *column) {
|
||||||
SLOT(onValueChanged(const QString &)));
|
SLOT(onValueChanged(const QString &)));
|
||||||
|
|
||||||
m_filterColorCombo->setCurrentIndex(m_column->getFilterColorId());
|
m_filterColorCombo->setCurrentIndex(m_column->getFilterColorId());
|
||||||
|
|
||||||
|
if (m_lockBtn) m_lockBtn->setChecked(m_column->isLocked());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*void ColumnTransparencyPopup::mouseMoveEvent ( QMouseEvent * e )
|
/*void ColumnTransparencyPopup::mouseMoveEvent ( QMouseEvent * e )
|
||||||
|
@ -2129,6 +2208,19 @@ void ColumnArea::openCameraColumnPopup(QPoint pos) {
|
||||||
SLOT(onCameraColumnChangedTriggered()));
|
SLOT(onCameraColumnChangedTriggered()));
|
||||||
menu.addAction(action);
|
menu.addAction(action);
|
||||||
}
|
}
|
||||||
|
// Lock button is moved in this menu for Minimum layout
|
||||||
|
if (m_viewer->getXsheetLayout() == "Minimum") {
|
||||||
|
menu.addSeparator();
|
||||||
|
bool isLocked = m_viewer->getXsheet()->getColumn(-1)->isLocked();
|
||||||
|
QAction *lockAction =
|
||||||
|
new QAction((isLocked) ? tr("Unlock") : tr("Lock"), this);
|
||||||
|
lockAction->setCheckable(true);
|
||||||
|
lockAction->setChecked(isLocked);
|
||||||
|
lockAction->setIcon(createLockIcon(m_viewer));
|
||||||
|
menu.addAction(lockAction);
|
||||||
|
connect(lockAction, SIGNAL(toggled(bool)), this,
|
||||||
|
SLOT(onCameraColumnLockToggled(bool)));
|
||||||
|
}
|
||||||
|
|
||||||
menu.exec(pos);
|
menu.exec(pos);
|
||||||
}
|
}
|
||||||
|
@ -2138,6 +2230,10 @@ void ColumnArea::onCameraColumnChangedTriggered() {
|
||||||
onXsheetCameraChange(newIndex);
|
onXsheetCameraChange(newIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ColumnArea::onCameraColumnLockToggled(bool lock) {
|
||||||
|
m_viewer->getXsheet()->getColumn(-1)->lock(lock);
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
|
|
||||||
void ColumnArea::onXsheetCameraChange(int newIndex) {
|
void ColumnArea::onXsheetCameraChange(int newIndex) {
|
||||||
|
@ -2156,8 +2252,7 @@ void ColumnArea::onXsheetCameraChange(int newIndex) {
|
||||||
|
|
||||||
void ColumnArea::startTransparencyPopupTimer(QMouseEvent *e) { // AREA
|
void ColumnArea::startTransparencyPopupTimer(QMouseEvent *e) { // AREA
|
||||||
if (!m_columnTransparencyPopup)
|
if (!m_columnTransparencyPopup)
|
||||||
m_columnTransparencyPopup = new ColumnTransparencyPopup(
|
m_columnTransparencyPopup = new ColumnTransparencyPopup(m_viewer, this);
|
||||||
this); // Qt::ToolTip|Qt::MSWindowsFixedSizeDialogHint);//Qt::MSWindowsFixedSizeDialogHint|Qt::Tool);
|
|
||||||
|
|
||||||
m_columnTransparencyPopup->move(e->globalPos().x(), e->globalPos().y());
|
m_columnTransparencyPopup->move(e->globalPos().x(), e->globalPos().y());
|
||||||
|
|
||||||
|
@ -2565,7 +2660,8 @@ void ColumnArea::mouseReleaseEvent(QMouseEvent *event) {
|
||||||
openSoundColumnPopup();
|
openSoundColumnPopup();
|
||||||
} else {
|
} else {
|
||||||
if (!m_columnTransparencyPopup)
|
if (!m_columnTransparencyPopup)
|
||||||
m_columnTransparencyPopup = new ColumnTransparencyPopup(this);
|
m_columnTransparencyPopup =
|
||||||
|
new ColumnTransparencyPopup(m_viewer, this);
|
||||||
|
|
||||||
m_columnTransparencyPopup->move(event->globalPos().x() + x,
|
m_columnTransparencyPopup->move(event->globalPos().x() + x,
|
||||||
event->globalPos().y() - y);
|
event->globalPos().y() - y);
|
||||||
|
@ -2937,11 +3033,11 @@ void ColumnArea::onSubSampling(QAction *action) {
|
||||||
TXshColumn *column = xsh->getColumn(e);
|
TXshColumn *column = xsh->getColumn(e);
|
||||||
TXshColumn::ColumnType type = column->getColumnType();
|
TXshColumn::ColumnType type = column->getColumnType();
|
||||||
if (type != TXshColumn::eLevelType) continue;
|
if (type != TXshColumn::eLevelType) continue;
|
||||||
const QSet<TXshSimpleLevel *> levels = getLevels(column);
|
const QSet<TXshLevel *> levels = getLevels(column);
|
||||||
QSet<TXshSimpleLevel *>::const_iterator it2;
|
QSet<TXshLevel *>::const_iterator it2;
|
||||||
for (it2 = levels.begin(); it2 != levels.end(); it2++) {
|
for (it2 = levels.begin(); it2 != levels.end(); it2++) {
|
||||||
TXshSimpleLevel *sl = *it2;
|
TXshSimpleLevel *sl = (*it2)->getSimpleLevel();
|
||||||
if (sl->getProperties()->getDirtyFlag()) continue;
|
if (!sl || sl->getProperties()->getDirtyFlag()) continue;
|
||||||
int type = sl->getType();
|
int type = sl->getType();
|
||||||
if (type == TZI_XSHLEVEL || type == TZP_XSHLEVEL ||
|
if (type == TZI_XSHLEVEL || type == TZP_XSHLEVEL ||
|
||||||
type == OVL_XSHLEVEL) {
|
type == OVL_XSHLEVEL) {
|
||||||
|
|
|
@ -27,6 +27,7 @@ class TXsheetHandle;
|
||||||
class TStageObjectId;
|
class TStageObjectId;
|
||||||
class TXshColumn;
|
class TXshColumn;
|
||||||
class QComboBox;
|
class QComboBox;
|
||||||
|
class QPushButton;
|
||||||
class Orientation;
|
class Orientation;
|
||||||
class TApp;
|
class TApp;
|
||||||
class TXsheet;
|
class TXsheet;
|
||||||
|
@ -215,8 +216,11 @@ class ColumnTransparencyPopup final : public QWidget {
|
||||||
|
|
||||||
QComboBox *m_filterColorCombo;
|
QComboBox *m_filterColorCombo;
|
||||||
|
|
||||||
|
XsheetViewer *m_viewer;
|
||||||
|
QPushButton *m_lockBtn;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ColumnTransparencyPopup(QWidget *parent);
|
ColumnTransparencyPopup(XsheetViewer *viewer, QWidget *parent);
|
||||||
void setColumn(TXshColumn *column);
|
void setColumn(TXshColumn *column);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -230,6 +234,7 @@ protected slots:
|
||||||
void onValueChanged(const QString &);
|
void onValueChanged(const QString &);
|
||||||
|
|
||||||
void onFilterColorChanged(int id);
|
void onFilterColorChanged(int id);
|
||||||
|
void onLockButtonClicked(bool on);
|
||||||
};
|
};
|
||||||
|
|
||||||
class SoundColumnPopup final : public QWidget {
|
class SoundColumnPopup final : public QWidget {
|
||||||
|
@ -384,12 +389,13 @@ protected slots:
|
||||||
void openSoundColumnPopup();
|
void openSoundColumnPopup();
|
||||||
void openCameraColumnPopup(QPoint pos);
|
void openCameraColumnPopup(QPoint pos);
|
||||||
void onCameraColumnChangedTriggered();
|
void onCameraColumnChangedTriggered();
|
||||||
|
void onCameraColumnLockToggled(bool);
|
||||||
void onXsheetCameraChange(int);
|
void onXsheetCameraChange(int);
|
||||||
void onSetMask(int);
|
void onSetMask(int);
|
||||||
};
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
} // namespace XsheetGUI;
|
} // namespace XsheetGUI
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
#endif // XSHCOLUMNVIEWER_H
|
#endif // XSHCOLUMNVIEWER_H
|
||||||
|
|
|
@ -1661,12 +1661,28 @@ public:
|
||||||
, m_offset(0)
|
, m_offset(0)
|
||||||
, m_origOffset(0) {}
|
, m_origOffset(0) {}
|
||||||
|
|
||||||
void onClick(const CellPosition &pos) override {
|
void onClick(const QMouseEvent *event) override {
|
||||||
|
QPoint xy = event->pos();
|
||||||
|
CellPosition pos = getViewer()->xyToPosition(xy);
|
||||||
int col = pos.layer();
|
int col = pos.layer();
|
||||||
TColumnSelection *selection = getViewer()->getColumnSelection();
|
TColumnSelection *selection = getViewer()->getColumnSelection();
|
||||||
if (!selection->isColumnSelected(col)) {
|
if (!selection->isColumnSelected(col)) {
|
||||||
selection->selectNone();
|
if (event->modifiers() & Qt::ControlModifier) {
|
||||||
selection->selectColumn(col);
|
selection->selectColumn(col, true);
|
||||||
|
} else if (event->modifiers() & Qt::ShiftModifier) {
|
||||||
|
int ia = col, ib = col;
|
||||||
|
int columnCount = getViewer()->getXsheet()->getColumnCount();
|
||||||
|
while (ia > 0 && !selection->isColumnSelected(ia - 1)) --ia;
|
||||||
|
if (ia == 0) ia = col;
|
||||||
|
while (ib < columnCount - 1 && !selection->isColumnSelected(ib + 1))
|
||||||
|
++ib;
|
||||||
|
if (ib == columnCount - 1) ib = col;
|
||||||
|
int i;
|
||||||
|
for (i = ia; i <= ib; i++) selection->selectColumn(i, true);
|
||||||
|
} else {
|
||||||
|
selection->selectNone();
|
||||||
|
selection->selectColumn(col);
|
||||||
|
}
|
||||||
selection->makeCurrent();
|
selection->makeCurrent();
|
||||||
}
|
}
|
||||||
std::set<int> indices = selection->getIndices();
|
std::set<int> indices = selection->getIndices();
|
||||||
|
|
|
@ -148,8 +148,8 @@ void XsheetViewer::getColumnColor(QColor &color, QColor &sideColor, int index,
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
void XsheetViewer::getButton(int &btype, QColor &bgColor, QImage &iconImage,
|
void XsheetViewer::getButton(const int &btype, QColor &bgColor,
|
||||||
bool isTimeline) {
|
QImage &iconImage, bool isTimeline) {
|
||||||
switch (btype) {
|
switch (btype) {
|
||||||
case PREVIEW_ON_XSHBUTTON:
|
case PREVIEW_ON_XSHBUTTON:
|
||||||
bgColor = (isTimeline) ? getTimelinePreviewButtonBgOnColor()
|
bgColor = (isTimeline) ? getTimelinePreviewButtonBgOnColor()
|
||||||
|
@ -251,7 +251,6 @@ XsheetViewer::XsheetViewer(QWidget *parent, Qt::WFlags flags)
|
||||||
m_toolbar = new XsheetGUI::QuickToolbar(this, 0, true);
|
m_toolbar = new XsheetGUI::QuickToolbar(this, 0, true);
|
||||||
m_toolbarScrollArea->setWidget(m_toolbar);
|
m_toolbarScrollArea->setWidget(m_toolbar);
|
||||||
|
|
||||||
QRect noteArea(0, 0, 75, 120);
|
|
||||||
m_noteArea = new XsheetGUI::NoteArea(this);
|
m_noteArea = new XsheetGUI::NoteArea(this);
|
||||||
m_noteScrollArea = new XsheetScrollArea(this);
|
m_noteScrollArea = new XsheetScrollArea(this);
|
||||||
m_noteScrollArea->setObjectName("xsheetArea");
|
m_noteScrollArea->setObjectName("xsheetArea");
|
||||||
|
|
|
@ -1260,7 +1260,7 @@ public:
|
||||||
return m_layerHeaderLockOverImage;
|
return m_layerHeaderLockOverImage;
|
||||||
}
|
}
|
||||||
|
|
||||||
void getButton(int &btype, QColor &bgColor, QImage &iconImage,
|
void getButton(const int &btype, QColor &bgColor, QImage &iconImage,
|
||||||
bool isTimeline = false);
|
bool isTimeline = false);
|
||||||
|
|
||||||
// convert the last one digit of the frame number to alphabet
|
// convert the last one digit of the frame number to alphabet
|
||||||
|
|
|
@ -460,7 +460,10 @@ NoteArea::NoteArea(XsheetViewer *parent, Qt::WFlags flags)
|
||||||
, m_precNoteButton(nullptr)
|
, m_precNoteButton(nullptr)
|
||||||
, m_nextNoteButton(nullptr)
|
, m_nextNoteButton(nullptr)
|
||||||
, m_frameDisplayStyleCombo(nullptr)
|
, m_frameDisplayStyleCombo(nullptr)
|
||||||
, m_layerHeaderPanel(nullptr) {
|
, m_layerHeaderPanel(nullptr)
|
||||||
|
, m_hamburgerButton(nullptr)
|
||||||
|
, m_popup(nullptr)
|
||||||
|
, m_currentLayout(nullptr) {
|
||||||
|
|
||||||
setFrameStyle(QFrame::StyledPanel);
|
setFrameStyle(QFrame::StyledPanel);
|
||||||
setObjectName("cornerWidget");
|
setObjectName("cornerWidget");
|
||||||
|
@ -518,7 +521,7 @@ NoteArea::NoteArea(XsheetViewer *parent, Qt::WFlags flags)
|
||||||
m_frameDisplayStyleCombo->setCurrentIndex(
|
m_frameDisplayStyleCombo->setCurrentIndex(
|
||||||
(int)m_viewer->getFrameDisplayStyle());
|
(int)m_viewer->getFrameDisplayStyle());
|
||||||
m_frameDisplayStyleCombo->hide();
|
m_frameDisplayStyleCombo->hide();
|
||||||
// layout
|
|
||||||
createLayout();
|
createLayout();
|
||||||
|
|
||||||
// signal-slot connections
|
// signal-slot connections
|
||||||
|
@ -551,22 +554,54 @@ NoteArea::NoteArea(XsheetViewer *parent, Qt::WFlags flags)
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
void NoteArea::removeLayout() {
|
void NoteArea::removeLayout() {
|
||||||
QLayout *currentLayout = layout();
|
if (!m_currentLayout) return;
|
||||||
if (!currentLayout) return;
|
|
||||||
|
|
||||||
// currentLayout->removeWidget(m_flipOrientationButton);
|
// m_currentLayout->removeWidget(m_flipOrientationButton);
|
||||||
currentLayout->removeWidget(m_noteButton);
|
m_currentLayout->removeWidget(m_noteButton);
|
||||||
currentLayout->removeWidget(m_precNoteButton);
|
m_currentLayout->removeWidget(m_precNoteButton);
|
||||||
currentLayout->removeWidget(m_nextNoteButton);
|
m_currentLayout->removeWidget(m_nextNoteButton);
|
||||||
currentLayout->removeWidget(m_newLevelButton);
|
m_currentLayout->removeWidget(m_frameDisplayStyleCombo);
|
||||||
currentLayout->removeWidget(m_frameDisplayStyleCombo);
|
m_currentLayout->removeWidget(m_layerHeaderPanel);
|
||||||
currentLayout->removeWidget(m_layerHeaderPanel);
|
delete m_currentLayout;
|
||||||
delete currentLayout;
|
m_currentLayout = nullptr;
|
||||||
|
|
||||||
|
const Orientation *o = m_viewer->orientation();
|
||||||
|
bool noteInPopup = o->flag(PredefinedFlag::NOTE_AREA_IN_POPUP);
|
||||||
|
if (!noteInPopup && m_popup) {
|
||||||
|
QLayout *panelLayout = layout();
|
||||||
|
if (panelLayout) {
|
||||||
|
panelLayout->removeWidget(m_hamburgerButton);
|
||||||
|
delete panelLayout;
|
||||||
|
}
|
||||||
|
m_hamburgerButton->hide();
|
||||||
|
m_popup->hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NoteArea::createLayout() {
|
void NoteArea::createLayout() {
|
||||||
const Orientation *o = m_viewer->orientation();
|
const Orientation *o = m_viewer->orientation();
|
||||||
QRect rect = o->rect(PredefinedRect::NOTE_AREA);
|
QRect rect = o->rect(PredefinedRect::NOTE_AREA);
|
||||||
|
bool noteInPopup = o->flag(PredefinedFlag::NOTE_AREA_IN_POPUP);
|
||||||
|
|
||||||
|
if (noteInPopup) {
|
||||||
|
if (!m_popup) {
|
||||||
|
m_hamburgerButton = new QPushButton(this);
|
||||||
|
m_hamburgerButton->setFixedSize(30, 30);
|
||||||
|
m_hamburgerButton->setIcon(createQIcon("menu"));
|
||||||
|
m_popup = new QWidget(this, Qt::Popup);
|
||||||
|
m_popup->hide();
|
||||||
|
m_popup->setFixedHeight(85);
|
||||||
|
connect(m_hamburgerButton, SIGNAL(clicked(bool)), this,
|
||||||
|
SLOT(onClickHamburger()));
|
||||||
|
}
|
||||||
|
QVBoxLayout *lay = new QVBoxLayout();
|
||||||
|
lay->setMargin(5);
|
||||||
|
lay->setSpacing(5);
|
||||||
|
lay->addWidget(m_hamburgerButton, 1, Qt::AlignCenter);
|
||||||
|
setLayout(lay);
|
||||||
|
m_hamburgerButton->show();
|
||||||
|
}
|
||||||
|
QWidget *targetWidget = (noteInPopup) ? m_popup : this;
|
||||||
|
|
||||||
setFixedSize(rect.size());
|
setFixedSize(rect.size());
|
||||||
|
|
||||||
|
@ -596,7 +631,7 @@ void NoteArea::createLayout() {
|
||||||
buttonsLayout->addWidget(m_noteButton, 0, centerAlign);
|
buttonsLayout->addWidget(m_noteButton, 0, centerAlign);
|
||||||
buttonsLayout->addWidget(m_nextNoteButton, 0);
|
buttonsLayout->addWidget(m_nextNoteButton, 0);
|
||||||
}
|
}
|
||||||
mainLayout->addLayout(buttonsLayout, 0);
|
mainLayout->addLayout(buttonsLayout, 1);
|
||||||
|
|
||||||
mainLayout->addWidget(m_frameDisplayStyleCombo, 0);
|
mainLayout->addWidget(m_frameDisplayStyleCombo, 0);
|
||||||
}
|
}
|
||||||
|
@ -604,7 +639,8 @@ void NoteArea::createLayout() {
|
||||||
|
|
||||||
panelLayout->addWidget(m_layerHeaderPanel);
|
panelLayout->addWidget(m_layerHeaderPanel);
|
||||||
}
|
}
|
||||||
setLayout(panelLayout);
|
targetWidget->setLayout(panelLayout);
|
||||||
|
m_currentLayout = panelLayout;
|
||||||
|
|
||||||
m_layerHeaderPanel->showOrHide(o);
|
m_layerHeaderPanel->showOrHide(o);
|
||||||
if (!o->isVerticalTimeline()) {
|
if (!o->isVerticalTimeline()) {
|
||||||
|
@ -691,6 +727,13 @@ void NoteArea::onFrameDisplayStyleChanged(int id) {
|
||||||
m_viewer->updateRows();
|
m_viewer->updateRows();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NoteArea::onClickHamburger() {
|
||||||
|
m_popup->move(
|
||||||
|
m_hamburgerButton->mapToGlobal(m_hamburgerButton->rect().center()));
|
||||||
|
m_popup->show();
|
||||||
|
m_popup->updateGeometry();
|
||||||
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
// FooterNoteArea
|
// FooterNoteArea
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
|
@ -131,6 +131,10 @@ class NoteArea final : public QFrame {
|
||||||
|
|
||||||
LayerHeaderPanel *m_layerHeaderPanel;
|
LayerHeaderPanel *m_layerHeaderPanel;
|
||||||
|
|
||||||
|
QPushButton *m_hamburgerButton;
|
||||||
|
QWidget *m_popup;
|
||||||
|
QLayout *m_currentLayout;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
#if QT_VERSION >= 0x050500
|
#if QT_VERSION >= 0x050500
|
||||||
NoteArea(XsheetViewer *parent = 0, Qt::WindowFlags flags = 0);
|
NoteArea(XsheetViewer *parent = 0, Qt::WindowFlags flags = 0);
|
||||||
|
@ -150,6 +154,8 @@ protected slots:
|
||||||
void onFrameDisplayStyleChanged(int id);
|
void onFrameDisplayStyleChanged(int id);
|
||||||
void onXsheetOrientationChanged(const Orientation *orientation);
|
void onXsheetOrientationChanged(const Orientation *orientation);
|
||||||
|
|
||||||
|
void onClickHamburger();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void removeLayout();
|
void removeLayout();
|
||||||
void createLayout();
|
void createLayout();
|
||||||
|
@ -193,6 +199,6 @@ protected:
|
||||||
void createLayout();
|
void createLayout();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace XsheetGUI;
|
} // namespace XsheetGUI
|
||||||
|
|
||||||
#endif // XSHNOTEVIEWER_H
|
#endif // XSHNOTEVIEWER_H
|
||||||
|
|
|
@ -154,17 +154,15 @@ void RowArea::drawRows(QPainter &p, int r0, int r1) {
|
||||||
p.setPen(m_viewer->getTextColor());
|
p.setPen(m_viewer->getTextColor());
|
||||||
|
|
||||||
QPoint basePoint = m_viewer->positionToXY(CellPosition(r, -1));
|
QPoint basePoint = m_viewer->positionToXY(CellPosition(r, -1));
|
||||||
if (!m_viewer->orientation()->isVerticalTimeline())
|
if (!o->isVerticalTimeline())
|
||||||
basePoint.setY(0);
|
basePoint.setY(0);
|
||||||
else
|
else
|
||||||
basePoint.setX(0);
|
basePoint.setX(0);
|
||||||
QRect labelRect = m_viewer->orientation()
|
QRect labelRect =
|
||||||
->rect(PredefinedRect::FRAME_LABEL)
|
o->rect(PredefinedRect::FRAME_LABEL).translated(basePoint);
|
||||||
.translated(basePoint);
|
|
||||||
labelRect.adjust(-frameAdj.x() / 2, -frameAdj.y() / 2, -frameAdj.x() / 2,
|
labelRect.adjust(-frameAdj.x() / 2, -frameAdj.y() / 2, -frameAdj.x() / 2,
|
||||||
-frameAdj.y() / 2);
|
-frameAdj.y() / 2);
|
||||||
int align = m_viewer->orientation()->dimension(
|
int align = o->dimension(PredefinedDimension::FRAME_LABEL_ALIGN);
|
||||||
PredefinedDimension::FRAME_LABEL_ALIGN);
|
|
||||||
// display time and/or frame number
|
// display time and/or frame number
|
||||||
z++;
|
z++;
|
||||||
switch (m_viewer->getFrameDisplayStyle()) {
|
switch (m_viewer->getFrameDisplayStyle()) {
|
||||||
|
@ -275,7 +273,6 @@ void RowArea::drawPlayRangeBackground(QPainter &p, int r0, int r1) {
|
||||||
const Orientation *o = m_viewer->orientation();
|
const Orientation *o = m_viewer->orientation();
|
||||||
TXsheet *xsh = m_viewer->getXsheet();
|
TXsheet *xsh = m_viewer->getXsheet();
|
||||||
QPoint frameAdj = m_viewer->getFrameZoomAdjustment();
|
QPoint frameAdj = m_viewer->getFrameZoomAdjustment();
|
||||||
QRect playRangeRect = o->rect(PredefinedRect::PLAY_RANGE);
|
|
||||||
|
|
||||||
int playR0, playR1, step;
|
int playR0, playR1, step;
|
||||||
XsheetGUI::getPlayRange(playR0, playR1, step);
|
XsheetGUI::getPlayRange(playR0, playR1, step);
|
||||||
|
|
|
@ -12,8 +12,6 @@ const int KEY_ICON_WIDTH = 11;
|
||||||
const int KEY_ICON_HEIGHT = 11;
|
const int KEY_ICON_HEIGHT = 11;
|
||||||
const int EASE_TRIANGLE_SIZE = 4;
|
const int EASE_TRIANGLE_SIZE = 4;
|
||||||
const int PLAY_MARKER_SIZE = 10;
|
const int PLAY_MARKER_SIZE = 10;
|
||||||
const int ONION_SIZE = 19;
|
|
||||||
const int ONION_DOT_SIZE = 8;
|
|
||||||
const int PINNED_SIZE = 10;
|
const int PINNED_SIZE = 10;
|
||||||
const int FRAME_MARKER_SIZE = 4;
|
const int FRAME_MARKER_SIZE = 4;
|
||||||
const int FOLDED_CELL_SIZE = 9;
|
const int FOLDED_CELL_SIZE = 9;
|
||||||
|
@ -30,7 +28,8 @@ QRect iconRect(const QRect &areaRect, const int iconWidth, const int iconHeight,
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
class TopToBottomOrientation : public Orientation {
|
class TopToBottomOrientation : public Orientation {
|
||||||
const int CELL_WIDTH = 74;
|
int CELL_WIDTH = 74;
|
||||||
|
// const int CELL_WIDTH = 74;
|
||||||
const int CELL_HEIGHT = 20;
|
const int CELL_HEIGHT = 20;
|
||||||
const int CELL_DRAG_WIDTH = 7;
|
const int CELL_DRAG_WIDTH = 7;
|
||||||
const int EXTENDER_WIDTH = 20;
|
const int EXTENDER_WIDTH = 20;
|
||||||
|
@ -39,15 +38,20 @@ class TopToBottomOrientation : public Orientation {
|
||||||
const int LAYER_HEADER_HEIGHT = 119;
|
const int LAYER_HEADER_HEIGHT = 119;
|
||||||
const int FOLDED_LAYER_HEADER_HEIGHT = LAYER_HEADER_HEIGHT;
|
const int FOLDED_LAYER_HEADER_HEIGHT = LAYER_HEADER_HEIGHT;
|
||||||
const int FOLDED_LAYER_HEADER_WIDTH = 8;
|
const int FOLDED_LAYER_HEADER_WIDTH = 8;
|
||||||
const int FRAME_HEADER_WIDTH = CELL_WIDTH;
|
int FRAME_HEADER_WIDTH = CELL_WIDTH;
|
||||||
const int PLAY_RANGE_X = FRAME_HEADER_WIDTH / 2 - PLAY_MARKER_SIZE;
|
int PLAY_RANGE_X = FRAME_HEADER_WIDTH / 2 - PLAY_MARKER_SIZE;
|
||||||
const int ONION_X = 0, ONION_Y = 0;
|
const int ONION_X = 0;
|
||||||
const int ICON_WIDTH = 18;
|
int ONION_Y = 0;
|
||||||
const int ICON_HEIGHT = 18;
|
// const int ICON_WIDTH = 18;
|
||||||
|
// const int ICON_HEIGHT = 18;
|
||||||
|
int ICON_WIDTH = 18;
|
||||||
|
int ICON_HEIGHT = 18;
|
||||||
const int TRACKLEN = 60;
|
const int TRACKLEN = 60;
|
||||||
const int SHIFTTRACE_DOT_OFFSET = 3;
|
const int SHIFTTRACE_DOT_OFFSET = 3;
|
||||||
const int CAMERA_CELL_WIDTH = 22;
|
const int CAMERA_CELL_WIDTH = 22;
|
||||||
const int LAYER_FOOTER_PANEL_WIDTH = 16;
|
const int LAYER_FOOTER_PANEL_WIDTH = 16;
|
||||||
|
int ONION_SIZE = 19;
|
||||||
|
int ONION_DOT_SIZE = 8;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TopToBottomOrientation();
|
TopToBottomOrientation();
|
||||||
|
@ -97,6 +101,8 @@ class LeftToRightOrientation : public Orientation {
|
||||||
const int SOUND_PREVIEW_HEIGHT = 6;
|
const int SOUND_PREVIEW_HEIGHT = 6;
|
||||||
const int FRAME_HEADER_HEIGHT = 50;
|
const int FRAME_HEADER_HEIGHT = 50;
|
||||||
const int ONION_X = 0, ONION_Y = 0;
|
const int ONION_X = 0, ONION_Y = 0;
|
||||||
|
const int ONION_SIZE = 19;
|
||||||
|
const int ONION_DOT_SIZE = 8;
|
||||||
const int PLAY_RANGE_Y = ONION_SIZE;
|
const int PLAY_RANGE_Y = ONION_SIZE;
|
||||||
const int ICON_WIDTH = 20;
|
const int ICON_WIDTH = 20;
|
||||||
const int ICON_HEIGHT = 20;
|
const int ICON_HEIGHT = 20;
|
||||||
|
@ -279,10 +285,24 @@ TopToBottomOrientation::TopToBottomOrientation() {
|
||||||
|
|
||||||
int use_header_height = LAYER_HEADER_HEIGHT;
|
int use_header_height = LAYER_HEADER_HEIGHT;
|
||||||
|
|
||||||
if (layout == QString("Compact")) use_header_height -= 18;
|
if (layout == QString("Compact"))
|
||||||
|
use_header_height -= 18;
|
||||||
|
else if (layout == QString("Minimum"))
|
||||||
|
use_header_height = CELL_HEIGHT * 2;
|
||||||
|
|
||||||
int user_folded_header_height = use_header_height;
|
int user_folded_header_height = use_header_height;
|
||||||
|
|
||||||
|
if (layout == QString("Minimum")) {
|
||||||
|
CELL_WIDTH = 50;
|
||||||
|
ICON_WIDTH = 16;
|
||||||
|
ICON_HEIGHT = 16;
|
||||||
|
FRAME_HEADER_WIDTH = 45;
|
||||||
|
ONION_SIZE = 15;
|
||||||
|
ONION_DOT_SIZE = 6;
|
||||||
|
PLAY_RANGE_X = ONION_SIZE;
|
||||||
|
ONION_Y = (CELL_HEIGHT - ONION_SIZE) / 2;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Area rectangles
|
// Area rectangles
|
||||||
//
|
//
|
||||||
|
@ -338,9 +358,8 @@ TopToBottomOrientation::TopToBottomOrientation() {
|
||||||
cameraKeyRect.translated(-3, 0));
|
cameraKeyRect.translated(-3, 0));
|
||||||
|
|
||||||
// Note viewer
|
// Note viewer
|
||||||
addRect(
|
addRect(PredefinedRect::NOTE_AREA,
|
||||||
PredefinedRect::NOTE_AREA,
|
QRect(QPoint(0, 0), QSize(FRAME_HEADER_WIDTH, use_header_height)));
|
||||||
QRect(QPoint(0, 0), QSize(FRAME_HEADER_WIDTH, use_header_height - 1)));
|
|
||||||
addRect(PredefinedRect::NOTE_ICON,
|
addRect(PredefinedRect::NOTE_ICON,
|
||||||
QRect(QPoint(0, 0), QSize(CELL_WIDTH - 2, CELL_HEIGHT - 2)));
|
QRect(QPoint(0, 0), QSize(CELL_WIDTH - 2, CELL_HEIGHT - 2)));
|
||||||
|
|
||||||
|
@ -352,8 +371,12 @@ TopToBottomOrientation::TopToBottomOrientation() {
|
||||||
addRect(PredefinedRect::PANEL_LAYER_NAME, QRect(0, 0, -1, -1)); // hide
|
addRect(PredefinedRect::PANEL_LAYER_NAME, QRect(0, 0, -1, -1)); // hide
|
||||||
|
|
||||||
// Row viewer
|
// Row viewer
|
||||||
addRect(PredefinedRect::FRAME_LABEL,
|
if (layout == QString("Minimum"))
|
||||||
QRect(0, 0, CELL_WIDTH - 4, CELL_HEIGHT));
|
addRect(PredefinedRect::FRAME_LABEL,
|
||||||
|
QRect(0, 0, FRAME_HEADER_WIDTH - 2, CELL_HEIGHT));
|
||||||
|
else
|
||||||
|
addRect(PredefinedRect::FRAME_LABEL,
|
||||||
|
QRect(0, 0, CELL_WIDTH - 4, CELL_HEIGHT));
|
||||||
addRect(PredefinedRect::FRAME_HEADER,
|
addRect(PredefinedRect::FRAME_HEADER,
|
||||||
QRect(0, 0, FRAME_HEADER_WIDTH, CELL_HEIGHT));
|
QRect(0, 0, FRAME_HEADER_WIDTH, CELL_HEIGHT));
|
||||||
addRect(PredefinedRect::PLAY_RANGE,
|
addRect(PredefinedRect::PLAY_RANGE,
|
||||||
|
@ -413,7 +436,89 @@ TopToBottomOrientation::TopToBottomOrientation() {
|
||||||
volumeArea;
|
volumeArea;
|
||||||
QPoint soundTopLeft;
|
QPoint soundTopLeft;
|
||||||
|
|
||||||
if (layout == QString("Compact")) {
|
if (layout == QString("Minimum")) {
|
||||||
|
THUMBNAIL_HEIGHT = -1;
|
||||||
|
HDRROW_HEIGHT = CELL_HEIGHT - 1;
|
||||||
|
INDENT = 0;
|
||||||
|
HDRROW1 = 1; // Name, number
|
||||||
|
HDRROW2 = HDRROW1 + HDRROW_HEIGHT; // eye, preview, config
|
||||||
|
|
||||||
|
addRect(PredefinedRect::DRAG_LAYER, QRect(0, 0, -1, -1));
|
||||||
|
|
||||||
|
addRect(PredefinedRect::RENAME_COLUMN,
|
||||||
|
QRect(0, HDRROW1, CELL_WIDTH, HDRROW_HEIGHT));
|
||||||
|
|
||||||
|
layername =
|
||||||
|
QRect(INDENT + 1, HDRROW1 + 1, CELL_WIDTH - 1, HDRROW_HEIGHT - 1);
|
||||||
|
addRect(PredefinedRect::LAYER_NAME, layername);
|
||||||
|
addRect(PredefinedRect::CAMERA_LAYER_NAME, QRect(0, 0, -1, -1));
|
||||||
|
addRect(PredefinedRect::LAYER_NUMBER,
|
||||||
|
QRect(INDENT + layername.width() - 20, HDRROW1, 20, HDRROW_HEIGHT));
|
||||||
|
|
||||||
|
eyeArea = QRect(INDENT, HDRROW2, ICON_WIDTH + 1, HDRROW_HEIGHT); // Compact
|
||||||
|
addRect(PredefinedRect::EYE_AREA, eyeArea);
|
||||||
|
addRect(PredefinedRect::EYE,
|
||||||
|
iconRect(eyeArea, ICON_WIDTH, ICON_HEIGHT - 1, 1));
|
||||||
|
|
||||||
|
previewArea =
|
||||||
|
QRect(INDENT + eyeArea.width(), HDRROW2, ICON_WIDTH + 1, HDRROW_HEIGHT);
|
||||||
|
addRect(PredefinedRect::PREVIEW_LAYER_AREA, previewArea);
|
||||||
|
addRect(PredefinedRect::PREVIEW_LAYER,
|
||||||
|
iconRect(previewArea, ICON_WIDTH, ICON_HEIGHT - 1, 1));
|
||||||
|
|
||||||
|
addRect(PredefinedRect::LOCK_AREA, QRect(0, 0, -1, -1));
|
||||||
|
addRect(PredefinedRect::LOCK, QRect(0, 0, -1, -1));
|
||||||
|
addRect(PredefinedRect::CAMERA_LOCK_AREA, QRect(0, 0, -1, -1));
|
||||||
|
addRect(PredefinedRect::CAMERA_LOCK, QRect(0, 0, -1, -1));
|
||||||
|
|
||||||
|
configArea = QRect(INDENT + eyeArea.width() + previewArea.width(), HDRROW2,
|
||||||
|
ICON_WIDTH, HDRROW_HEIGHT);
|
||||||
|
addRect(PredefinedRect::CONFIG_AREA, configArea);
|
||||||
|
addRect(PredefinedRect::CONFIG,
|
||||||
|
iconRect(configArea, ICON_WIDTH - 1, ICON_HEIGHT - 1));
|
||||||
|
cameraConfigArea = QRect(INDENT, HDRROW2, CAMERA_CELL_WIDTH, HDRROW_HEIGHT);
|
||||||
|
addRect(PredefinedRect::CAMERA_CONFIG_AREA, cameraConfigArea);
|
||||||
|
addRect(PredefinedRect::CAMERA_CONFIG,
|
||||||
|
iconRect(cameraConfigArea, ICON_WIDTH - 1, ICON_HEIGHT - 1));
|
||||||
|
addRect(PredefinedRect::THUMBNAIL_AREA, QRect(0, 0, -1, -1));
|
||||||
|
addRect(PredefinedRect::THUMBNAIL, QRect(0, 0, -1, -1));
|
||||||
|
cameraIconArea = QRect(INDENT, HDRROW1, CAMERA_CELL_WIDTH, HDRROW_HEIGHT);
|
||||||
|
addRect(PredefinedRect::CAMERA_ICON_AREA, cameraIconArea);
|
||||||
|
addRect(PredefinedRect::CAMERA_ICON,
|
||||||
|
iconRect(cameraIconArea, ICON_WIDTH, ICON_HEIGHT));
|
||||||
|
|
||||||
|
addRect(PredefinedRect::FILTER_COLOR, rect(PredefinedRect::CONFIG));
|
||||||
|
addRect(PredefinedRect::SOUND_ICON, QRect(0, 0, -1, -1));
|
||||||
|
addRect(PredefinedRect::VOLUME_AREA, QRect(0, 0, -1, -1));
|
||||||
|
addRect(PredefinedRect::PEGBAR_NAME, QRect(0, 0, -1, -1));
|
||||||
|
addRect(PredefinedRect::PARENT_HANDLE_NAME, QRect(0, 0, -1, -1));
|
||||||
|
|
||||||
|
addFlag(PredefinedFlag::DRAG_LAYER_BORDER, false);
|
||||||
|
addFlag(PredefinedFlag::DRAG_LAYER_VISIBLE, false);
|
||||||
|
addFlag(PredefinedFlag::LAYER_NAME_BORDER, false);
|
||||||
|
addFlag(PredefinedFlag::LAYER_NAME_VISIBLE, true);
|
||||||
|
addFlag(PredefinedFlag::LAYER_NUMBER_BORDER, false);
|
||||||
|
addFlag(PredefinedFlag::LAYER_NUMBER_VISIBLE, false);
|
||||||
|
addFlag(PredefinedFlag::EYE_AREA_BORDER, true);
|
||||||
|
addFlag(PredefinedFlag::EYE_AREA_VISIBLE, true);
|
||||||
|
addFlag(PredefinedFlag::LOCK_AREA_BORDER, false);
|
||||||
|
addFlag(PredefinedFlag::LOCK_AREA_VISIBLE, false);
|
||||||
|
addFlag(PredefinedFlag::PREVIEW_LAYER_AREA_BORDER, true);
|
||||||
|
addFlag(PredefinedFlag::PREVIEW_LAYER_AREA_VISIBLE, true);
|
||||||
|
addFlag(PredefinedFlag::CONFIG_AREA_BORDER, true);
|
||||||
|
addFlag(PredefinedFlag::CAMERA_CONFIG_AREA_BORDER, true);
|
||||||
|
addFlag(PredefinedFlag::CONFIG_AREA_VISIBLE, true);
|
||||||
|
addFlag(PredefinedFlag::CAMERA_CONFIG_AREA_VISIBLE, true);
|
||||||
|
addFlag(PredefinedFlag::PEGBAR_NAME_BORDER, false);
|
||||||
|
addFlag(PredefinedFlag::PEGBAR_NAME_VISIBLE, false);
|
||||||
|
addFlag(PredefinedFlag::PARENT_HANDLE_NAME_BORDER, false);
|
||||||
|
addFlag(PredefinedFlag::PARENT_HANDLE_NAME_VISIBILE, true);
|
||||||
|
addFlag(PredefinedFlag::THUMBNAIL_AREA_BORDER, false);
|
||||||
|
addFlag(PredefinedFlag::THUMBNAIL_AREA_VISIBLE, false);
|
||||||
|
addFlag(PredefinedFlag::CAMERA_ICON_VISIBLE, true);
|
||||||
|
addFlag(PredefinedFlag::VOLUME_AREA_VERTICAL, false);
|
||||||
|
addFlag(PredefinedFlag::NOTE_AREA_IN_POPUP, true);
|
||||||
|
} else if (layout == QString("Compact")) {
|
||||||
THUMBNAIL_HEIGHT = 44;
|
THUMBNAIL_HEIGHT = 44;
|
||||||
HDRROW_HEIGHT = CELL_HEIGHT - 2;
|
HDRROW_HEIGHT = CELL_HEIGHT - 2;
|
||||||
INDENT = 0;
|
INDENT = 0;
|
||||||
|
@ -521,6 +626,7 @@ TopToBottomOrientation::TopToBottomOrientation() {
|
||||||
addFlag(PredefinedFlag::THUMBNAIL_AREA_VISIBLE, true);
|
addFlag(PredefinedFlag::THUMBNAIL_AREA_VISIBLE, true);
|
||||||
addFlag(PredefinedFlag::CAMERA_ICON_VISIBLE, false);
|
addFlag(PredefinedFlag::CAMERA_ICON_VISIBLE, false);
|
||||||
addFlag(PredefinedFlag::VOLUME_AREA_VERTICAL, false);
|
addFlag(PredefinedFlag::VOLUME_AREA_VERTICAL, false);
|
||||||
|
addFlag(PredefinedFlag::NOTE_AREA_IN_POPUP, false);
|
||||||
} else if (layout == QString("Roomy")) {
|
} else if (layout == QString("Roomy")) {
|
||||||
THUMBNAIL_HEIGHT = 44;
|
THUMBNAIL_HEIGHT = 44;
|
||||||
HDRROW_HEIGHT = CELL_HEIGHT - 2;
|
HDRROW_HEIGHT = CELL_HEIGHT - 2;
|
||||||
|
@ -632,6 +738,7 @@ TopToBottomOrientation::TopToBottomOrientation() {
|
||||||
addFlag(PredefinedFlag::THUMBNAIL_AREA_VISIBLE, true);
|
addFlag(PredefinedFlag::THUMBNAIL_AREA_VISIBLE, true);
|
||||||
addFlag(PredefinedFlag::CAMERA_ICON_VISIBLE, true);
|
addFlag(PredefinedFlag::CAMERA_ICON_VISIBLE, true);
|
||||||
addFlag(PredefinedFlag::VOLUME_AREA_VERTICAL, false);
|
addFlag(PredefinedFlag::VOLUME_AREA_VERTICAL, false);
|
||||||
|
addFlag(PredefinedFlag::NOTE_AREA_IN_POPUP, false);
|
||||||
} else {
|
} else {
|
||||||
THUMBNAIL_HEIGHT = 43;
|
THUMBNAIL_HEIGHT = 43;
|
||||||
HDRROW_HEIGHT = CELL_HEIGHT - 2;
|
HDRROW_HEIGHT = CELL_HEIGHT - 2;
|
||||||
|
@ -738,6 +845,7 @@ TopToBottomOrientation::TopToBottomOrientation() {
|
||||||
addFlag(PredefinedFlag::THUMBNAIL_AREA_VISIBLE, true);
|
addFlag(PredefinedFlag::THUMBNAIL_AREA_VISIBLE, true);
|
||||||
addFlag(PredefinedFlag::CAMERA_ICON_VISIBLE, true);
|
addFlag(PredefinedFlag::CAMERA_ICON_VISIBLE, true);
|
||||||
addFlag(PredefinedFlag::VOLUME_AREA_VERTICAL, true);
|
addFlag(PredefinedFlag::VOLUME_AREA_VERTICAL, true);
|
||||||
|
addFlag(PredefinedFlag::NOTE_AREA_IN_POPUP, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flag(PredefinedFlag::VOLUME_AREA_VERTICAL)) {
|
if (flag(PredefinedFlag::VOLUME_AREA_VERTICAL)) {
|
||||||
|
@ -759,7 +867,10 @@ TopToBottomOrientation::TopToBottomOrientation() {
|
||||||
|
|
||||||
zoomSlider = QRect(0, 17, LAYER_FOOTER_PANEL_WIDTH, use_header_height - 34);
|
zoomSlider = QRect(0, 17, LAYER_FOOTER_PANEL_WIDTH, use_header_height - 34);
|
||||||
addRect(PredefinedRect::ZOOM_SLIDER_AREA, zoomSlider);
|
addRect(PredefinedRect::ZOOM_SLIDER_AREA, zoomSlider);
|
||||||
addRect(PredefinedRect::ZOOM_SLIDER, zoomSlider.adjusted(0, 1, 0, 0));
|
if (layout == QString("Minimum"))
|
||||||
|
addRect(PredefinedRect::ZOOM_SLIDER, QRect(0, 0, -1, -1));
|
||||||
|
else
|
||||||
|
addRect(PredefinedRect::ZOOM_SLIDER, zoomSlider.adjusted(0, 1, 0, 0));
|
||||||
|
|
||||||
zoomIn = QRect(0, zoomSlider.bottom() + 1, LAYER_FOOTER_PANEL_WIDTH, 16);
|
zoomIn = QRect(0, zoomSlider.bottom() + 1, LAYER_FOOTER_PANEL_WIDTH, 16);
|
||||||
addRect(PredefinedRect::ZOOM_IN_AREA, zoomIn);
|
addRect(PredefinedRect::ZOOM_IN_AREA, zoomIn);
|
||||||
|
@ -768,6 +879,7 @@ TopToBottomOrientation::TopToBottomOrientation() {
|
||||||
zoomOut = QRect(0, zoomSlider.top() - 17, LAYER_FOOTER_PANEL_WIDTH, 16);
|
zoomOut = QRect(0, zoomSlider.top() - 17, LAYER_FOOTER_PANEL_WIDTH, 16);
|
||||||
addRect(PredefinedRect::ZOOM_OUT_AREA, zoomOut);
|
addRect(PredefinedRect::ZOOM_OUT_AREA, zoomOut);
|
||||||
addRect(PredefinedRect::ZOOM_OUT, zoomOut.adjusted(1, 1, 0, 0));
|
addRect(PredefinedRect::ZOOM_OUT, zoomOut.adjusted(1, 1, 0, 0));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// Layer footer panel
|
// Layer footer panel
|
||||||
addRect(PredefinedRect::LAYER_FOOTER_PANEL, QRect(0, 0, -1, -1)); // hide
|
addRect(PredefinedRect::LAYER_FOOTER_PANEL, QRect(0, 0, -1, -1)); // hide
|
||||||
|
@ -1204,6 +1316,7 @@ LeftToRightOrientation::LeftToRightOrientation() {
|
||||||
addFlag(PredefinedFlag::THUMBNAIL_AREA_VISIBLE, true);
|
addFlag(PredefinedFlag::THUMBNAIL_AREA_VISIBLE, true);
|
||||||
addFlag(PredefinedFlag::CAMERA_ICON_VISIBLE, true);
|
addFlag(PredefinedFlag::CAMERA_ICON_VISIBLE, true);
|
||||||
addFlag(PredefinedFlag::VOLUME_AREA_VERTICAL, false);
|
addFlag(PredefinedFlag::VOLUME_AREA_VERTICAL, false);
|
||||||
|
addFlag(PredefinedFlag::NOTE_AREA_IN_POPUP, false);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Lines
|
// Lines
|
||||||
|
|
|
@ -408,12 +408,8 @@ void Preferences::definePreferenceItems() {
|
||||||
QMetaType::Bool, true);
|
QMetaType::Bool, true);
|
||||||
define(actualPixelViewOnSceneEditingMode, "actualPixelViewOnSceneEditingMode",
|
define(actualPixelViewOnSceneEditingMode, "actualPixelViewOnSceneEditingMode",
|
||||||
QMetaType::Bool, false);
|
QMetaType::Bool, false);
|
||||||
define(levelNameOnEachMarkerEnabled, "levelNameOnEachMarkerEnabled",
|
|
||||||
QMetaType::Bool, false);
|
|
||||||
define(showRasterImagesDarkenBlendedInViewer,
|
define(showRasterImagesDarkenBlendedInViewer,
|
||||||
"showRasterImagesDarkenBlendedInViewer", QMetaType::Bool, false);
|
"showRasterImagesDarkenBlendedInViewer", QMetaType::Bool, false);
|
||||||
define(showFrameNumberWithLetters, "showFrameNumberWithLetters",
|
|
||||||
QMetaType::Bool, false);
|
|
||||||
define(iconSize, "iconSize", QMetaType::QSize, QSize(80, 45), QSize(10, 10),
|
define(iconSize, "iconSize", QMetaType::QSize, QSize(80, 45), QSize(10, 10),
|
||||||
QSize(400, 400));
|
QSize(400, 400));
|
||||||
define(viewShrink, "viewShrink", QMetaType::Int, 1, 1, 20);
|
define(viewShrink, "viewShrink", QMetaType::Int, 1, 1, 20);
|
||||||
|
@ -576,6 +572,12 @@ void Preferences::definePreferenceItems() {
|
||||||
true);
|
true);
|
||||||
define(currentColumnColor, "currentColumnColor", QMetaType::QColor,
|
define(currentColumnColor, "currentColumnColor", QMetaType::QColor,
|
||||||
QColor(Qt::yellow));
|
QColor(Qt::yellow));
|
||||||
|
// define(levelNameOnEachMarkerEnabled, "levelNameOnEachMarkerEnabled",
|
||||||
|
// QMetaType::Bool, false);
|
||||||
|
define(levelNameDisplayType, "levelNameDisplayType", QMetaType::Int,
|
||||||
|
0); // default
|
||||||
|
define(showFrameNumberWithLetters, "showFrameNumberWithLetters",
|
||||||
|
QMetaType::Bool, false);
|
||||||
|
|
||||||
// Animation
|
// Animation
|
||||||
define(keyframeType, "keyframeType", QMetaType::Int, 2); // Linear
|
define(keyframeType, "keyframeType", QMetaType::Int, 2); // Linear
|
||||||
|
@ -764,6 +766,16 @@ void Preferences::resolveCompatibility() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// "levelNameOnEachMarkerEnabled" is changed to "levelNameDisplayType", adding
|
||||||
|
// a new option
|
||||||
|
if (m_settings->contains("levelNameOnEachMarkerEnabled") &&
|
||||||
|
!m_settings->contains("levelNameDisplayType")) {
|
||||||
|
if (m_settings->value("levelNameOnEachMarkerEnabled")
|
||||||
|
.toBool()) // show level name on each marker
|
||||||
|
setValue(levelNameDisplayType, ShowLevelNameOnEachMarker);
|
||||||
|
else // Default (level name on top of each cell block)
|
||||||
|
setValue(levelNameDisplayType, ShowLevelName_Default);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------
|
//-----------------------------------------------------------------
|
||||||
|
|
|
@ -328,8 +328,8 @@ void FunctionSheetColumnHeadViewer::paintEvent(QPaintEvent *e) {
|
||||||
|
|
||||||
int y0 = 0;
|
int y0 = 0;
|
||||||
int y1 = 17; // needs work
|
int y1 = 17; // needs work
|
||||||
int y2 = 34;
|
|
||||||
int y3 = 53;
|
int y3 = 53;
|
||||||
|
if (m_sheet->isSmallHeader()) y3 = 34;
|
||||||
|
|
||||||
/*--- Fill header with background color ---*/
|
/*--- Fill header with background color ---*/
|
||||||
for (int c = c0; c <= c1; c++) {
|
for (int c = c0; c <= c1; c++) {
|
||||||
|
@ -401,9 +401,9 @@ void FunctionSheetColumnHeadViewer::paintEvent(QPaintEvent *e) {
|
||||||
|
|
||||||
QString text = channel->getShortName();
|
QString text = channel->getShortName();
|
||||||
int d = 8;
|
int d = 8;
|
||||||
painter.drawText(x0 + d, y1, width - d, y3 - y1 + 1,
|
int flags = Qt::AlignLeft | Qt::AlignVCenter;
|
||||||
Qt::TextWrapAnywhere | Qt::AlignLeft | Qt::AlignVCenter,
|
if (!m_sheet->isSmallHeader()) flags |= Qt::TextWrapAnywhere;
|
||||||
text);
|
painter.drawText(x0 + d, y1, width - d, y3 - y1 + 1, flags, text);
|
||||||
|
|
||||||
// warning of losing expression reference
|
// warning of losing expression reference
|
||||||
TXsheet *xsh = m_sheet->getViewer()->getXsheetHandle()->getXsheet();
|
TXsheet *xsh = m_sheet->getViewer()->getXsheetHandle()->getXsheet();
|
||||||
|
|
|
@ -126,19 +126,25 @@ FunctionViewer::FunctionViewer(QWidget *parent, Qt::WFlags flags)
|
||||||
|
|
||||||
//---- layout
|
//---- layout
|
||||||
|
|
||||||
|
QString layout = Preferences::instance()->getLoadedXsheetLayout();
|
||||||
|
bool toolBarOnBottom =
|
||||||
|
layout == QString("Minimum") &&
|
||||||
|
Preferences::instance()->isExpandFunctionHeaderEnabled() &&
|
||||||
|
m_toggleStart !=
|
||||||
|
Preferences::FunctionEditorToggle::ShowFunctionSpreadsheetInPopup;
|
||||||
|
|
||||||
m_leftLayout = new QVBoxLayout();
|
m_leftLayout = new QVBoxLayout();
|
||||||
m_leftLayout->setMargin(0);
|
m_leftLayout->setMargin(0);
|
||||||
m_leftLayout->setSpacing(0);
|
m_leftLayout->setSpacing(0);
|
||||||
{
|
{
|
||||||
m_leftLayout->addWidget(m_toolbar);
|
if (!toolBarOnBottom) m_leftLayout->addWidget(m_toolbar);
|
||||||
if (Preferences::instance()->isShowQuickToolbarEnabled() &&
|
m_spacing = 35;
|
||||||
Preferences::instance()->isExpandFunctionHeaderEnabled()) {
|
if (layout == QString("Compact"))
|
||||||
m_spacing = 65;
|
m_spacing -= 18;
|
||||||
} else
|
else if (toolBarOnBottom) {
|
||||||
m_spacing = 35;
|
m_spacing = 3; // m_spacing is used for the height of spacer widget
|
||||||
|
m_leftLayout->addSpacing(m_spacing);
|
||||||
QString layout = Preferences::instance()->getLoadedXsheetLayout();
|
}
|
||||||
if (layout == QString("Compact")) m_spacing -= 18;
|
|
||||||
|
|
||||||
if (m_toggleStart !=
|
if (m_toggleStart !=
|
||||||
Preferences::FunctionEditorToggle::ShowGraphEditorInPopup)
|
Preferences::FunctionEditorToggle::ShowGraphEditorInPopup)
|
||||||
|
@ -146,6 +152,8 @@ FunctionViewer::FunctionViewer(QWidget *parent, Qt::WFlags flags)
|
||||||
if (m_toggleStart !=
|
if (m_toggleStart !=
|
||||||
Preferences::FunctionEditorToggle::ShowFunctionSpreadsheetInPopup)
|
Preferences::FunctionEditorToggle::ShowFunctionSpreadsheetInPopup)
|
||||||
m_leftLayout->addWidget(m_numericalColumns);
|
m_leftLayout->addWidget(m_numericalColumns);
|
||||||
|
// display the toolbar on the bottom in Minimum layout
|
||||||
|
if (toolBarOnBottom) m_leftLayout->addWidget(m_toolbar);
|
||||||
}
|
}
|
||||||
|
|
||||||
leftPanel->setLayout(m_leftLayout);
|
leftPanel->setLayout(m_leftLayout);
|
||||||
|
@ -209,13 +217,25 @@ FunctionViewer::FunctionViewer(QWidget *parent, Qt::WFlags flags)
|
||||||
|
|
||||||
assert(ret);
|
assert(ret);
|
||||||
if (m_toggleStart ==
|
if (m_toggleStart ==
|
||||||
Preferences::FunctionEditorToggle::ShowGraphEditorInPopup) {
|
Preferences::FunctionEditorToggle::ShowFunctionSpreadsheetInPopup) {
|
||||||
m_functionGraph->hide();
|
|
||||||
m_leftLayout->setSpacing(m_spacing);
|
|
||||||
}
|
|
||||||
if (m_toggleStart ==
|
|
||||||
Preferences::FunctionEditorToggle::ShowFunctionSpreadsheetInPopup)
|
|
||||||
m_numericalColumns->hide();
|
m_numericalColumns->hide();
|
||||||
|
if (QSpacerItem *spacer = m_leftLayout->itemAt(0)->spacerItem())
|
||||||
|
spacer->changeSize(0, 0);
|
||||||
|
} else {
|
||||||
|
bool toolBarVisible =
|
||||||
|
Preferences::instance()->isShowQuickToolbarEnabled() &&
|
||||||
|
Preferences::instance()->isExpandFunctionHeaderEnabled();
|
||||||
|
if (QSpacerItem *spacer = m_leftLayout->itemAt(0)->spacerItem()) {
|
||||||
|
spacer->changeSize(1, m_spacing + ((toolBarVisible) ? 10 : 0),
|
||||||
|
QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||||
|
spacer->invalidate();
|
||||||
|
} else
|
||||||
|
m_leftLayout->setSpacing(m_spacing + ((toolBarVisible) ? 30 : 0));
|
||||||
|
if (m_toggleStart ==
|
||||||
|
Preferences::FunctionEditorToggle::ShowGraphEditorInPopup) {
|
||||||
|
m_functionGraph->hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
m_toggleStatus = FunctionEditorToggleStatus;
|
m_toggleStatus = FunctionEditorToggleStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -235,46 +255,40 @@ void FunctionViewer::showEvent(QShowEvent *) {
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
|
|
||||||
if (m_xshHandle) {
|
if (m_xshHandle) {
|
||||||
ret = connect(m_xshHandle, SIGNAL(xsheetChanged()), this,
|
ret = ret && connect(m_xshHandle, SIGNAL(xsheetChanged()), this,
|
||||||
SLOT(refreshModel())) &&
|
SLOT(refreshModel()));
|
||||||
ret;
|
ret = ret && connect(m_xshHandle, SIGNAL(xsheetSwitched()), this,
|
||||||
ret = connect(m_xshHandle, SIGNAL(xsheetSwitched()), this,
|
SLOT(rebuildModel()));
|
||||||
SLOT(rebuildModel())) &&
|
|
||||||
ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_frameHandle) {
|
if (m_frameHandle) {
|
||||||
ret = connect(m_frameHandle, SIGNAL(frameSwitched()), this,
|
ret = ret && connect(m_frameHandle, SIGNAL(frameSwitched()), this,
|
||||||
SLOT(propagateExternalSetFrame())) &&
|
SLOT(propagateExternalSetFrame()));
|
||||||
ret;
|
ret = ret && connect(m_frameHandle, SIGNAL(triggerNextKeyframe(QWidget *)),
|
||||||
|
m_toolbar, SLOT(onNextKeyframe(QWidget *)));
|
||||||
ret = connect(m_frameHandle, SIGNAL(triggerNextKeyframe(QWidget *)),
|
ret = ret && connect(m_frameHandle, SIGNAL(triggerPrevKeyframe(QWidget *)),
|
||||||
m_toolbar, SLOT(onNextKeyframe(QWidget *))) &&
|
m_toolbar, SLOT(onPrevKeyframe(QWidget *)));
|
||||||
ret;
|
|
||||||
ret = connect(m_frameHandle, SIGNAL(triggerPrevKeyframe(QWidget *)),
|
|
||||||
m_toolbar, SLOT(onPrevKeyframe(QWidget *))) &&
|
|
||||||
ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_objectHandle) {
|
if (m_objectHandle) {
|
||||||
ret = connect(m_objectHandle, SIGNAL(objectSwitched()), this,
|
ret = ret && connect(m_objectHandle, SIGNAL(objectSwitched()), this,
|
||||||
SLOT(onStageObjectSwitched())) &&
|
SLOT(onStageObjectSwitched()));
|
||||||
ret;
|
ret = ret && connect(m_objectHandle, SIGNAL(objectChanged(bool)), this,
|
||||||
ret = connect(m_objectHandle, SIGNAL(objectChanged(bool)), this,
|
SLOT(onStageObjectChanged(bool)));
|
||||||
SLOT(onStageObjectChanged(bool))) &&
|
|
||||||
ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_fxHandle)
|
if (m_fxHandle)
|
||||||
ret =
|
ret = ret &&
|
||||||
connect(m_fxHandle, SIGNAL(fxSwitched()), this, SLOT(onFxSwitched())) &&
|
connect(m_fxHandle, SIGNAL(fxSwitched()), this, SLOT(onFxSwitched()));
|
||||||
ret;
|
|
||||||
|
|
||||||
// display animated channels when the scene is switched
|
// display animated channels when the scene is switched
|
||||||
if (m_sceneHandle)
|
if (m_sceneHandle) {
|
||||||
ret = connect(m_sceneHandle, SIGNAL(sceneSwitched()), m_treeView,
|
ret = ret && connect(m_sceneHandle, SIGNAL(sceneSwitched()), m_treeView,
|
||||||
SLOT(displayAnimatedChannels())) &&
|
SLOT(displayAnimatedChannels()));
|
||||||
ret;
|
ret = ret &&
|
||||||
|
connect(m_sceneHandle, SIGNAL(preferenceChanged(const QString &)),
|
||||||
|
this, SLOT(onPreferenceChanged(const QString &)));
|
||||||
|
}
|
||||||
|
|
||||||
assert(ret);
|
assert(ret);
|
||||||
|
|
||||||
|
@ -295,18 +309,7 @@ void FunctionViewer::showEvent(QShowEvent *) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_fxHandle) ftm->setCurrentFx(m_fxHandle->getFx());
|
if (m_fxHandle) ftm->setCurrentFx(m_fxHandle->getFx());
|
||||||
if (m_toggleStart ==
|
onPreferenceChanged("");
|
||||||
Preferences::FunctionEditorToggle::ToggleBetweenGraphAndSpreadsheet) {
|
|
||||||
if (m_toggleStatus == 1) {
|
|
||||||
m_numericalColumns->hide();
|
|
||||||
m_functionGraph->show();
|
|
||||||
m_leftLayout->setSpacing(0);
|
|
||||||
} else {
|
|
||||||
m_functionGraph->hide();
|
|
||||||
m_numericalColumns->show();
|
|
||||||
m_leftLayout->setSpacing(m_spacing);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@ -509,13 +512,28 @@ void FunctionViewer::toggleMode() {
|
||||||
m_functionGraph->hide();
|
m_functionGraph->hide();
|
||||||
m_numericalColumns->show();
|
m_numericalColumns->show();
|
||||||
m_numericalColumns->setFocus();
|
m_numericalColumns->setFocus();
|
||||||
m_leftLayout->setSpacing(m_spacing);
|
bool toolBarVisible =
|
||||||
|
Preferences::instance()->isShowQuickToolbarEnabled() &&
|
||||||
|
Preferences::instance()->isExpandFunctionHeaderEnabled();
|
||||||
|
if (QSpacerItem *spacer = m_leftLayout->itemAt(0)->spacerItem()) {
|
||||||
|
spacer->changeSize(1, m_spacing + ((toolBarVisible) ? 10 : 0),
|
||||||
|
QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||||
|
spacer->invalidate();
|
||||||
|
m_numericalColumns->updateHeaderHeight();
|
||||||
|
m_leftLayout->setSpacing(0);
|
||||||
|
} else
|
||||||
|
m_leftLayout->setSpacing(m_spacing + ((toolBarVisible) ? 30 : 0));
|
||||||
|
updateGeometry();
|
||||||
m_toggleStatus = 0;
|
m_toggleStatus = 0;
|
||||||
} else {
|
} else {
|
||||||
m_functionGraph->show();
|
m_functionGraph->show();
|
||||||
m_functionGraph->setFocus();
|
m_functionGraph->setFocus();
|
||||||
m_numericalColumns->hide();
|
m_numericalColumns->hide();
|
||||||
m_leftLayout->setSpacing(0);
|
m_leftLayout->setSpacing(0);
|
||||||
|
if (QSpacerItem *spacer = m_leftLayout->itemAt(0)->spacerItem()) {
|
||||||
|
spacer->changeSize(0, 0);
|
||||||
|
spacer->invalidate();
|
||||||
|
}
|
||||||
m_toggleStatus = 1;
|
m_toggleStatus = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -651,6 +669,45 @@ void FunctionViewer::doSwitchCurrentObject(TStageObject *obj) {
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void FunctionViewer::onPreferenceChanged(const QString &prefName) {
|
||||||
|
if (prefName != "XSheetToolbar" && !prefName.isEmpty()) return;
|
||||||
|
if (!Preferences::instance()->isExpandFunctionHeaderEnabled()) return;
|
||||||
|
if (m_toggleStart ==
|
||||||
|
Preferences::FunctionEditorToggle::ShowFunctionSpreadsheetInPopup)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (m_toggleStart ==
|
||||||
|
Preferences::FunctionEditorToggle::ToggleBetweenGraphAndSpreadsheet &&
|
||||||
|
m_toggleStatus == 1) {
|
||||||
|
m_numericalColumns->hide();
|
||||||
|
m_functionGraph->show();
|
||||||
|
m_leftLayout->setSpacing(0);
|
||||||
|
if (QSpacerItem *spacer = m_leftLayout->itemAt(0)->spacerItem()) {
|
||||||
|
spacer->changeSize(0, 0);
|
||||||
|
spacer->invalidate();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// spreadsheet is shown
|
||||||
|
bool toolBarVisible =
|
||||||
|
Preferences::instance()->isShowQuickToolbarEnabled() &&
|
||||||
|
Preferences::instance()->isExpandFunctionHeaderEnabled();
|
||||||
|
m_functionGraph->hide();
|
||||||
|
m_numericalColumns->show();
|
||||||
|
if (QSpacerItem *spacer = m_leftLayout->itemAt(0)->spacerItem()) {
|
||||||
|
spacer->changeSize(1, m_spacing + ((toolBarVisible) ? 10 : 0),
|
||||||
|
QSizePolicy::Fixed, QSizePolicy::Fixed);
|
||||||
|
spacer->invalidate();
|
||||||
|
m_numericalColumns->updateHeaderHeight();
|
||||||
|
m_leftLayout->setSpacing(0);
|
||||||
|
} else
|
||||||
|
m_leftLayout->setSpacing(m_spacing + ((toolBarVisible) ? 30 : 0));
|
||||||
|
updateGeometry();
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
void FunctionViewer::doSwitchCurrentFx(TFx *fx) {
|
void FunctionViewer::doSwitchCurrentFx(TFx *fx) {
|
||||||
if (!fx) {
|
if (!fx) {
|
||||||
m_fxHandle->setFx(0);
|
m_fxHandle->setFx(0);
|
||||||
|
|
|
@ -569,8 +569,15 @@ SpreadsheetViewer::SpreadsheetViewer(QWidget *parent)
|
||||||
QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Ignored));
|
QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Ignored));
|
||||||
|
|
||||||
m_rowScrollArea->setFixedWidth(30);
|
m_rowScrollArea->setFixedWidth(30);
|
||||||
m_columnScrollArea->setFixedHeight(m_rowHeight * 3 - 4);
|
|
||||||
// m_columnScrollArea->setFixedHeight(m_rowHeight * 3 + 60 - 63);
|
if (Preferences::instance()->getLoadedXsheetLayout() == QString("Minimum") &&
|
||||||
|
!Preferences::instance()->isShowQuickToolbarEnabled() &&
|
||||||
|
Preferences::instance()->isExpandFunctionHeaderEnabled() &&
|
||||||
|
Preferences::instance()->getFunctionEditorToggle() !=
|
||||||
|
Preferences::FunctionEditorToggle::ShowFunctionSpreadsheetInPopup)
|
||||||
|
m_columnScrollArea->setFixedHeight(m_rowHeight * 2 - 4);
|
||||||
|
else
|
||||||
|
m_columnScrollArea->setFixedHeight(m_rowHeight * 3 - 4);
|
||||||
|
|
||||||
m_frameScroller.setFrameScrollArea(m_cellScrollArea);
|
m_frameScroller.setFrameScrollArea(m_cellScrollArea);
|
||||||
connect(&m_frameScroller, &Spreadsheet::FrameScroller::prepareToScrollOffset,
|
connect(&m_frameScroller, &Spreadsheet::FrameScroller::prepareToScrollOffset,
|
||||||
|
@ -1043,6 +1050,22 @@ void SpreadsheetViewer::ensureVisibleCol(int col) {
|
||||||
m_cellScrollArea->ensureVisible(x, vertValue, m_columnWidth / 2, 0);
|
m_cellScrollArea->ensureVisible(x, vertValue, m_columnWidth / 2, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool SpreadsheetViewer::isSmallHeader() {
|
||||||
|
return (
|
||||||
|
Preferences::instance()->getLoadedXsheetLayout() == QString("Minimum") &&
|
||||||
|
!Preferences::instance()->isShowQuickToolbarEnabled() &&
|
||||||
|
Preferences::instance()->isExpandFunctionHeaderEnabled() &&
|
||||||
|
Preferences::instance()->getFunctionEditorToggle() !=
|
||||||
|
Preferences::FunctionEditorToggle::ShowFunctionSpreadsheetInPopup);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SpreadsheetViewer::updateHeaderHeight() {
|
||||||
|
if (isSmallHeader())
|
||||||
|
m_columnScrollArea->setFixedHeight(m_rowHeight * 2 - 4);
|
||||||
|
else
|
||||||
|
m_columnScrollArea->setFixedHeight(m_rowHeight * 3 - 4);
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
bool SpreadsheetViewer::event(QEvent *e) {
|
bool SpreadsheetViewer::event(QEvent *e) {
|
||||||
|
|
Loading…
Reference in a new issue