From c639b4dba31c9ffe44c2aed146823a7f586c8f3e Mon Sep 17 00:00:00 2001 From: David Capello Date: Sun, 15 Jun 2014 04:14:53 -0300 Subject: [PATCH] Add "dots" freehand algorithm (change to ButtonSet the selection of FreehandAlgorithm) --- data/skins/default/sheet.png | Bin 11917 -> 12011 bytes data/skins/default/skin.xml | 6 ++ src/app/settings/freehand_algorithm.h | 1 + src/app/settings/ui_settings_impl.cpp | 20 ++-- src/app/ui/context_bar.cpp | 147 +++++++++++++++++++++++--- src/app/ui/skin/skin_parts.h | 7 ++ src/app/ui/skin/skin_theme.cpp | 6 ++ 7 files changed, 167 insertions(+), 20 deletions(-) diff --git a/data/skins/default/sheet.png b/data/skins/default/sheet.png index 148c27d0f8bcfca9e3cddb044765f8c77a04a3b4..87e79714afe0c419052f23d39226984111ef5c92 100644 GIT binary patch literal 12011 zcmX|{WmsEHxU~a?qQ#x!6b(?^-Q5ZVEd)}$K#O~EDXxVA#T^p7DK5n&(Be*UcZZYr zeBX6`ME(GnFOgTUh}A^^0D6F` zg6uo*?}s@nu{6r*+u8z`7zaJTi=K9G&PPRwPIWvbTwzYwy{EEQY!sCW$o&FAL4QM3J{F!mA0L|qfW?o zGc9i-=%N4FU}dL%4i}RFYR0`UaDMyx2E#`v`!7CLUVP95h>EbM2PAz`f+L(gYWdTw z+h3~G_2P#KPDD2?AQ@M6rMX$_2&5oDtO&ainVYZJRz)?jCnxK~RG{&8YRB;}kuT@G(EI zebm?soNz2sz)3X@M-)3zr_#tsCTK1yJ+3T{QVvr`?Y4w*xyrL4Yk^eZGY~7Lz|K7s zNQMIflEoc`RLo@^c&X&r(US4#`Jd}V#AU*qolb;-#MOe`Te1Sh2pS{W;kv4iN99>I z#_0&)FtB20(Y<<~-gn9;_XTIlC5$qwI4XjT*3dY;8Y4w-e#Z#>s0aU(xYS!*;;*x+9&#WvG?oBQ*TPLjiv{k1fQ*)fIq& zfzeh(`2zgebyUIeZ6?86d?k{X^3Mj=71-VurNCjTnKr6#Rp;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GXYTax!@Ma}-GVkGfx@9jG$LJB`a-7XL63YqwldBf2>*Df zV6k0}b+texqX`q}q<)aB*}W`xZuuocS|gvQ1D6oV(N~nR|9dMJ4*-;iM@y}u>CqU! zq)L0+(7T5>{|=wcxrFw-ZMCm9|4t9>j?@pw1GskHD5SYQPyyJ;e}tb$;Z6FbJX*7L zaO);86fzCm^6Sw>Q1Pnk6VF@J1)MPX*NQth-KG5fNv);S5nk(s%3_O|d>&)|+YU#1 zK#B89)#*1XR#k1DEhSp%b-xPnrnNVgpy~JAi{F*^NEsiUXd*(i*&G~BCE&kIi zgZ%n5ado)}KEQGNXj+~LyVJv_v>KWi^tnr_1^r!)iMB^IVt2XF+GaWdDXiLz-av|| z^k1ppDr*^&yQuef;Cc27fF^r)$?{96ZlAnqE)GLTIS^$`Stcx(&BPvm|7~S*Z+aqQ zexDnK*?*3_(sD8ei(OOO;WSYiBHJTkw~4R zY^*~SQCCq+F;!WT+8hdJYl)m4Wfz{Mk`bB9JA%zQBzMyKvs2VEIZJNiTb`0EP7wK*FSls z#Tn2dYJMxymZ@R^B=`VO;rTjcu_vCmlPe;gJn6@^?m(sT+BEm@b{dZeU|~ZAanwll zNm4TA>pCjf{#_9_OpsIiHgiBkF}5jmHAaO~bny13JFutBtU>D{nzvm$*?2^hzbne^1+Q3m4;1yB zQRQ=aYG7#s=k?MD5U2=37ZC2KNYXhsn06K4o2e9Z|0BxrlWIm-=GBn;er+q!LCT*h z$FH)dNmaieEV##X*6Cr9Gj-q#}<62#b+QXopm8hR&VOs73IN@Kx|h zj@ntKeE48v=ou?E3u6GUX9~7L2Vfm_fS;fk; zKjV%1=8aaelN>yaQ>_L6Wo`P2miueUigw46DdH?XxYX@ xQ<6SsjK~@mX~aQ*W7YK^sZ}sO)bz#!&gustZj>?|C1%VVprc`^UZZLs^?&yj7a0Hm diff --git a/data/skins/default/skin.xml b/data/skins/default/skin.xml index d7107be38..638e6de5b 100644 --- a/data/skins/default/skin.xml +++ b/data/skins/default/skin.xml @@ -328,6 +328,12 @@ + + + + + + diff --git a/src/app/settings/freehand_algorithm.h b/src/app/settings/freehand_algorithm.h index a756023dc..8b1ebe015 100644 --- a/src/app/settings/freehand_algorithm.h +++ b/src/app/settings/freehand_algorithm.h @@ -25,6 +25,7 @@ namespace app { enum FreehandAlgorithm { kDefaultFreehandAlgorithm, kPixelPerfectFreehandAlgorithm, + kDotsFreehandAlgorithm, }; } // namespace app diff --git a/src/app/settings/ui_settings_impl.cpp b/src/app/settings/ui_settings_impl.cpp index 02f8adf05..e9260eba0 100644 --- a/src/app/settings/ui_settings_impl.cpp +++ b/src/app/settings/ui_settings_impl.cpp @@ -760,13 +760,19 @@ public: tools::ToolBox* toolBox = App::instance()->getToolBox(); for (int i=0; i<2; ++i) { - if (algorithm == kPixelPerfectFreehandAlgorithm) { - m_tool->setIntertwine(i, toolBox->getIntertwinerById(tools::WellKnownIntertwiners::AsPixelPerfect)); - m_tool->setTracePolicy(i, tools::TracePolicyLast); - } - else { - m_tool->setIntertwine(i, toolBox->getIntertwinerById(tools::WellKnownIntertwiners::AsLines)); - m_tool->setTracePolicy(i, tools::TracePolicyAccumulate); + switch (algorithm) { + case kDefaultFreehandAlgorithm: + m_tool->setIntertwine(i, toolBox->getIntertwinerById(tools::WellKnownIntertwiners::AsLines)); + m_tool->setTracePolicy(i, tools::TracePolicyAccumulate); + break; + case kPixelPerfectFreehandAlgorithm: + m_tool->setIntertwine(i, toolBox->getIntertwinerById(tools::WellKnownIntertwiners::AsPixelPerfect)); + m_tool->setTracePolicy(i, tools::TracePolicyLast); + break; + case kDotsFreehandAlgorithm: + m_tool->setIntertwine(i, toolBox->getIntertwinerById(tools::WellKnownIntertwiners::None)); + m_tool->setTracePolicy(i, tools::TracePolicyAccumulate); + break; } } } diff --git a/src/app/ui/context_bar.cpp b/src/app/ui/context_bar.cpp index 82f41ab7e..84c922ec1 100644 --- a/src/app/ui/context_bar.cpp +++ b/src/app/ui/context_bar.cpp @@ -440,26 +440,144 @@ private: bool m_lockChange; }; -class ContextBar::FreehandAlgorithmField : public CheckBox +class ContextBar::FreehandAlgorithmField : public Button + , public IButtonIcon { public: - FreehandAlgorithmField() : CheckBox("Pixel-perfect") { - setup_mini_font(this); + 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) { + int part = PART_FREEHAND_ALGO_DEFAULT; + m_freehandAlgo = algo; + switch (m_freehandAlgo) { + case kDefaultFreehandAlgorithm: + part = PART_FREEHAND_ALGO_DEFAULT; + break; + case kPixelPerfectFreehandAlgorithm: + part = PART_FREEHAND_ALGO_PIXEL_PERFECT; + break; + case kDotsFreehandAlgorithm: + part = PART_FREEHAND_ALGO_DOTS; + break; + } + m_bitmap = static_cast(getTheme())->get_part(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. + } + + int getWidth() OVERRIDE { + return m_bitmap->w; + } + + int getHeight() OVERRIDE { + return m_bitmap->h; + } + + BITMAP* getNormalIcon() OVERRIDE { + return m_bitmap; + } + + BITMAP* getSelectedIcon() OVERRIDE { + return m_bitmap; + } + + BITMAP* getDisabledIcon() OVERRIDE { + return m_bitmap; + } + + int getIconAlign() OVERRIDE { + return JI_CENTER | JI_MIDDLE; + } + +protected: void onClick(Event& ev) OVERRIDE { - CheckBox::onClick(ev); + Button::onClick(ev); + + if (!m_popupWindow || !m_popupWindow->isVisible()) + openPopup(); + else + closePopup(); + } + + void onPreferredSize(PreferredSizeEvent& ev) { + ev.setPreferredSize(Size(16*jguiscale(), + 16*jguiscale())); + } + +private: + void openPopup() { + Border border = Border(2, 2, 2, 3)*jguiscale(); + 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, 1, m_freehandAlgo, + PART_FREEHAND_ALGO_DEFAULT, + PART_FREEHAND_ALGO_PIXEL_PERFECT, + PART_FREEHAND_ALGO_DOTS); + m_freehandAlgoButton->ItemChange.connect(&FreehandAlgorithmField::onFreehandAlgoChange, this); + m_freehandAlgoButton->setTransparent(true); + m_freehandAlgoButton->setBgColor(ui::ColorNone); + + m_tooltipManager->addTooltipFor(m_freehandAlgoButton->getButtonAt(0), "Normal trace", JI_TOP); + m_tooltipManager->addTooltipFor(m_freehandAlgoButton->getButtonAt(1), "Pixel-perfect trace", JI_TOP); + m_tooltipManager->addTooltipFor(m_freehandAlgoButton->getButtonAt(2), "Dots", JI_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()); ISettings* settings = UIContext::instance()->getSettings(); Tool* currentTool = settings->getCurrentTool(); settings->getToolSettings(currentTool) - ->setFreehandAlgorithm(isSelected() ? - kPixelPerfectFreehandAlgorithm: - kDefaultFreehandAlgorithm); - - releaseFocus( -); + ->setFreehandAlgorithm(m_freehandAlgo); } + + BITMAP* m_bitmap; + FreehandAlgorithm m_freehandAlgo; + PopupWindow* m_popupWindow; + ButtonSet* m_freehandAlgoButton; + TooltipManager* m_tooltipManager; }; class ContextBar::SelectionModeField : public ButtonSet @@ -474,8 +592,7 @@ public: ->selection()->getSelectionMode()); } - void setupTooltips(TooltipManager* tooltipManager) - { + void setupTooltips(TooltipManager* tooltipManager) { tooltipManager->addTooltipFor(getButtonAt(0), "Replace selection", JI_BOTTOM); tooltipManager->addTooltipFor(getButtonAt(1), "Add to selection", JI_BOTTOM); tooltipManager->addTooltipFor(getButtonAt(2), "Subtract from selection", JI_BOTTOM); @@ -572,11 +689,14 @@ ContextBar::ContextBar() m_sprayBox->addChild(m_sprayWidth = new SprayWidthField()); m_sprayBox->addChild(m_spraySpeed = new SpraySpeedField()); + Label* freehandLabel; addChild(m_freehandBox = new HBox()); + m_freehandBox->addChild(freehandLabel = new Label("Freehand:")); m_freehandBox->addChild(m_freehandAlgo = new FreehandAlgorithmField()); setup_mini_font(m_toleranceLabel); setup_mini_font(m_opacityLabel); + setup_mini_font(freehandLabel); TooltipManager* tooltipManager = new TooltipManager(); addChild(tooltipManager); @@ -597,6 +717,7 @@ ContextBar::ContextBar() "from the composition of all sprite layers.", JI_LEFT | JI_TOP); m_selectionMode->setupTooltips(tooltipManager); m_dropPixels->setupTooltips(tooltipManager); + m_freehandAlgo->setupTooltips(tooltipManager); App::instance()->BrushSizeAfterChange.connect(&ContextBar::onBrushSizeChange, this); App::instance()->BrushAngleAfterChange.connect(&ContextBar::onBrushAngleChange, this); @@ -681,7 +802,7 @@ void ContextBar::updateFromTool(tools::Tool* tool) m_inkOpacity->setTextf("%d", toolSettings->getOpacity()); m_grabAlpha->setSelected(settings->getGrabAlpha()); - m_freehandAlgo->setSelected(toolSettings->getFreehandAlgorithm() == kPixelPerfectFreehandAlgorithm); + m_freehandAlgo->setFreehandAlgorithm(toolSettings->getFreehandAlgorithm()); m_sprayWidth->setValue(toolSettings->getSprayWidth()); m_spraySpeed->setValue(toolSettings->getSpraySpeed()); diff --git a/src/app/ui/skin/skin_parts.h b/src/app/ui/skin/skin_parts.h index 3d8ebf283..1a1c558ae 100644 --- a/src/app/ui/skin/skin_parts.h +++ b/src/app/ui/skin/skin_parts.h @@ -200,6 +200,13 @@ namespace app { PART_DROP_PIXELS_CANCEL, PART_DROP_PIXELS_CANCEL_SELECTED, + PART_FREEHAND_ALGO_DEFAULT, + PART_FREEHAND_ALGO_DEFAULT_SELECTED, + PART_FREEHAND_ALGO_PIXEL_PERFECT, + PART_FREEHAND_ALGO_PIXEL_PERFECT_SELECTED, + PART_FREEHAND_ALGO_DOTS, + PART_FREEHAND_ALGO_DOTS_SELECTED, + PARTS }; diff --git a/src/app/ui/skin/skin_theme.cpp b/src/app/ui/skin/skin_theme.cpp index 5afc6733f..3d5762ca8 100644 --- a/src/app/ui/skin/skin_theme.cpp +++ b/src/app/ui/skin/skin_theme.cpp @@ -287,6 +287,12 @@ SkinTheme::SkinTheme() sheet_mapping["drop_pixels_ok_selected"] = PART_DROP_PIXELS_OK_SELECTED; sheet_mapping["drop_pixels_cancel"] = PART_DROP_PIXELS_CANCEL; sheet_mapping["drop_pixels_cancel_selected"] = PART_DROP_PIXELS_CANCEL_SELECTED; + sheet_mapping["freehand_algo_default"] = PART_FREEHAND_ALGO_DEFAULT; + sheet_mapping["freehand_algo_default_selected"] = PART_FREEHAND_ALGO_DEFAULT_SELECTED; + sheet_mapping["freehand_algo_pixel_perfect"] = PART_FREEHAND_ALGO_PIXEL_PERFECT; + sheet_mapping["freehand_algo_pixel_perfect_selected"] = PART_FREEHAND_ALGO_PIXEL_PERFECT_SELECTED; + sheet_mapping["freehand_algo_dots"] = PART_FREEHAND_ALGO_DOTS; + sheet_mapping["freehand_algo_dots_selected"] = PART_FREEHAND_ALGO_DOTS_SELECTED; color_mapping["text"] = ThemeColor::Text; color_mapping["disabled"] = ThemeColor::Disabled;