Minor changes and comments about the previous commit

This commit is contained in:
David Capello 2016-07-25 10:17:53 -03:00
parent 57567af06b
commit 942300e350
6 changed files with 37 additions and 38 deletions

View File

@ -17,6 +17,7 @@
#include "app/tools/ink_type.h"
#include "app/tools/rotation_algorithm.h"
#include "app/ui/color_bar.h"
#include "doc/algorithm/resize_image.h"
#include "doc/anidir.h"
#include "doc/brush_pattern.h"
#include "doc/documents_observer.h"
@ -26,7 +27,6 @@
#include "gfx/rect.h"
#include "render/onionskin_position.h"
#include "render/zoom.h"
#include "doc/algorithm/resize_image.h"
#include "pref.xml.h"

View File

@ -9,11 +9,7 @@
#include "app/document.h"
#include "app/pref/preferences.h"
#include "app/thumbnails.h"
#include "base/bind.h"
#include "base/connection.h"
#include "base/shared_ptr.h"
#include "doc/algorithm/resize_image.h"
#include "doc/algorithm/rotate.h"
#include "doc/cel.h"
#include "doc/conversion_she.h"
#include "doc/doc.h"

View File

@ -1,5 +1,5 @@
// Aseprite
// Copyright (C) 2001-2015 David Capello
// Copyright (C) 2001-2016 David Capello
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
@ -41,6 +41,9 @@ ConfigureTimelinePopup::ConfigureTimelinePopup()
: PopupWindow("Timeline Settings", ClickBehavior::CloseOnClickInOtherWindow)
, m_lockUpdates(false)
{
// TODO we should add a new hot region to automatically close the
// popup if the mouse is moved outside or find other kind of
// dialog/window
setHotRegion(gfx::Region(manager()->bounds())); // for the color selector
setAutoRemap(false);
@ -118,15 +121,16 @@ void ConfigureTimelinePopup::updateWidgetsFromCurrentSettings()
}
switch (docPref.thumbnails.quality()) {
case doc::algorithm::RESIZE_METHOD_NEAREST_NEIGHBOR:
m_box->thumbQuality()->setSelectedItemIndex(0);
break;
case doc::algorithm::RESIZE_METHOD_BILINEAR:
m_box->thumbQuality()->setSelectedItemIndex(1);
break;
default:
docPref.thumbnails.quality(doc::algorithm::RESIZE_METHOD_NEAREST_NEIGHBOR);
m_box->thumbQuality()->setSelectedItemIndex(0);
case doc::algorithm::RESIZE_METHOD_NEAREST_NEIGHBOR:
m_box->thumbQuality()->setSelectedItemIndex(0);
break;
case doc::algorithm::RESIZE_METHOD_BILINEAR:
m_box->thumbQuality()->setSelectedItemIndex(1);
break;
default:
docPref.thumbnails.quality(doc::algorithm::RESIZE_METHOD_NEAREST_NEIGHBOR);
m_box->thumbQuality()->setSelectedItemIndex(0);
break;
}
m_box->thumbOpacity()->setValue(docPref.thumbnails.opacity());
@ -213,15 +217,16 @@ void ConfigureTimelinePopup::onThumbOpacityChange()
void ConfigureTimelinePopup::onThumbQualityChange()
{
switch (m_box->thumbQuality()->getSelectedItemIndex()) {
case 0:
docPref().thumbnails.quality(doc::algorithm::RESIZE_METHOD_NEAREST_NEIGHBOR);
break;
case 1:
docPref().thumbnails.quality(doc::algorithm::RESIZE_METHOD_BILINEAR);
break;
default:
docPref().thumbnails.quality(doc::algorithm::RESIZE_METHOD_NEAREST_NEIGHBOR);
m_box->thumbQuality()->setSelectedItemIndex(0);
case 0:
docPref().thumbnails.quality(doc::algorithm::RESIZE_METHOD_NEAREST_NEIGHBOR);
break;
case 1:
docPref().thumbnails.quality(doc::algorithm::RESIZE_METHOD_BILINEAR);
break;
default:
docPref().thumbnails.quality(doc::algorithm::RESIZE_METHOD_NEAREST_NEIGHBOR);
m_box->thumbQuality()->setSelectedItemIndex(0);
break;
}
}

View File

@ -1,5 +1,5 @@
// Aseprite
// Copyright (C) 2001-2015 David Capello
// Copyright (C) 2001-2016 David Capello
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
@ -12,7 +12,6 @@
#include "app/pref/preferences.h"
#include "doc/anidir.h"
#include "ui/popup_window.h"
#include "base/connection.h"
namespace ui {
class Button;

View File

@ -27,6 +27,7 @@
#include "app/modules/editors.h"
#include "app/modules/gfx.h"
#include "app/modules/gui.h"
#include "app/thumbnails.h"
#include "app/transaction.h"
#include "app/ui/app_menuitem.h"
#include "app/ui/configure_timeline_popup.h"
@ -39,23 +40,25 @@
#include "app/ui/workspace.h"
#include "app/ui_context.h"
#include "app/util/clipboard.h"
#include "base/bind.h"
#include "base/convert_to.h"
#include "base/memory.h"
#include "base/scoped_value.h"
#include "base/unique_ptr.h"
#include "doc/doc.h"
#include "doc/document_event.h"
#include "doc/frame_tag.h"
#include "gfx/point.h"
#include "gfx/rect.h"
#include "she/font.h"
#include "she/surface.h"
#include "ui/scroll_helper.h"
#include "ui/ui.h"
#include "base/unique_ptr.h"
#include "she/surface.h"
#include "she/system.h"
#include "doc/conversion_she.h"
#include "base/bind.h"
// TODO why we need this? It should be done in app/thumbnails.cpp
#include "doc/algorithm/rotate.h"
#include "doc/conversion_she.h"
#include "she/system.h"
#include <cstdio>
#include <vector>
@ -1632,8 +1635,8 @@ void Timeline::drawCelOverlay(ui::Graphics* g)
base::UniquePtr<Image> overlay_img(
Image::create(image->pixelFormat(),
m_thumbnailsOverlayInner.w,
m_thumbnailsOverlayInner.h));
m_thumbnailsOverlayInner.w,
m_thumbnailsOverlayInner.h));
double scale = (
m_sprite->width() > m_sprite->height() ?

View File

@ -23,7 +23,6 @@
#include "ui/scroll_bar.h"
#include "ui/timer.h"
#include "ui/widget.h"
#include "app/thumbnails.h"
#include <vector>
@ -38,10 +37,6 @@ namespace ui {
class Graphics;
}
namespace she {
class Surface;
}
namespace app {
namespace skin {
@ -300,6 +295,7 @@ namespace app {
AniControls m_aniControls;
// Data used for thumbnails.
bool m_thumbnailsOverlayVisible;
gfx::Rect m_thumbnailsOverlayInner;
gfx::Rect m_thumbnailsOverlayOuter;