mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-28 16:20:50 +00:00
setting to change timeline zoom
This commit is contained in:
parent
1d51ceec20
commit
30feffab8d
@ -257,6 +257,7 @@
|
|||||||
<option id="color2" type="app::Color" default="app::Color::fromRgb(192, 192, 192)" migrate="Option.CheckedBgColor2" />
|
<option id="color2" type="app::Color" default="app::Color::fromRgb(192, 192, 192)" migrate="Option.CheckedBgColor2" />
|
||||||
</section>
|
</section>
|
||||||
<section id="thumbnails">
|
<section id="thumbnails">
|
||||||
|
<option id="zoom" type="double" default="1" />
|
||||||
<option id="enabled" type="bool" default="false" />
|
<option id="enabled" type="bool" default="false" />
|
||||||
<option id="overlay_enabled" type="bool" default="false" />
|
<option id="overlay_enabled" type="bool" default="false" />
|
||||||
<option id="overlay_size" type="int" default="5" />
|
<option id="overlay_size" type="int" default="5" />
|
||||||
|
@ -4,6 +4,9 @@
|
|||||||
<vbox id="timeline_conf">
|
<vbox id="timeline_conf">
|
||||||
<separator cell_hspan="2" text="Thumbnails:" left="true" horizontal="true" />
|
<separator cell_hspan="2" text="Thumbnails:" left="true" horizontal="true" />
|
||||||
<grid columns="3">
|
<grid columns="3">
|
||||||
|
<label text="Zoom:" />
|
||||||
|
<slider min="10" max="100" id="zoom" cell_align="horizontal" width="128" cell_hspan="2" />
|
||||||
|
|
||||||
<check id="thumb_enabled" text="Enabled" />
|
<check id="thumb_enabled" text="Enabled" />
|
||||||
<label text="Opacity:" />
|
<label text="Opacity:" />
|
||||||
<slider min="0" max="255" id="thumb_opacity" cell_align="horizontal" width="128" />
|
<slider min="0" max="255" id="thumb_opacity" cell_align="horizontal" width="128" />
|
||||||
|
@ -62,6 +62,7 @@ ConfigureTimelinePopup::ConfigureTimelinePopup()
|
|||||||
m_box->behind()->Click.connect(base::Bind<void>(&ConfigureTimelinePopup::onPositionChange, this));
|
m_box->behind()->Click.connect(base::Bind<void>(&ConfigureTimelinePopup::onPositionChange, this));
|
||||||
m_box->infront()->Click.connect(base::Bind<void>(&ConfigureTimelinePopup::onPositionChange, this));
|
m_box->infront()->Click.connect(base::Bind<void>(&ConfigureTimelinePopup::onPositionChange, this));
|
||||||
|
|
||||||
|
m_box->zoom()->Change.connect(base::Bind<void>(&ConfigureTimelinePopup::onZoomChange, this));
|
||||||
m_box->thumbOpacity()->Change.connect(base::Bind<void>(&ConfigureTimelinePopup::onThumbOpacityChange, this));
|
m_box->thumbOpacity()->Change.connect(base::Bind<void>(&ConfigureTimelinePopup::onThumbOpacityChange, this));
|
||||||
m_box->thumbBackground()->Change.connect(&ConfigureTimelinePopup::onThumbBackgroundChange, this);
|
m_box->thumbBackground()->Change.connect(&ConfigureTimelinePopup::onThumbBackgroundChange, this);
|
||||||
m_box->thumbEnabled()->Click.connect(base::Bind<void>(&ConfigureTimelinePopup::onThumbEnabledChange, this));
|
m_box->thumbEnabled()->Click.connect(base::Bind<void>(&ConfigureTimelinePopup::onThumbEnabledChange, this));
|
||||||
@ -133,6 +134,7 @@ void ConfigureTimelinePopup::updateWidgetsFromCurrentSettings()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_box->zoom()->setValue(docPref.thumbnails.zoom() * 10.0);
|
||||||
m_box->thumbOpacity()->setValue(docPref.thumbnails.opacity());
|
m_box->thumbOpacity()->setValue(docPref.thumbnails.opacity());
|
||||||
m_box->thumbBackground()->setColor(docPref.thumbnails.background());
|
m_box->thumbBackground()->setColor(docPref.thumbnails.background());
|
||||||
m_box->thumbEnabled()->setSelected(docPref.thumbnails.enabled());
|
m_box->thumbEnabled()->setSelected(docPref.thumbnails.enabled());
|
||||||
@ -209,6 +211,11 @@ void ConfigureTimelinePopup::onPositionChange()
|
|||||||
render::OnionskinPosition::INFRONT);
|
render::OnionskinPosition::INFRONT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ConfigureTimelinePopup::onZoomChange()
|
||||||
|
{
|
||||||
|
docPref().thumbnails.zoom(m_box->zoom()->getValue()/10.0);
|
||||||
|
}
|
||||||
|
|
||||||
void ConfigureTimelinePopup::onThumbOpacityChange()
|
void ConfigureTimelinePopup::onThumbOpacityChange()
|
||||||
{
|
{
|
||||||
docPref().thumbnails.opacity(m_box->thumbOpacity()->getValue());
|
docPref().thumbnails.opacity(m_box->thumbOpacity()->getValue());
|
||||||
|
@ -41,6 +41,7 @@ namespace app {
|
|||||||
void onCurrentLayerChange();
|
void onCurrentLayerChange();
|
||||||
void onPositionChange();
|
void onPositionChange();
|
||||||
|
|
||||||
|
void onZoomChange();
|
||||||
void onThumbOpacityChange();
|
void onThumbOpacityChange();
|
||||||
void onThumbQualityChange();
|
void onThumbQualityChange();
|
||||||
void onThumbBackgroundChange(const app::Color& color);
|
void onThumbBackgroundChange(const app::Color& color);
|
||||||
|
@ -150,8 +150,14 @@ Timeline::~Timeline()
|
|||||||
delete m_confPopup;
|
delete m_confPopup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Timeline::setZoom(double zoom)
|
||||||
|
{
|
||||||
|
m_zoom = MID(1.0, zoom, 10.0);
|
||||||
|
}
|
||||||
|
|
||||||
void Timeline::onThumbnailsPrefChange()
|
void Timeline::onThumbnailsPrefChange()
|
||||||
{
|
{
|
||||||
|
setZoom(docPref().thumbnails.zoom());
|
||||||
invalidate();
|
invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,6 +193,8 @@ void Timeline::updateUsingEditor(Editor* editor)
|
|||||||
m_thumbnailsPrefConn = docPref.thumbnails.AfterChange.connect(
|
m_thumbnailsPrefConn = docPref.thumbnails.AfterChange.connect(
|
||||||
base::Bind<void>(&Timeline::onThumbnailsPrefChange, this));
|
base::Bind<void>(&Timeline::onThumbnailsPrefChange, this));
|
||||||
|
|
||||||
|
setZoom(docPref.thumbnails.zoom());
|
||||||
|
|
||||||
// If we are already in the same position as the "editor", we don't
|
// If we are already in the same position as the "editor", we don't
|
||||||
// need to update the at all timeline.
|
// need to update the at all timeline.
|
||||||
if (m_document == site.document() &&
|
if (m_document == site.document() &&
|
||||||
@ -893,8 +901,7 @@ bool Timeline::onProcessMessage(Message* msg)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case kTouchMagnifyMessage:
|
case kTouchMagnifyMessage:
|
||||||
m_zoom = m_zoom + m_zoom * static_cast<ui::TouchMessage*>(msg)->magnification();
|
setZoom(m_zoom + m_zoom * static_cast<ui::TouchMessage*>(msg)->magnification());
|
||||||
m_zoom = MID(1.0, m_zoom, 10.0);
|
|
||||||
invalidate();
|
invalidate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -265,6 +265,7 @@ namespace app {
|
|||||||
void updateCelOverlayBounds(const Hit& hit);
|
void updateCelOverlayBounds(const Hit& hit);
|
||||||
void drawCelOverlay(ui::Graphics* g);
|
void drawCelOverlay(ui::Graphics* g);
|
||||||
void onThumbnailsPrefChange();
|
void onThumbnailsPrefChange();
|
||||||
|
void setZoom(double zoom);
|
||||||
|
|
||||||
ui::ScrollBar m_hbar;
|
ui::ScrollBar m_hbar;
|
||||||
ui::ScrollBar m_vbar;
|
ui::ScrollBar m_vbar;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user