From d80b984f0056e80902e368a3cbc10c030ace3b1b Mon Sep 17 00:00:00 2001 From: David Capello Date: Thu, 2 Jul 2015 13:16:06 -0300 Subject: [PATCH] Adjust default ink to be more pixel-art friendly (just replace RGBA values) Now that we have alpha channel in color selector and palette entries, it's nice to have as a default ink a more pixel-art friendly, i.e. an ink that just replace RGBA values instead of doing alpha compositing. Issue #286 --- data/skins/default/sheet.png | Bin 12607 -> 12703 bytes data/skins/default/skin.xml | 3 + src/app/tools/ink_type.h | 3 +- src/app/tools/inks.h | 6 +- src/app/ui/context_bar.cpp | 142 ++++++++++++++++++--------------- src/app/ui/context_bar.h | 2 +- src/app/ui/editor/editor.cpp | 40 ++-------- src/app/ui/skin/skin_parts.h | 4 + src/app/ui/skin/skin_theme.cpp | 3 + 9 files changed, 99 insertions(+), 104 deletions(-) diff --git a/data/skins/default/sheet.png b/data/skins/default/sheet.png index 590efd825fadba77ee5e463dea17218cb000f815..ebe610d1bc2adc2e034d0801d292b3990d04ba13 100644 GIT binary patch delta 12128 zcmXY1Wmr_-*Bzuox&?;r4i!YYQv`-#=mDfdN>Jbel0(;kgb2vcDJ9(~9a7RI2uOFn z^ZP&V{c@lC;huZXIeV|O*4n!ro@1RL4!G{;jA8nvN4yoIz-giouKhTI5%%0~;NREp zh{{D>%nOa0j~uM6+zz-U{ASsY`lDzQ=#6`(;|Whv)DS)F-vep;Tv?xU?BR4bKEV-V z7rL|Dz6VcBFZ}j?_wVflJ7VfibHJ`CU z4st}2h?1}|CAR~crw&jvDZ;Dro3rYvf^P|!AO=Dt;yU=?dX+jFyKKe@fC{GJagmhN zS=z77%;X6$v(oUpGzq50_3Qn+>B%89M&|yNu`|X|*0X;&WvF3I1V_n6r@lI4#_Xtu zMy>VA_gr@(dlAXYO(dn7b{HVoT0!@Du+ZS^t1nH`EuQ{kY^=|M4Q~XyEE#16MVaF0 zo{D4<=r2e;9<2GoDwO5~a8W8z@CQ+hzmB4ch(;FE^(qgll)c6#+Z7l+sg4$7U;9`- z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 z#kS5Nd1jD=ct*7?jlFRGv@G+JEV4cp-AU0%ku+qMmW=q1)Cg9nUUMJ>8fc!E(iuA) zfU8~|o6KHlx6=ID;rC6H)05QoNyGmVJO#3?!+WfD)bfxb=amEq^U+YzQ7%`s4*4I3 CJA*R- diff --git a/data/skins/default/skin.xml b/data/skins/default/skin.xml index 967333803..140a1467f 100644 --- a/data/skins/default/skin.xml +++ b/data/skins/default/skin.xml @@ -372,6 +372,9 @@ + + + diff --git a/src/app/tools/ink_type.h b/src/app/tools/ink_type.h index 6acadcdc9..a7934fc45 100644 --- a/src/app/tools/ink_type.h +++ b/src/app/tools/ink_type.h @@ -14,7 +14,8 @@ namespace tools { enum class InkType { DEFAULT = 0, - SET_ALPHA = 1, + REPLACE_PIXEL = 0, + ALPHA_COMPOSITING = 1, LOCK_ALPHA = 2, }; diff --git a/src/app/tools/inks.h b/src/app/tools/inks.h index 9cad96d41..8132f2f60 100644 --- a/src/app/tools/inks.h +++ b/src/app/tools/inks.h @@ -62,11 +62,7 @@ public: case Opaque: m_proc = ink_processing[INK_OPAQUE][depth]; break; case SetAlpha: m_proc = ink_processing[INK_SETALPHA][depth]; break; case LockAlpha: m_proc = ink_processing[INK_LOCKALPHA][depth]; break; - default: - m_proc = (loop->getOpacity() == 255 ? - ink_processing[INK_OPAQUE][depth]: - ink_processing[INK_TRANSPARENT][depth]); - break; + default: m_proc = ink_processing[INK_TRANSPARENT][depth]; break; } } } diff --git a/src/app/ui/context_bar.cpp b/src/app/ui/context_bar.cpp index 8459bfcec..b0a0b16cd 100644 --- a/src/app/ui/context_bar.cpp +++ b/src/app/ui/context_bar.cpp @@ -42,6 +42,7 @@ #include "ui/int_entry.h" #include "ui/label.h" #include "ui/listitem.h" +#include "ui/menu.h" #include "ui/popup_window.h" #include "ui/preferred_size_event.h" #include "ui/theme.h" @@ -147,6 +148,7 @@ private: void closePopup() { m_popupWindow.closeWindow(NULL); + deselectItems(); } void onBrushChange(const BrushRef& brush) { @@ -319,66 +321,67 @@ protected: } }; -class ContextBar::InkTypeField : public ComboBox +class ContextBar::InkTypeField : public ButtonSet { public: - InkTypeField() : m_lock(false) { - // The same order as in InkType - addItem("Default Ink"); -#if 0 - addItem("Opaque"); -#endif - addItem("Set Alpha"); - addItem("Lock Alpha"); -#if 0 - addItem("Merge"); - addItem("Shading"); - addItem("Replace"); - addItem("Erase"); - addItem("Selection"); - addItem("Blur"); - addItem("Jumble"); -#endif + InkTypeField(ContextBar* owner) : ButtonSet(1) + , m_owner(owner) { + addItem( + static_cast(getTheme())->get_part(PART_INK_DEFAULT)); } void setInkType(InkType inkType) { - int index = 0; + int part = PART_INK_DEFAULT; switch (inkType) { - case InkType::DEFAULT: index = 0; break; - case InkType::SET_ALPHA: index = 1; break; - case InkType::LOCK_ALPHA: index = 2; break; + case InkType::REPLACE_PIXEL: part = PART_INK_DEFAULT; break; + case InkType::ALPHA_COMPOSITING: part = PART_INK_COMPOSITE; break; + case InkType::LOCK_ALPHA: part = PART_INK_LOCK_ALPHA; break; } - m_lock = true; - setSelectedItemIndex(index); - m_lock = false; + getItem(0)->setIcon( + static_cast(getTheme())->get_part(part)); } protected: - void onChange() override { - ComboBox::onChange(); + void onItemChange() override { + ButtonSet::onItemChange(); - if (m_lock) - return; + gfx::Rect bounds = getBounds(); - InkType inkType = InkType::DEFAULT; - - switch (getSelectedItemIndex()) { - case 0: inkType = InkType::DEFAULT; break; - case 1: inkType = InkType::SET_ALPHA; break; - case 2: inkType = InkType::LOCK_ALPHA; break; - } + Menu menu; + MenuItem + replace("Replace Pixel"), + alphacompo("Alpha Compositing"), + lockalpha("Lock Alpha"); + menu.addChild(&replace); + menu.addChild(&alphacompo); + menu.addChild(&lockalpha); + Tool* tool = App::instance()->activeTool(); + switch (Preferences::instance().tool(tool).ink()) { + case tools::InkType::REPLACE_PIXEL: replace.setSelected(true); break; + case tools::InkType::ALPHA_COMPOSITING: alphacompo.setSelected(true); break; + case tools::InkType::LOCK_ALPHA: lockalpha.setSelected(true); break; + } + + replace.Click.connect(Bind(&InkTypeField::selectInk, this, InkType::REPLACE_PIXEL)); + alphacompo.Click.connect(Bind(&InkTypeField::selectInk, this, InkType::ALPHA_COMPOSITING)); + lockalpha.Click.connect(Bind(&InkTypeField::selectInk, this, InkType::LOCK_ALPHA)); + + menu.showPopup(gfx::Point(bounds.x, bounds.y+bounds.h)); + + deselectItems(); + } + + void selectInk(InkType inkType) { Tool* tool = App::instance()->activeTool(); Preferences::instance().tool(tool).ink(inkType); + + m_owner->updateForCurrentTool(); } - void onCloseListBox() override { - releaseFocus(); - } - - bool m_lock; + ContextBar* m_owner; }; class ContextBar::InkOpacityField : public IntEntry @@ -802,9 +805,9 @@ ContextBar::ContextBar() addChild(m_contiguous = new ContiguousField()); addChild(m_stopAtGrid = new StopAtGridField()); - addChild(m_inkType = new InkTypeField()); + addChild(m_inkType = new InkTypeField(this)); - addChild(m_opacityLabel = new Label("Opacity:")); + addChild(m_inkOpacityLabel = new Label("Opacity:")); addChild(m_inkOpacity = new InkOpacityField()); addChild(m_grabAlpha = new GrabAlphaField()); @@ -832,7 +835,7 @@ ContextBar::ContextBar() m_freehandBox->addChild(m_freehandAlgo = new FreehandAlgorithmField()); setup_mini_font(m_toleranceLabel); - setup_mini_font(m_opacityLabel); + setup_mini_font(m_inkOpacityLabel); TooltipManager* tooltipManager = new TooltipManager(); addChild(tooltipManager); @@ -840,7 +843,8 @@ ContextBar::ContextBar() tooltipManager->addTooltipFor(m_brushType, "Brush Type", BOTTOM); tooltipManager->addTooltipFor(m_brushSize, "Brush Size (in pixels)", BOTTOM); tooltipManager->addTooltipFor(m_brushAngle, "Brush Angle (in degrees)", BOTTOM); - tooltipManager->addTooltipFor(m_inkOpacity, "Opacity (Alpha value in RGBA)", BOTTOM); + tooltipManager->addTooltipFor(m_inkType, "Ink", BOTTOM); + tooltipManager->addTooltipFor(m_inkOpacity, "Opacity (paint intensity)", BOTTOM); tooltipManager->addTooltipFor(m_sprayWidth, "Spray Width", BOTTOM); tooltipManager->addTooltipFor(m_spraySpeed, "Spray Speed", BOTTOM); tooltipManager->addTooltipFor(m_transparentColor, "Transparent Color", BOTTOM); @@ -939,6 +943,25 @@ void ContextBar::updateForTool(tools::Tool* tool) m_brushPatternField->setBrushPattern( preferences.brush.pattern()); + // Tool ink + bool isPaint = tool && + (tool->getInk(0)->isPaint() || + tool->getInk(1)->isPaint()); + bool isEffect = tool && + (tool->getInk(0)->isEffect() || + tool->getInk(1)->isEffect()); + + // True if the current tool support opacity slider + bool supportOpacity = (isPaint || isEffect); + + // True if it makes sense to change the ink property for the current + // tool. + bool hasInk = tool && + ((tool->getInk(0)->isPaint() && !tool->getInk(0)->isEffect()) || + (tool->getInk(1)->isPaint() && !tool->getInk(1)->isEffect())); + + bool hasInkWithOpacity = false; + if (toolPref) { m_tolerance->setTextf("%d", toolPref->tolerance()); m_contiguous->setSelected(toolPref->contiguous()); @@ -948,6 +971,10 @@ void ContextBar::updateForTool(tools::Tool* tool) m_inkType->setInkType(toolPref->ink()); m_inkOpacity->setTextf("%d", toolPref->opacity()); + hasInkWithOpacity = + ((isPaint && toolPref->ink() != tools::InkType::REPLACE_PIXEL) || + (isEffect)); + m_freehandAlgo->setFreehandAlgorithm(toolPref->freehandAlgorithm()); m_sprayWidth->setValue(toolPref->spray.width()); @@ -957,13 +984,6 @@ void ContextBar::updateForTool(tools::Tool* tool) m_grabAlpha->setSelected(preferences.editor.grabAlpha()); m_autoSelectLayer->setSelected(preferences.editor.autoSelectLayer()); - // True if the current tool needs opacity options - bool hasOpacity = tool && - (tool->getInk(0)->isPaint() || - tool->getInk(0)->isEffect() || - tool->getInk(1)->isPaint() || - tool->getInk(1)->isEffect()); - // True if we have an image as brush bool hasImageBrush = (activeBrush()->type() == kImageBrushType); @@ -977,10 +997,6 @@ void ContextBar::updateForTool(tools::Tool* tool) (tool->getInk(0)->isCelMovement() || tool->getInk(1)->isCelMovement()); - // True if it makes sense to change the ink property for the current - // tool. - bool hasInk = hasOpacity; - // True if the current tool is floodfill bool isFloodfill = tool && (tool->getPointShape(0)->isFloodFill() || @@ -1005,16 +1021,16 @@ void ContextBar::updateForTool(tools::Tool* tool) tool->getController(1)->isFreehand()); // Show/Hide fields - m_brushType->setVisible(hasOpacity && (!isFloodfill || (isFloodfill && hasImageBrush))); - m_brushSize->setVisible(hasOpacity && !isFloodfill && !hasImageBrush); - m_brushAngle->setVisible(hasOpacity && !isFloodfill && !hasImageBrush); - m_brushPatternField->setVisible(hasOpacity && hasImageBrush); - m_opacityLabel->setVisible(hasOpacity); + m_brushType->setVisible(supportOpacity && (!isFloodfill || (isFloodfill && hasImageBrush))); + m_brushSize->setVisible(supportOpacity && !isFloodfill && !hasImageBrush); + m_brushAngle->setVisible(supportOpacity && !isFloodfill && !hasImageBrush); + m_brushPatternField->setVisible(supportOpacity && hasImageBrush); m_inkType->setVisible(hasInk && !hasImageBrush); - m_inkOpacity->setVisible(hasOpacity); + m_inkOpacityLabel->setVisible(hasInkWithOpacity && supportOpacity); + m_inkOpacity->setVisible(hasInkWithOpacity && supportOpacity); m_grabAlpha->setVisible(isEyedropper); m_autoSelectLayer->setVisible(isMove); - m_freehandBox->setVisible(isFreehand && hasOpacity); + m_freehandBox->setVisible(isFreehand && supportOpacity); m_toleranceLabel->setVisible(hasTolerance); m_tolerance->setVisible(hasTolerance); m_contiguous->setVisible(hasTolerance); diff --git a/src/app/ui/context_bar.h b/src/app/ui/context_bar.h index de172e3ed..40b192c47 100644 --- a/src/app/ui/context_bar.h +++ b/src/app/ui/context_bar.h @@ -118,7 +118,7 @@ namespace app { ContiguousField* m_contiguous; StopAtGridField* m_stopAtGrid; InkTypeField* m_inkType; - ui::Label* m_opacityLabel; + ui::Label* m_inkOpacityLabel; InkOpacityField* m_inkOpacity; GrabAlphaField* m_grabAlpha; AutoSelectLayerField* m_autoSelectLayer; diff --git a/src/app/ui/editor/editor.cpp b/src/app/ui/editor/editor.cpp index 6f42482de..734f4fcc7 100644 --- a/src/app/ui/editor/editor.cpp +++ b/src/app/ui/editor/editor.cpp @@ -916,49 +916,21 @@ tools::Ink* Editor::getCurrentEditorInk() break; } } - else { + // Only paint tools can have different inks + else if (ink->isPaint() && !ink->isEffect()) { tools::InkType inkType = Preferences::instance().tool(tool).ink(); const char* id = NULL; switch (inkType) { - case tools::InkType::DEFAULT: - // Do nothing + case tools::InkType::REPLACE_PIXEL: + id = tools::WellKnownInks::PaintOpaque; break; - case tools::InkType::SET_ALPHA: - id = tools::WellKnownInks::PaintSetAlpha; + case tools::InkType::ALPHA_COMPOSITING: + id = tools::WellKnownInks::Paint; break; case tools::InkType::LOCK_ALPHA: id = tools::WellKnownInks::PaintLockAlpha; break; -#if 0 - case tools::InkType::OPAQUE: - id = tools::WellKnownInks::PaintOpaque; - break; - case tools::InkType::MERGE: - id = tools::WellKnownInks::Paint; - break; - case tools::InkType::SHADING: - id = tools::WellKnownInks::Shading; - break; - case tools::InkType::REPLACE: - if (!m_secondaryButton) - id = tools::WellKnownInks::ReplaceBgWithFg; - else - id = tools::WellKnownInks::ReplaceFgWithBg; - break; - case tools::InkType::ERASER: - id = tools::WellKnownInks::Eraser; - break; - case tools::InkType::SELECTION: - id = tools::WellKnownInks::Selection; - break; - case tools::InkType::BLUR: - id = tools::WellKnownInks::Blur; - break; - case tools::InkType::JUMBLE: - id = tools::WellKnownInks::Jumble; - break; -#endif } if (id) diff --git a/src/app/ui/skin/skin_parts.h b/src/app/ui/skin/skin_parts.h index 7b589a884..118c337b1 100644 --- a/src/app/ui/skin/skin_parts.h +++ b/src/app/ui/skin/skin_parts.h @@ -176,6 +176,10 @@ namespace app { PART_FREEHAND_ALGO_DOTS, PART_FREEHAND_ALGO_DOTS_SELECTED, + PART_INK_DEFAULT, + PART_INK_COMPOSITE, + PART_INK_LOCK_ALPHA, + PARTS }; diff --git a/src/app/ui/skin/skin_theme.cpp b/src/app/ui/skin/skin_theme.cpp index c1bbd9fd0..fb3fce864 100644 --- a/src/app/ui/skin/skin_theme.cpp +++ b/src/app/ui/skin/skin_theme.cpp @@ -278,6 +278,9 @@ SkinTheme::SkinTheme() 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; + sheet_mapping["ink_default"] = PART_INK_DEFAULT; + sheet_mapping["ink_composite"] = PART_INK_COMPOSITE; + sheet_mapping["ink_lock_alpha"] = PART_INK_LOCK_ALPHA; } SkinTheme::~SkinTheme()