mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-29 19:20:09 +00:00
Add stabilizer options for the Lasso tool
This commit is contained in:
parent
cb6ccc3dc5
commit
49bcc69c9a
@ -6,10 +6,10 @@
|
||||
<check id="stabilizer" text="@.stabilizer"
|
||||
tooltip="@.stabilizer_tooltip" tooltip_dir="bottom" />
|
||||
<slider id="stabilizer_factor" value="16" min="0" max="64" expansive="true" style="mini_slider"
|
||||
tooltip="@.stabilizer_tooltip" tooltip_dir="bottom" />
|
||||
tooltip="@.stabilizer_tooltip" tooltip_dir="bottom" minwidth="64" />
|
||||
</hbox>
|
||||
|
||||
<hbox>
|
||||
<hbox id="grid">
|
||||
<buttonset id="values" columns="3">
|
||||
<item text="" />
|
||||
<item text="@.pressure" tooltip="@.pressure_tooltip" tooltip_dir="bottom" />
|
||||
|
@ -1150,6 +1150,7 @@ public:
|
||||
|
||||
if (!m_popup) {
|
||||
m_popup.reset(new DynamicsPopup(this));
|
||||
m_popup->setOptionsGridVisibility(m_optionsGridVisibility);
|
||||
m_popup->Close.connect(
|
||||
[this](CloseEvent&){
|
||||
deselectItems();
|
||||
@ -1173,6 +1174,12 @@ public:
|
||||
return m_dynamics;
|
||||
}
|
||||
|
||||
void setOptionsGridVisibility(bool state) {
|
||||
m_optionsGridVisibility = state;
|
||||
if (m_popup)
|
||||
m_popup->setOptionsGridVisibility(state);
|
||||
}
|
||||
|
||||
private:
|
||||
// DynamicsPopup::Delegate impl
|
||||
doc::BrushRef getActiveBrush() override {
|
||||
@ -1205,6 +1212,7 @@ private:
|
||||
std::unique_ptr<DynamicsPopup> m_popup;
|
||||
ContextBar* m_ctxBar;
|
||||
mutable tools::DynamicsOptions m_dynamics;
|
||||
bool m_optionsGridVisibility = true;
|
||||
};
|
||||
|
||||
class ContextBar::FreehandAlgorithmField : public CheckBox {
|
||||
@ -2096,7 +2104,8 @@ void ContextBar::updateForTool(tools::Tool* tool)
|
||||
m_eyedropperField->setVisible(isEyedropper);
|
||||
m_autoSelectLayer->setVisible(isMove);
|
||||
m_dynamics->setVisible(isFreehand && supportDynamics);
|
||||
m_freehandBox->setVisible(isFreehand && supportOpacity);
|
||||
m_dynamics->setOptionsGridVisibility(isFreehand && !hasSelectOptions);
|
||||
m_freehandBox->setVisible(isFreehand);
|
||||
m_toleranceLabel->setVisible(hasTolerance);
|
||||
m_tolerance->setVisible(hasTolerance);
|
||||
m_contiguous->setVisible(hasTolerance);
|
||||
|
@ -264,6 +264,13 @@ DynamicsPopup::DynamicsPopup(Delegate* delegate)
|
||||
onValuesChange(nullptr);
|
||||
}
|
||||
|
||||
void DynamicsPopup::setOptionsGridVisibility(bool state)
|
||||
{
|
||||
m_dynamics->grid()->setVisible(state);
|
||||
if (isVisible())
|
||||
expandWindow(sizeHint());
|
||||
}
|
||||
|
||||
tools::DynamicsOptions DynamicsPopup::getDynamics() const
|
||||
{
|
||||
tools::DynamicsOptions opts;
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2020 Igara Studio S.A.
|
||||
// Copyright (C) 2020-2021 Igara Studio S.A.
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -35,6 +35,7 @@ namespace app {
|
||||
DynamicsPopup(Delegate* delegate);
|
||||
|
||||
tools::DynamicsOptions getDynamics() const;
|
||||
void setOptionsGridVisibility(bool state);
|
||||
|
||||
private:
|
||||
class ThresholdSlider;
|
||||
|
Loading…
x
Reference in New Issue
Block a user