Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

Fix widths

Jeremy Bullock195eae456d03
diff --git a/toonz/sources/tnztools/tooloptions.cpp b/toonz/sources/tnztools/tooloptions.cpp
index d2ba53bab..445636644 100644
--- a/toonz/sources/tnztools/tooloptions.cpp
+++ b/toonz/sources/tnztools/tooloptions.cpp
@@ -535,7 +535,7 @@ ArrowToolOptionsBox::ArrowToolOptionsBox(
m_nsPosField =
new PegbarChannelField(m_tool, TStageObject::T_Y, "field", frameHandle,
objHandle, xshHandle, this);
- m_zField = new PegbarChannelField(m_tool, TStageObject::T_Z, "field",
+ m_zField = new PegbarChannelField(m_tool, TStageObject::T_Z, "field",
frameHandle, objHandle, xshHandle, this);
m_noScaleZField = new NoScaleField(m_tool, "field");
@@ -666,7 +666,7 @@ ArrowToolOptionsBox::ArrowToolOptionsBox(
m_zField->setPrecision(4);
m_noScaleZField->setPrecision(4);
- bool splined = isCurrentObjectSplined();
+ bool splined = isCurrentObjectSplined();
if (splined != m_splined) m_splined = splined;
setSplined(m_splined);
@@ -1299,7 +1299,7 @@ SelectionToolOptionsBox::SelectionToolOptionsBox(QWidget *parent, TTool *tool,
// assert(ret);
bool ret = connect(m_scaleXField, SIGNAL(valueChange(bool)),
SLOT(onScaleXValueChanged(bool)));
- ret = ret && connect(m_scaleYField, SIGNAL(valueChange(bool)),
+ ret = ret && connect(m_scaleYField, SIGNAL(valueChange(bool)),
SLOT(onScaleYValueChanged(bool)));
if (m_setSaveboxCheckbox)
ret = ret && connect(m_setSaveboxCheckbox, SIGNAL(toggled(bool)),
@@ -1710,11 +1710,11 @@ FillToolOptionsBox::FillToolOptionsBox(QWidget *parent, TTool *tool,
bool ret = connect(m_colorMode, SIGNAL(currentIndexChanged(int)), this,
SLOT(onColorModeChanged(int)));
- ret = ret && connect(m_toolType, SIGNAL(currentIndexChanged(int)), this,
+ ret = ret && connect(m_toolType, SIGNAL(currentIndexChanged(int)), this,
SLOT(onToolTypeChanged(int)));
- ret = ret && connect(m_onionMode, SIGNAL(toggled(bool)), this,
+ ret = ret && connect(m_onionMode, SIGNAL(toggled(bool)), this,
SLOT(onOnionModeToggled(bool)));
- ret = ret && connect(m_multiFrameMode, SIGNAL(toggled(bool)), this,
+ ret = ret && connect(m_multiFrameMode, SIGNAL(toggled(bool)), this,
SLOT(onMultiFrameModeToggled(bool)));
assert(ret);
if (m_colorMode->getProperty()->getValue() == L"Lines") {
@@ -2313,9 +2313,9 @@ TapeToolOptionsBox::TapeToolOptionsBox(QWidget *parent, TTool *tool,
bool ret = connect(m_typeMode, SIGNAL(currentIndexChanged(int)), this,
SLOT(onToolTypeChanged(int)));
- ret = ret && connect(m_toolMode, SIGNAL(currentIndexChanged(int)), this,
+ ret = ret && connect(m_toolMode, SIGNAL(currentIndexChanged(int)), this,
SLOT(onToolModeChanged(int)));
- ret = ret && connect(m_joinStrokesMode, SIGNAL(toggled(bool)), this,
+ ret = ret && connect(m_joinStrokesMode, SIGNAL(toggled(bool)), this,
SLOT(onJoinStrokesModeChanged()));
assert(ret);
}
@@ -2402,11 +2402,10 @@ protected:
p.setPen(Qt::black);
p.setBrush(Qt::NoBrush);
- p.drawText(rect(), Qt::AlignCenter,
- QString("R:%1 G:%2 B:%3")
- .arg(m_color.red())
- .arg(m_color.green())
- .arg(m_color.blue()));
+ p.drawText(rect(), Qt::AlignCenter, QString("R:%1 G:%2 B:%3")
+ .arg(m_color.red())
+ .arg(m_color.green())
+ .arg(m_color.blue()));
}
};
@@ -2425,6 +2424,8 @@ RGBPickerToolOptionsBox::RGBPickerToolOptionsBox(
CommandManager::instance()->getAction("A_ToolOption_PickScreen");
QPushButton *button = new QPushButton(tr("Pick Screen"));
+ int buttonWidth = fontMetrics().width(button->text()) + 10;
+ button->setFixedWidth(buttonWidth);
button->setFixedHeight(20);
button->addAction(pickScreenAction);
connect(button, SIGNAL(clicked()), pickScreenAction, SLOT(trigger()));
@@ -2440,7 +2441,8 @@ RGBPickerToolOptionsBox::RGBPickerToolOptionsBox(
m_layout->addWidget(m_currentRGBLabel, 0);
m_layout->addStretch(1);
- m_layout->addWidget(button, 0); // new in 6.4
+ m_layout->addWidget(button, 0);
+ m_layout->addSpacing(5);
if (m_realTimePickMode) {
connect(m_realTimePickMode, SIGNAL(toggled(bool)), m_currentRGBLabel,
@@ -2503,8 +2505,9 @@ StylePickerToolOptionsBox::StylePickerToolOptionsBox(
ToolOptionCheckbox *organizePaletteCB =
dynamic_cast<ToolOptionCheckbox *>(m_controls.value("Organize Palette"));
m_layout->removeWidget(organizePaletteCB);
- m_layout->addWidget(new ToolOptionsBarSeparator(this), 0);
+ // m_layout->addWidget(new ToolOptionsBarSeparator(this), 0);
m_layout->addWidget(organizePaletteCB);
+ m_layout->addSpacing(5);
organizePaletteCB->setToolTip(
tr("With this option being activated, the picked style will be\nmoved to "
"the end of the first page of the palette."));
@@ -2685,15 +2688,20 @@ ZoomToolOptionsBox::ZoomToolOptionsBox(QWidget *parent, TTool *tool,
setFrameStyle(QFrame::StyledPanel);
setFixedHeight(26);
- QAction *resetZoomAction = CommandManager::instance()->getAction(VB_ZoomReset);
+ QAction *resetZoomAction =
+ CommandManager::instance()->getAction(VB_ZoomReset);
QPushButton *button = new QPushButton(tr("Reset Zoom"));
+ int buttonWidth = fontMetrics().width(button->text()) + 10;
+ button->setFixedWidth(buttonWidth);
button->setFixedHeight(20);
button->addAction(resetZoomAction);
+
connect(button, SIGNAL(clicked()), resetZoomAction, SLOT(trigger()));
m_layout->addStretch(1);
m_layout->addWidget(button, 0);
+ m_layout->addSpacing(5);
}
//=============================================================================
@@ -2711,12 +2719,16 @@ RotateToolOptionsBox::RotateToolOptionsBox(QWidget *parent, TTool *tool,
CommandManager::instance()->getAction(VB_RotateReset);
QPushButton *button = new QPushButton(tr("Reset Rotation"));
+ int buttonWidth = fontMetrics().width(button->text()) + 10;
+ button->setFixedWidth(buttonWidth);
button->setFixedHeight(20);
button->addAction(resetRotationAction);
+
connect(button, SIGNAL(clicked()), resetRotationAction, SLOT(trigger()));
m_layout->addStretch(1);
m_layout->addWidget(button, 0);
+ m_layout->addSpacing(5);
}
//=============================================================================
@@ -2734,12 +2746,16 @@ HandToolOptionsBox::HandToolOptionsBox(QWidget *parent, TTool *tool,
CommandManager::instance()->getAction(VB_PositionReset);
QPushButton *button = new QPushButton(tr("Reset Position"));
+ int buttonWidth = fontMetrics().width(button->text()) + 10;
+ button->setFixedWidth(buttonWidth);
button->setFixedHeight(20);
button->addAction(resetPositionAction);
+
connect(button, SIGNAL(clicked()), resetPositionAction, SLOT(trigger()));
m_layout->addStretch(1);
m_layout->addWidget(button, 0);
+ m_layout->addSpacing(5);
}
//=============================================================================
@@ -2817,7 +2833,7 @@ void ToolOptions::onToolSwitched() {
TTool *tool = app->getCurrentTool()->getTool();
if (tool) {
// c'e' un tool corrente
- ToolOptionsBox *panel = 0;
+ ToolOptionsBox *panel = 0;
std::map<TTool *, ToolOptionsBox *>::iterator it = m_panels.find(tool);
if (it == m_panels.end()) {
// ... senza panel associato