[aseprite] 114/308: Don't use ContextBar from BrushPopup

Tobias Hansen thansen at moszumanska.debian.org
Tue Mar 8 02:44:59 UTC 2016


This is an automated email from the git hooks/post-receive script.

thansen pushed a commit to branch master
in repository aseprite.

commit 53b8eb7c4d06c97be282f51881d07000b36e90c0
Author: David Capello <davidcapello at gmail.com>
Date:   Tue Dec 15 18:17:21 2015 -0300

    Don't use ContextBar from BrushPopup
---
 src/app/ui/brush_popup.cpp | 10 ++++++----
 src/app/ui/brush_popup.h   |  1 +
 src/app/ui/context_bar.cpp |  4 ++++
 3 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/app/ui/brush_popup.cpp b/src/app/ui/brush_popup.cpp
index fa2c8f5..c27ca04 100644
--- a/src/app/ui/brush_popup.cpp
+++ b/src/app/ui/brush_popup.cpp
@@ -19,7 +19,6 @@
 #include "app/modules/palettes.h"
 #include "app/ui/app_menuitem.h"
 #include "app/ui/button_set.h"
-#include "app/ui/context_bar.h"
 #include "app/ui/keyboard_shortcuts.h"
 #include "app/ui/skin/skin_theme.h"
 #include "app/ui_context.h"
@@ -149,7 +148,7 @@ private:
   void onSaveBrush() {
     AppBrushes& brushes = App::instance()->brushes();
     brushes.setCustomBrush(
-      m_slot, ContextBar::createBrushFromPreferences());
+      m_slot, m_delegate->onCreateBrushFromActivePreferences());
     brushes.lockCustomBrush(m_slot);
   }
 
@@ -176,7 +175,8 @@ private:
 
 class NewCustomBrushItem : public ButtonSet::Item {
 public:
-  NewCustomBrushItem() {
+  NewCustomBrushItem(BrushPopupDelegate* delegate)
+    : m_delegate(delegate) {
     setText("Save Brush");
   }
 
@@ -184,9 +184,11 @@ private:
   void onClick() override {
     AppBrushes& brushes = App::instance()->brushes();
     auto slot = brushes.addCustomBrush(
-      ContextBar::createBrushFromPreferences());
+      m_delegate->onCreateBrushFromActivePreferences());
     brushes.lockCustomBrush(slot);
   }
+
+  BrushPopupDelegate* m_delegate;
 };
 
 } // anonymous namespace
diff --git a/src/app/ui/brush_popup.h b/src/app/ui/brush_popup.h
index 00f2cad..f7a2356 100644
--- a/src/app/ui/brush_popup.h
+++ b/src/app/ui/brush_popup.h
@@ -21,6 +21,7 @@ namespace app {
   class BrushPopupDelegate {
   public:
     virtual ~BrushPopupDelegate() { }
+    virtual doc::BrushRef onCreateBrushFromActivePreferences() = 0;
     virtual void onSelectBrush(const doc::BrushRef& brush) = 0;
     virtual void onSelectBrushSlot(int slot) = 0;
     virtual void onDeleteBrushSlot(int slot) = 0;
diff --git a/src/app/ui/context_bar.cpp b/src/app/ui/context_bar.cpp
index 56807f6..044bd56 100644
--- a/src/app/ui/context_bar.cpp
+++ b/src/app/ui/context_bar.cpp
@@ -123,6 +123,10 @@ protected:
   }
 
   // BrushPopupDelegate impl
+  BrushRef onCreateBrushFromActivePreferences() {
+    return ContextBar::createBrushFromPreferences();
+  }
+
   void onSelectBrush(const BrushRef& brush) {
     if (brush->type() == kImageBrushType)
       m_owner->setActiveBrush(brush);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git



More information about the Pkg-games-commits mailing list