[aseprite] 06/308: Remove commented code in context_bar.cpp to select dots freehand algorithm
Tobias Hansen
thansen at moszumanska.debian.org
Tue Mar 8 02:44:46 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 c29fd79796f0844cb5d4aecff73f9964b1a79b62
Author: David Capello <davidcapello at gmail.com>
Date: Wed Nov 18 15:32:48 2015 -0300
Remove commented code in context_bar.cpp to select dots freehand algorithm
---
src/app/ui/context_bar.cpp | 143 ---------------------------------------------
1 file changed, 143 deletions(-)
diff --git a/src/app/ui/context_bar.cpp b/src/app/ui/context_bar.cpp
index 6d5b3ea..1916bda 100644
--- a/src/app/ui/context_bar.cpp
+++ b/src/app/ui/context_bar.cpp
@@ -809,147 +809,6 @@ private:
bool m_lockChange;
};
-#if 0 // TODO for v1.1 to avoid changing the UI
-
-class ContextBar::FreehandAlgorithmField : public Button
- , public IButtonIcon
-{
-public:
- FreehandAlgorithmField()
- : Button("")
- , m_popupWindow(NULL)
- , m_tooltipManager(NULL) {
- setup_mini_look(this);
- setIconInterface(this);
- }
-
- ~FreehandAlgorithmField() {
- closePopup();
- setIconInterface(NULL);
- }
-
- void setupTooltips(TooltipManager* tooltipManager) {
- m_tooltipManager = tooltipManager;
- }
-
- void setFreehandAlgorithm(FreehandAlgorithm algo) {
- SkinTheme* theme = SkinTheme::instance();
- SkinPartPtr part = theme->parts.freehandAlgoDefault();
- m_freehandAlgo = algo;
- switch (m_freehandAlgo) {
- case kDefaultFreehandAlgorithm:
- part = theme->parts.freehandAlgoDefault();
- break;
- case kPixelPerfectFreehandAlgorithm:
- part = theme->parts.freehandAlgoPixelPerfect();
- break;
- case kDotsFreehandAlgorithm:
- part = theme->parts.freehandAlgoDots();
- break;
- }
- m_bitmap = part;
- invalidate();
- }
-
- // IButtonIcon implementation
- void destroy() override {
- // Do nothing, BrushTypeField is added as a widget in the
- // ContextBar, so it will be destroyed together with the
- // ContextBar.
- }
-
- gfx::Size getSize() override {
- return m_bitmap->getSize();
- }
-
- she::Surface* getNormalIcon() override {
- return m_bitmap->getBitmap(0);
- }
-
- she::Surface* getSelectedIcon() override {
- return m_bitmap->getBitmap(0);
- }
-
- she::Surface* getDisabledIcon() override {
- return m_bitmap->getBitmap(0);
- }
-
- int getIconAlign() override {
- return CENTER | MIDDLE;
- }
-
-protected:
- void onClick(Event& ev) override {
- Button::onClick(ev);
-
- if (!m_popupWindow || !m_popupWindow->isVisible())
- openPopup();
- else
- closePopup();
- }
-
- void onPreferredSize(PreferredSizeEvent& ev) override {
- ev.setPreferredSize(Size(16, 18)*guiscale());
- }
-
-private:
- void openPopup() {
- SkinTheme* theme = static_cast<SkinTheme*>(getTheme());
-
- Border border = Border(2, 2, 2, 3)*guiscale();
- Rect rc = getBounds();
- rc.y += rc.h;
- rc.w *= 3;
- m_popupWindow = new PopupWindow("", PopupWindow::kCloseOnClickInOtherWindow);
- m_popupWindow->setAutoRemap(false);
- m_popupWindow->setBorder(border);
- m_popupWindow->setBounds(rc + border);
-
- Region rgn(m_popupWindow->getBounds().createUnion(getBounds()));
- m_popupWindow->setHotRegion(rgn);
- m_freehandAlgoButton = new ButtonSet(3);
- m_freehandAlgoButton->addItem(theme->parts.freehandAlgoDefault());
- m_freehandAlgoButton->addItem(theme->parts.freehandAlgoPixelPerfect());
- m_freehandAlgoButton->addItem(theme->parts.freehandAlgoDots());
- m_freehandAlgoButton->setSelectedItem((int)m_freehandAlgo);
- m_freehandAlgoButton->ItemChange.connect(&FreehandAlgorithmField::onFreehandAlgoChange, this);
- m_freehandAlgoButton->setTransparent(true);
- m_freehandAlgoButton->setBgColor(gfx::ColorNone);
-
- m_tooltipManager->addTooltipFor(at(0), "Normal trace", TOP);
- m_tooltipManager->addTooltipFor(at(1), "Pixel-perfect trace", TOP);
- m_tooltipManager->addTooltipFor(at(2), "Dots", TOP);
-
- m_popupWindow->addChild(m_freehandAlgoButton);
- m_popupWindow->openWindow();
- }
-
- void closePopup() {
- if (m_popupWindow) {
- m_popupWindow->closeWindow(NULL);
- delete m_popupWindow;
- m_popupWindow = NULL;
- m_freehandAlgoButton = NULL;
- }
- }
-
- void onFreehandAlgoChange() {
- setFreehandAlgorithm(
- (FreehandAlgorithm)m_freehandAlgoButton->getSelectedItem());
-
- Tool* tool = App::instance()->activeTool();
- Preferences::instance().tool(tool).freehandAlgorithm(m_freehandAlgo);
- }
-
- SkinPartPtr m_bitmap;
- FreehandAlgorithm m_freehandAlgo;
- PopupWindow* m_popupWindow;
- ButtonSet* m_freehandAlgoButton;
- TooltipManager* m_tooltipManager;
-};
-
-#else
-
class ContextBar::FreehandAlgorithmField : public CheckBox
{
public:
@@ -989,8 +848,6 @@ protected:
}
};
-#endif
-
class ContextBar::SelectionModeField : public ButtonSet
{
public:
--
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